update_customer_info.ftl 61 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147
  1. <!DOCTYPE HTML>
  2. <html>
  3. <head>
  4. <#--new style begin-->
  5. <meta charset="utf-8">
  6. <meta name="renderer" content="webkit|ie-comp|ie-stand">
  7. <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
  8. <meta name="viewport" content="width=device-width,initial-scale=1,minimum-scale=1.0,maximum-scale=1.0,user-scalable=no" />
  9. <meta http-equiv="Cache-Control" content="no-siteapp" />
  10. <#include "/base/add_base.ftl">
  11. <link href="${path}/common/lib/jquery.ui/jquery-ui.css" rel="stylesheet" type="text/css"/>
  12. <link href="${path}/common/lib/webuploader/0.1.5/webuploader.css" rel="stylesheet" type="text/css"/>
  13. <link href="${path}/common/lib/icheck/icheck.css" rel="stylesheet" type="text/css"/>
  14. <style>
  15. .tit{position: relative;text-align: left;font-size: 16px;padding-left: 10px;}
  16. .tit:after{content: '';position: absolute;left: 0;top: 20%;height: 60%;width: 3px;background-color: #32a3d8;}
  17. .tit-2{position: relative;text-align: left;font-size: 16px;padding-left: 10px;}
  18. .tit-2:after{content: '';position: absolute;left: 0;top: 20%;height: 60%;width: 3px;background-color: #32a3d8;}
  19. #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;}
  20. .my-btn-search{border: 1px solid #32a3d8;padding: 1px 25px;height: 32px;background-color: #32a3d8;color: #fff;}
  21. #suggest, #suggest2 {width:200px}
  22. .gray {color:gray}
  23. .ac_results {background:#fff;border:1px solid #7f9db9;position: absolute;z-index: 10000;display: none}
  24. .ac_results li a {white-space: nowrap;text-decoration:none;display:block;color:#05a;padding:1px 3px}
  25. .ac_results li {border:1px solid #fff}
  26. .ac_over, .ac_results li a:hover {background:#c8e3fc}
  27. .ac_results li a span {float:right}
  28. .ac_result_tip {border-bottom:1px dashed #666;padding:3px}
  29. .select-box{background: url(${path}/common/images/cm/select-1.png) right center no-repeat;background-size: auto 100%;}
  30. .select-box select{-webkit-appearance:none !important;background-color: transparent; appearance:none;padding-right: 25px;}
  31. .dalog-ask{position: absolute;left:60%;top:0;-webkit-transform: translateY(-30%);transform: translateY(-30%);display: none;background-color: #fff;z-index: 10;}
  32. .tag{ width:300px; min-height:300px; border:1px solid #32a3d8; position:relative;background-color: #fff;line-height: 1.5;padding: 10px 12px;}
  33. .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;}
  34. .dalog-ask .ask{color: #000;margin: 10px 0 5px 0;}
  35. .dalog-ask .answer{color: #666;margin-bottom: 10px;}
  36. .dalog-ask .answer:hover{color: #32a3d8;cursor: pointer;}
  37. .time-line-list{list-style: none;width: 100%;margin-left: -20px;}
  38. .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;}
  39. .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%;}
  40. .time-line-list .red{display: inline-block; padding: 2px; background: red;border: 2px solid #fff;box-shadow:0 0 0 1px #32a3d8;width: 20px;height: 20px;color: #fff;line-height: 20px;border-radius: 50%;}
  41. .time-line-list>li:before{content:'';position: absolute;height: 1px;width: 30%;right:0;top: 15px; background-color: #32a3d8;}
  42. .time-line-list>li:after{content: '';position: absolute;height: 1px;width: 30%;left: 0;top: 15px;background:#32a3d8;}
  43. .time-line-list>li:first-child:after,.time-line-list>li:last-child:before{display: none;}
  44. .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;}
  45. .time-line-list>li:first-child .arrow{display: none;}
  46. .table-bg th{background-color: #e2f6ff;}
  47. .update-parts>span{margin-right: 10px;padding: 3px 4px;background-color: #effaff;border: 1px solid #32a3d8;}
  48. .my-search-input{padding-left: 30px;background: url(${path}/common/images/cm/search.png) 6px center no-repeat;background-size: auto 60%; }
  49. .txt-red{color:red}
  50. </style>
  51. <title>修改客户信息</title>
  52. </head>
  53. <body>
  54. <nav class="breadcrumb"><i class="Hui-iconfont">&#xe67f;</i> 首页
  55. <span class="c-gray en">&gt;</span> 客户信息管理
  56. <span class="c-gray en">&gt;</span> 修改客户信息
  57. <a class="btn radius r" style="line-height:1.6em;margin-top:3px;background: #32a3d8;color: #fff;border:1px solid #32a3d8;" href="javascript:location.replace(location.href);" title="刷新" ><i class="Hui-iconfont">&#xe68f;</i></a>
  58. </nav>
  59. <div class="pd-20 cl">
  60. <form action="${path}/admin/customerBasic/updateCustomerInfo" method="post">
  61. <#--<form action="${path}/admin/customerBasic/save_customer_info" method="post" class="form form-horizontal" id="form-customerInfoAdmin-add" onkeydown="if(event.keyCode==13)return false;">-->
  62. <input type="hidden" id="saveCustomerInfo" name="saveCustomerInfo" value="">
  63. <input type="hidden" id="customerId" name="customerId" value="${customerBasicInfo.customerId!''}">
  64. <input type="hidden" id="billingId" name="billingId" value="<#if billingInfo??>${billingInfo.billingId!''}</#if>">
  65. <input type="hidden" id="ticketOpeningId" name="ticketOpeningId" value="<#if billingInfo??>${ticketOpeningInfo.ticketOpeningId!''}</#if>">
  66. <#--客户基本信息 start-->
  67. <div class="row cl">
  68. <label class="form-label col-2">
  69. <div class="tit-2">客户基本信息</div>
  70. </label>
  71. <div class="formControls col-9">
  72. </div>
  73. </div>
  74. <div class="row cl" style="margin-bottom: 10px;">
  75. <label class="form-label col-2 col-sm-2" style="width: 110px;"><span class="c-red">*</span>客户类型:</label>
  76. <div class="formControls col-4 col-sm-4">
  77. <span class="select-box">
  78. <select name="customerType" class="select">
  79. <option value="1" <#if customerBasicInfo.customerType == 1>selected</#if>>个人</option>
  80. <option value="2"<#if customerBasicInfo.customerType == 2>selected</#if>>公司</option>
  81. </select>
  82. </span>
  83. </div>
  84. <label class="form-label col-2 col-sm-2" style="width: 110px;"><span class="c-red">*</span>合作进度:</label>
  85. <div class="formControls col-4 col-sm-4">
  86. <span class="select-box">
  87. <select name="cooperativeState" class="select">
  88. <option value="1"<#if customerBasicInfo.cooperativeState == 1>selected</#if>>意向合作</option>
  89. <option value="2"<#if customerBasicInfo.cooperativeState == 2>selected</#if>>已经合作</option>
  90. <option value="3"<#if customerBasicInfo.cooperativeState == 3>selected</#if>>停止合作</option>
  91. </select>
  92. </span>
  93. </div>
  94. </div>
  95. <div class="row cl" style="margin-bottom: 10px;">
  96. <label class="form-label col-2 col-sm-2" style="width: 110px;"><span class="c-red">*</span>客户名称:</label>
  97. <div class="formControls col-4 col-sm-4">
  98. <input type="text" class="input-text trim_input" placeholder="公司/客户 全称" id="customerName" name="customerName" value="${customerBasicInfo.customerName!''}">
  99. </div>
  100. <label class="form-label col-2 col-sm-2" style="width: 110px;">客户行业:</label>
  101. <div class="formControls col-4 col-sm-4">
  102. <input type="text" class="input-text trim_input" placeholder="请输入行业名称" id="customerIndustry" name="customerIndustry" value="${customerBasicInfo.customerIndustry!''}">
  103. </div>
  104. </div>
  105. <div class="row cl" style="position: relative;margin-bottom: 10px;">
  106. <label class="form-label col-2 col-sm-2" style="width: 110px;"><span class="c-red">*</span>客户地址:</label>
  107. <div class="formControls col-4 col-sm-4">
  108. <span class="select-box">
  109. <select name="customerProvinceCode" id="customerProvinceCode" class="select">
  110. <option value="">请选择省份</option>
  111. </select>
  112. </span>
  113. </div>
  114. <div class="formControls col-4 col-sm-4">
  115. <span class="select-box">
  116. <select name="customerCityCode" id="customerCityCode" class="select">
  117. <option value="">请选择城市</option>
  118. </select>
  119. </span>
  120. </div>
  121. </div>
  122. <div class="row cl" style="margin-bottom: 10px;">
  123. <label class="form-label col-2 col-sm-2" style="width: 110px;"></label>
  124. <div class="formControls col-9 col-sm-9">
  125. <input type="text" class="input-text trim_input" placeholder="请输入客户的详细地址" id="customerAddress" name="customerAddress" value="${customerBasicInfo.customerAddress!''}">
  126. </div>
  127. </div>
  128. <#--客户基本信息 end-->
  129. <#--对接联系人信息-->
  130. <div class="row cl">
  131. <label class="form-label col-3">
  132. <div class="tit-2">对接联系人信息<span style="font-family:'Arial Normal', 'Arial';font-weight:400;font-size:14px;">(请确保真实性,公司将不定期抽验回访)</span></div>
  133. </label>
  134. <div class="formControls col-9">
  135. </div>
  136. </div>
  137. <div class="row cl">
  138. <div class="formControls col-9">
  139. <span class="c-red">*</span>姓名:<input type="text" class="input-text" style="width:100px;margin-right: 10px; margin-bottom: 10px;" placeholder="联系人姓名" id="contactName" name="contactName">
  140. <span class="c-red">*</span>电话:<input type="text" class="input-text" style="width:100px;margin-right: 10px;margin-bottom: 10px;" placeholder="联系人电话" id="contactPhone" name="contactPhone">
  141. <span class="c-red">*</span>职位/身份:<input type="text" class="input-text" style="width:100px;margin-right: 10px;margin-bottom: 10px;" placeholder="职位或身份" id="contactType" name="contactType">
  142. <span class="c-red">*</span>联系邮箱:<input type="text" class="input-text" style="width:100px;margin-right: 10px;margin-bottom: 10px;" placeholder="邮箱" id="contactEmail" name="contactEmail">
  143. <span class="c-red"><button type="button" style="cursor:pointer; float: right;height: 35px;margin-right: 30px;margin-bottom: 10px;" class="my-btn-search" onclick="toAddDockedContactInfo();">保存</button></span>
  144. </div>
  145. <div class="mt-20" style="margin: 20px;">
  146. <input type="hidden" id="dockedContactInfoJson" name="dockedContactInfoJson">
  147. <table class="table table-border table-bordered table-bg table-hover table-sort" id="contactTable">
  148. <thead>
  149. <tr class="text-c">
  150. <th width="100">联系人姓名</th>
  151. <th width="100">联系电话</th>
  152. <th width="100">职位/身份</th>
  153. <th width="100">联系邮箱</th>
  154. <th width="100">操作</th>
  155. </tr>
  156. </thead>
  157. <tbody id="contactListId">
  158. <#if listDockedContactInfo?? && (listDockedContactInfo?size > 0) >
  159. <tr><td colspan="5" id="contactTbodyId" class="td-manage text-c" style="display: none;" >暂时没有联系人信息,请添加!</td></tr>
  160. <#list listDockedContactInfo as list>
  161. <tr>
  162. <td>${list.contactName!''}</td>
  163. <td>${list.contactPhone!''}</td>
  164. <td>${list.contactType!''}</td>
  165. <td>${list.contactEmail!''}</td>
  166. <td><a href='javascript:;' onclick='deleteContact(this)'>删除</a></td>
  167. </tr>
  168. </#list>
  169. <#else>
  170. <tr><td colspan="5" id="contactTbodyId" class="td-manage text-c" >暂时没有联系人信息,请添加!</td></tr>
  171. </#if>
  172. </tbody>
  173. </table>
  174. </div>
  175. </div>
  176. <#--客户销售渠道信息备案-->
  177. <div class="row cl">
  178. <label class="form-label col-3">
  179. <div class="tit-2">客户销售渠道信息备案</div>
  180. </label>
  181. <div class="formControls col-9">
  182. </div>
  183. </div>
  184. <div class="row cl">
  185. <label class="form-label col-2 col-sm-2" style="width:120px;"><span class="c-red">*</span>渠道类别:</label>
  186. <div class="formControls col-2 col-sm-2" style="width:120px;padding:0px 0px;margin-right: 15px;">
  187. <span class="select-box">
  188. <select name="channelCategory" id="channelCategory" class="select">
  189. </select>
  190. </span>
  191. </div>
  192. <label class="form-label col-2 col-sm-2" style="width:120px;"><span class="c-red">*</span>渠道类型:</label>
  193. <div class="formControls col-2 col-sm-2" style="width:120px;padding:0px 0px;margin-right: 15px;">
  194. <span class="select-box">
  195. <select name="channelType" id="channelType" class="select">
  196. </select>
  197. </span>
  198. </div>
  199. <label class="form-label col-2 col-sm-2" style="width:120px;"><span class="c-red">*</span>渠道名称:</label>
  200. <div class="formControls col-2 col-sm-2" style="width:120px;padding:0px 0px;margin-right: 15px;">
  201. <input type="text" class="input-text" style="width:90px;margin-right: 0px;margin-bottom: 10px;" placeholder="填写具体店名" id="channelName" name="channelName">
  202. </div>
  203. <label class="form-label col-2 col-sm-2" style="width:120px;"><span class="c-red">*</span>销售产品:</label>
  204. <div class="formControls col-2 col-sm-2" style="width:180px;padding:0px 0px;margin-right: 15px;">
  205. <span class="select-box">
  206. <select name="promotingProducts" id="promotingProducts" class="select">
  207. </select>
  208. </span>
  209. </div>
  210. </div>
  211. <div class="row cl">
  212. <label class="form-label col-2 col-sm-2" style="width:120px;"><span class="c-red">*</span>供货价格:</label>
  213. <div class="formControls col-2 col-sm-2" style="width:120px;padding:0 0;margin-right: 15px;">
  214. <span class="select-box">
  215. <select name="supplyPrice" id="supplyPrice" class="select">
  216. </select>
  217. </span>
  218. <input type="text" class="input-text" style="width:90px;margin-right: 0px;margin-bottom: 10px;" placeholder="填写供货价格" id="writeSupplyPrice" name="writeSupplyPrice">
  219. </div>
  220. <label class="form-label col-2 col-sm-2" style="width:120px;"><span class="c-red">*</span>账期:</label>
  221. <div class="formControls col-2 col-sm-2" style="width:120px;padding:0 0;margin-right: 15px;">
  222. <span class="select-box">
  223. <select name="accountPeriod" id="accountPeriod" class="select">
  224. <option value="1">先款</option>
  225. <option value="2">月结</option>
  226. <option value="3">两个月</option>
  227. </select>
  228. </span>
  229. </div>
  230. <label class="form-label col-2 col-sm-2" style="width:150px;">
  231. <button type="button" style="cursor:pointer; float: right;height: 35px;margin-right: 30px;margin-bottom: 10px;" class="my-btn-search" onclick="toAddChannelSaleInfo();">保存</button>
  232. </label>
  233. <div class="formControls col-2 col-sm-2" style="width:120px; padding:0px 0px;margin-right: 15px;">
  234. </div>
  235. <div class="mt-20" style="margin: 20px;">
  236. <input type="hidden" id="channelSaleInfoJson" name="channelSaleInfoJson">
  237. <table class="table table-border table-bordered table-bg table-hover table-sort" id="saleTable">
  238. <thead>
  239. <tr class="text-c">
  240. <th width="100">渠道类别</th>
  241. <th width="100">渠道类型</th>
  242. <th width="100">渠道/平台名称</th>
  243. <th width="100">销售产品型号</th>
  244. <th width="100">供货价(元)</th>
  245. <th width="100">账期 </th>
  246. <th width="100">操作</th>
  247. </tr>
  248. </thead>
  249. <tbody id="channelSaleListId">
  250. <#if listChannelSaleInfo?? && (listChannelSaleInfo?size > 0) >
  251. <tr><td colspan="7" class="td-manage text-c" id="channelTbodyId" style="display: none;" >暂时没有客户销售渠道信息,请添加!</td></tr>
  252. <#list listChannelSaleInfo as list>
  253. <tr>
  254. <td>
  255. <#if list.channelCategory??>
  256. <#if list.channelCategory == 1>电商</#if>
  257. <#if list.channelCategory == 2>特殊渠道</#if>
  258. <#if list.channelCategory == 3>线下</#if>
  259. <#if list.channelCategory == 4>海外</#if>
  260. </#if>
  261. </td>
  262. <td>${list.channelType!''}</td>
  263. <td>${list.channelName!''}</td>
  264. <td>${list.promotingProducts!''}</td>
  265. <td>${list.supplyPrice/100!''}</td>
  266. <td>
  267. <#if list.accountPeriod??>
  268. <#if list.accountPeriod == 1>先款</#if>
  269. <#if list.accountPeriod == 2>月结</#if>
  270. <#if list.accountPeriod == 3>俩个月</#if>
  271. </#if>
  272. </td>
  273. <td><a href='javascript:;' onclick='deleteChannelSale(this)'>删除</a></td>
  274. </tr>
  275. </#list>
  276. <#else>
  277. <tr><td colspan="7" class="td-manage text-c" id="channelTbodyId" >暂时没有客户销售渠道信息,请添加!</td></tr>
  278. </#if>
  279. </tbody>
  280. </table>
  281. </div>
  282. </div>
  283. <#--付款/退款信息-->
  284. <div class="row cl">
  285. <label class="form-label col-9">
  286. <div class="tit-2">付款/退款信息<span style="font-family:'Arial Normal', 'Arial';font-weight:400;font-size:14px;">(请真实有效,用于财务收款确认或退款业务)</span></div>
  287. </label>
  288. <div class="formControls col-9">
  289. </div>
  290. </div>
  291. <#if billingInfo??>
  292. <div class="row cl" style="margin-bottom: 10px;">
  293. <label class="form-label col-2 col-sm-2" style="width: 125px;"><span class="c-red">*</span>开户支行:</label>
  294. <div class="formControls col-2 col-sm-2">
  295. <input type="text" class="input-text trim_input" placeholder="开户支行" id="accountOpeningBranch" name="accountOpeningBranch" value="${billingInfo.accountOpeningBranch!''}">
  296. </div>
  297. <label class="form-label col-2 col-sm-2" style="width: 125px;"><span class="c-red">*</span>账户名称:</label>
  298. <div class="formControls col-2 col-sm-2 skin-minimal">
  299. <input type="text" class="input-text trim_input" placeholder="账户名称" id="accountName" name="accountName" value="${billingInfo.accountName!''}">
  300. </div>
  301. <label class="form-label col-2 col-sm-2" style="width: 125px;"><span class="c-red">*</span>账号:</label>
  302. <div class="formControls col-2 col-sm-2 skin-minimal">
  303. <input type="text" class="input-text trim_input" placeholder="填写账号" id="accountNum" name="accountNum" value="${billingInfo.accountNum!''}">
  304. </div>
  305. </div>
  306. <div class="row cl" style="margin-bottom: 10px;">
  307. <label class="form-label col-2 col-sm-2" style="width: 125px;"><span class="c-red">*</span>收款人姓名:</label>
  308. <div class="formControls col-2 col-sm-2 skin-minimal">
  309. <input type="text" class="input-text trim_input" placeholder="收款人姓名" id="receivablesName" name="receivablesName" value="${billingInfo.receivablesName!''}">
  310. </div>
  311. <label class="form-label col-2 col-sm-2" style="width: 125px;"><span class="c-red">*</span>收款人手机:</label>
  312. <div class="formControls col-2 col-sm-2 skin-minimal">
  313. <input type="text" class="input-text trim_input" placeholder="收款人手机" id="receivablesPhone" name="receivablesPhone" value="${billingInfo.receivablesPhone!''}">
  314. </div>
  315. </div>
  316. <#else >
  317. <div class="row cl" style="margin-bottom: 10px;">
  318. <label class="form-label col-2 col-sm-2" style="width: 125px;"><span class="c-red">*</span>开户支行:</label>
  319. <div class="formControls col-2 col-sm-2">
  320. <input type="text" class="input-text trim_input" placeholder="开户支行" id="accountOpeningBranch" name="accountOpeningBranch" value="">
  321. </div>
  322. <label class="form-label col-2 col-sm-2" style="width: 125px;"><span class="c-red">*</span>账户名称:</label>
  323. <div class="formControls col-2 col-sm-2 skin-minimal">
  324. <input type="text" class="input-text trim_input" placeholder="账户名称" id="accountName" name="accountName" value="">
  325. </div>
  326. <label class="form-label col-2 col-sm-2" style="width: 125px;"><span class="c-red">*</span>账号:</label>
  327. <div class="formControls col-2 col-sm-2 skin-minimal">
  328. <input type="text" class="input-text trim_input" placeholder="填写账号" id="accountNum" name="accountNum" value="">
  329. </div>
  330. </div>
  331. <div class="row cl" style="margin-bottom: 10px;">
  332. <label class="form-label col-2 col-sm-2" style="width: 125px;"><span class="c-red">*</span>收款人姓名:</label>
  333. <div class="formControls col-2 col-sm-2 skin-minimal">
  334. <input type="text" class="input-text trim_input" placeholder="收款人姓名" id="receivablesName" name="receivablesName" value="">
  335. </div>
  336. <label class="form-label col-2 col-sm-2" style="width: 125px;"><span class="c-red">*</span>收款人手机:</label>
  337. <div class="formControls col-2 col-sm-2 skin-minimal">
  338. <input type="text" class="input-text trim_input" placeholder="收款人手机" id="receivablesPhone" name="receivablesPhone" value="">
  339. </div>
  340. </div>
  341. </#if>
  342. <#--开票信息-->
  343. <div class="row cl" style="margin-bottom: 10px;">
  344. <label class="form-label col-9 skin-minimal">
  345. <span class="tit-2">开票信息</span><span class="c-red">&nbsp;&nbsp;&nbsp;*</span>是否开票
  346. <div class="radio-box">
  347. <input type="radio" id="isOpenTicket-1" name="isOpenTicket" value="1" checked="checked" >
  348. <label for="isOpenTicket-1">开票</label>
  349. </div>
  350. <div class="radio-box">
  351. <input type="radio" id="isOpenTicket-2" name="isOpenTicket" value="1" >
  352. <label for="isOpenTicket-2">不开票</label>
  353. </div>
  354. </label>
  355. <div class="formControls col-3">
  356. </div>
  357. </div>
  358. <#if ticketOpeningInfo??>
  359. <div class="row cl" style="margin-bottom: 10px;">
  360. <label class="form-label col-2 col-sm-2" style="width: 120px;"><span class="c-red">*</span>发票类型:</label>
  361. <div class="formControls col-2 col-sm-2">
  362. <span class="select-box">
  363. <select name="ticketType" class="select">
  364. <option value="1" <#if ticketOpeningInfo.ticketType == 1>selected</#if>>专票</option>
  365. <option value="2" <#if ticketOpeningInfo.ticketType == 2>selected</#if>>普票</option>
  366. </select>
  367. </span>
  368. </div>
  369. <label class="form-label col-2 col-sm-2" style="width: 120px;"><span class="c-red">*</span>开户支行:</label>
  370. <div class="formControls col-2 col-sm-2 skin-minimal">
  371. <input type="text" class="input-text trim_input" placeholder="开户支行名称" id="accountOpeningBranch" name="accountOpeningBranch" value="${ticketOpeningInfo.accountOpeningBranch!''}">
  372. </div>
  373. <label class="form-label col-2 col-sm-2" style="width: 120px;"><span class="c-red">*</span>开票账户:</label>
  374. <div class="formControls col-2 col-sm-2 skin-minimal">
  375. <input type="text" class="input-text trim_input" placeholder="开票账户" id="ticketOpeningAccount" name="ticketOpeningAccount" value="${ticketOpeningInfo.ticketOpeningAccount!''}">
  376. </div>
  377. </div>
  378. <div class="row cl" style="margin-bottom: 10px;">
  379. <label class="form-label col-2 col-sm-2" style="width: 120px;"><span class="c-red">*</span>企业名称:</label>
  380. <div class="formControls col-2 col-sm-2 skin-minimal">
  381. <input type="text" class="input-text trim_input" placeholder="企业名称" id="enterpriseName" name="enterpriseName" value="${ticketOpeningInfo.enterpriseName!''}">
  382. </div>
  383. <label class="form-label col-2 col-sm-2" style="width: 140px;"><span class="c-red">*</span>纳税人识别号:</label>
  384. <div class="formControls col-2 col-sm-2 skin-minimal">
  385. <input type="text" class="input-text trim_input" placeholder="纳税人识别号" id="taxpayerIdentificationNum" name="taxpayerIdentificationNum" value="${ticketOpeningInfo.taxpayerIdentificationNum!''}">
  386. </div>
  387. <label class="form-label col-2 col-sm-2" style="width: 120px;"><span class="c-red">*</span>开票电话:</label>
  388. <div class="formControls col-2 col-sm-2 skin-minimal">
  389. <input type="text" class="input-text trim_input" placeholder="开票电话" id="ticketOpeningPhone" name="ticketOpeningPhone" value="${ticketOpeningInfo.ticketOpeningPhone!''}">
  390. </div>
  391. </div>
  392. <div class="row cl" style="margin-bottom: 10px;">
  393. <label class="form-label col-2 col-sm-2" style="width: 120px;"><span class="c-red">*</span>企业地址:</label>
  394. <div class="formControls col-2 col-sm-2 skin-minimal">
  395. <input type="text" class="input-text trim_input" placeholder="企业地址" id="enterpriseAddress" name="enterpriseAddress" value="${ticketOpeningInfo.enterpriseAddress!''}">
  396. </div>
  397. </div>
  398. <#else >
  399. <div class="row cl" style="margin-bottom: 10px;">
  400. <label class="form-label col-2 col-sm-2" style="width: 120px;"><span class="c-red">*</span>发票类型:</label>
  401. <div class="formControls col-2 col-sm-2">
  402. <span class="select-box">
  403. <select name="ticketType" class="select">
  404. <option value="1">专票</option>
  405. <option value="2">普票</option>
  406. </select>
  407. </span>
  408. </div>
  409. <label class="form-label col-2 col-sm-2" style="width: 120px;"><span class="c-red">*</span>开户支行:</label>
  410. <div class="formControls col-2 col-sm-2 skin-minimal">
  411. <input type="text" class="input-text trim_input" placeholder="开户支行名称" id="accountOpeningBranch" name="accountOpeningBranch" value="">
  412. </div>
  413. <label class="form-label col-2 col-sm-2" style="width: 120px;"><span class="c-red">*</span>开票账户:</label>
  414. <div class="formControls col-2 col-sm-2 skin-minimal">
  415. <input type="text" class="input-text trim_input" placeholder="开票账户" id="ticketOpeningAccount" name="ticketOpeningAccount" value="">
  416. </div>
  417. </div>
  418. <div class="row cl" style="margin-bottom: 10px;">
  419. <label class="form-label col-2 col-sm-2" style="width: 120px;"><span class="c-red">*</span>企业名称:</label>
  420. <div class="formControls col-2 col-sm-2 skin-minimal">
  421. <input type="text" class="input-text trim_input" placeholder="企业名称" id="enterpriseName" name="enterpriseName" value="">
  422. </div>
  423. <label class="form-label col-2 col-sm-2" style="width: 120px;"><span class="c-red">*</span>纳税人识别号:</label>
  424. <div class="formControls col-2 col-sm-2 skin-minimal">
  425. <input type="text" class="input-text trim_input" placeholder="纳税人识别号" id="taxpayerIdentificationNum" name="taxpayerIdentificationNum" value="">
  426. </div>
  427. <label class="form-label col-2 col-sm-2" style="width: 120px;"><span class="c-red">*</span>开票电话:</label>
  428. <div class="formControls col-2 col-sm-2 skin-minimal">
  429. <input type="text" class="input-text trim_input" placeholder="开票电话" id="ticketOpeningPhone" name="ticketOpeningPhone" value="">
  430. </div>
  431. </div>
  432. <div class="row cl" style="margin-bottom: 10px;">
  433. <label class="form-label col-2 col-sm-2" style="width: 120px;"><span class="c-red">*</span>企业地址:</label>
  434. <div class="formControls col-2 col-sm-2 skin-minimal">
  435. <input type="text" class="input-text trim_input" placeholder="企业地址" id="enterpriseAddress" name="enterpriseAddress" value="">
  436. </div>
  437. </div>
  438. </#if>
  439. <#--客户备注-->
  440. <div class="row cl">
  441. <label class="form-label col-3">
  442. <div class="tit-2">客户备注</div>
  443. </label>
  444. <div class="formControls col-9">
  445. </div>
  446. </div>
  447. <div class="row cl">
  448. <label class="form-label">
  449. </label>
  450. <div class="formControls col-9">
  451. <textarea id="customerRemarks" style="width: 100%;height: 100px;" name="customerRemarks" >${customerBasicInfo.customerRemarks!''}</textarea>
  452. </div>
  453. </div>
  454. <#--添加保存按钮-->
  455. <div class="row cl">
  456. <label class="form-label col-5 col-sm-5"></label>
  457. <div class="formControls col-5 col-sm-5 skin-minimal">
  458. <span class="c-red"><button type="button" style="cursor:pointer; float: inherit;height: 35px;margin-right: 30px;margin-bottom: 10px;margin-top: 20px;" class="my-btn-search" onclick="updateCustomerBasicInfo();">确认修改</button></span>
  459. </div>
  460. </div>
  461. <input type="hidden" id="provinceCode" value="${customerBasicInfo.customerProvinceCode!''}">
  462. <input type="hidden" id="cityCode" value="${customerBasicInfo.customerCityCode!''}">
  463. </form>
  464. </div>
  465. <#--业务js-->
  466. <#--<script type="text/javascript" src="${path}/common/js/customerSaveAdmin/save_customer_info.js"></script>-->
  467. <script>
  468. /*初始化页面参数*/
  469. $(function () {
  470. /* 初始化单选框样式 */
  471. //initCheck();
  472. $('.skin-minimal input').iCheck({
  473. checkboxClass: 'icheckbox-blue',
  474. radioClass: 'iradio-blue',
  475. increaseArea: '20%'
  476. });
  477. /*初始化省份(大类)*/
  478. initProvince();
  479. //初始化市
  480. initCity('${customerBasicInfo.customerProvinceCode!''}');
  481. /*初始化渠道类别(大类)*/
  482. initChannelCategory();
  483. /*初始化销售产品(大类)*/
  484. initPromotingProducts();
  485. /*监听省份*/
  486. $("[name='customerProvinceCode']").change(function (){
  487. initCity($(this).val());
  488. })
  489. /*监听渠道类别*/
  490. $("[name='channelCategory']").change(function (){
  491. initChannelType($(this).val());
  492. })
  493. /*监听销售产品*/
  494. $("[name='promotingProducts']").change(function (){
  495. initSupplyPrice($(this).val());
  496. })
  497. /*监听产品价格选择*/
  498. $("[name='supplyPrice']").change(function (){
  499. changeSupplyPrice($(this).val());
  500. })
  501. })
  502. /*业务逻辑js控制 start*/
  503. $(document).on('click', '.dalog-ask .answer', function() {
  504. var customerProvinceCode = $(this).find(".customerProvinceCode").val();
  505. $("select[name='complaintId']").val(customerProvinceCode);
  506. initCity(customerProvinceCode); //根据省份初始化城市
  507. $(".dalog-ask").hide();
  508. });
  509. /*初始化省份*/
  510. function initProvince() {
  511. //默认查询参数为空
  512. var provinceListInfo = null;
  513. $.ajax({
  514. type: "POST",
  515. data: {
  516. provinceId : provinceListInfo
  517. },
  518. url: "${path}/admin/customerBasic/query_provinceList",
  519. async: true,
  520. success: function(data){
  521. var html = '<option value="">请选择省份</option>';
  522. var id;
  523. if (data.returnCode == 200) {
  524. for(var i=0;i<data.returnMsg.provinceList.length;i++){
  525. provinceListInfo = data.returnMsg.provinceList[i];
  526. if(i == 0 ){
  527. id = provinceListInfo.divisionCode;
  528. }
  529. html += '<option value="'+ provinceListInfo.divisionCode +'">'+ provinceListInfo.province +'</option>';
  530. }
  531. }else{
  532. html = '';
  533. }
  534. $("[name='customerProvinceCode']").html(html);
  535. $("#customerProvinceCode").val($("#provinceCode").val());
  536. },
  537. error: function(XmlHttpRequest, textStatus, errorThrown){
  538. }
  539. });
  540. }
  541. /*根据省份代号初始化城市*/
  542. function initCity(customerProvinceId){
  543. var cityListInfo = null;
  544. if(customerProvinceId == null || customerProvinceId == ""){
  545. var html = '<option value="">请选择城市</option>';
  546. $("[name='customerCityCode']").html(html);
  547. }else{
  548. $.ajax({
  549. type: "POST",
  550. data: {
  551. provinceId : customerProvinceId
  552. },
  553. url: "${path}/admin/customerBasic/query_cityList",
  554. async: true,
  555. success: function(data){
  556. var html = '<option value="">请选择城市</option>';
  557. if (data.returnCode == 200) {
  558. for(var i=0;i<data.returnMsg.cityList.length;i++){
  559. cityListInfo = data.returnMsg.cityList[i];
  560. html += '<option value="'+ cityListInfo.divisionCode +'">'+ cityListInfo.city +'</option>';
  561. }
  562. }else{
  563. html = '';
  564. }
  565. $("[name='customerCityCode']").html(html);
  566. $("#customerCityCode").val($("#cityCode").val());
  567. },
  568. error: function(XmlHttpRequest, textStatus, errorThrown){
  569. }
  570. });
  571. }
  572. }
  573. /*初始化渠道类别*/
  574. function initChannelCategory() {
  575. //默认查询参数为空
  576. var channelCategoryListInfo = null;
  577. $.ajax({
  578. type: "POST",
  579. data: {
  580. channelCategoryId : channelCategoryListInfo
  581. },
  582. url: "${path}/admin/customerBasic/query_channelCategoryList",
  583. async: true,
  584. success: function(data){
  585. var html = '<option value="">请选择渠道类别</option>';
  586. var id;
  587. if (data.returnCode == 200) {
  588. for(var i=0;i<data.returnMsg.channelCategoryList.length;i++){
  589. channelCategoryListInfo = data.returnMsg.channelCategoryList[i];
  590. if(i == 0 ){
  591. id = channelCategoryListInfo.channelCategory;
  592. }
  593. html += '<option value="'+ channelCategoryListInfo.channelCategory +'">'+ channelCategoryListInfo.channelName +'</option>';
  594. }
  595. }else{
  596. html = '';
  597. }
  598. $("[name='channelCategory']").html(html);
  599. },
  600. error: function(XmlHttpRequest, textStatus, errorThrown){
  601. }
  602. });
  603. }
  604. /*根据渠道类别初始化渠道类型*/
  605. function initChannelType(channelCategory){
  606. var channelTypeListInfo = null;
  607. $.ajax({
  608. type: "POST",
  609. data: {
  610. channelCategoryId : channelCategory
  611. },
  612. url: "${path}/admin/customerBasic/query_channelTypeList",
  613. async: true,
  614. success: function(data){
  615. var html = '<option value="">请选择渠道类型</option>';
  616. if (data.returnCode == 200) {
  617. for(var i=0;i<data.returnMsg.channelTypeList.length;i++){
  618. channelTypeListInfo = data.returnMsg.channelTypeList[i];
  619. html += '<option value="'+ channelTypeListInfo.channelName +'">'+ channelTypeListInfo.channelType +'</option>';
  620. }
  621. }else{
  622. html = '';
  623. }
  624. $("[name='channelType']").html(html);
  625. },
  626. error: function(XmlHttpRequest, textStatus, errorThrown){
  627. }
  628. });
  629. }
  630. /*初始化销售产品*/
  631. function initPromotingProducts() {
  632. var promotingProductsInfo = null;
  633. $.ajax({
  634. type: "POST",
  635. data: {
  636. promotingProductsInfo : promotingProductsInfo
  637. },
  638. url: "${path}/admin/customerBasic/query_promotingProductsList",
  639. async: true,
  640. success: function(data){
  641. var html = '<option value="">请选择销售产品</option>';
  642. var id;
  643. if (data.returnCode == 200) {
  644. for(var i=0;i<data.returnMsg.promotingProductsList.length;i++){
  645. promotingProductsInfo = data.returnMsg.promotingProductsList[i];
  646. if(i == 0 ){
  647. id = promotingProductsInfo.productId;
  648. }
  649. html += '<option value="'+ promotingProductsInfo.productId +'">'+ promotingProductsInfo.productName +'</option>';
  650. }
  651. }else{
  652. html = '';
  653. }
  654. $("[name='promotingProducts']").html(html);
  655. },
  656. error: function(XmlHttpRequest, textStatus, errorThrown){
  657. }
  658. });
  659. }
  660. /*初始化产品价格*/
  661. function initSupplyPrice(promotingProductsId){
  662. //var supplyPriceInfo = null;
  663. if(promotingProductsId == null || promotingProductsId == ""){
  664. var html = '<option value="">请选择销售产品</option>';
  665. //$("[name='promotingProducts']").html(html);
  666. }else{
  667. $.ajax({
  668. type: "POST",
  669. data: {
  670. promotingProductsId : promotingProductsId
  671. },
  672. url: "${path}/admin/customerBasic/query_supplyPriceList",
  673. async: true,
  674. success: function(data){
  675. var html = '<option value="">手动输入产品价格</option>';
  676. if (data.returnCode == 200) {
  677. for(var i=0;i<data.returnMsg.supplyPriceList.length;i++){
  678. var supplyPriceInfo = data.returnMsg.supplyPriceList[i];
  679. html += '<option value="'+ supplyPriceInfo.colorPrice/100 +'">'+ supplyPriceInfo.colorPrice/100 +'</option>';
  680. }
  681. }else{
  682. html = '';
  683. }
  684. $("[name='supplyPrice']").html(html);
  685. $("#writeSupplyPrice").show();
  686. },
  687. error: function(XmlHttpRequest, textStatus, errorThrown){
  688. }
  689. });
  690. }
  691. }
  692. /*监听产品价格选项*/
  693. function changeSupplyPrice(supplyPrice){
  694. if(supplyPrice == ""){
  695. $("#writeSupplyPrice").show();
  696. }else{
  697. $("#writeSupplyPrice").hide();
  698. }
  699. }
  700. /*保存对接联系人信息到列表*/
  701. function toAddDockedContactInfo() {
  702. var contactName = document.getElementById("contactName").value;
  703. var contactPhone = document.getElementById("contactPhone").value;
  704. var contactType = document.getElementById("contactType").value;
  705. var contactEmail = document.getElementById("contactEmail").value;
  706. if(contactName == "" || contactName == null ){
  707. layer.msg("联系人姓名不能为空");
  708. return;
  709. }
  710. if(contactPhone == "" || contactPhone == null ){
  711. layer.msg("电话不能为空");
  712. return;
  713. }else{
  714. //var reg = /^(((13[0-9]{1})|(15[0-9]{1})|(18[0-9]{1}))+\d{8})$/;
  715. var reg = /^(0?(13[0-9]|15[012356789]|17[013678]|18[0-9]|14[57])[0-9]{8})$/
  716. if(!reg.test(contactPhone)){
  717. layer.msg("请填写正确的手机号码!", {icon: 5, time: 3000});
  718. return;
  719. }
  720. }
  721. if(contactType == "" || contactType == null ){
  722. layer.msg("职位/身份不能为空");
  723. return;
  724. }
  725. if(contactEmail == "" || contactEmail == null ){
  726. layer.msg("联系邮箱不能为空");
  727. return;
  728. }else{
  729. var reg = /^[a-zA-Z0-9_-]+@[a-zA-Z0-9_-]+(\.[a-zA-Z0-9_-]+)+$/;
  730. if(!reg.test(contactEmail)){
  731. layer.msg("请填写正确的邮箱!", {icon: 5, time: 3000});
  732. return;
  733. }
  734. }
  735. //var operation = "删除";
  736. var operation = "<a href='javascript:;' onclick='deleteContact(this)'>删除</a>";
  737. //"<a href='javascript:;' onclick='del(this)'>删除</a>";
  738. row = document.getElementById("contactTable").insertRow();
  739. if(row!=null){
  740. cell=row.insertCell();
  741. cell.style.textAlign = "center";
  742. cell.innerHTML=contactName;
  743. cell = row.insertCell();
  744. cell.style.textAlign = "center";
  745. cell.innerHTML=contactPhone;
  746. cell = row.insertCell();
  747. cell.style.textAlign = "center";
  748. cell.innerHTML=contactType;
  749. cell = row.insertCell();
  750. cell.style.textAlign = "center";
  751. cell.innerHTML=contactEmail;
  752. cell = row.insertCell();
  753. cell.style.textAlign = "center";
  754. cell.innerHTML=operation;
  755. }
  756. $("#contactTbodyId").hide();
  757. return false;
  758. }
  759. /*保存客户销售信息到列表*/
  760. function toAddChannelSaleInfo() {
  761. var channelCategory = document.getElementById("channelCategory").value;
  762. if(channelCategory == "1"){
  763. channelCategory = "电商";
  764. }else if(channelCategory == "2"){
  765. channelCategory = "特殊渠道";
  766. }else if(channelCategory == "3"){
  767. channelCategory = "线下";
  768. }else if(channelCategory == "4"){
  769. channelCategory = "海外";
  770. }
  771. var channelType = document.getElementById("channelType").value;
  772. var channelName = document.getElementById("channelName").value;
  773. var promotingProducts = document.getElementById("promotingProducts").value;
  774. var myselect=document.getElementById("promotingProducts");
  775. var promotingProductsText = myselect.options[myselect.selectedIndex].text;
  776. var supplyPrice = document.getElementById("supplyPrice").value;
  777. var writeSupplyPrice = document.getElementById("writeSupplyPrice").value;//手动输入价格
  778. if(writeSupplyPrice != null && writeSupplyPrice !=""){
  779. supplyPrice = writeSupplyPrice;
  780. }
  781. var accountPeriod = document.getElementById("accountPeriod").value;
  782. if(accountPeriod == "1"){
  783. accountPeriod = "先款";
  784. }else if(accountPeriod == "2"){
  785. accountPeriod = "月结";
  786. }else if(accountPeriod == "3"){
  787. accountPeriod = "两个月";
  788. }
  789. if(channelCategory == "" || channelCategory == null ){
  790. layer.msg("渠道类别不能为空");
  791. return;
  792. }
  793. if(channelType == "" || channelType == null ){
  794. layer.msg("渠道类型不能为空");
  795. return;
  796. }
  797. if(channelName == "" || channelName == null ){
  798. layer.msg("渠道平台/名称不能为空");
  799. return;
  800. }
  801. if(promotingProducts == "" || promotingProducts == null ){
  802. layer.msg("销售产品不能为空");
  803. return;
  804. }
  805. if(supplyPrice == "" || supplyPrice == null ){
  806. layer.msg("供货价格不能为空");
  807. return;
  808. }
  809. var promotingProductsHtml = '<input type="hidden" value="'+promotingProducts+'">';
  810. var operation = "<a href='javascript:;' onclick='deleteChannelSale(this)' name='deleteChannelSale'>删除</a>";
  811. row = document.getElementById("saleTable").insertRow();
  812. if(row!=null){
  813. cell=row.insertCell();
  814. cell.style.textAlign = "center";
  815. cell.innerHTML=channelCategory;
  816. cell = row.insertCell();
  817. cell.style.textAlign = "center";
  818. cell.innerHTML=channelType;
  819. cell = row.insertCell();
  820. cell.style.textAlign = "center";
  821. cell.innerHTML=channelName;
  822. cell = row.insertCell();
  823. cell.style.textAlign = "center";
  824. cell.innerHTML=promotingProductsHtml+promotingProductsText;
  825. cell = row.insertCell();
  826. cell.style.textAlign = "center";
  827. cell.innerHTML=supplyPrice;
  828. cell = row.insertCell();
  829. cell.style.textAlign = "center";
  830. cell.innerHTML=accountPeriod;
  831. cell = row.insertCell();
  832. cell.style.textAlign = "center";
  833. cell.innerHTML=operation;
  834. }
  835. $("#channelTbodyId").hide();
  836. return false;
  837. }
  838. /*修改客户信息*/
  839. function updateCustomerBasicInfo() {
  840. var customerBasicInfoSaveForm = {};
  841. //客户基本信息
  842. var customerBasicInfo = {};
  843. customerBasicInfo.customerId = $("[name='customerId']").val();
  844. customerBasicInfo.customerType = $("[name='customerType']").val();
  845. customerBasicInfo.cooperativeState = $("[name='cooperativeState']").val();
  846. customerBasicInfo.customerName = $("[name='customerName']").val();
  847. customerBasicInfo.customerIndustry = $("[name='customerIndustry']").val();
  848. customerBasicInfo.customerProvinceCode = $("[name='customerProvinceCode']").val();
  849. customerBasicInfo.customerCityCode = $("[name='customerCityCode']").val();
  850. customerBasicInfo.customerAddress = $("[name='customerAddress']").val();
  851. customerBasicInfo.customerRemarks = $("[name='customerRemarks']").val();
  852. if(customerBasicInfo.customerName == "" || customerBasicInfo.customerName == null ){
  853. layer.msg("客户名称不能为空");
  854. return;
  855. }
  856. if(customerBasicInfo.customerProvinceCode == "" || customerBasicInfo.customerProvinceCode == null ){
  857. layer.msg("客户省份不能为空");
  858. return;
  859. }
  860. if(customerBasicInfo.customerCityCode == "" || customerBasicInfo.customerCityCode == null ){
  861. layer.msg("客户城市不能为空");
  862. return;
  863. }
  864. //对接联系人信息
  865. var dockedContactInfoList = new Array();
  866. $("#contactListId").find("tr").each(function (index,element){
  867. var a = $(element).children();
  868. var dockedContactInfo = {};
  869. for(var i=0;i<a.length;i++){
  870. switch(i){
  871. case 0:
  872. dockedContactInfo.contactName = a.eq(i).text().trim();
  873. break;
  874. case 1:
  875. dockedContactInfo.contactPhone = a.eq(i).text().trim();
  876. break;
  877. case 2:
  878. dockedContactInfo.contactType = a.eq(i).text().trim();
  879. break;
  880. case 3:
  881. dockedContactInfo.contactEmail = a.eq(i).text().trim();
  882. break;
  883. }
  884. }
  885. dockedContactInfoList.push(dockedContactInfo);
  886. })
  887. if(dockedContactInfoList.length<1){
  888. layer.msg("对接联系人信息不能为空");
  889. return;
  890. }
  891. /*var dockedContactInfoListJson = $("#dockedContactInfoJson").val(JSON.stringify(dockedContactInfoList));*/
  892. //客户销售渠道信息
  893. var channelSaleInfoList = new Array();
  894. $("#channelSaleListId").find("tr").each(function (index,element){
  895. var a = $(element).children();
  896. var channelSaleInfo = {};
  897. for(var i=0;i<a.length;i++){
  898. switch(i){
  899. case 0:
  900. channelSaleInfo.channelCategory = a.eq(i).text().trim();
  901. if(channelSaleInfo.channelCategory == "电商"){
  902. channelSaleInfo.channelCategory = "1";
  903. }else if(channelSaleInfo.channelCategory == "特殊渠道"){
  904. channelSaleInfo.channelCategory = "2";
  905. }else if(channelSaleInfo.channelCategory == "线下"){
  906. channelSaleInfo.channelCategory = "3";
  907. }else if(channelSaleInfo.channelCategory == "海外"){
  908. channelSaleInfo.channelCategory = "4";
  909. }
  910. break;
  911. case 1:
  912. channelSaleInfo.channelType = a.eq(i).text().trim();
  913. break;
  914. case 2:
  915. channelSaleInfo.channelName = a.eq(i).text().trim();
  916. break;
  917. case 3:
  918. channelSaleInfo.promotingProducts = a.eq(i).text().trim();
  919. break;
  920. case 4:
  921. channelSaleInfo.supplyPrice = a.eq(i).text().trim();
  922. channelSaleInfo.supplyPrice = channelSaleInfo.supplyPrice * 100;
  923. break;
  924. case 5:
  925. channelSaleInfo.accountPeriod = a.eq(i).text().trim();
  926. if(channelSaleInfo.accountPeriod == "先款"){
  927. channelSaleInfo.accountPeriod = "1";
  928. }else if(channelSaleInfo.accountPeriod == "月结"){
  929. channelSaleInfo.accountPeriod = "2";
  930. }else if(channelSaleInfo.accountPeriod == "两个月"){
  931. channelSaleInfo.accountPeriod = "3";
  932. }
  933. break;
  934. }
  935. }
  936. channelSaleInfoList.push(channelSaleInfo);
  937. });
  938. if(channelSaleInfoList.length<2){
  939. layer.msg("客户销售渠道信息不能为空");
  940. return;
  941. }
  942. /*var channelSaleInfoListJson = $("#channelSaleInfoJson").val(JSON.stringify(channelSaleInfoList));*/
  943. //alert("dockedContactInfoList:"+dockedContactInfoList.length);
  944. //alert("channelSaleInfoList:"+channelSaleInfoList.length);
  945. //付款/退款信息
  946. var billingInfo = {};
  947. billingInfo.billingId = $("[name='billingId']").val();
  948. billingInfo.accountOpeningBranch = $("[name='accountOpeningBranch']").val();
  949. billingInfo.accountName = $("[name='accountName']").val();
  950. billingInfo.accountNum = $("[name='accountNum']").val();
  951. billingInfo.receivablesName = $("[name='receivablesName']").val();
  952. billingInfo.receivablesPhone = $("[name='receivablesPhone']").val();
  953. if(billingInfo.accountOpeningBranch == "" || billingInfo.accountOpeningBranch == null ){
  954. layer.msg("开户支行不能为空");
  955. return;
  956. }
  957. if(billingInfo.accountName == "" || billingInfo.accountName == null ){
  958. layer.msg("账号名称不能为空");
  959. return;
  960. }
  961. if(billingInfo.accountNum == "" || billingInfo.accountNum == null ){
  962. layer.msg("账号不能为空");
  963. return;
  964. }
  965. if(billingInfo.receivablesName == "" || billingInfo.receivablesName == null ){
  966. layer.msg("收款人姓名不能为空");
  967. return;
  968. }if(billingInfo.receivablesPhone == "" || billingInfo.receivablesPhone == null ){
  969. layer.msg("收款人手机不能为空");
  970. return;
  971. }else{
  972. var reg = /^(0?(13[0-9]|15[012356789]|17[013678]|18[0-9]|14[57])[0-9]{8})$/
  973. if(!reg.test(phone)){
  974. layer.msg("请填写正确的手机号码!", {icon: 5, time: 3000});
  975. return;
  976. }
  977. }
  978. //开票信息
  979. var ticketOpeningInfo = {};
  980. ticketOpeningInfo.ticketOpeningId = $("[name='ticketOpeningId']").val();
  981. ticketOpeningInfo.ticketType = $("[name='ticketType']").val();
  982. ticketOpeningInfo.accountOpeningBranch = $("[name='accountOpeningBranch']").val();
  983. ticketOpeningInfo.ticketOpeningAccount = $("[name='ticketOpeningAccount']").val();
  984. ticketOpeningInfo.enterpriseName = $("[name='enterpriseName']").val();
  985. ticketOpeningInfo.taxpayerIdentificationNum = $("[name='taxpayerIdentificationNum']").val();
  986. ticketOpeningInfo.ticketOpeningPhone = $("[name='ticketOpeningPhone']").val();
  987. ticketOpeningInfo.enterpriseAddress = $("[name='enterpriseAddress']").val();
  988. if(ticketOpeningInfo.ticketType == "1" ){
  989. if(ticketOpeningInfo.accountOpeningBranch == "" || ticketOpeningInfo.accountOpeningBranch == null ){
  990. layer.msg("开户支行不能为空");
  991. return;
  992. }
  993. if(ticketOpeningInfo.ticketOpeningAccount == "" || ticketOpeningInfo.ticketOpeningAccount == null ){
  994. layer.msg("开票账户不能为空");
  995. return;
  996. }
  997. if(ticketOpeningInfo.enterpriseName == "" || ticketOpeningInfo.enterpriseName == null ){
  998. layer.msg("企业名称不能为空");
  999. return;
  1000. }
  1001. if(ticketOpeningInfo.taxpayerIdentificationNum == "" || ticketOpeningInfo.taxpayerIdentificationNum == null ){
  1002. layer.msg("纳税人识别号不能为空");
  1003. return;
  1004. }
  1005. if(ticketOpeningInfo.ticketOpeningPhone == "" || ticketOpeningInfo.ticketOpeningPhone == null ){
  1006. layer.msg("开票电话不能为空");
  1007. return;
  1008. }else{
  1009. var reg = /^(0?(13[0-9]|15[012356789]|17[013678]|18[0-9]|14[57])[0-9]{8})$/
  1010. if(!reg.test(ticketOpeningInfo.ticketOpeningPhone)){
  1011. layer.msg("请填写正确的电话号码!", {icon: 5, time: 3000});
  1012. return;
  1013. }
  1014. }if(ticketOpeningInfo.enterpriseAddress == "" || ticketOpeningInfo.enterpriseAddress == null ){
  1015. layer.msg("企业地址不能为空");
  1016. return;
  1017. }
  1018. }else{
  1019. if(ticketOpeningInfo.enterpriseName == "" || ticketOpeningInfo.enterpriseName == null ){
  1020. layer.msg("企业名称不能为空");
  1021. return;
  1022. }
  1023. if(ticketOpeningInfo.taxpayerIdentificationNum == "" || ticketOpeningInfo.taxpayerIdentificationNum == null ){
  1024. layer.msg("纳税人识别号不能为空");
  1025. return;
  1026. }
  1027. }
  1028. //发送保存请求
  1029. customerBasicInfoSaveForm.customerBasicInfo = customerBasicInfo;
  1030. customerBasicInfoSaveForm.dockedContactInfoList = dockedContactInfoList;
  1031. customerBasicInfoSaveForm.channelSaleInfoList = channelSaleInfoList;
  1032. customerBasicInfoSaveForm.billingInfo = billingInfo;
  1033. customerBasicInfoSaveForm.ticketOpeningInfo = ticketOpeningInfo;
  1034. var saveStates = "";
  1035. console.log(customerBasicInfoSaveForm);
  1036. var customerInfoJson = JSON.stringify(customerBasicInfo);
  1037. var billingInfoJson = JSON.stringify(billingInfo);
  1038. var ticketOpeningInfoJson = JSON.stringify(ticketOpeningInfo);
  1039. var dockedContactInfoListJson = JSON.stringify(dockedContactInfoList);
  1040. var channelSaleInfoListJson = JSON.stringify(channelSaleInfoList);
  1041. //$.post("${path}/admin/customerBasic/save_customer_info",customerBasicInfoSaveForm, function(res){});
  1042. $.ajax({
  1043. type: "POST",
  1044. data: {
  1045. customerInfoJson:customerInfoJson,
  1046. dockedContactInfoListJson:dockedContactInfoListJson,
  1047. channelSaleInfoListJson:channelSaleInfoListJson,
  1048. billingInfoJson : billingInfoJson,
  1049. ticketOpeningInfoJson:ticketOpeningInfoJson
  1050. },
  1051. url: "${path}/admin/customerBasic/update_customer_info",
  1052. async: true,
  1053. success: function(data){
  1054. if (data.returnCode == 200) {
  1055. saveStates = "保存成功";
  1056. layer.msg(saveStates,{icon: 1,time:1000});
  1057. window.location.href= "${path}/admin/customerBasic/listCustomerBasic";
  1058. }else{
  1059. saveStates = "保存失败";
  1060. layer.msg(saveStates,{icon: 5,time:1000});
  1061. }
  1062. },
  1063. error: function(XmlHttpRequest, textStatus, errorThrown){
  1064. saveStates = "保存失败";
  1065. layer.msg(saveStates,{icon: 5,time:1000});
  1066. }
  1067. });
  1068. }
  1069. // 删除对接联系人函数
  1070. function deleteContact(x){
  1071. $(x).parent().parent().remove();
  1072. // tr.parentNode.removeChild(tr);
  1073. initContactInfoListBody();
  1074. }
  1075. // 删除客户销售渠道信息函数
  1076. function deleteChannelSale(x){
  1077. var tr = x.parentNode.parentNode;
  1078. tr.parentNode.removeChild(tr);
  1079. initChannelSaleInfoListBody();
  1080. }
  1081. //监听对接联系人
  1082. function initContactInfoListBody() {
  1083. var dockedContactInfoList = new Array();
  1084. $("#contactListId").find("tr").each(function (){
  1085. var dockedContactInfo = {};
  1086. dockedContactInfo.contactName = $("[name='contactName']").val();
  1087. dockedContactInfo.contactPhone = $("[name='contactPhone']").val();
  1088. dockedContactInfo.contactType = $("[name='contactType']").val();
  1089. dockedContactInfo.contactEmail = $("[name='contactEmail']").val();
  1090. dockedContactInfoList.push(dockedContactInfo);
  1091. })
  1092. if(dockedContactInfoList.length<2){
  1093. $("#contactTbodyId").show();
  1094. //document.getElementById("contactListId").innerHTML = "<tr><td colspan=\"5\" class=\"td-manage text-c\" >暂时没有联系人信息,请添加!</td></tr>";
  1095. }
  1096. }
  1097. //监听销售渠道
  1098. function initChannelSaleInfoListBody() {
  1099. var channelSaleInfoList = new Array();
  1100. $("#channelSaleListId").find("tr").each(function (){
  1101. var channelSaleInfo = {};
  1102. channelSaleInfo.channelCategory = $("[name='channelCategory']").val();
  1103. channelSaleInfo.channelType = $("[name='channelType']").val();
  1104. channelSaleInfo.channelName = $("[name='channelName']").val();
  1105. channelSaleInfo.promotingProducts = $("[name='promotingProducts']").val();
  1106. channelSaleInfo.supplyPrice = $("[name='supplyPrice']").val();
  1107. channelSaleInfo.accountPeriod = $("[name='accountPeriod']").val();
  1108. channelSaleInfoList.push(channelSaleInfo);
  1109. })
  1110. if(channelSaleInfoList.length<2){
  1111. $("#channelTbodyId").show();
  1112. //document.getElementById("channelSaleListId").innerHTML = "<tr><td colspan=\"7\" class=\"td-manage text-c\" >暂时没有客户销售渠道信息,请添加!</td></tr>";
  1113. }
  1114. }
  1115. /*业务逻辑js控制 end*/
  1116. </script>
  1117. </body>
  1118. </html>