save_customer_info.ftl 55 KB

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