add_customer.ftl 100 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392139313941395139613971398139914001401140214031404140514061407140814091410141114121413141414151416141714181419142014211422142314241425142614271428142914301431143214331434143514361437143814391440144114421443144414451446144714481449145014511452145314541455145614571458145914601461146214631464146514661467146814691470147114721473147414751476147714781479148014811482148314841485148614871488148914901491149214931494149514961497149814991500150115021503150415051506150715081509151015111512151315141515151615171518151915201521152215231524152515261527152815291530153115321533153415351536153715381539154015411542154315441545154615471548154915501551155215531554155515561557155815591560156115621563156415651566156715681569157015711572157315741575157615771578157915801581158215831584158515861587158815891590159115921593159415951596159715981599160016011602160316041605160616071608160916101611161216131614161516161617161816191620162116221623162416251626162716281629163016311632163316341635163616371638163916401641164216431644164516461647164816491650165116521653165416551656165716581659166016611662166316641665166616671668166916701671167216731674167516761677167816791680168116821683168416851686168716881689169016911692169316941695169616971698169917001701170217031704170517061707170817091710171117121713171417151716171717181719172017211722172317241725172617271728172917301731173217331734173517361737173817391740174117421743174417451746174717481749175017511752175317541755175617571758175917601761176217631764176517661767176817691770177117721773177417751776177717781779178017811782178317841785178617871788178917901791179217931794179517961797179817991800180118021803180418051806180718081809181018111812181318141815181618171818181918201821182218231824182518261827182818291830183118321833183418351836183718381839184018411842184318441845184618471848184918501851185218531854185518561857185818591860186118621863186418651866186718681869187018711872187318741875187618771878187918801881188218831884188518861887188818891890189118921893189418951896189718981899190019011902190319041905190619071908190919101911191219131914191519161917191819191920192119221923192419251926192719281929193019311932193319341935193619371938193919401941194219431944194519461947194819491950195119521953195419551956195719581959196019611962196319641965196619671968196919701971197219731974197519761977197819791980198119821983198419851986198719881989199019911992199319941995199619971998199920002001200220032004200520062007200820092010201120122013201420152016201720182019202020212022202320242025202620272028202920302031203220332034203520362037203820392040204120422043204420452046204720482049205020512052205320542055205620572058205920602061206220632064206520662067206820692070207120722073207420752076207720782079208020812082208320842085208620872088208920902091209220932094209520962097209820992100210121022103210421052106210721082109211021112112211321142115211621172118211921202121212221232124212521262127212821292130213121322133213421352136213721382139214021412142214321442145214621472148214921502151215221532154215521562157215821592160216121622163216421652166216721682169217021712172217321742175217621772178217921802181218221832184218521862187218821892190219121922193219421952196219721982199220022012202220322042205220622072208220922102211221222132214221522162217221822192220222122222223222422252226222722282229223022312232223322342235223622372238223922402241224222432244224522462247224822492250225122522253225422552256225722582259226022612262226322642265226622672268226922702271227222732274227522762277227822792280
  1. <!DOCTYPE HTML>
  2. <html>
  3. <head>
  4. <meta charset="utf-8">
  5. <meta name="renderer" content="webkit|ie-comp|ie-stand">
  6. <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
  7. <meta name="viewport" content="width=device-width,initial-scale=1,minimum-scale=1.0,maximum-scale=1.0,user-scalable=no" />
  8. <meta http-equiv="Cache-Control" content="no-siteapp" />
  9. <#include "/base/add_base.ftl">
  10. <link href="${path}/common/lib/jquery.ui/jquery-ui.css" rel="stylesheet" type="text/css"/>
  11. <link href="${path}/common/lib/webuploader/0.1.5/webuploader.css" rel="stylesheet" type="text/css"/>
  12. <link href="${path}/common/lib/icheck/icheck.css" rel="stylesheet" type="text/css"/>
  13. <style>
  14. .tit{position: relative;text-align: left;font-size: 16px;padding-left: 10px;}
  15. .tit:after{content: '';position: absolute;left: 0;top: 20%;height: 60%;width: 3px;background-color: #32a3d8;}
  16. .tit-2{position: relative;text-align: left;font-size: 16px;padding-left: 10px;}
  17. .tit-2:after{content: '';position: absolute;left: 0;top: 20%;height: 60%;width: 3px;background-color: #32a3d8;}
  18. #province select{margin-right:10px; width:100px;height: 31px;-webkit-appearance:none !important;appearance:none;background: url(${path}/common/images/cm/select-1.png) right center no-repeat;background-size: auto 100%;padding-left:3px;padding-right: 25px;}
  19. #suggest, #suggest2 {width:200px}
  20. .gray {color:gray}
  21. .ac_results {background:#fff;border:1px solid #7f9db9;position: absolute;z-index: 10000;display: none}
  22. .ac_results li a {white-space: nowrap;text-decoration:none;display:block;color:#05a;padding:1px 3px}
  23. .ac_results li {border:1px solid #fff}
  24. .ac_over, .ac_results li a:hover {background:#c8e3fc}
  25. .ac_results li a span {float:right}
  26. .ac_result_tip {border-bottom:1px dashed #666;padding:3px}
  27. .select-box{background: url(${path}/common/images/cm/select-1.png) right center no-repeat;background-size: auto 100%;}
  28. .select-box select{-webkit-appearance:none !important;background-color: transparent; appearance:none;padding-right: 25px;}
  29. .dalog-ask{position: absolute;left:60%;top:0;-webkit-transform: translateY(-30%);transform: translateY(-30%);display: none;background-color: #fff;z-index: 10;}
  30. .tag{ width:300px; min-height:300px; border:1px solid #32a3d8; position:relative;background-color: #fff;line-height: 1.5;padding: 10px 12px;}
  31. .tag em{display:block; border-width:15px; position:absolute; top:30%; left:-30px;border-style:solid dashed dashed; border-color:transparent #32a3d8 transparent transparent;font-size:0; line-height:0;}
  32. .dalog-ask .ask{color: #000;margin: 10px 0 5px 0;}
  33. .dalog-ask .answer{color: #666;margin-bottom: 10px;}
  34. .dalog-ask .answer:hover{color: #32a3d8;cursor: pointer;}
  35. .time-line-list{list-style: none;width: 100%;margin-left: -20px;}
  36. .time-line-list>li{position: relative;float: left; text-align: center;width: 100px;overflow: hidden;white-space: nowrap;word-break: break-all;padding: 2px 0;}
  37. .time-line-list .number{display: inline-block; padding: 2px; background: #32a3d8;border: 2px solid #fff;box-shadow:0 0 0 1px #32a3d8;width: 20px;height: 20px;color: #fff;line-height: 20px;border-radius: 50%;}
  38. .time-line-list>li:before{content:'';position: absolute;height: 1px;width: 30%;right:0;top: 15px; background-color: #32a3d8;}
  39. .time-line-list>li:after{content: '';position: absolute;height: 1px;width: 30%;left: 0;top: 15px;background:#32a3d8;}
  40. .time-line-list>li:first-child:after,.time-line-list>li:last-child:before{display: none;}
  41. .time-line-list .arrow{border-width:7px; position:absolute; left:25%; top:9px;border-style:solid dashed dashed; border-color:transparent transparent transparent #32a3d8;font-size:0; line-height:0;}
  42. .time-line-list>li:first-child .arrow{display: none;}
  43. .table-bg th{background-color: #e2f6ff;}
  44. .update-parts>span{margin-right: 10px;padding: 3px 4px;background-color: #effaff;border: 1px solid #32a3d8;}
  45. .my-search-input{padding-left: 30px;background: url(${path}/common/images/cm/search.png) 6px center no-repeat;background-size: auto 60%; }
  46. .input-produce{height: 25px;line-height: 25px}
  47. .color-div{height: 30px;}
  48. .table-td-color{}
  49. .msg-phone{
  50. height: 35px;
  51. line-height: 35px;
  52. }
  53. </style>
  54. <title>添加客诉 - 客诉管理 - RST</title>
  55. </head>
  56. <body>
  57. <nav class="breadcrumb"><i class="Hui-iconfont">&#xe67f;</i> 首页
  58. <span class="c-gray en">&gt;</span> 客诉管理
  59. <span class="c-gray en">&gt;</span> 添加客诉
  60. <a class="btn radius r"
  61. style="line-height:1.6em;margin-top:3px;background: #32a3d8;color: #fff;border:1px solid #32a3d8;"
  62. href="javascript:location.replace(location.href);" title="刷新"><i class="Hui-iconfont">&#xe68f;</i></a>
  63. </nav>
  64. <article class="page-container" style="padding: 10px;">
  65. <div class="pd-20 cl">
  66. <form action="${path}/admin/customer/save_customer" method="post" class="form form-horizontal" id="form-customer-add" onkeydown="if(event.keyCode==13)return false;">
  67. <input type="hidden" id="customerName" name="customerName" value="">
  68. <input type="hidden" id="customerTel" name="customerTel" value="">
  69. <div class="row cl">
  70. <label class="form-label col-3">
  71. <div class="tit-2">客诉基本信息</div>
  72. </label>
  73. <div class="formControls col-9">
  74. </div>
  75. </div>
  76. <div class="row cl">
  77. <label class="form-label col-1 col-sm-1"><span class="c-red">*</span>跟进客服:</label>
  78. <div class="formControls col-4 col-sm-4"> <span class="select-box" style=" width: 625px;">
  79. <select name="adminId" id="adminId" class="select">
  80. </select>
  81. </span>
  82. </div>
  83. </div>
  84. <div class="row cl">
  85. <label class="form-label col-1 col-sm-1"><span class="c-red">*</span>来源入口:</label>
  86. <div class="formControls col-10 col-sm-10 skin-minimal">
  87. <div class="radio-box">
  88. <input type="radio" id="tel-1" name="customerSourceType" value="1" datatype="*" checked nullmsg="请选择来源入口!">
  89. <label for="tel-1">400电话</label>
  90. </div>
  91. <div class="radio-box">
  92. <input type="radio" id="tel-2" name="customerSourceType" value="2">
  93. <label for="tel-2">微信公众号</label>
  94. </div>
  95. <div class="radio-box">
  96. <input type="radio" id="tel-3" name="customerSourceType" value="3">
  97. <label for="tel-3">其他</label>
  98. <input type="text" style="width: 321px;margin-left: 10px; display: none;" class="input-text" value="" placeholder="" id="customerSourceOld" name="customerSourceOld" placeholder="">
  99. <input type="hidden" value="" placeholder="" id="customerSource" name="customerSource">
  100. </div>
  101. </div>
  102. </div>
  103. <div class="row cl">
  104. <label class="form-label col-1 col-sm-1"><span class="c-red">*</span>咨询类型:</label>
  105. <div class="formControls col-10 col-sm-10 skin-minimal">
  106. <div class="radio-box">
  107. <input type="radio" class="customerCounselType" id="customer-type-1" name="customerCounselType" value="1" >
  108. <label for="customer-type-1">售前咨询</label>
  109. </div>
  110. <div class="radio-box">
  111. <input type="radio" class="customerCounselType" id="customer-type-2" name="customerCounselType" value="2" checked>
  112. <label for="customer-type-2">售后咨询</label>
  113. </div>
  114. </div>
  115. </div>
  116. <div class="row cl">
  117. <label class="form-label col-1 col-sm-1"><span class="c-red">*</span>产品类型:</label>
  118. <input type="hidden" id="typeCompany" name="typeCompany" value="">
  119. <div class="formControls col-10 col-sm-10 skin-minimal" id="produceTypeHtml">
  120. <#--<div class="radio-box">
  121. <input type="radio" id="tel-3" name="produceType" datatype="*" nullmsg="请选择产品类型!">
  122. <label for="tel-3">净水机</label>
  123. </div>
  124. <div class="radio-box">
  125. <input type="radio" id="tel-3" name="produceType" datatype="*" nullmsg="请选择产品类型!">
  126. <label for="tel-4">冲奶机</label>
  127. </div>-->
  128. </div>
  129. </div>
  130. <div class="row cl" style="position: relative;">
  131. <label class="form-label col-1 col-sm-1"><span class="c-red">*</span>客诉问题:</label>
  132. <div class="formControls col-2 col-sm-2"> <span class="select-box">
  133. <select name="complaintId" class="select">
  134. <option value="">请选择问题分类</option>
  135. <#--<option value="0">使用操作</option>-->
  136. <#--<option value="1">使用操作</option>-->
  137. </select>
  138. </span>
  139. </div>
  140. <div class="formControls col-2 col-sm-2"> <span class="select-box">
  141. <select name="smallClassId" id="smallClassId" class="select">
  142. <option value="">请选择问题分类</option>
  143. <#--<option value="0">使用操作制水出水</option>
  144. <option value="1">使用操作制水出水</option>-->
  145. </select>
  146. </span>
  147. </div>
  148. <div class="formControls col-2 col-sm-2">
  149. <div class="clearfix">
  150. <input type="text" placeholder="搜索关键词" class="input-text ac_input" name="questionIdMsg" value="" id="search_text" autocomplete="off" style="width:60%"><button type="button" class="btn btn-primary" id="search_button">搜索</button>
  151. </div>
  152. </div>
  153. <div class="dalog-ask">
  154. <div class="tag">
  155. <em></em>
  156. <strong>相关QA</strong>
  157. <a href="javascript:void(0)" style="margin-left: 200px;" onclick="closeQA()">关闭</a>
  158. <ul id="question" style="padding-top: 15px">
  159. <#--<li class="ask">1、净水机面板操作不灵敏,是怎么回事?</li>
  160. <li class="answer">答:<span>4净水机面板操作不灵敏,是怎么回事。1、净水机面板操作不灵敏,是怎么回事?1、净水机面板操作不灵敏,是怎么回事?1、净水机面板操作不灵敏,是怎么回事?</span></li>-->
  161. </ul>
  162. </div>
  163. </div>
  164. </div>
  165. <div class="row cl">
  166. <label class="form-label col-1 col-sm-1"><span class="c-red">*</span>问题标题:</label>
  167. <div class="formControls col-5 col-sm-5">
  168. <input type="text" class="input-text" style="width: 625px;" name="describeTitle" id="describeTitle" datatype="*1-50" errormsg="问题标题不正确!" >
  169. </div>
  170. </div>
  171. <div class="row cl">
  172. <#--处理描述 - 客诉备注-->
  173. <label class="form-label col-1 col-sm-1">问题描述:</label>
  174. <div class="formControls col-5 col-sm-5">
  175. <span>问题描述详情,内部使用,不会对外公布。</span>
  176. <script id="describeHandleDescText" type="text/plain" style="width:983px;height:250px;"></script>
  177. </script>
  178. <input type="hidden" id="describeHandleDesc" name="describeHandleDesc">
  179. </div>
  180. </div>
  181. <div class="row cl">
  182. <label class="form-label col-1 col-sm-1"><span class="c-red">*</span>问题回复:</label>
  183. <div class="formControls col-5 col-sm-5">
  184. <input type="hidden" name="questionId" id="questionId" value="">
  185. <script id="describeContentText" type="text/plain" style="width:983px;height:250px;"></script>
  186. </script>
  187. <input type="hidden" name="describeContent" id="describeContent" value="">
  188. </div>
  189. </div>
  190. <div class="row cl">
  191. <label class="form-label col-1 col-sm-1"></label>
  192. <div class="formControls col-2 col-sm-2">
  193. <input type="text" class="input-text associated-phone" value="" placeholder="请输入手机号" id="p-phone" name="">
  194. </div>
  195. <div class="formControls col-2 col-sm-2" style="width: 10%">
  196. <input type="button" class="btn btn-primary" value="发送问题回复给用户" onclick="sendPhone('p','p-msg');">
  197. </div>
  198. <div class="formControls col-2 col-sm-2" style="width: 10%; margin-left: 40px;">
  199. <input type="button" class="btn btn-primary" value="保存QA" onclick="saveQuestion();">
  200. </div>
  201. <div class="formControls col-2 col-sm-2 msg-phone">
  202. <div id="p-msg" style="color: #e00"></div>
  203. </div>
  204. </div>
  205. <div class="row cl">
  206. <label class="form-label col-1 col-sm-1">
  207. <div class="tit">处理结果</div>
  208. </label>
  209. <div class="formControls col-10 col-sm-10">
  210. </div>
  211. </div>
  212. <input type="hidden" id="sendProdcues" name="sendProdcuesJson" value="">
  213. <input type="hidden" id="sendFittings" name="sendFittingsJson" value="">
  214. <input type="hidden" id="closedProdcues" name="closedProdcuesJson" value="">
  215. <input type="hidden" id="closedFittings" name="closedFittingsJson" value="">
  216. <div class="row cl">
  217. <label class="form-label col-1 col-sm-1">处理类型:</label>
  218. <div class="formControls col-10 col-sm-10 skin-minimal">
  219. <div class="radio-box" id="solved">
  220. <input type="radio" id="customer-process-1" value="1" name="customerIsSolve" >
  221. <label for="customer-process-1">已解决</label>
  222. </div>
  223. <div class="radio-box" id="noSolved">
  224. <input type="radio" id="customer-process-2" value="2" name="customerIsSolve">
  225. <label for="customer-process-2">未解决</label>
  226. </div>
  227. <div class="radio-box" id="renewed" style="display: none">
  228. <input type="radio" id="customer-process-3" value="3" name="customerIsSolve" checked>
  229. <label for="customer-process-3">换新</label>
  230. </div>
  231. <div class="radio-box" id="maintain" style="display: none">
  232. <input type="radio" id="customer-process-4" value="4" name="customerIsSolve" >
  233. <label for="customer-process-4">维修</label>
  234. </div>
  235. <div class="radio-box" id="reissue" style="display: none">
  236. <input type="radio" id="customer-process-5" value="5" name="customerIsSolve">
  237. <label for="customer-process-5">补发</label>
  238. </div>
  239. <div class="radio-box" id="backGoods" style="display: none">
  240. <input type="radio" id="customer-process-6" value="6" name="customerIsSolve">
  241. <label for="customer-process-6">退货</label>
  242. </div>
  243. <div class="radio-box" id="noReasonBack" style="display: none">
  244. <input type="radio" id="customer-process-7" value="7" name="customerIsSolve">
  245. <label for="customer-process-7">无理由退货</label>
  246. </div>
  247. </div>
  248. </div>
  249. <div class="row cl">
  250. <label class="form-label col-1 col-sm-1"></label>
  251. <div class="formControls col-10 col-sm-10">
  252. <ul class="time-line-list" id="processResultStatus">
  253. <#-- <li><span class="arrow"></span><div class="number">1</div><div>录入客诉</div></li>
  254. <li><span class="arrow"></span><div class="number">2</div><div>督促用户寄回</div></li>
  255. <li><span class="arrow"></span><div class="number">3</div><div>录入快递单号</div></li>
  256. <li><span class="arrow"></span><div class="number">4</div><div>仓库收货</div></li>
  257. <li><span class="arrow"></span><div class="number">5</div><div>换新发货</div></li>
  258. <li><span class="arrow"></span><div class="number">6</div><div>发货通知用户</div></li>
  259. <li><span class="arrow"></span><div class="number">7</div><div>收货后回访</div></li>-->
  260. </ul>
  261. </div>
  262. </div>
  263. <div class="row cl" id="orderHead" style="display: none;">
  264. <label class="form-label col-1 col-sm-1"><span class="c-red">*</span>订单信息:</label>
  265. <div class="formControls col-1 col-sm-1">
  266. <button type="button" class="btn btn-primary" id="selectOrder">搜索订单</button>
  267. </div>
  268. </div>
  269. <div class="row cl" id="order" style="display: none;">
  270. <label class="form-label col-1 col-sm-1"></label>
  271. <div class="formControls col-9 col-sm-9 text-c">
  272. <table class="table table-border table-bg table-bordered">
  273. <tr>
  274. <th style="text-align: center;">销售</th>
  275. <th style="text-align: center;">订单号</th>
  276. <th style="text-align: center;">姓名</th>
  277. <th style="text-align: center;">电话</th>
  278. <th style="text-align: center;">订单金额</th>
  279. <th style="text-align: center;">购买产品</th>
  280. <th style="text-align: center;">购买日期</th>
  281. </tr>
  282. <tr id="showOrder">
  283. <td style="text-align: center;" colspan="7">暂未选择订单</td>
  284. </tr>
  285. </table>
  286. <input type="hidden" id="companyId" name="companyId" value="" >
  287. <input type="hidden" id="storeId" name="storeId" value="" >
  288. <input type="hidden" id="orderId" name="salesId" value="" >
  289. </div>
  290. </div>
  291. <div class="row cl" id="recipientInfoTitle" style="display: none;">
  292. <label class="form-label col-1 col-sm-1"><span class="c-red">*</span>收件信息:</label>
  293. <div class="formControls col-8 col-sm-8">请先选择订单,系统自动填充姓名,电话和地址信息。</div>
  294. </div>
  295. <div class="row cl" id="recipientInfo" style="display: none;">
  296. <label class="form-label col-1 col-sm-1"></label>
  297. <div class="formControls col-2 col-sm-2">
  298. <input type="text" class="input-text" value="" placeholder="填写收件人姓名" id="sendName" name="relationSendName" datatype="/^[\u4e00-\u9fa5]{1,20}$/" errormsg="联系人格式不正确!" >
  299. </div>
  300. <div class="formControls col-2 col-sm-2">
  301. <input type="text" class="input-text" value="" placeholder="填写收件人手机号" id="sendTel" name="relationSendTel" datatype="m" errormsg="联系人电话格式不正确!">
  302. </div>
  303. <div class="formControls col-2 col-sm-2" id="postageAccount">
  304. <input type="text" class="input-text" value="" placeholder="邮费转账 支付宝账户" id="relationAlipay" name="relationAlipay" errormsg="邮费转账账户!">
  305. </div>
  306. </div>
  307. <div class="row cl" id="recipientAddress" style="display: none;">
  308. <input type="hidden" id="addressInfo">
  309. <label class="form-label col-1 col-sm-1"></label>
  310. <div class="formControls col-2 col-sm-2">
  311. <span class="select-box">
  312. <select id="province" class="select" name="provinceNumber">
  313. </select>
  314. </span>
  315. </div>
  316. <div class="formControls col-2 col-sm-2">
  317. <span class="select-box">
  318. <select id="city" class="select" name="cityNumber">
  319. </select>
  320. </span>
  321. </div>
  322. <div class="formControls col-2 col-sm-2">
  323. <span class="select-box">
  324. <select id="district" class="select" name="areaNumber">
  325. </select>
  326. </span>
  327. </div>
  328. <input type="hidden" name="relationSendMergeAddress" id="relationSendMergeAddress">
  329. </div>
  330. <div class="row cl" id="recipientAddressText" style="display: none;">
  331. <label class="form-label col-1 col-sm-1"></label>
  332. <div class="formControls col-5 col-sm-5">
  333. <textarea name="relationSendAddress" id="sendAddress" cols="" rows="2" datatype="*" errormsg="收货地址不正确!" class="textarea" placeholder="请填写详细地址,最多支持50字符" onKeyUp="$.Huitextarealength(this,50)"></textarea>
  334. <span id="addrssMsg"></span>
  335. </div>
  336. </div>
  337. <div class="row cl" id="renewedProduct" style="display: none;">
  338. <label class="form-label col-1 col-sm-1"><span class="c-red">*</span><span id="relationProduct">换新产品</span>:</label>
  339. <div class="formControls col-9 col-sm-9 text-c" id="produceSelect">
  340. <table class="table table-border table-bg table-bordered">
  341. <thead>
  342. <tr class="text-c" id="table1">
  343. <th style="text-align: center;" width="60">产品名称</th>
  344. <th style="text-align: center;" width="60">产品颜色</th>
  345. <th style="text-align: center;" width="60">产品配件</th>
  346. </tr>
  347. </thead>
  348. <tbody id="addProduct">
  349. <tr id="showOrder">
  350. <td style="text-align: center;" colspan="3">请选择订单之后再选择产品</td>
  351. </tr>
  352. </tbody>
  353. </table>
  354. </div>
  355. </div>
  356. <div class="row cl" id="TDScollect" style="display: none;">
  357. <label class="form-label col-1 col-sm-1">TDS收集:</label>
  358. <div class="formControls col-2 col-sm-2" style="position: relative;">
  359. <input type="hidden" name="arrcity_3word" id="arrcity_3word" value="" />
  360. <input style="width: 190px;" placeholder="" class="input-text my-search-input" placeholder="请输入城市名称搜索" type="text" name="arrcity" id="arrcity" />
  361. <div id="suggest" class="ac_results"></div>
  362. </div>
  363. <div class="formControls col-2 col-sm-2">
  364. <span class="select-box">
  365. <select name="" class="select" id="TDSArea" name="TDSArea">
  366. <option value="">请搜索城市</option>
  367. </select>
  368. </span>
  369. </div>
  370. <input type="hidden" name="customerArea" id="customerArea">
  371. <div class="formControls col-2 col-sm-2">
  372. <input type="text" class="input-text" value="" placeholder="进水TDS数值,最大999" id="customerInTDS" name="customerInTDS" onkeyup="TDSLinkage($(this),999)" onpaste="TDSLinkage($(this),999)">
  373. </div>
  374. <div class="formControls col-2 col-sm-2">
  375. <input type="text" class="input-text" value="" placeholder="出水TDS数值,最大999" id="customerOutTDS" name="customerOutTDS" onkeyup="TDSLinkage($(this),999)" onpaste="TDSLinkage($(this),999)">
  376. </div>
  377. </div>
  378. <div class="row cl" id="TDScollectShow" style="display: none;">
  379. <label class="form-label col-1 col-sm-1"></label>
  380. <div class="formControls col-6 col-sm-6">
  381. <span id="DTS-address"></span>
  382. &nbsp;&nbsp;&nbsp;&nbsp;<span id="DTS-in"></span>&nbsp;&nbsp; <span id="DTS-out"></span>
  383. </div>
  384. </div>
  385. <div class="row cl" id="sendAddressInfo">
  386. <label class="form-label col-1 col-sm-1"><span class="c-red">*</span>寄回信息:</label>
  387. <div class="formControls col-5 col-sm-5" style="height: 250px">
  388. <script id="sendAddressSms" type="text/plain" style="width:983px;height:200px;"></script>
  389. </script>
  390. </div>
  391. </div>
  392. <div class="row cl" id="sendAddressByPhone" style="display: none;">
  393. <label class="form-label col-1 col-sm-1"></label>
  394. <div class="formControls col-2 col-sm-2">
  395. <input type="text" class="input-text associated-phone" value="" placeholder="请输入手机号" id="m-phone" name="">
  396. </div>
  397. <div class="formControls col-2 col-sm-2" style="width: 10%">
  398. <input type="button" class="btn btn-primary" value="发短信给用户" onclick="sendPhone('m','m-msg');">
  399. </div>
  400. <div class="formControls col-2 col-sm-2 msg-phone">
  401. <div id="m-msg" style="color: #e00"></div>
  402. </div>
  403. </div>
  404. <div class="row cl" id="updateProduct" style="display: none;">
  405. <label class="form-label col-1 col-sm-1"><span class="c-red">*</span>更换产品:</label>
  406. <div class="formControls col-9 col-sm-9" >
  407. <table class="table table-border table-bg table-bordered">
  408. <thead>
  409. <tr class="text-c" id="table2">
  410. <th style="text-align: center;" width="60">产品名称</th>
  411. <th style="text-align: center;" width="60">产品颜色</th>
  412. <th style="text-align: center;" width="60">产品配件</th>
  413. </tr>
  414. </thead>
  415. <tbody id="back-product">
  416. <tr id="showOrder">
  417. <td style="text-align: center;" colspan="3">请选择订单之后再选择产品</td>
  418. </tr>
  419. </tbody>
  420. </table>
  421. </div>
  422. </div>
  423. <div class="row cl">
  424. <label class="form-label col-1 col-sm-1"><span class="c-red">*</span>回访信息:</label>
  425. <div class="formControls col-10 col-sm-10 skin-minimal">
  426. <div class="radio-box">
  427. <input type="radio" id="customer-visit-1" name="customerIsVisit" value="2" >
  428. <label for="customer-visit-1">需要回访</label>
  429. </div>
  430. <div class="radio-box">
  431. <input type="radio" id="customer-visit-2" name="customerIsVisit" value="1" checked>
  432. <label for="customer-visit-2">不需要回访</label>
  433. </div>
  434. </div>
  435. </div>
  436. <div id="needToVisit" style="display: none;">
  437. <div class="row cl">
  438. <label class="form-label col-1 col-sm-1"><span class="c-red">*</span>回访人:</label>
  439. <div class="formControls col-2 col-sm-2">
  440. <input type="text" class="input-text" value="" placeholder="填写回访人姓名" id="" name="visitName" datatype="s1-20" errormsg="回访人姓名格式不正确!" >
  441. </div>
  442. <div class="formControls col-2 col-sm-2">
  443. <input type="text" class="input-text associated-phone" value="" placeholder="填写回访人手机号" id="" name="visitTel" datatype="m" errormsg="回访人手机号码格式不正确!">
  444. </div>
  445. </div>
  446. <div class="row cl">
  447. <label class="form-label col-1 col-sm-1"><span class="c-red">*</span>回访日期:</label>
  448. <div class="formControls col-2 col-sm-2">
  449. <input type="text" placeholder="请选择回访日期" id="datemin" name="visitDate" datatype="*" class="input-text Wdate" onclick="WdatePicker({skin:'whyGreen',minDate:'%y-%M-%d'})" readonly="readonly">
  450. </div>
  451. </div>
  452. <div class="row cl">
  453. <label class="form-label col-1 col-sm-1"><span class="c-red">*</span>回访时间:</label>
  454. <div class="formControls col-10 col-sm-10 skin-minimal">
  455. <div class="radio-box">
  456. <input type="radio" id="visit-time-1" name="visitTimeSelect" value="1" checked>
  457. <label for="visit-time-1">09:00-12:00</label>
  458. </div>
  459. <div class="radio-box">
  460. <input type="radio" id="visit-time-2" name="visitTimeSelect" value="2">
  461. <label for="visit-time-2">12:00-14:00</label>
  462. </div>
  463. <div class="radio-box">
  464. <input type="radio" id="visit-time-3" name="visitTimeSelect" value="3">
  465. <label for="visit-time-3">14:00-18:00</label>
  466. </div>
  467. </div>
  468. </div>
  469. <div class="row cl">
  470. <label class="form-label col-1 col-sm-1"><span class="c-red">*</span>提醒人:</label>
  471. <div class="formControls col-4 col-sm-4"> <span class="select-box">
  472. <select class="select" id="visitAdminId" name="visitAdminId">
  473. </select>
  474. </span>
  475. </div>
  476. </div>
  477. <div class="cl" style="display: table;width: 100%;">
  478. <label class="form-label col-1 col-sm-1"></label>
  479. <div class="formControls col-4 col-sm-4">
  480. <span class="c-red" id="visitAdminIdMsg">您将为自己指定一个回访任务</span>
  481. </div>
  482. </div>
  483. </div>
  484. <div class="row cl">
  485. <div class="col-2 col-sm-2 col-offset-3">
  486. <button class="btn btn-block btn-primary size-XL" type="submit">确认录入</button>
  487. </div>
  488. </div>
  489. </form>
  490. </div>
  491. </article>
  492. <#--时间控件-->
  493. <script type="text/javascript" src="${path}/common/lib/My97DatePicker/4.8/WdatePicker.js"></script>
  494. <script type="text/javascript" src="${path}/common/lib/webuploader/0.1.5/webuploader.min.js"></script>
  495. <script type="text/javascript" src="${path}/common/lib/icheck/jquery.icheck.min.js"></script>
  496. <script type="text/javascript" src="${path}/common/lib/cm.lib/jquery.provincesCity.js"></script>
  497. <script type="text/javascript" src="${path}/common/lib/cm.lib/provincesData.js"></script>
  498. <script type="text/javascript" src="${path}/common/lib/cm.lib/airCity.js"></script>
  499. <#--<script type="text/javascript" src="${path}/common/lib/cm.lib/dimensions.js"></script>-->
  500. <script type="text/javascript" src="${path}/common/lib/cm.lib/suggest.js"></script>
  501. <#--百度富文本编译器-->
  502. <script type="text/javascript" charset="utf-8" src="${path}/common/lib/ueditor/1.4.3/ueditor.config.js"></script>
  503. <script type="text/javascript" charset="utf-8" src="${path}/common/lib/ueditor/1.4.3/ueditor.all.js"></script>
  504. <script type="text/javascript" charset="utf-8" src="${path}/common/lib/ueditor/1.4.3/ueditor.parse.js"></script>
  505. <script type="text/javascript" charset="utf-8" src="${path}/common/lib/ueditor/1.4.3/lang/zh-cn/zh-cn.js"></script>
  506. <script type="text/javascript">
  507. $(function(){
  508. $("#province").ProvinceCity();
  509. $('.skin-minimal input').iCheck({
  510. checkboxClass: 'icheckbox-blue',
  511. radioClass: 'iradio-blue',
  512. increaseArea: '20%'
  513. });
  514. $("#arrcity").suggest(citys,{hot_list:commoncitys,dataContainer:'#arrcity_3word',onSelect:function(result){
  515. console.log($(this)[0].value);
  516. $("#city2").click()
  517. },
  518. attachObject:'#suggest'
  519. });
  520. $("#city2").suggest(citys,{hot_list:commoncitys,attachObject:"#suggest2"})
  521. });
  522. $(document).on('click', '.dalog-ask .answer', function() {
  523. var questionId = $(this).find(".quesId").val()
  524. var title = $(this).find("span").html();
  525. var desc = $(this).find("#questionProfile").html()
  526. $("#questionId").val(questionId);
  527. $("#describeTitle").val(title);
  528. UE.getEditor('describeContentText').setContent(desc);
  529. //$("#answer-textarea").text();
  530. $(".dalog-ask").hide(); //隐藏qa
  531. });
  532. </script>
  533. <script>
  534. var tool = [
  535. 'anchor', //锚点
  536. 'undo', //撤销
  537. 'redo', //重做
  538. 'bold', //加粗
  539. 'indent', //首行缩进
  540. 'snapscreen', //截图
  541. 'italic', //斜体
  542. 'underline', //下划线
  543. 'strikethrough', //删除线
  544. 'subscript', //下标
  545. 'fontborder', //字符边框
  546. 'superscript', //上标
  547. 'formatmatch', //格式刷
  548. //'source', //源代码
  549. 'blockquote', //引用
  550. 'pasteplain', //纯文本粘贴模式
  551. 'selectall', //全选
  552. 'print', //打印
  553. 'preview', //预览
  554. 'horizontal', //分隔线
  555. 'removeformat', //清除格式
  556. 'time', //时间
  557. 'date', //日期
  558. 'unlink', //取消链接
  559. 'insertrow', //前插入行
  560. 'insertcol', //前插入列
  561. 'mergeright', //右合并单元格
  562. 'mergedown', //下合并单元格
  563. 'deleterow', //删除行
  564. 'deletecol', //删除列
  565. 'splittorows', //拆分成行
  566. 'splittocols', //拆分成列
  567. 'splittocells', //完全拆分单元格
  568. 'deletecaption', //删除表格标题
  569. 'inserttitle', //插入标题
  570. 'mergecells', //合并多个单元格
  571. 'deletetable', //删除表格
  572. 'cleardoc', //清空文档
  573. 'insertparagraphbeforetable', //"表格前插入行"
  574. //'insertcode', //代码语言
  575. 'fontfamily', //字体
  576. 'fontsize', //字号
  577. 'paragraph', //段落格式
  578. 'simpleupload', //单图上传
  579. 'insertimage', //多图上传
  580. 'edittable', //表格属性
  581. 'edittd', //单元格属性
  582. 'link', //超链接
  583. 'emotion', //表情
  584. 'spechars', //特殊字符
  585. 'searchreplace', //查询替换
  586. 'map', //Baidu地图
  587. 'gmap', //Google地图
  588. 'insertvideo', //视频
  589. 'help', //帮助
  590. 'justifyleft', //居左对齐
  591. 'justifyright', //居右对齐
  592. 'justifycenter', //居中对齐
  593. 'justifyjustify', //两端对齐
  594. 'forecolor', //字体颜色
  595. 'backcolor', //背景色
  596. 'insertorderedlist', //有序列表
  597. 'insertunorderedlist', //无序列表
  598. 'fullscreen', //全屏
  599. 'directionalityltr', //从左向右输入
  600. 'directionalityrtl', //从右向左输入
  601. 'rowspacingtop', //段前距
  602. 'rowspacingbottom', //段后距
  603. 'pagebreak', //分页
  604. 'insertframe', //插入Iframe
  605. 'imagenone', //默认
  606. 'imageleft', //左浮动
  607. 'imageright', //右浮动
  608. 'attachment', //附件
  609. 'imagecenter', //居中
  610. 'wordimage', //图片转存
  611. 'lineheight', //行间距
  612. 'edittip ', //编辑提示
  613. 'customstyle', //自定义标题
  614. 'autotypeset', //自动排版
  615. // 'webapp', //百度应用
  616. 'touppercase', //字母大写
  617. 'tolowercase', //字母小写
  618. 'background', //背景
  619. 'template', //模板
  620. // 'scrawl', //涂鸦
  621. 'music', //音乐
  622. 'inserttable', //插入表格
  623. 'drafts', // 从草稿箱加载
  624. 'charts' // 图表
  625. ];
  626. /*问题描述*/
  627. var describeContentText = UE.getEditor('describeContentText', {
  628. toolbars: [tool],
  629. autoHeightEnabled: true,
  630. autoFloatEnabled: true,
  631. elementPathEnabled : false,/*去掉元素路径*/
  632. zIndex : 5
  633. });
  634. /*处理描述*/
  635. var describeHandleDescText = UE.getEditor('describeHandleDescText', {
  636. toolbars: [tool],
  637. autoHeightEnabled: true,
  638. autoFloatEnabled: true,
  639. elementPathEnabled : false, /*去掉元素路径*/
  640. zIndex : 5
  641. });
  642. /*邮寄地址*/
  643. var sendAddressSms = UE.getEditor('sendAddressSms', {
  644. toolbars: [tool],
  645. autoHeightEnabled: true,
  646. autoFloatEnabled: true,
  647. elementPathEnabled : false /*去掉元素路径*/
  648. });
  649. var isInitSendAddressSms = false;
  650. sendAddressSms.ready(function() {
  651. sendAddressSms.setHeight(130); //固定高度
  652. });
  653. </script>
  654. <script type="text/javascript">
  655. /*处理结果的执行状态*/
  656. var isSolve = {
  657. solved : [],
  658. noSolved : [],
  659. renewed : ["录入客诉","督促用户寄回","录入快递单号","仓库收货","换新发货","发货通知用户","收货后回访"],
  660. maintain : ["录入客诉","督促用户寄回","录入快递单号","仓库收货","品质检测","产线维修","换新发货","发货通知用户","收货后回访"],
  661. reissue : ["录入客诉","生成E订单","督促仓库发货","仓库发货","发货通知用户","收货后回访"],
  662. backGoods : ["录入客诉","督促用户寄回","录入快递单号","仓库收货","品质检测","退款","退货完成"],
  663. noReasonBack : ["录入客诉","督促用户寄回","录入快递单号","仓库收货","品质检测","退款","退货完成"]
  664. }
  665. /*处理结果的变更状态 产品列表表头信息*/
  666. var isSolveTitleMsg = {
  667. solved : [[],[]],
  668. noSolved : [[],[]],
  669. renewed : [["退回产品","退回产品颜色","退回产品配件"],["更换产品","更换产品颜色","更换产品配件"]],
  670. maintain : [["需要维修的产品","需要维修的产品颜色","需要维修的产品配件"],["维修产品","维修产品颜色","维修产品配件"]],
  671. reissue : [["补发产品","补发产品颜色","补发产品配件"],[]],
  672. backGoods : [["退回产品","退回产品颜色","退回产品配件"],[]],
  673. noReasonBack : [["退回产品","退回产品颜色","退回产品配件"],[]]
  674. }
  675. /*个人id*/
  676. var adminId = 0;
  677. /* 咨询类型 1:售前咨询 2:售后咨询 3:其他 */
  678. var allCustomerInfoType;
  679. /*全局标识当前状态 type : 1 :已解决 2:未解决 3:换新 4:维修 5:补发 6:退货 7:无理由退货*/
  680. var allCustomerType = 1;
  681. var allCustomerTypeName = ["已解决","未解决","换新","维修","补发","退货","无理由退货"];
  682. /* 寄回地址的id */
  683. var complaint_questionId = 5;
  684. /* 用于判断是否第一次初始化省市区-- 只在选择类型为售后时使用 */
  685. var isInitAddress = 0;
  686. /*初始化页面参数*/
  687. $(function () {
  688. /* 初始化单选框样式 */
  689. //initCheck();
  690. /*初始化产品类型 -- 客诉头部的产品类型单选 */
  691. initProduceType();
  692. /*初始化问题分类*/
  693. initComplaintTypeInfo();
  694. /*初始化客服*/
  695. initSysAdmin();
  696. /*初始化回访客服*/
  697. initVisitSysAdmin();
  698. /*初始化选择处理结果 -- type : 1 :已解决 2:未解决 3:换新 4:维修 5:补发 6:退货 7:无理由退货 */
  699. initProcessResult(3);
  700. /*监听来源入口选择事件*/
  701. $("input[name='customerSourceType']").change(function (){
  702. var type = parseInt($(this).val());
  703. if(type == 3){
  704. $("#customerSourceOld").show();
  705. }else{
  706. $("#customerSourceOld").hide();
  707. }
  708. })
  709. /*监听客诉类型选择事件*/
  710. $("input[name='customerCounselType']").change(function (){
  711. allCustomerInfoType = parseInt($(this).val());
  712. if(allCustomerInfoType == 1){
  713. $("#customer-process-1").iCheck('check'); //设置已解决
  714. allCustomerType = 1;
  715. }else{
  716. $("#customer-process-3").iCheck('check'); //设置换新
  717. allCustomerType =3;
  718. }
  719. initProcessResult(allCustomerType);
  720. })
  721. /*监听处理结果选择事件*/
  722. $("[name='customerIsSolve']").change(function(){
  723. initProcessResult(parseInt($(this).val()));
  724. })
  725. /*监听问题类型 选择事件*/
  726. $("[name='complaintId']").change(function(){
  727. initComplaintSmallClassInfo($(this).val());
  728. })
  729. /*监听问题关键字搜索*/
  730. $(document).on('click', '#search_button', function() {
  731. initComplaintQuestionInfo("p");
  732. });
  733. /*搜索订单事件*/
  734. $(document).on('click', '#selectOrder', function() {
  735. selectOrder();
  736. });
  737. /*监听省选择事件*/
  738. $(document).on('change', '#province', function() {
  739. var proId = $("#province").val();
  740. var cityId = setCity("",proId,2)
  741. setDistrict("",cityId,2)
  742. });
  743. /*监听市选择事件*/
  744. $(document).on('change', '#city', function() {
  745. var city = $("#city").val();
  746. setDistrict("",city,2)
  747. });
  748. /*监听回访类型选择事件 是否需要回访 1:不需要回访 2:需要回复 */
  749. initVisitEvent();
  750. /*监听回访选择客服的选择事件*/
  751. $(document).on('change', '#visitAdminId', function() {
  752. var visitAdminName = $("#visitAdminId").find("option:selected").text();
  753. var visitAdminId = $("#visitAdminId").val();
  754. if(convertUndefinedToEmpty(visitAdminId) == adminId){
  755. showVisitMsg(1);
  756. }else{
  757. showVisitMsg(2,visitAdminName);
  758. }
  759. });
  760. /* 监听TDS收集--地址选择 */
  761. $(document).on('change', '#TDSArea', function() {
  762. setTDSCollect();
  763. });
  764. /*实时监听文本框-- TDS进水*/
  765. // document.getElementById("customerInTDS").addEventListener("input", function(){
  766. // setTDSCollect();
  767. // });
  768. /*实时监听文本框-- TDS出水*/
  769. // document.getElementById("customerOutTDS").addEventListener("input", function(){
  770. // setTDSCollect();
  771. // });
  772. /* 监听手机号 失去焦点时 将其他手机号码未填的 */
  773. $(".associated-phone").blur(function (){
  774. var phone = $(this).val();
  775. $(".associated-phone").each(function(){
  776. var ph = $(this).val();
  777. if(ph == null || ph == "" || typeof(ph) == undefined ){
  778. $(this).val(phone);
  779. }
  780. })
  781. })
  782. })
  783. /*用于初始化回访信息的展示*/
  784. function initVisitEvent(){
  785. $("input[name='customerIsVisit']").change(function (){
  786. if($(this).val() == 2){
  787. $("#needToVisit").css("display","block");
  788. }else{
  789. $("#needToVisit").css("display","none");
  790. }
  791. })
  792. }
  793. /*关闭qa*/
  794. function closeQA(){
  795. $(".dalog-ask").hide(); //隐藏qa
  796. }
  797. /*初始化单选框样式*/
  798. function initCheck(){
  799. $('.skin-minimal input').iCheck({
  800. checkboxClass: 'icheckbox-blue',
  801. radioClass: 'iradio-blue',
  802. increaseArea: '20%'
  803. });
  804. }
  805. /*初始化单选框样式*/
  806. function initCheckByNode(node){
  807. node.iCheck({
  808. checkboxClass: 'icheckbox-blue',
  809. radioClass: 'iradio-blue',
  810. increaseArea: '20%'
  811. });
  812. }
  813. /*
  814. * type 1:不需要回访 2:需要回访
  815. * */
  816. function visitByType(type){
  817. if(1 == type){ //不需要回访
  818. $("#customer-visit-2").iCheck('check'); //设置不需要回访
  819. $("#needToVisit").css("display","none");
  820. }else{
  821. $("#customer-visit-1").iCheck('check'); //设置需要回访
  822. $("#needToVisit").css("display","block");
  823. }
  824. initVisitEvent();
  825. }
  826. /*初始化客服*/
  827. var sysAminList;
  828. function initSysAdmin() {
  829. sysAminList = getSysAdmin();
  830. var html = "";
  831. for(var i=0;i<sysAminList.length;i++){
  832. var adminList = sysAminList[i];
  833. if(adminId != null && adminId != "" && adminId != 0 && adminId == adminList.adminId ){
  834. html += '<option value="'+ adminList.adminId +'" selected>'+ adminList.adminName +'(我)</option>';
  835. }else{
  836. html += '<option value="'+ adminList.adminId +'">'+ adminList.adminName +'</option>';
  837. }
  838. }
  839. $("#adminId").html(html);
  840. }
  841. /*初始化回访客服的选择*/
  842. function initVisitSysAdmin(){
  843. var html = "";
  844. var flag = false;
  845. for(var i=0;i<sysAminList.length;i++){
  846. var adminList = sysAminList[i];
  847. if(adminId != null && adminId != "" && adminId != 0 && adminId == adminList.adminId ){
  848. html += '<option value="'+ adminList.adminId +'" selected>'+ adminList.adminName +'(我)</option>';
  849. flag = true;
  850. }else{
  851. html += '<option value="'+ adminList.adminId +'">'+ adminList.adminName +'</option>';
  852. }
  853. }
  854. $("#visitAdminId").html(html);
  855. if(flag){
  856. showVisitMsg(1);
  857. }
  858. }
  859. /**
  860. * 用于显示回访指派任务提示信息
  861. * 1 :自己
  862. * 2 :其他人
  863. */
  864. function showVisitMsg(type,adminName) {
  865. if(type == 1){
  866. $("#visitAdminIdMsg").html("您将为自己指定一个回访任务");
  867. }else{
  868. $("#visitAdminIdMsg").html("您将为"+ adminName +"指定一个回访任务");
  869. }
  870. }
  871. /*获取客服*/
  872. var sysAminList;
  873. function getSysAdmin(){
  874. if(sysAminList != null && sysAminList.length > 0){
  875. return sysAminList
  876. }
  877. $.ajax({
  878. type: "POST",
  879. data: {
  880. },
  881. url: "${path}/admin/customer/select_sys_admin",
  882. async: false,
  883. success: function(data){
  884. if (data.returnCode == 200) {
  885. sysAminList = data.returnMsg.adminList;
  886. adminId = data.returnMsg.adminId;
  887. }
  888. },
  889. error: function(XmlHttpRequest, textStatus, errorThrown){
  890. }
  891. });
  892. return sysAminList;
  893. }
  894. /*初始化产品类型 -- 客诉头部的产品类型单选*/
  895. function initProduceType(){
  896. var html = "";
  897. $.ajax({
  898. type: "POST",
  899. data: {
  900. },
  901. url: "${path}/admin/customer/select_produce_type",
  902. async: false,
  903. success: function(data){
  904. if (data.returnCode == 200) {
  905. var check = "checked";
  906. for(var i=0;i<data.returnMsg.productTypeList.length;i++){
  907. var produce = data.returnMsg.productTypeList[i];
  908. html += ' <div class="radio-box">' +
  909. '<input type="radio" id="produce-type-'+ i +'" name="typeId" typeCompany="'+ produce.typeCompany +'" datatype="*" value="'+ produce.typeId +'" '+ check +' nullmsg="请选择产品类型!" >' +
  910. ' <label for="produce-type-'+ i +'">'+ produce.typeName +'</label>' +
  911. ' </div>';
  912. check = "";
  913. }
  914. }else{
  915. html = '';
  916. }
  917. },
  918. error: function(XmlHttpRequest, textStatus, errorThrown){
  919. }
  920. });
  921. $("#produceTypeHtml").html(html);
  922. initCheck();
  923. }
  924. /**
  925. * 选择处理结果-- 默认选择已解决
  926. * type : 1 :已解决 2:未解决 3:换新 4:维修 5:补发 6:退货 7:无理由退货
  927. */
  928. function initProcessResult(type){
  929. if(type == null || type == ""){
  930. type = 1;
  931. }
  932. allCustomerType = type;
  933. if(allCustomerInfoType == null || allCustomerInfoType == ""){
  934. allCustomerInfoType = $("input[name='customerCounselType']:checked").val();
  935. }
  936. var statusHtml = '<li><span class="arrow"></span><div class="number">status_index</div><div>status_html</div></li>';
  937. var resultHtml = '';
  938. var result = {};
  939. var resultProductTableTitle = {};
  940. $("#solved").show(); //已解决
  941. $("#noSolved").show();//未解决
  942. if(allCustomerInfoType == 1){ //售前
  943. $("#renewed").hide();
  944. $("#maintain").hide();
  945. $("#reissue").hide();
  946. $("#backGoods").hide();
  947. $("#noReasonBack").hide();
  948. switch(type)
  949. {
  950. case 1:
  951. otherHied();
  952. visitByType(1);
  953. break;
  954. case 2:
  955. otherHied();
  956. visitByType(2);
  957. break;
  958. default:
  959. break;
  960. }
  961. }else if(allCustomerInfoType == 2){ //售后
  962. if(!isInitSendAddressSms){
  963. initComplaintQuestionInfo("m");
  964. isInitSendAddressSms = true;
  965. }
  966. /* 在选择售后类型是,直接初始化省市区,使用isInitAddress 变量来判断 */
  967. if(isInitAddress == 0){
  968. var proId = setPro(null,2);
  969. var cityId = setCity(null,proId,2);
  970. setDistrict(null,cityId,2);
  971. isInitAddress = 1;
  972. }
  973. $("#renewed").show();
  974. $("#maintain").show();
  975. $("#reissue").show();
  976. $("#backGoods").show();
  977. $("#noReasonBack").show();
  978. switch(type)
  979. {
  980. case 1:
  981. otherHied();
  982. visitByType(1);
  983. break;
  984. case 2:
  985. otherHied();
  986. visitByType(2); //需要回访
  987. break;
  988. case 3: //换新
  989. result = isSolve.renewed;
  990. resultProductTableTitle = isSolveTitleMsg.renewed;
  991. $("#relationProduct").html("换新产品");
  992. $("#processResultStatus").show();
  993. $("#orderHead").show();
  994. $("#order").show();
  995. $("#recipientInfo").show();
  996. $("#recipientInfoTitle").show();
  997. $("#recipientAddress").show();
  998. $("#recipientAddressText").show();
  999. $("#renewedProduct").show();
  1000. $("#TDScollect").show();
  1001. $("#TDScollectShow").show();
  1002. $("#sendAddressInfo").show();
  1003. $("#sendAddressByPhone").show();
  1004. $("#updateProduct").hide(); //换新产品
  1005. $("#postageAccount").show(); //邮费转账账户
  1006. visitByType(2); //需要回访
  1007. break;
  1008. case 4: //维修
  1009. result = isSolve.maintain;
  1010. resultProductTableTitle = isSolveTitleMsg.maintain;
  1011. $("#relationProduct").html("维修产品");
  1012. $("#processResultStatus").show();
  1013. $("#orderHead").show();
  1014. $("#order").show();
  1015. $("#recipientInfo").show();
  1016. $("#recipientInfoTitle").show();
  1017. $("#recipientAddress").show();
  1018. $("#recipientAddressText").show();
  1019. $("#renewedProduct").show();
  1020. $("#TDScollect").show();
  1021. $("#TDScollectShow").show();
  1022. $("#sendAddressInfo").show();
  1023. $("#sendAddressByPhone").show();
  1024. $("#updateProduct").hide();//维修产品
  1025. $("#postageAccount").show(); //邮费转账账户
  1026. visitByType(2); //需要回访
  1027. break;
  1028. case 5://补发
  1029. result = isSolve.reissue;
  1030. resultProductTableTitle = isSolveTitleMsg.reissue;
  1031. $("#relationProduct").html("补发产品");
  1032. $("#processResultStatus").show();
  1033. $("#orderHead").show();
  1034. $("#order").show();
  1035. $("#recipientInfo").show();
  1036. $("#recipientInfoTitle").show();
  1037. $("#recipientAddress").show();
  1038. $("#recipientAddressText").show();
  1039. $("#renewedProduct").show();
  1040. $("#TDScollect").show();
  1041. $("#TDScollectShow").show();
  1042. $("#sendAddressInfo").hide();
  1043. $("#sendAddressByPhone").hide();
  1044. $("#updateProduct").hide();
  1045. $("#postageAccount").hide(); //邮费转账账户 -- 隐藏
  1046. visitByType(2); //需要回访
  1047. break;
  1048. case 6: //退货
  1049. result = isSolve.backGoods;
  1050. resultProductTableTitle = isSolveTitleMsg.backGoods;
  1051. $("#relationProduct").html("退货产品");
  1052. $("#processResultStatus").show();
  1053. $("#orderHead").show();
  1054. $("#order").show();
  1055. $("#recipientInfo").show();
  1056. $("#recipientInfoTitle").show();
  1057. $("#recipientAddress").show();
  1058. $("#recipientAddressText").show();
  1059. $("#renewedProduct").show();
  1060. $("#TDScollect").show();
  1061. $("#TDScollectShow").show();
  1062. $("#sendAddressInfo").show();
  1063. $("#sendAddressByPhone").show();
  1064. $("#updateProduct").hide();
  1065. $("#postageAccount").show(); //邮费转账账户
  1066. visitByType(2); //需要回访
  1067. break;
  1068. case 7://无理由退货
  1069. result = isSolve.noReasonBack;
  1070. resultProductTableTitle = isSolveTitleMsg.noReasonBack;
  1071. $("#relationProduct").html("退货产品");
  1072. $("#processResultStatus").show();
  1073. $("#orderHead").show();
  1074. $("#order").show();
  1075. $("#recipientInfo").show();
  1076. $("#recipientInfoTitle").show();
  1077. $("#recipientAddress").show();
  1078. $("#recipientAddressText").show();
  1079. $("#renewedProduct").show();
  1080. $("#TDScollect").show();
  1081. $("#TDScollectShow").show();
  1082. $("#sendAddressInfo").show();
  1083. $("#sendAddressByPhone").show();
  1084. $("#updateProduct").hide();
  1085. $("#postageAccount").show(); //邮费转账账户
  1086. visitByType(2); //需要回访
  1087. break;
  1088. default:
  1089. break;
  1090. }
  1091. }
  1092. for(var i=0;i< result.length;i++){
  1093. var html = statusHtml.replace("status_index",i+1);
  1094. html = html.replace("status_html",result[i]);
  1095. resultHtml += html;
  1096. }
  1097. if(resultProductTableTitle != null && resultProductTableTitle.length > 0){
  1098. /* 根据处理类型来切换 产品列表的列名称 */
  1099. for(var i=0;i<resultProductTableTitle[0].length;i++){
  1100. $("#table1").find("th").eq(i).html(resultProductTableTitle[0][i]);
  1101. }
  1102. for(var i=0;i<resultProductTableTitle[1].length;i++){
  1103. $("#table2").find("th").eq(i).html(resultProductTableTitle[1][i]);
  1104. }
  1105. }
  1106. $("#processResultStatus").html(resultHtml);
  1107. }
  1108. /*已解决|未解决 */
  1109. function otherHied(){
  1110. $("#processResultStatus").hide(); //处理结果的执行状态 已解决未解决没有该信息
  1111. $("#orderHead").hide();
  1112. $("#order").hide();
  1113. $("#recipientInfo").hide();
  1114. $("#recipientInfoTitle").hide();
  1115. $("#recipientAddress").hide();
  1116. $("#recipientAddressText").hide();
  1117. $("#renewedProduct").hide();
  1118. $("#TDScollect").hide();
  1119. $("#TDScollectShow").hide();
  1120. $("#sendAddressInfo").hide();
  1121. $("#sendAddressByPhone").hide();
  1122. $("#updateProduct").hide();
  1123. }
  1124. /*初始化问题大类*/
  1125. function initComplaintTypeInfo() {
  1126. //默认为售前咨询
  1127. //var customerCounselTypeOverall = allCustomerInfoType;
  1128. var customerCounselTypeOverall = null;
  1129. $.ajax({
  1130. type: "POST",
  1131. data: {
  1132. complaintConsultingType : customerCounselTypeOverall
  1133. },
  1134. url: "${path}/admin/complaintQuestion/list_complaintType",
  1135. async: true,
  1136. success: function(data){
  1137. var html = '<option value="">请选择问题分类</option>';
  1138. var id;
  1139. if (data.returnCode == 200) {
  1140. for(var i=0;i<data.returnMsg.complaintTypeInfoList.length;i++){
  1141. var complaintTypeInfo = data.returnMsg.complaintTypeInfoList[i];
  1142. if(i == 0 ){
  1143. id = complaintTypeInfo.complaintId;
  1144. }
  1145. html += '<option value="'+ complaintTypeInfo.complaintId +'">'+ complaintTypeInfo.complaintClassName +'</option>';
  1146. }
  1147. }else{
  1148. html = '';
  1149. }
  1150. $("[name='complaintId']").html(html);
  1151. },
  1152. error: function(XmlHttpRequest, textStatus, errorThrown){
  1153. }
  1154. });
  1155. }
  1156. /*显示小类*/
  1157. function initComplaintSmallClassInfo(complaintId){
  1158. if(complaintId == null || complaintId == ""){
  1159. var html = '<option value="">请选择问题小类</option>';
  1160. $("[name='smallClassId']").html(html);
  1161. }else{
  1162. $.ajax({
  1163. type: "POST",
  1164. data: {
  1165. complaintId : complaintId
  1166. },
  1167. url: "${path}/admin/complaintQuestion/list_complaintSmallClass",
  1168. async: true,
  1169. success: function(data){
  1170. var html = '<option value="">请选择问题小类</option>';
  1171. if (data.returnCode == 200) {
  1172. for(var i=0;i<data.returnMsg.complaintSmallClassInfoList.length;i++){
  1173. var ComplaintSmallClassInfo = data.returnMsg.complaintSmallClassInfoList[i];
  1174. html += '<option value="'+ ComplaintSmallClassInfo.smallClassId +'">'+ ComplaintSmallClassInfo.smallClassName +'</option>';
  1175. }
  1176. }else{
  1177. html = '';
  1178. }
  1179. $("[name='smallClassId']").html(html);
  1180. },
  1181. error: function(XmlHttpRequest, textStatus, errorThrown){
  1182. }
  1183. });
  1184. }
  1185. }
  1186. /**
  1187. * 搜索QA 显示
  1188. * type p:问题qa; m:邮寄qa
  1189. */
  1190. function initComplaintQuestionInfo(type){
  1191. var complaintId;
  1192. var smallClassId;
  1193. var questionName;
  1194. var customerCounselType;
  1195. var questionId;
  1196. if(type == "p"){
  1197. complaintId = $("[name='complaintId']").val();
  1198. smallClassId = $("[name='smallClassId']").val();
  1199. questionName = $("[name='questionIdMsg']").val();
  1200. customerCounselType = $("[name='customerCounselType']:checked").val();
  1201. }else if(type == "m"){
  1202. questionId = complaint_questionId;
  1203. }
  1204. $.ajax({
  1205. type: "POST",
  1206. data: {
  1207. complaintId : complaintId,
  1208. smallClassId : smallClassId,
  1209. questionName : questionName,
  1210. /*complaintType : customerCounselType,*/
  1211. questionId : questionId
  1212. },
  1213. url: "${path}/admin/complaintQuestion/list_complaintQuestion",
  1214. async: false,
  1215. success: function(data){
  1216. if(type == "p"){
  1217. var html = "";
  1218. if (data.returnCode == 200) {
  1219. for(var i=0;i<data.returnMsg.complaintQuestionInfoList.length;i++){
  1220. var complaintQuestion= data.returnMsg.complaintQuestionInfoList[i];
  1221. //html += '<li class="ask">'+ complaintQuestion.questionName +'' +
  1222. // '</li>' +
  1223. // '<li class="answer" style="height: 65px;overflow: hidden;">答:<span>'+ complaintQuestion.questionProfile +'</span><input class="quesId" type="hidden" value="'+ complaintQuestion.questionId +'"></li>';
  1224. html += '' +
  1225. '<li class="answer" style="height: 20px;overflow: hidden;border-bottom: 1px solid #ddd;"><span>'+ complaintQuestion.questionName +'</span>' +
  1226. '<input class="quesId" type="hidden" value="'+ complaintQuestion.questionId +'">' +
  1227. '<div id="questionProfile" style="display: block">'+ complaintQuestion.questionProfile +'</div>' +
  1228. '</li>';
  1229. }
  1230. }else{
  1231. html = '<span style="font-size: 12px; margin-top: 10px; display: block;">未搜索到QA信息,请更换关键字或者直接录入到系统!</span>';
  1232. }
  1233. $("#question").html(html);
  1234. $(".dalog-ask").show();
  1235. }else if(type == "m"){
  1236. var msg = "";
  1237. if (data.returnCode == 200) {
  1238. msg = data.returnMsg.complaintQuestionInfoList[0].questionProfile;
  1239. }
  1240. addSmsMsg(msg);
  1241. }
  1242. },
  1243. error: function(XmlHttpRequest, textStatus, errorThrown){
  1244. }
  1245. });
  1246. }
  1247. /*添加邮寄信息*/
  1248. function addSmsMsg(msg){
  1249. sendAddressSms.addListener("ready", function () {
  1250. // editor准备好之后才可以使用
  1251. sendAddressSms.setContent(msg);
  1252. });
  1253. }
  1254. /**
  1255. * 发送短信
  1256. * @param type 类型: "problem" 问题处理; mailAddress:邮寄地址;
  1257. * @param node 返回结果显示节点
  1258. */
  1259. function sendPhone(type,node){
  1260. var index = layer.load(1, {
  1261. shade: [0.5,'#fff'] //0.1透明度的白色背景
  1262. });
  1263. var desc = "";
  1264. var phone = "";
  1265. var questionId = "";
  1266. var describeTitle = "";
  1267. var smallClassId = ""; /* 客诉问题类型小类id */
  1268. var typeCompany = parseInt($("input:radio[name='typeId']:checked").attr("typeCompany"));
  1269. if(type == "p"){
  1270. phone = $("#p-phone").val();
  1271. questionId = $("#questionId").val();
  1272. describeTitle = $("#describeTitle").val();
  1273. desc = UE.getEditor('describeContentText').getContent();
  1274. smallClassId = $("#smallClassId").val();
  1275. if(smallClassId == null || smallClassId == "" ){
  1276. layer.close(index);
  1277. layer.msg("请选择问题分类!", {icon: 5, time: 3000});
  1278. return false;
  1279. }
  1280. if(describeTitle==null || describeTitle == ""){
  1281. layer.close(index);
  1282. layer.msg("请填写问题标题!", {icon: 5, time: 3000});
  1283. return false;
  1284. }
  1285. if(describeTitle.length > 50){
  1286. layer.close(index);
  1287. layer.msg("问题标题长度不能高于50个字符!", {icon: 5, time: 3000});
  1288. return false;
  1289. }
  1290. if(desc == null || desc == ""){
  1291. layer.close(index);
  1292. layer.msg("请填写问题回复!", {icon: 5, time: 3000});
  1293. return false;
  1294. }
  1295. }else if(type == "m"){
  1296. phone = $("#m-phone").val();
  1297. questionId = complaint_questionId;
  1298. desc = UE.getEditor('sendAddressSms').getContent();
  1299. if(desc == null || desc == ""){
  1300. layer.close(index);
  1301. layer.msg("请填写邮寄信息内容!", {icon: 5, time: 3000});
  1302. return false;
  1303. }
  1304. }else{
  1305. layer.close(index);
  1306. layer.msg("发送报错!", {icon: 5, time: 3000});
  1307. return false;
  1308. }
  1309. var reg = /^(((13[0-9]{1})|(15[0-9]{1})|(18[0-9]{1}))+\d{8})$/;
  1310. if(!reg.test(phone)){
  1311. layer.close(index);
  1312. layer.msg("请填写正确的手机号码!", {icon: 5, time: 3000});
  1313. return false;
  1314. }
  1315. $.ajax({
  1316. type: "POST",
  1317. data: {
  1318. type : type,
  1319. typeCompany : typeCompany,
  1320. phone : phone,
  1321. questionId : questionId,
  1322. smallClassId : smallClassId,
  1323. questionName : describeTitle,
  1324. questionProfile : desc //回复内容
  1325. },
  1326. url: "${path}/admin/customer/send_phone_sms",
  1327. async: true,
  1328. success: function(data){
  1329. if (data.returnCode == 200) {
  1330. if(type == "p"){
  1331. $("#p-msg").html(data.resultMsg);
  1332. }else if(type == "m"){
  1333. $("#m-msg").html(data.resultMsg);
  1334. }
  1335. }else{
  1336. if(type == "p"){
  1337. $("#p-msg").html(data.resultMsg);
  1338. }else if(type == "m"){
  1339. $("#m-msg").html(data.resultMsg);
  1340. }
  1341. }
  1342. layer.close(index);
  1343. },
  1344. error: function(XmlHttpRequest, textStatus, errorThrown){
  1345. if(type == "p"){
  1346. $("#p-msg").html("发送短信失败!");
  1347. }else if(type == "m"){
  1348. $("#m-msg").html("发送短信失败!");
  1349. }
  1350. layer.close(index);
  1351. }
  1352. });
  1353. }
  1354. /*保存QA问题*/
  1355. function saveQuestion(){
  1356. var index = layer.load(1, {
  1357. shade: [0.5,'#fff'] //0.1透明度的白色背景
  1358. });
  1359. var desc = "";
  1360. var questionId = "";
  1361. var describeTitle = "";
  1362. var smallClassId = ""; /* 客诉问题类型小类id */
  1363. questionId = $("#questionId").val();
  1364. describeTitle = $("#describeTitle").val();
  1365. desc = UE.getEditor('describeContentText').getContent();
  1366. smallClassId = $("#smallClassId").val();
  1367. if((smallClassId == null || smallClassId == "") && (questionId == null || questionId == "") ){
  1368. layer.close(index);
  1369. layer.msg("请选择问题分类!", {icon: 5, time: 3000});
  1370. return false;
  1371. }
  1372. if(describeTitle==null || describeTitle == ""){
  1373. layer.close(index);
  1374. layer.msg("请填写问题标题!", {icon: 5, time: 3000});
  1375. return false;
  1376. }
  1377. if(desc == null || desc == ""){
  1378. layer.close(index);
  1379. layer.msg("请填写问题回复!", {icon: 5, time: 3000});
  1380. return false;
  1381. }
  1382. $.ajax({
  1383. type: "POST",
  1384. data: {
  1385. questionId : questionId,
  1386. smallClassId : smallClassId,
  1387. questionName : describeTitle,
  1388. questionProfile : desc //回复内容
  1389. },
  1390. url: "${path}/admin/complaintQuestion/save_question",
  1391. async: true,
  1392. success: function(data){
  1393. if (data.returnCode == 200) {
  1394. $("#questionId").val(data.returnMsg.questionId);
  1395. layer.msg(data.resultMsg, {icon: 1, time: 3000});
  1396. }else{
  1397. layer.msg(data.resultMsg, {icon: 5, time: 3000});
  1398. }
  1399. layer.close(index);
  1400. },
  1401. error: function(XmlHttpRequest, textStatus, errorThrown){
  1402. layer.close(index);
  1403. }
  1404. });
  1405. }
  1406. /***
  1407. * 打开搜索订单框
  1408. */
  1409. function selectOrder(){
  1410. layer_show("搜索订单","${path}/admin/customer/select_order","1000","500");
  1411. }
  1412. /**
  1413. * 显示选择的订单
  1414. */
  1415. function setSelectOrder(orderId){
  1416. if(orderId == null || orderId == "" || typeof (orderId)=="undefined"){
  1417. layer.msg("未选中订单", {icon: 5, time: 3000});
  1418. return false
  1419. }
  1420. var html = '';
  1421. var address = ''; //地址
  1422. var orderItemList = {};
  1423. var companyId = ''; //销售公司
  1424. var storeId = ''; //店铺
  1425. $.ajax({
  1426. type: "POST",
  1427. data: {
  1428. salesId : orderId
  1429. },
  1430. url: "${path}/admin/customer/select_salesOrder",
  1431. async: false,
  1432. success: function(data){
  1433. if (data.returnCode == 200) {
  1434. for(var i=0;i<data.returnMsg.salesOrderList.length;i++){
  1435. var salesOrder = data.returnMsg.salesOrderList[i];
  1436. companyId = salesOrder.salesCompanyId;
  1437. storeId = salesOrder.salesStoreId;
  1438. var productsHtml = '';
  1439. var salesOrderItem = salesOrder.salesOrderItemList;
  1440. orderItemList = salesOrder.salesOrderItemList;
  1441. for(var j=0;j<salesOrderItem.length;j++){
  1442. var item = salesOrderItem[j].itemProductName + "*" + salesOrderItem[j].itemNum;
  1443. if(j==0){
  1444. productsHtml += item
  1445. }else{
  1446. productsHtml += '<br>'+ item
  1447. }
  1448. }
  1449. var time = formatDate(new Date(salesOrder.salesCreateTime),"yyyy-MM-dd");
  1450. html += '' +
  1451. ' <td style="text-align: center;">'+ convertUndefinedToEmpty(salesOrder.companyName) +'-'+ convertUndefinedToEmpty(salesOrder.storeName) +'</td>' +
  1452. ' <td style="text-align: center;">'+ salesOrder.salesId +'</td>' +
  1453. ' <td style="text-align: center;">'+ salesOrder.salesAddressName +'</td>' +
  1454. ' <td style="text-align: center;">'+ salesOrder.salesAddressTel +'</td>' +
  1455. ' <td style="text-align: center;">'+ salesOrder.salesAmount/100 +'</td>' +
  1456. ' <td style="text-align: center;">'+ productsHtml +'</td>' +
  1457. ' <td style="text-align: center;">'+ time +'</td>' +
  1458. '';
  1459. //address = '<td colspan="1">收货地址</td><td colspan="6" class="td-manage text-c" >'+ salesOrder.salesAddressInfo +'&nbsp;&nbsp;&nbsp;&nbsp;<a style="color: #0a6999;text-decoration: underline;" href="javascript:void(0);" title="编辑" onclick="updateAdress()">修改地址</a></td>' ;
  1460. address = salesOrder.salesAddressInfo;
  1461. $("#sendName").val(salesOrder.salesAddressName); //收件人名称
  1462. $("#sendTel").val(salesOrder.salesAddressTel); //收件人电话号码
  1463. $("#customerName").val(salesOrder.salesAddressName); //收件人名称
  1464. $("#customerTel").val(salesOrder.salesAddressTel); //收件人电话号码
  1465. }
  1466. // $("#showOrderAddress").html(address);
  1467. }else{
  1468. html = '';
  1469. }
  1470. $("#showOrder").html(html); //显示订单
  1471. },
  1472. error: function(XmlHttpRequest, textStatus, errorThrown){
  1473. }
  1474. });
  1475. $("#addressInfo").val(address);
  1476. setAdress(); //显示地址
  1477. setProduce(orderItemList); //显示产品
  1478. $("#companyId").val(companyId);
  1479. $("#storeId").val(storeId);
  1480. $("#orderId").val(orderId);
  1481. }
  1482. /**
  1483. * 设置地址
  1484. */
  1485. function setAdress(){
  1486. var addres = $("#addressInfo").val();
  1487. $("#addrssMsg").html("");
  1488. if(addres == null){
  1489. $("#addrssMsg").html("*未能获取到地址,请手动选择地址");
  1490. return;
  1491. }
  1492. var addresList = addres.split("-");
  1493. if(addresList[0] == null || addresList[1]==null || addresList[2]==null || addresList[3]==null){
  1494. $("#addrssMsg").html("*未能获取到地址,请手动选择地址");
  1495. return;
  1496. }
  1497. var proId = setPro(getAddress(addresList[0],0),1);
  1498. var cityId = setCity(getAddress(addresList[1],1),proId,1);
  1499. setDistrict(getAddress(addresList[2],2),cityId,1);
  1500. var sendAddress = addresList[3];
  1501. if(addresList.length > 4){
  1502. for(var k = 4;k< addresList.length;k++){
  1503. sendAddress += addresList[k];
  1504. }
  1505. }
  1506. $("#sendAddress").val(sendAddress);
  1507. }
  1508. /***
  1509. * 删除 “省”,“市”,“区”关键字
  1510. * type : 0:省 2:市 3:区
  1511. */
  1512. function getAddress(addrss,type) {
  1513. var abbreviation = "";
  1514. if(addrss == ""){
  1515. abbreviation = "";
  1516. }else{
  1517. switch(type)
  1518. {
  1519. case 0:
  1520. //var proReg = new RegExp("省","g");
  1521. //abbreviation = addrss.replace(proReg,"");
  1522. abbreviation = addrss.substring(0,2);
  1523. break;
  1524. case 1:
  1525. var cityReg = new RegExp("市","g");
  1526. abbreviation = addrss.replace(cityReg,"");
  1527. cityReg = new RegExp("区","g");
  1528. abbreviation = addrss.replace(cityReg,"");
  1529. break;
  1530. case 2:
  1531. var districtReg = new RegExp("区","g");
  1532. abbreviation = addrss.replace(districtReg,"");
  1533. districtReg = new RegExp("市","g");
  1534. abbreviation = abbreviation.replace(districtReg,"");
  1535. break;
  1536. default:
  1537. break;
  1538. }
  1539. }
  1540. return abbreviation
  1541. }
  1542. /**
  1543. * 设置省
  1544. * type 1:搜索订单赋值 2:只查询全部,默认第一个
  1545. */
  1546. function setPro(provinceName,type) {
  1547. var proId = '';
  1548. var province = listProvince();
  1549. var selectPro = new Array();
  1550. if(type == 1){
  1551. selectPro = listProvince("",provinceName);
  1552. }
  1553. if(province!=null){
  1554. var provinceHtml = ''
  1555. for(var i=0;i<province.length;i++){
  1556. provinceHtml += '<option value="'+ province[i].provinceId +'">'+ province[i].province +'</option>';
  1557. }
  1558. $("#province").html(provinceHtml);
  1559. if(selectPro != null && selectPro.length > 0 ){
  1560. proId = selectPro[0].provinceId;
  1561. }else{
  1562. proId = province[0].provinceId;
  1563. }
  1564. $("#province option[value='" + proId + "']").attr("selected","true");
  1565. }
  1566. return proId;
  1567. }
  1568. /**
  1569. * 设置市
  1570. * type 1:搜索订单赋值 2:只查询全部,默认第一个
  1571. */
  1572. function setCity(cityName,proId,type) {
  1573. var cityId = '';
  1574. var city = listCity(proId,"");
  1575. var selectCity = new Array();
  1576. if(type == 1){
  1577. selectCity = listCity(proId,cityName);
  1578. }
  1579. if(city!=null){
  1580. var cityHtml = ''
  1581. for(var i=0;i<city.length;i++){
  1582. cityHtml += '<option value="'+ city[i].cityId +'">'+ city[i].city +'</option>';
  1583. }
  1584. $("#city").html(cityHtml);
  1585. if(selectCity != null && selectCity.length > 0 ){
  1586. cityId = selectCity[0].cityId;
  1587. }else{
  1588. cityId = city[0].cityId;
  1589. }
  1590. $("#city option[value='" + cityId + "']").attr("selected","true");
  1591. }
  1592. return cityId;
  1593. }
  1594. /**
  1595. * 设置区
  1596. * type 1:搜索订单赋值 2:只查询全部,默认第一个
  1597. */
  1598. function setDistrict(districtName,cityId,type) {
  1599. var district = listDistrict(cityId,"");
  1600. var selectDistrict = new Array();
  1601. if(type == 1){
  1602. selectDistrict = listDistrict(cityId,districtName);
  1603. }
  1604. if(district!=null){
  1605. var districtHtml = ''
  1606. for(var i=0;i<district.length;i++){
  1607. districtHtml += '<option value="'+ district[i].districtId +'">'+ district[i].district +'</option>';
  1608. }
  1609. var disId = "";
  1610. $("#district").html(districtHtml);
  1611. if(selectDistrict != null && selectDistrict.length > 0 ){
  1612. disId = selectDistrict[0].districtId;
  1613. }else{
  1614. disId = district[0].districtId;
  1615. }
  1616. $("#district option[value='" + disId + "']").attr("selected","true");
  1617. }
  1618. }
  1619. /* TDS收集设置区 */
  1620. var TDSCity = '';
  1621. function linkageSetDistrict(){
  1622. var arrcity_3word = $("#arrcity_3word").val();
  1623. var cityName = '北京';
  1624. for(var i = 0;i<citys.length;i++){
  1625. for(var j=0;j<citys[i].length;j++){
  1626. if(j == 0 && arrcity_3word == citys[i][j]){
  1627. cityName = citys[i][1];
  1628. }
  1629. }
  1630. }
  1631. TDSCity = cityName;
  1632. var selectCity = listCity(null,cityName);
  1633. var cityId = selectCity[0].cityId;
  1634. var selectDistrict = listDistrict(cityId,"");
  1635. var html = '';
  1636. for(var i=0;i<selectDistrict.length;i++){
  1637. html += '<option value="'+ selectDistrict[i].districtId +'">'+ selectDistrict[i].district +'</option>';
  1638. }
  1639. $("#TDSArea").html(html);
  1640. $("#TDSArea").find("option").eq(0).prop("selected",true);
  1641. setTDSCollect();
  1642. }
  1643. /**
  1644. * 展示产品
  1645. * @param orderItemList
  1646. */
  1647. function setProduce(orderItemList) {
  1648. var productList = getProduct() ; //所有产品
  1649. var html = "";
  1650. var productTypeNo = 0;
  1651. for(var i=0;i<productList.length;i++) {
  1652. var product = productList[i];
  1653. var produceFittings = getProduceFittings(product.productId); //获取该产品的所有配件
  1654. var colorList = product.colorList; //该产品的所有颜色
  1655. var productType = product.productType;
  1656. var colorHtml = '';
  1657. if(colorList != null && colorList.length >0 ){
  1658. colorHtml += '<table style="height: 100%;">';
  1659. for(var j=0;j<colorList.length;j++){
  1660. var number = "";
  1661. var color = colorList[j];
  1662. for(var k=0;k<orderItemList.length;k++){
  1663. var item = orderItemList[k];
  1664. if(item.itemColorId == color.colorId && item.itemIsSource == 1){
  1665. number = item.itemNum;
  1666. }
  1667. }
  1668. var fristInputStyle = "border-top: 1px solid #ddd;";
  1669. if(color.colorProductId == product.productId) {
  1670. colorHtml += '<tr >' +
  1671. ' <td width="55" style="border-left: none;text-align: center;'+ fristInputStyle +'">' + color.colorName + '</td>' +
  1672. ' <td width="45" style="'+ fristInputStyle +' padding: 0px;width: 25px;">' +
  1673. ' <input type="hidden" class="input-produce-id" value="' + color.colorProductId + '">' +
  1674. ' <input type="hidden" class="input-color-id" value="' + color.colorId + '">' +
  1675. ' <input type="text" class="input-text input-color-number number-input" style="width: 100%;border: none;text-align: center;" value="'+ number +'" placeholder="产品数量" id="color-' + color.colorProductId + '-' + color.colorId + '" name="" onkeyup="keyFun($(this),999)" onpaste="keyFun($(this),999)" >' +
  1676. ' </td>' +
  1677. ' </tr>';
  1678. fristInputStyle = "";
  1679. }
  1680. }
  1681. colorHtml += '</table>';
  1682. }else{
  1683. colorHtml += '<span>暂无该产品的颜色!<span>';
  1684. }
  1685. var produceFittingsHtml = '';
  1686. if(produceFittings != null && produceFittings.length > 0){
  1687. produceFittingsHtml += '<table style="height: 100%;">';
  1688. for(var m=0;m<produceFittings.length;m++){
  1689. var number = "";
  1690. var fitt = produceFittings[m];
  1691. for(var k=0;k<orderItemList.length;k++){
  1692. var item = orderItemList[k];
  1693. if(item.itemColorId == fitt.fittingsId && item.itemIsSource == 2){
  1694. number = item.itemNum;
  1695. }
  1696. }
  1697. var produceFit = produceFittings[m];
  1698. if(produceFit.productId == product.productId) {
  1699. var fristInputStyle = "border-top: 1px solid #ddd;";
  1700. produceFittingsHtml += '<tr >' +
  1701. ' <td width="55" style="border-left: none;text-align: center; '+ fristInputStyle +'">' + produceFit.fittingsName +'</td>' +
  1702. ' <td width="45" style="'+ fristInputStyle +'padding: 0px;width: 25px;">' +
  1703. ' <input type="hidden" class="input-produce-id" value="' + produceFit.productId + '">' +
  1704. ' <input type="hidden" class="input-fittings-id" value="' + produceFit.fittingsId +'">' +
  1705. ' <input type="text" class="input-text input-fittings-number" style="width: 100%;border: none;text-align: center;" value="'+ number +'" placeholder="配件数量" id="fittings-' + produceFit.productId + '-' + produceFit.fittingsId +'" name="" onkeyup="keyFun($(this),999)" onpaste="keyFun($(this),999)" >' +
  1706. ' </td>' +
  1707. ' </tr>';
  1708. fristInputStyle = "";
  1709. }
  1710. }
  1711. produceFittingsHtml += '</table>';
  1712. }else{
  1713. produceFittingsHtml += '<span>暂无产品配件!<span>';
  1714. }
  1715. var produceHtml = '<input type="hidden" value="'+ product.productId +'">' +
  1716. '<span>'+ product.productName +'</span>';
  1717. html += ' <tr >' +
  1718. ' <td width="80">'+ produceHtml +'</td>' +
  1719. ' <td style="padding: 0px;text-align: center;">' +
  1720. colorHtml +
  1721. ' </td>' +
  1722. ' <td style="padding: 0px;text-align: center;">' +
  1723. produceFittingsHtml +
  1724. ' </td>' +
  1725. '</tr>';
  1726. }
  1727. $("#addProduct").html(html);
  1728. setBackProduct(html); //设置寄回产品
  1729. monitorProduct(); //监听产品变化
  1730. }
  1731. /*获取产品*/
  1732. function getProduct(){
  1733. var productList;
  1734. $.ajax({
  1735. type: "POST",
  1736. data: {
  1737. },
  1738. url: "${path}/admin/customer/select_produce",
  1739. async: false,
  1740. success: function(data){
  1741. if (data.returnCode == 200) {
  1742. productList = data.returnMsg.productList;
  1743. }
  1744. },
  1745. error: function(XmlHttpRequest, textStatus, errorThrown){
  1746. }
  1747. });
  1748. return productList;
  1749. }
  1750. /*获取产品配件*/
  1751. function getProduceFittings(productId){
  1752. var produceFittings;
  1753. $.ajax({
  1754. type: "get",
  1755. data: {
  1756. productId : productId
  1757. },
  1758. url: "${path}/admin/customer/select_produce_fittings",
  1759. async: false,
  1760. success: function(data){
  1761. if (data.returnCode == 200) {
  1762. produceFittings = data.returnMsg.produceFittingsList;
  1763. }
  1764. },
  1765. error: function(XmlHttpRequest, textStatus, errorThrown){
  1766. }
  1767. });
  1768. return produceFittings;
  1769. }
  1770. /*监听产品变化*/
  1771. function monitorProduct(){
  1772. /*产品数量*/
  1773. $("#addProduct").find(".input-color-number").blur(function (){
  1774. setBackProduct();
  1775. })
  1776. /*产品配件*/
  1777. $("#addProduct").find(".input-fittings-number").blur(function (){
  1778. setBackProduct();
  1779. })
  1780. }
  1781. /*设置寄回产品*/
  1782. function setBackProduct(html) {
  1783. if(html != null && html != "" && typeof(html) != "undefined"){
  1784. $("#back-product").html(html);
  1785. }else{
  1786. $("#addProduct").find(".input-color-number").each(function(){
  1787. var number = $(this).val();
  1788. var colorNodeId = $(this).attr("id");
  1789. $("#back-product").find("#"+colorNodeId).val(number);
  1790. })
  1791. $("#addProduct").find(".input-fittings-number").each(function(){
  1792. var number = $(this).val();
  1793. var fittingsNodeId = $(this).attr("id");
  1794. $("#back-product").find("#"+fittingsNodeId).val(number);
  1795. })
  1796. }
  1797. }
  1798. /*设置TDS收集信息*/
  1799. function setTDSCollect(){
  1800. var TDSArea = $("#TDSArea").find("option:selected").text();
  1801. var TDSAddress = TDSCity + '-' + TDSArea;
  1802. if(TDSAddress != null && TDSAddress != ""){
  1803. $("#DTS-address").html("地址:" + TDSAddress);
  1804. }
  1805. }
  1806. /*TDS联动处理*/
  1807. function TDSLinkage(node,maxNumber,minNumber){
  1808. setTDSCollect();
  1809. var number = 0;
  1810. var c=$(node);
  1811. if(c.val() == ""){
  1812. $(node).val("");
  1813. }else{
  1814. var temp_amount=c.val().replace(/[^\d]/g,'');
  1815. number = Number(temp_amount)
  1816. if(maxNumber!= null && maxNumber!= "" && number > maxNumber){
  1817. number = maxNumber;
  1818. }
  1819. if(minNumber!= null && minNumber!= "" && number < minNumber){
  1820. number = minNumber;
  1821. }
  1822. $(node).val(number);
  1823. }
  1824. var nodeName = $(node).attr("id");
  1825. if(nodeName == "customerInTDS" ){
  1826. $("#DTS-in").html("进水:" + number + " PPM");
  1827. }else if(nodeName == "customerOutTDS" ){
  1828. $("#DTS-out").html("出水:" + number + " PPM");
  1829. }
  1830. }
  1831. </script>
  1832. <script>
  1833. $(function(){
  1834. $("#form-customer-add").Validform({
  1835. tiptype: function (msg, o, cssctl) {
  1836. if (o.type == 3) {//失败
  1837. layer.msg(msg, {icon: 5, time: 3000});
  1838. $(window).scrollTop(o.obj.offset().top - 40);
  1839. }
  1840. },
  1841. datatype: {//自定义验证类型
  1842. },
  1843. ignoreHidden: true,
  1844. tipSweep: true, //若为true,则只在表单提交时验证
  1845. ajaxPost: true, //异步提交
  1846. beforeCheck: function (curform) { //验证通过之前执行的函数
  1847. },
  1848. beforeSubmit: function (curform) { //验证通过之后执行的函数
  1849. var flag = addCustomerReady();
  1850. if(!flag){
  1851. return false;
  1852. }
  1853. },
  1854. callback: function (data) {//异步回调函数
  1855. if (data) {
  1856. var index = layer.alert(data.resultMsg, function (index) {
  1857. if (data.resultCode == 200) {
  1858. location.href = "${path}/admin/customer/select_customer_list";
  1859. } else if(data.resultCode == 505){
  1860. location.href = "${path}/admin/customer/select_customer_list";
  1861. }else {
  1862. layer.close(index);
  1863. }
  1864. });
  1865. }
  1866. }
  1867. });
  1868. })
  1869. /* 添加客诉的准备 */
  1870. function addCustomerReady(){
  1871. /* 录入电话号码和姓名到客诉基本信息里面 */
  1872. if(allCustomerType == 3 || allCustomerType == 4 || allCustomerType == 5 || allCustomerType == 6 || allCustomerType == 7){
  1873. $("#customerName").val($("#sendName").val());
  1874. $("#customerTel").val($("#sendTel").val());
  1875. }
  1876. /*验证来源入口*/
  1877. var customerSourceType = $("input:radio[name='customerSourceType']:checked").val();
  1878. if(customerSourceType == 3){
  1879. var customerSourceOld = $("#customerSourceOld").val();
  1880. if(customerSourceOld == null || customerSourceOld == "" || typeof(customerSourceOld)=="undefined"){
  1881. vailErrorMsg($("#customerSourceOld"),"未填写来源入口");
  1882. return false;
  1883. }else{
  1884. $("#customerSource").val(customerSourceOld);
  1885. }
  1886. }
  1887. /*根据产品类型,获取来源商城*/
  1888. var typeCompany = parseInt($("input:radio[name='typeId']:checked").attr("typeCompany"));
  1889. $("#typeCompany").val(typeCompany);
  1890. /*----TDS收集模块--start-----*/
  1891. var valicity = $(".ac_result_tip").html();
  1892. if(valicity == null || valicity == "" || typeof(valicity)=="undefined"){
  1893. $("#TDSArea").html("");
  1894. }else if(valicity.indexOf("对不起,找不到") > 0 ){
  1895. $("#TDSArea").html("");
  1896. $("#customerArea").val("");
  1897. }else{
  1898. var TDSArea = $("#TDSArea").find("option:selected").text();
  1899. if(TDSArea != null && TDSArea != ""){
  1900. var area = TDSCity + "-" + TDSArea
  1901. $("#customerArea").val(area);
  1902. }
  1903. }
  1904. /*----TDS收集模块--end-----*/
  1905. /* 地址拼接 */
  1906. var province = $("#province").find("option:selected").text();
  1907. var city = $("#city").find("option:selected").text();
  1908. var district = $("#district").find("option:selected").text();
  1909. var relationSendMergeAddress = province + "-" + city + "-" + district;
  1910. $("#relationSendMergeAddress").val(relationSendMergeAddress);
  1911. /* 地址拼接 */
  1912. /*----问题描述- start --*/
  1913. var describeContentText = UE.getEditor('describeContentText').getContent();
  1914. if(describeContentText == null || describeContentText == ""){
  1915. //layer.msg("未填写问题描述", {icon: 5, time: 3000});
  1916. vailErrorMsg($("#describeTitle"),"未填写问题描述");
  1917. return false;
  1918. }
  1919. $("#describeContent").val(describeContentText);
  1920. /*----问题描述--end-----*/
  1921. /*----处理描述- start --*/
  1922. var describeHandleDescText = UE.getEditor('describeHandleDescText').getContent();
  1923. $("#describeHandleDesc").val(describeHandleDescText);
  1924. /*----处理描述--end-----*/
  1925. /* --- 类型:售后 处理结果:维修/换新/补发/退货/无理由退货 -- 处理产品 start---- */
  1926. var sendProdcues = new Array(); //寄出产品表
  1927. var sendFittings = new Array();
  1928. var closedProdcues = new Array();
  1929. var closedFittings = new Array();
  1930. $("#addProduct").find(".input-color-number").each(function(){
  1931. var number = $(this).val();
  1932. if(number != null && number != "" && number != 0){
  1933. var product = new Object();
  1934. product.productId = $(this).parent().find(".input-produce-id").val();
  1935. product.colorId = $(this).parent().find(".input-color-id").val();
  1936. //换新、维修,退货,无理由退货,
  1937. if(allCustomerType == 3 || allCustomerType == 4 || allCustomerType == 6 || allCustomerType == 7){
  1938. product.closedProdcueNumber = number;
  1939. closedProdcues.push(product);
  1940. }else if(allCustomerType == 5){
  1941. product.sendProdcueNumber = number;
  1942. sendProdcues.push(product);
  1943. }
  1944. }
  1945. })
  1946. $("#addProduct").find(".input-fittings-number").each(function(){
  1947. var number = $(this).val();
  1948. if(number != null && number != "" && number != 0){
  1949. var fittings = new Object();
  1950. fittings.productId = $(this).parent().find(".input-produce-id").val();
  1951. fittings.fittingsId = $(this).parent().find(".input-fittings-id").val();
  1952. //换新、维修,退货,无理由退货,
  1953. if(allCustomerType == 3 || allCustomerType == 4 || allCustomerType == 6 || allCustomerType == 7){
  1954. fittings.closedFittingNumber = number;
  1955. closedFittings.push(fittings);
  1956. }else if(allCustomerType == 5){
  1957. fittings.sendFittingNumber = number;
  1958. sendFittings.push(fittings);
  1959. }
  1960. }
  1961. })
  1962. $("#back-product").find(".input-color-number").each(function(){
  1963. var number = $(this).val();
  1964. if(number != null && number != "" && number != 0){
  1965. //换新、维修,
  1966. if(allCustomerType == 3 || allCustomerType == 4){
  1967. var fittings = new Object();
  1968. fittings.productId = $(this).parent().find(".input-produce-id").val();
  1969. fittings.colorId = $(this).parent().find(".input-color-id").val();
  1970. fittings.sendProdcueNumber = number;
  1971. sendProdcues.push(fittings);
  1972. }
  1973. }
  1974. })
  1975. $("#back-product").find(".input-fittings-number").each(function(){
  1976. var number = $(this).val();
  1977. if(number != null && number != "" && number != 0){
  1978. //换新、维修
  1979. if(allCustomerType == 3 || allCustomerType == 4){
  1980. var fittings = new Object();
  1981. fittings.productId = $(this).parent().find(".input-produce-id").val();
  1982. fittings.fittingsId = $(this).parent().find(".input-fittings-id").val();
  1983. fittings.sendFittingNumber = number;
  1984. sendFittings.push(fittings);
  1985. }
  1986. }
  1987. })
  1988. var backErrorMsg = "请选择一个replace_error_msg寄回的产品或配件并填写一个以上的数量!"
  1989. var sendErrorMsg = "请选择一个replace_error_msg寄送的产品或配件并填写一个以上的数量!"
  1990. var process = true;
  1991. switch (allCustomerType){
  1992. case 3:
  1993. process = processIsEmpty([closedProdcues,closedFittings]);
  1994. if(!process){
  1995. var msg = backErrorMsg.replace("replace_error_msg","换新");
  1996. layer.msg(msg, {icon: 5, time: 3000});
  1997. return false;
  1998. }
  1999. process = processIsEmpty([sendProdcues,sendFittings]);
  2000. if(!process){
  2001. var msg = sendErrorMsg.replace("replace_error_msg","换新");
  2002. layer.msg(msg, {icon: 5, time: 3000});
  2003. return false;
  2004. }
  2005. break;
  2006. case 4:
  2007. process = processIsEmpty([closedProdcues,closedFittings]);
  2008. if(!process){
  2009. var msg = backErrorMsg.replace("replace_error_msg","维修");
  2010. layer.msg(msg, {icon: 5, time: 3000});
  2011. return false;
  2012. }
  2013. process = processIsEmpty([sendProdcues,sendFittings]);
  2014. if(!process){
  2015. var msg = sendErrorMsg.replace("replace_error_msg","维修");
  2016. layer.msg(msg, {icon: 5, time: 3000});
  2017. return false;
  2018. }
  2019. break;
  2020. case 5:
  2021. process = processIsEmpty([sendProdcues,sendFittings]);
  2022. if(!process){
  2023. var msg = sendErrorMsg.replace("replace_error_msg","补发");
  2024. layer.msg(msg, {icon: 5, time: 3000});
  2025. return false;
  2026. }
  2027. break;
  2028. case 6:
  2029. process = processIsEmpty([closedProdcues,closedFittings]);
  2030. if(!process){
  2031. var msg = backErrorMsg.replace("replace_error_msg","退货");
  2032. layer.msg(msg, {icon: 5, time: 3000});
  2033. return false;
  2034. }
  2035. break;
  2036. case 7:
  2037. process = processIsEmpty([closedProdcues,closedFittings]);
  2038. if(!process){
  2039. var msg = backErrorMsg.replace("replace_error_msg","退货");
  2040. layer.msg(msg, {icon: 5, time: 3000});
  2041. return false;
  2042. }
  2043. break;
  2044. default:
  2045. break;
  2046. }
  2047. $("#sendProdcues").val(JSON.stringify(sendProdcues));
  2048. $("#sendFittings").val(JSON.stringify(sendFittings));
  2049. $("#closedProdcues").val(JSON.stringify(closedProdcues));
  2050. $("#closedFittings").val(JSON.stringify(closedFittings));
  2051. var visitTimeSelect = $("input[name='visitTimeSelect']:checked").val();
  2052. var visit_date = $('#datemin').val();
  2053. var myDate = new Date();
  2054. var date = myDate.getFullYear()+"-"+(myDate.getMonth()+1)+"-"+myDate.getDate();
  2055. var hours = myDate.getHours();
  2056. //如果两个时间相等,则判断可选的回访时间
  2057. if(Date.parse(visit_date) == Date.parse(date)){
  2058. var msg = "该时间已超过当前时间,请重新选择回访时间!";
  2059. if (hours > 12 && visitTimeSelect == 1) {
  2060. vailErrorMsg($("#datemin"),msg);
  2061. return false;
  2062. } else if (hours > 14 && visitTimeSelect == 2) {
  2063. vailErrorMsg($("#datemin"),msg);
  2064. return false;
  2065. } else if (hours > 18 && visitTimeSelect == 3) {
  2066. vailErrorMsg($("#datemin"),msg);
  2067. return false;
  2068. }
  2069. }
  2070. return true;
  2071. }
  2072. /* 判断产品与配件是否填入值 */
  2073. function processIsEmpty(process){
  2074. if(process != null && process != "" && process.length > 0){
  2075. var flag = 2;
  2076. var num = 0;
  2077. if(process[0] == null || process[0].length < 1 ){
  2078. flag -- ;
  2079. }
  2080. if(process[1] == null || process[1].length < 1 ){
  2081. flag -- ;
  2082. }
  2083. for(var j=0; j<process.length;j++){
  2084. for(var i=0;i<process[j].length;i++){
  2085. if(process[j][i].sendProdcueNumber !== undefined){
  2086. num += process[j][i].sendProdcueNumber;
  2087. }
  2088. if(process[j][i].sendFittingNumber !== undefined){
  2089. num += process[j][i].sendFittingNumber;
  2090. }
  2091. if(process[j][i].closedProdcueNumber !== undefined){
  2092. num += process[j][i].closedProdcueNumber ;
  2093. }
  2094. if(process[j][i].closedFittingNumber !== undefined){
  2095. num += process[j][i].closedFittingNumber;
  2096. }
  2097. }
  2098. }
  2099. if(flag == 0){
  2100. return false;
  2101. }
  2102. if(num == 0){
  2103. return false;
  2104. }
  2105. }
  2106. return true;
  2107. }
  2108. </script>
  2109. <!--/请在上方写此页面业务相关的脚本-->
  2110. </body>
  2111. </html>