add_customer.ftl 91 KB

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