add_customer.ftl 83 KB

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