save_customer_info.ftl 60 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232
  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:80px;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:150px;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 skin-minimal" 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="radio-box">
  255. <input type="radio" id="accountType-1" name="accountType" value="1" checked>
  256. <label for="accountType-1">公司</label>
  257. </div>
  258. <div class="radio-box">
  259. <input type="radio" id="accountType-2" name="accountType" value="2">
  260. <label for="accountType-2">个人</label>
  261. </div>
  262. </div>
  263. <div class="row cl" style="margin-bottom: 10px;">
  264. <label class="form-label col-2 col-sm-2" style="width: 125px;"><span class="c-red">*</span>开户支行:</label>
  265. <div class="formControls col-2 col-sm-2">
  266. <input type="text" class="input-text trim_input" placeholder="开户支行" id="billAccountOpeningBranch" name="billAccountOpeningBranch" value="">
  267. </div>
  268. <label class="form-label col-2 col-sm-2" style="width: 125px;"><span class="c-red">*</span><span id="accountNameId">企业名称:</span></label>
  269. <div class="formControls col-2 col-sm-2 skin-minimal">
  270. <input type="text" class="input-text trim_input" placeholder="企业名称/收款人姓名" id="accountName" name="accountName" value="">
  271. </div>
  272. <label class="form-label col-2 col-sm-2" style="width: 125px;"><span class="c-red">*</span>账号:</label>
  273. <div class="formControls col-2 col-sm-2 skin-minimal">
  274. <input type="text" class="input-text trim_input" placeholder="填写账号" id="accountNum" name="accountNum" value="">
  275. </div>
  276. </div>
  277. <div class="row cl" style="margin-bottom: 10px;">
  278. <#--<label class="form-label col-2 col-sm-2" style="width: 125px;"><span class="c-red">*</span>收款人姓名:</label>
  279. <div class="formControls col-2 col-sm-2 skin-minimal">
  280. <input type="text" class="input-text trim_input" placeholder="收款人姓名" id="receivablesName" name="receivablesName" value="">
  281. </div>-->
  282. <label class="form-label col-2 col-sm-2" style="width: 125px;"><span class="c-red">*</span>收款人手机:</label>
  283. <div class="formControls col-2 col-sm-2 skin-minimal">
  284. <input type="text" class="input-text trim_input" placeholder="收款人手机" id="receivablesPhone" name="receivablesPhone" value="">
  285. </div>
  286. </div>
  287. <#--开票信息-->
  288. <div class="row cl">
  289. <label class="form-label col-9">
  290. <div class="tit-2">开票信息</div>
  291. </label>
  292. <div class="formControls col-9">
  293. </div>
  294. </div>
  295. <div class="row cl skin-minimal" style="margin-bottom: 10px;">
  296. <label class="form-label col-2 col-sm-2" style="width: 125px;"><span class="c-red">*</span>是否开票:</label>
  297. <div class="radio-box">
  298. <input type="radio" id="isOpenTicket-1" class="isShowOpenTicket" name="isOpenTicket" value="0" checked="checked" >
  299. <label for="isOpenTicket-1">开票</label>
  300. </div>
  301. <div class="radio-box">
  302. <input type="radio" id="isOpenTicket-2" class="isShowOpenTicket" name="isOpenTicket" value="1" >
  303. <label for="isOpenTicket-2">不开票</label>
  304. </div>
  305. </div>
  306. <div class="row cl" style="margin-bottom: 10px;" id="isShowOpenTicket">
  307. <label class="form-label col-2 col-sm-2" style="width: 120px;"><span class="c-red">*</span>发票类型:</label>
  308. <div class="formControls col-2 col-sm-2">
  309. <span class="select-box">
  310. <select name="ticketType" class="select">
  311. <option value="1">专票</option>
  312. <option value="2">普票</option>
  313. </select>
  314. </span>
  315. </div>
  316. <label class="form-label col-2 col-sm-2" style="width: 140px;"><span class="c-red normalTicketType">*</span>开户支行:</label>
  317. <div class="formControls col-2 col-sm-2 skin-minimal">
  318. <input type="text" class="input-text trim_input" placeholder="开户支行名称" id="ticketAccountOpeningBranch" name="ticketAccountOpeningBranch" value="">
  319. </div>
  320. <label class="form-label col-2 col-sm-2" style="width: 120px;"><span class="c-red normalTicketType">*</span>开票账户:</label>
  321. <div class="formControls col-2 col-sm-2 skin-minimal">
  322. <input type="text" class="input-text trim_input" placeholder="开票账户" id="ticketOpeningAccount" name="ticketOpeningAccount" value="">
  323. </div>
  324. </div>
  325. <div class="row cl" style="margin-bottom: 10px;" id="isShowEnterprise">
  326. <label class="form-label col-2 col-sm-2" style="width: 120px;"><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="enterpriseName" name="enterpriseName" value="">
  329. </div>
  330. <label class="form-label col-2 col-sm-2" style="width: 140px;"><span class="c-red">*</span>纳税人识别号:</label>
  331. <div class="formControls col-2 col-sm-2 skin-minimal">
  332. <input type="text" class="input-text trim_input" placeholder="纳税人识别号" id="taxpayerIdentificationNum" name="taxpayerIdentificationNum" value="">
  333. </div>
  334. <label class="form-label col-2 col-sm-2" style="width: 120px;"><span class="c-red normalTicketType">*</span>开票电话:</label>
  335. <div class="formControls col-2 col-sm-2 skin-minimal">
  336. <input type="text" class="input-text trim_input" placeholder="开票电话" id="ticketOpeningPhone" name="ticketOpeningPhone" value="">
  337. </div>
  338. </div>
  339. <div class="row cl" style="margin-bottom: 10px;" id="isShowAddress">
  340. <label class="form-label col-2 col-sm-2" style="width: 120px;"><span class="c-red normalTicketType">*</span>企业地址:</label>
  341. <div class="formControls col-2 col-sm-2 skin-minimal" style="width: 1105px;">
  342. <input type="text" class="input-text trim_input" placeholder="企业地址" id="enterpriseAddress" name="enterpriseAddress" value="">
  343. </div>
  344. </div>
  345. <#--客户备注-->
  346. <div class="row cl">
  347. <label class="form-label col-3">
  348. <div class="tit-2">客户备注</div>
  349. </label>
  350. <div class="formControls col-9">
  351. </div>
  352. </div>
  353. <div class="row cl">
  354. <label class="form-label">
  355. </label>
  356. <div class="formControls col-9">
  357. <#--<textarea id="customerRemarks" style="width: 100%;height: 100px;" name="customerRemarks" ></textarea>-->
  358. <textarea name="customerRemarks" style="width: 100%;height: 100px;" id="customerRemarks" cols="" rows="" class="textarea"
  359. placeholder="客户备注,最多支持100字符" onKeyUp="$.Huitextarealength(this,100)" ></textarea>
  360. <p class="textarea-numberbar"><em class="textarea-length">0</em>/100</p>
  361. </div>
  362. </div>
  363. <#--添加保存按钮-->
  364. <div class="row cl">
  365. <label class="form-label col-5 col-sm-5"></label>
  366. <div class="formControls col-5 col-sm-5 skin-minimal">
  367. <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>
  368. </div>
  369. </div>
  370. </form>
  371. </div>
  372. <script type="text/javascript" src="${path}/common/lib/icheck/jquery.icheck.min.js"></script>
  373. <script>
  374. $('.skin-minimal input').iCheck({
  375. checkboxClass: 'icheckbox-blue',
  376. radioClass: 'iradio-blue',
  377. increaseArea: '20%'
  378. });
  379. </script>
  380. <#--业务js-->
  381. <#--<script type="text/javascript" src="${path}/common/js/customerSaveAdmin/save_customer_info.js"></script>-->
  382. <script>
  383. $("#writeSupplyPrice").hide();//隐藏手动输入产品价格框
  384. /*初始化页面参数*/
  385. $(function () {
  386. /* 初始化单选框样式 */
  387. //initCheck();
  388. /*初始化省份(大类)*/
  389. initProvince();
  390. /*初始化渠道类别(大类)*/
  391. initChannelCategory();
  392. /*初始化销售产品(大类)*/
  393. initPromotingProducts();
  394. /*监听省份*/
  395. $("[name='customerProvinceCode']").change(function (){
  396. initCity($(this).val());
  397. })
  398. /*监听渠道类别*/
  399. $("[name='channelCategory']").change(function (){
  400. initChannelType($(this).val());
  401. })
  402. /*监听销售产品*/
  403. $("[name='promotingProducts']").change(function (){
  404. initSupplyPrice($(this).val());
  405. })
  406. /*监听产品价格选择*/
  407. $("[name='supplyPrice']").change(function (){
  408. changeSupplyPrice($(this).val());
  409. })
  410. /*监听是否开票事件*/
  411. $("input[name='isOpenTicket']").change(function (){
  412. var isOpenTicket = $("input[name='isOpenTicket']:checked").val();
  413. if(isOpenTicket == "1"){
  414. $("#isShowOpenTicket").hide();
  415. $("#isShowEnterprise").hide();
  416. $("#isShowAddress").hide();
  417. }else if(isOpenTicket == "0"){
  418. $("#isShowOpenTicket").show();
  419. $("#isShowEnterprise").show();
  420. $("#isShowAddress").show();
  421. }
  422. });
  423. /*监听发票类型*/
  424. $("[name='ticketType']").change(function (){
  425. isShowRedStar($(this).val());
  426. })
  427. })
  428. /*付款/退款信息填充到开票信息*/
  429. $("input[name='accountNum']").blur(function (){
  430. var accountType = $("input[name='accountType']:checked").val();
  431. if(accountType == 1){
  432. var accountOpeningBranch = $("#accountOpeningBranch").val();//开户支行
  433. var accountName = $("#accountName").val();//企业名称/收款人姓名
  434. var accountNum = $("#accountNum").val();//账号
  435. $("#ticketAccountOpeningBranch").val($("#billAccountOpeningBranch").val());
  436. $("#ticketOpeningAccount").val($("#accountNum").val());
  437. $("#enterpriseName").val($("#accountName").val());
  438. }
  439. });
  440. /*监听控制退款名称显示事件*/
  441. $("input[name='accountType']").change(function (){
  442. var accountType = parseInt($(this).val());
  443. if(accountType == 1){
  444. $("#accountNameId").html("企业名称:");
  445. }else{
  446. $("#accountNameId").html("收款人姓名:");
  447. }
  448. });
  449. /*业务逻辑js控制 start*/
  450. $(document).on('click', '.dalog-ask .answer', function() {
  451. var customerProvinceCode = $(this).find(".customerProvinceCode").val();
  452. $("select[name='complaintId']").val(customerProvinceCode);
  453. initCity(customerProvinceCode); //根据省份初始化城市
  454. $(".dalog-ask").hide();
  455. });
  456. function isShowRedStar(ticketType) {
  457. if(ticketType == "1"){
  458. $(".normalTicketType").show();
  459. }else{
  460. $(".normalTicketType").hide();
  461. }
  462. }
  463. /*初始化省份*/
  464. function initProvince() {
  465. //默认查询参数为空
  466. var provinceListInfo = null;
  467. $.ajax({
  468. type: "POST",
  469. data: {
  470. provinceId : provinceListInfo
  471. },
  472. url: "${path}/admin/customerBasic/query_provinceList",
  473. async: true,
  474. success: function(data){
  475. var html = '<option value="">请选择省份</option>';
  476. var id;
  477. if (data.returnCode == 200) {
  478. for(var i=0;i<data.returnMsg.provinceList.length;i++){
  479. provinceListInfo = data.returnMsg.provinceList[i];
  480. if(i == 0 ){
  481. id = provinceListInfo.provinceId;
  482. }
  483. html += '<option value="'+ provinceListInfo.provinceId +'">'+ provinceListInfo.province +'</option>';
  484. }
  485. }else{
  486. html = '';
  487. }
  488. $("[name='customerProvinceCode']").html(html);
  489. },
  490. error: function(XmlHttpRequest, textStatus, errorThrown){
  491. }
  492. });
  493. }
  494. /*根据省份代号初始化城市*/
  495. function initCity(customerProvinceId){
  496. var cityListInfo = null;
  497. if(customerProvinceId == null || customerProvinceId == ""){
  498. var html = '<option value="">请选择城市</option>';
  499. $("[name='customerCityCode']").html(html);
  500. }else{
  501. $.ajax({
  502. type: "POST",
  503. data: {
  504. provinceId : customerProvinceId
  505. },
  506. url: "${path}/admin/customerBasic/query_cityList",
  507. async: true,
  508. success: function(data){
  509. var html = '<option value="">请选择城市</option>';
  510. if (data.returnCode == 200) {
  511. for(var i=0;i<data.returnMsg.cityList.length;i++){
  512. cityListInfo = data.returnMsg.cityList[i];
  513. html += '<option value="'+ cityListInfo.cityId +'">'+ cityListInfo.city +'</option>';
  514. }
  515. }else{
  516. html = '';
  517. }
  518. $("[name='customerCityCode']").html(html);
  519. },
  520. error: function(XmlHttpRequest, textStatus, errorThrown){
  521. }
  522. });
  523. }
  524. }
  525. /*初始化渠道类别*/
  526. function initChannelCategory() {
  527. //默认查询参数为空
  528. var id;
  529. var channelCategoryListInfo = null;
  530. $.ajax({
  531. type: "POST",
  532. data: {
  533. channelCategoryId : channelCategoryListInfo
  534. },
  535. url: "${path}/admin/customerBasic/query_channelCategoryList",
  536. async: true,
  537. success: function(data){
  538. var html = '';
  539. if (data.returnCode == 200) {
  540. for(var i=0;i<data.returnMsg.channelCategoryList.length;i++){
  541. channelCategoryListInfo = data.returnMsg.channelCategoryList[i];
  542. if(i == 0 ){
  543. id = channelCategoryListInfo.channelCategory;
  544. }
  545. html += '<option value="'+ channelCategoryListInfo.channelCategory +'">'+ channelCategoryListInfo.channelName +'</option>';
  546. }
  547. }else{
  548. html = '';
  549. }
  550. $("[name='channelCategory']").html(html);
  551. },
  552. error: function(XmlHttpRequest, textStatus, errorThrown){
  553. }
  554. });
  555. initChannelType(id);
  556. }
  557. /*根据渠道类别初始化渠道类型*/
  558. function initChannelType(channelCategory){
  559. var channelTypeListInfo = null;
  560. /* if(channelCategory == null || channelCategory == ""){
  561. var html = '<option value="">请选择渠道类别</option>';
  562. $("[name='channelCategory']").html(html);
  563. }else{*/
  564. $.ajax({
  565. type: "POST",
  566. data: {
  567. channelCategoryId : channelCategory
  568. },
  569. url: "${path}/admin/customerBasic/query_channelTypeList",
  570. async: true,
  571. success: function(data){
  572. //var html = '<option value="">请选择渠道类型</option>';
  573. var html = '';
  574. if (data.returnCode == 200) {
  575. for(var i=0;i<data.returnMsg.channelTypeList.length;i++){
  576. channelTypeListInfo = data.returnMsg.channelTypeList[i];
  577. html += '<option value="'+ channelTypeListInfo.channelName +'">'+ channelTypeListInfo.channelType +'</option>';
  578. }
  579. }else{
  580. html = '';
  581. }
  582. $("[name='channelType']").html(html);
  583. },
  584. error: function(XmlHttpRequest, textStatus, errorThrown){
  585. }
  586. });
  587. //}
  588. }
  589. /*初始化销售产品*/
  590. function initPromotingProducts() {
  591. var promotingProductsInfo = null;
  592. $.ajax({
  593. type: "POST",
  594. data: {
  595. promotingProductsInfo : promotingProductsInfo
  596. },
  597. url: "${path}/admin/customerBasic/query_promotingProductsList",
  598. async: true,
  599. success: function(data){
  600. var html = '<option value="">请选择销售产品</option>';
  601. //var html = '';
  602. var id;
  603. if (data.returnCode == 200) {
  604. for(var i=0;i<data.returnMsg.promotingProductsList.length;i++){
  605. promotingProductsInfo = data.returnMsg.promotingProductsList[i];
  606. if(i == 0 ){
  607. id = promotingProductsInfo.productId;
  608. }
  609. html += '<option value="'+ promotingProductsInfo.productId +'">'+ promotingProductsInfo.productName +'</option>';
  610. }
  611. }else{
  612. html = '';
  613. }
  614. $("[name='promotingProducts']").html(html);
  615. },
  616. error: function(XmlHttpRequest, textStatus, errorThrown){
  617. }
  618. });
  619. }
  620. /*初始化产品价格*/
  621. function initSupplyPrice(promotingProductsId){
  622. //var supplyPriceInfo = null;
  623. if(promotingProductsId == null || promotingProductsId == ""){
  624. var html = '<option value="">请选择销售产品</option>';
  625. //$("[name='promotingProducts']").html(html);
  626. }else{
  627. $.ajax({
  628. type: "POST",
  629. data: {
  630. promotingProductsId : promotingProductsId
  631. },
  632. url: "${path}/admin/customerBasic/query_supplyPriceList",
  633. async: true,
  634. success: function(data){
  635. //var html = '<option value="">手动输入产品价格</option>';
  636. var html = '';
  637. var chose = "手动输入产品价格"
  638. if (data.returnCode == 200) {
  639. for(var i=0;i<data.returnMsg.supplyPriceList.length;i++){
  640. var supplyPriceInfo = data.returnMsg.supplyPriceList[i];
  641. html += '<option value="'+ supplyPriceInfo.colorPrice/100 +'">'+ supplyPriceInfo.colorPrice/100 +'</option>';
  642. }
  643. html += '<option value="00">'+ chose +'</option>';
  644. }else{
  645. html = '';
  646. }
  647. $("[name='supplyPrice']").html(html);
  648. //$("#writeSupplyPrice").show();
  649. },
  650. error: function(XmlHttpRequest, textStatus, errorThrown){
  651. }
  652. });
  653. }
  654. }
  655. /*监听产品价格选项*/
  656. function changeSupplyPrice(supplyPrice){
  657. if(supplyPrice == "00"){
  658. $("#writeSupplyPrice").show();
  659. }else{
  660. $("#writeSupplyPrice").hide();
  661. }
  662. }
  663. function getByteLen(val) {
  664. var len = 0;
  665. for (var i = 0; i < val.length; i++) {
  666. var length = val.charCodeAt(i);
  667. if(length>=0&&length<=128)
  668. {
  669. len += 1;
  670. }
  671. else
  672. {
  673. len += 2;
  674. }
  675. }
  676. return len;
  677. }
  678. /*保存对接联系人信息到列表*/
  679. function toAddDockedContactInfo() {
  680. var contactName = document.getElementById("contactName").value;
  681. var contactPhone = document.getElementById("contactPhone").value;
  682. var contactType = document.getElementById("contactType").value;
  683. var contactEmail = document.getElementById("contactEmail").value;
  684. if(contactName == "" || contactName == null ){
  685. //alert("联系人姓名不能为空");
  686. layer.msg("联系人姓名不能为空",{icon:2,time:2000});
  687. return;
  688. }else if(getByteLen(contactName) > 20){
  689. layer.msg("联系人姓名长度超限");
  690. return;
  691. }
  692. if(contactPhone == "" || contactPhone == null ){
  693. //alert("电话不能为空");
  694. layer.msg("电话不能为空",{icon:2,time:1000});
  695. return;
  696. }else{
  697. //var reg = /^(((13[0-9]{1})|(15[0-9]{1})|(18[0-9]{1}))+\d{8})$/;
  698. var reg = /^(0?(13[0-9]|15[012356789]|17[013678]|18[0-9]|14[57])[0-9]{8})$/
  699. if(!reg.test(contactPhone)){
  700. layer.msg("请填写正确的手机号码!", {icon: 5, time: 3000});
  701. return;
  702. }
  703. }
  704. if(contactType == "" || contactType == null ){
  705. layer.msg("职位/身份不能为空");
  706. return;
  707. }else if(getByteLen(contactType) > 20){
  708. layer.msg("职位/身份长度超限");
  709. return;
  710. }
  711. if(contactEmail == "" || contactEmail == null ){
  712. layer.msg("联系邮箱不能为空");
  713. return;
  714. }else{
  715. var reg = /^[a-zA-Z0-9_-]+@[a-zA-Z0-9_-]+(\.[a-zA-Z0-9_-]+)+$/;
  716. if(!reg.test(contactEmail)){
  717. layer.msg("请填写正确的邮箱!", {icon: 5, time: 3000});
  718. return;
  719. }else if(getByteLen(contactEmail) > 30){
  720. layer.msg("邮箱长度超限");
  721. return;
  722. }
  723. }
  724. //var operation = "删除";
  725. var operation = "<a href='javascript:;' onclick='deleteContact(this)'>删除</a>";
  726. //"<a href='javascript:;' onclick='del(this)'>删除</a>";
  727. row = document.getElementById("contactTable").insertRow();
  728. if(row!=null){
  729. cell=row.insertCell();
  730. cell.style.textAlign = "center";
  731. cell.innerHTML=contactName;
  732. cell = row.insertCell();
  733. cell.style.textAlign = "center";
  734. cell.innerHTML=contactPhone;
  735. cell = row.insertCell();
  736. cell.style.textAlign = "center";
  737. cell.innerHTML=contactType;
  738. cell = row.insertCell();
  739. cell.style.textAlign = "center";
  740. cell.innerHTML=contactEmail;
  741. cell = row.insertCell();
  742. cell.style.textAlign = "center";
  743. cell.innerHTML=operation;
  744. }
  745. $("#contactTbodyId").hide();
  746. return false;
  747. }
  748. //制保留2位小数,如:2,会在2后面补上00.即2.00
  749. function toDecimal2(x) {
  750. var f = parseFloat(x);
  751. if (isNaN(f)) {
  752. return false;
  753. }
  754. var f = Math.round(x*100)/100;
  755. var s = f.toString();
  756. var rs = s.indexOf('.');
  757. if (rs < 0) {
  758. rs = s.length;
  759. s += '.';
  760. }
  761. while (s.length <= rs + 2) {
  762. s += '0';
  763. }
  764. return s;
  765. }
  766. /*保存客户销售信息到列表*/
  767. function toAddChannelSaleInfo() {
  768. var channelCategory = document.getElementById("channelCategory").value;
  769. if(channelCategory == "1"){
  770. channelCategory = "电商";
  771. }else if(channelCategory == "2"){
  772. channelCategory = "特殊渠道";
  773. }else if(channelCategory == "3"){
  774. channelCategory = "线下";
  775. }else if(channelCategory == "4"){
  776. channelCategory = "海外";
  777. }
  778. var channelType = document.getElementById("channelType").value;
  779. var channelName = document.getElementById("channelName").value;
  780. var promotingProducts = document.getElementById("promotingProducts").value;
  781. var myselect=document.getElementById("promotingProducts");
  782. var promotingProductsText = myselect.options[myselect.selectedIndex].text;
  783. var supplyPrice = document.getElementById("supplyPrice").value;
  784. var writeSupplyPrice = document.getElementById("writeSupplyPrice").value;//手动输入价格
  785. if(writeSupplyPrice != null && writeSupplyPrice !=""){
  786. writeSupplyPrice = toDecimal2(writeSupplyPrice);
  787. supplyPrice = writeSupplyPrice;
  788. }else if(getByteLen(writeSupplyPrice) > 9){
  789. layer.msg("产品价格长度超限");
  790. return;
  791. }
  792. var accountPeriod = document.getElementById("accountPeriod").value;
  793. if(accountPeriod == "1"){
  794. accountPeriod = "先款";
  795. }else if(accountPeriod == "2"){
  796. accountPeriod = "月结";
  797. }else if(accountPeriod == "3"){
  798. accountPeriod = "两个月";
  799. }
  800. if(channelCategory == "" || channelCategory == null ){
  801. layer.msg("渠道类别不能为空");
  802. return;
  803. }
  804. if(channelType == "" || channelType == null ){
  805. layer.msg("渠道类型不能为空");
  806. return;
  807. }
  808. if(channelName == "" || channelName == null ){
  809. layer.msg("渠道平台/名称不能为空");
  810. return;
  811. }else if(getByteLen(channelName) > 30){
  812. layer.msg("渠道平台/名称长度超限");
  813. return;
  814. }
  815. if(promotingProducts == "" || promotingProducts == null ){
  816. layer.msg("销售产品不能为空");
  817. return;
  818. }
  819. if(supplyPrice == "" || supplyPrice == null ){
  820. layer.msg("供货价格不能为空");
  821. return;
  822. }else if(getByteLen(supplyPrice) > 9){
  823. layer.msg("供货价格长度超限");
  824. return;
  825. }
  826. var promotingProductsHtml = '<input type="hidden" value="'+promotingProducts+'">';
  827. //var operation = "删除";
  828. var operation = "<a href='javascript:;' onclick='deleteChannelSale(this)' name='deleteChannelSale'>删除</a>";
  829. row = document.getElementById("saleTable").insertRow();
  830. if(row!=null){
  831. cell=row.insertCell();
  832. cell.style.textAlign = "center";
  833. cell.innerHTML=channelCategory;
  834. cell = row.insertCell();
  835. cell.style.textAlign = "center";
  836. cell.innerHTML=channelType;
  837. cell = row.insertCell();
  838. cell.style.textAlign = "center";
  839. cell.innerHTML=channelName;
  840. cell = row.insertCell();
  841. cell.style.textAlign = "center";
  842. cell.innerHTML=promotingProductsHtml+promotingProductsText;
  843. cell = row.insertCell();
  844. cell.style.textAlign = "center";
  845. cell.innerHTML=supplyPrice;
  846. cell = row.insertCell();
  847. cell.style.textAlign = "center";
  848. cell.innerHTML=accountPeriod;
  849. cell = row.insertCell();
  850. cell.style.textAlign = "center";
  851. cell.innerHTML=operation;
  852. }
  853. $("#channelTbodyId").hide();
  854. return false;
  855. }
  856. /*添加客户信息*/
  857. function addCustomerBasicInfo() {
  858. //var customerBasicInfoSaveForm = {};
  859. //客户基本信息
  860. var customerBasicInfo = {};
  861. customerBasicInfo.customerType = $("[name='customerType']").val();
  862. customerBasicInfo.cooperativeState = $("[name='cooperativeState']").val();
  863. customerBasicInfo.customerName = $("[name='customerName']").val();
  864. customerBasicInfo.customerIndustry = $("[name='customerIndustry']").val();
  865. customerBasicInfo.customerProvinceCode = $("[name='customerProvinceCode']").val();
  866. customerBasicInfo.customerCityCode = $("[name='customerCityCode']").val();
  867. customerBasicInfo.customerAddress = $("[name='customerAddress']").val();
  868. customerBasicInfo.customerRemarks = $("[name='customerRemarks']").val();
  869. customerBasicInfo.customerStatus = "2";
  870. if(customerBasicInfo.customerName == "" || customerBasicInfo.customerName == null ){
  871. layer.msg("客户名称不能为空");
  872. return;
  873. }else if(getByteLen(customerBasicInfo.customerName) > 20){
  874. layer.msg("客户名称长度超限");
  875. return;
  876. }
  877. if(getByteLen(customerBasicInfo.customerIndustry) > 20){
  878. layer.msg("客户行业长度超限");
  879. return;
  880. }
  881. if(customerBasicInfo.customerProvinceCode == "" || customerBasicInfo.customerProvinceCode == null ){
  882. layer.msg("客户省份不能为空");
  883. return;
  884. }
  885. if(customerBasicInfo.customerCityCode == "" || customerBasicInfo.customerCityCode == null ){
  886. layer.msg("客户城市不能为空");
  887. return;
  888. }
  889. if(getByteLen(customerBasicInfo.customerAddress) > 100){
  890. layer.msg("客户详细地址长度超限");
  891. return;
  892. }
  893. if(getByteLen(customerBasicInfo.customerRemarks) > 100){
  894. layer.msg("备注信息长度超限");
  895. return;
  896. }
  897. //对接联系人信息
  898. var dockedContactInfoList = new Array();
  899. $("#contactListId").find("tr").each(function (index,element){
  900. var a = $(element).children();
  901. var dockedContactInfo = {};
  902. for(var i=0;i<a.length;i++){
  903. switch(i){
  904. case 0:
  905. dockedContactInfo.contactName = a.eq(i).text().trim();
  906. break;
  907. case 1:
  908. dockedContactInfo.contactPhone = a.eq(i).text().trim();
  909. break;
  910. case 2:
  911. dockedContactInfo.contactType = a.eq(i).text().trim();
  912. break;
  913. case 3:
  914. dockedContactInfo.contactEmail = a.eq(i).text().trim();
  915. break;
  916. }
  917. }
  918. dockedContactInfoList.push(dockedContactInfo);
  919. })
  920. if(dockedContactInfoList.length<1){
  921. layer.msg("对接联系人信息不能为空");
  922. return;
  923. }
  924. //var dockedContactInfoListJson = $("#dockedContactInfoJson").val(JSON.stringify(dockedContactInfoList));
  925. //客户销售渠道信息
  926. var channelSaleInfoList = new Array();
  927. $("#channelSaleListId").find("tr").each(function (index,element){
  928. var a = $(element).children();
  929. var channelSaleInfo = {};
  930. for(var i=0;i<a.length;i++){
  931. switch(i){
  932. case 0:
  933. channelSaleInfo.channelCategory = a.eq(i).text().trim();
  934. if(channelSaleInfo.channelCategory == "电商"){
  935. channelSaleInfo.channelCategory = "1";
  936. }else if(channelSaleInfo.channelCategory == "特殊渠道"){
  937. channelSaleInfo.channelCategory = "2";
  938. }else if(channelSaleInfo.channelCategory == "线下"){
  939. channelSaleInfo.channelCategory = "3";
  940. }else if(channelSaleInfo.channelCategory == "海外"){
  941. channelSaleInfo.channelCategory = "4";
  942. }
  943. break;
  944. case 1:
  945. channelSaleInfo.channelType = a.eq(i).text().trim();
  946. break;
  947. case 2:
  948. channelSaleInfo.channelName = a.eq(i).text().trim();
  949. break;
  950. case 3:
  951. channelSaleInfo.promotingProducts = a.eq(i).text().trim();
  952. break;
  953. case 4:
  954. channelSaleInfo.supplyPrice = a.eq(i).text().trim();
  955. channelSaleInfo.supplyPrice = channelSaleInfo.supplyPrice * 100;
  956. break;
  957. case 5:
  958. channelSaleInfo.accountPeriod = a.eq(i).text().trim();
  959. if(channelSaleInfo.accountPeriod == "先款"){
  960. channelSaleInfo.accountPeriod = "1";
  961. }else if(channelSaleInfo.accountPeriod == "月结"){
  962. channelSaleInfo.accountPeriod = "2";
  963. }else if(channelSaleInfo.accountPeriod == "两个月"){
  964. channelSaleInfo.accountPeriod = "3";
  965. }
  966. break;
  967. }
  968. }
  969. channelSaleInfoList.push(channelSaleInfo);
  970. });
  971. if(channelSaleInfoList.length<2){
  972. layer.msg("客户销售渠道信息不能为空");
  973. return;
  974. }
  975. //var channelSaleInfoListJson = $("#channelSaleInfoJson").val(JSON.stringify(channelSaleInfoList));
  976. //付款/退款信息
  977. var billingInfo = {};
  978. if(customerBasicInfo.cooperativeState != "1"){
  979. billingInfo.accountOpeningBranch = $("[name='billAccountOpeningBranch']").val();
  980. billingInfo.accountName = $("[name='accountName']").val();
  981. billingInfo.accountNum = $("[name='accountNum']").val();
  982. /*billingInfo.receivablesName = $("[name='receivablesName']").val();*/
  983. billingInfo.receivablesPhone = $("[name='receivablesPhone']").val();
  984. if(billingInfo.accountOpeningBranch == "" || billingInfo.accountOpeningBranch == null ){
  985. layer.msg("开户支行不能为空");
  986. return;
  987. }else if(getByteLen(billingInfo.accountOpeningBranch) > 50){
  988. layer.msg("开户支行长度超限");
  989. return;
  990. }
  991. if(billingInfo.accountName == "" || billingInfo.accountName == null ){
  992. layer.msg("账号名称不能为空");
  993. return;
  994. }else if(getByteLen(billingInfo.accountName) > 30){
  995. layer.msg("账号名称长度超限");
  996. return;
  997. }
  998. if(billingInfo.accountNum == "" || billingInfo.accountNum == null ){
  999. layer.msg("账号不能为空");
  1000. return;
  1001. }else if(getByteLen(billingInfo.accountNum) > 20){
  1002. layer.msg("账号长度超限");
  1003. return;
  1004. }
  1005. /*if(billingInfo.receivablesName == "" || billingInfo.receivablesName == null ){
  1006. layer.msg("收款人姓名不能为空");
  1007. return;
  1008. }*/
  1009. if(billingInfo.receivablesPhone == "" || billingInfo.receivablesPhone == null ){
  1010. layer.msg("收款人手机不能为空");
  1011. return;
  1012. }else{
  1013. var reg = /^(0?(13[0-9]|15[012356789]|17[013678]|18[0-9]|14[57])[0-9]{8})$/
  1014. if(!reg.test(billingInfo.receivablesPhone)){
  1015. layer.msg("请填写正确的手机号码!", {icon: 5, time: 3000});
  1016. return;
  1017. }
  1018. }
  1019. }
  1020. //开票信息
  1021. var ticketOpeningInfo = {};
  1022. var isOpenTicket = $("input[name='isOpenTicket']:checked").val();
  1023. if(customerBasicInfo.cooperativeState != "1" && isOpenTicket != "1"){
  1024. ticketOpeningInfo.ticketType = $("[name='ticketType']").val();
  1025. ticketOpeningInfo.accountOpeningBranch = $("[name='ticketAccountOpeningBranch']").val();
  1026. ticketOpeningInfo.ticketOpeningAccount = $("[name='ticketOpeningAccount']").val();
  1027. ticketOpeningInfo.enterpriseName = $("[name='enterpriseName']").val();
  1028. ticketOpeningInfo.taxpayerIdentificationNum = $("[name='taxpayerIdentificationNum']").val();
  1029. ticketOpeningInfo.ticketOpeningPhone = $("[name='ticketOpeningPhone']").val();
  1030. ticketOpeningInfo.enterpriseAddress = $("[name='enterpriseAddress']").val();
  1031. if(ticketOpeningInfo.ticketType == "1" ){
  1032. if(ticketOpeningInfo.accountOpeningBranch == "" || ticketOpeningInfo.accountOpeningBranch == null ){
  1033. layer.msg("开户支行不能为空");
  1034. return;
  1035. }else if(getByteLen(ticketOpeningInfo.accountOpeningBranch) > 50){
  1036. layer.msg("开户支行长度超限");
  1037. return;
  1038. }
  1039. if(ticketOpeningInfo.ticketOpeningAccount == "" || ticketOpeningInfo.ticketOpeningAccount == null ){
  1040. layer.msg("开票账户不能为空");
  1041. return;
  1042. }else if(getByteLen(ticketOpeningInfo.ticketOpeningAccount) > 30){
  1043. layer.msg("开票账户长度超限");
  1044. return;
  1045. }
  1046. if(ticketOpeningInfo.enterpriseName == "" || ticketOpeningInfo.enterpriseName == null ){
  1047. layer.msg("企业名称不能为空");
  1048. return;
  1049. }else if(getByteLen(ticketOpeningInfo.enterpriseName) > 30){
  1050. layer.msg("企业名称长度超限");
  1051. return;
  1052. }
  1053. if(ticketOpeningInfo.taxpayerIdentificationNum == "" || ticketOpeningInfo.taxpayerIdentificationNum == null ){
  1054. layer.msg("纳税人识别号不能为空");
  1055. return;
  1056. }else if(getByteLen(ticketOpeningInfo.taxpayerIdentificationNum) > 30){
  1057. layer.msg("纳税人识别号长度超限");
  1058. return;
  1059. }
  1060. if(ticketOpeningInfo.ticketOpeningPhone == "" || ticketOpeningInfo.ticketOpeningPhone == null ){
  1061. layer.msg("开票电话不能为空");
  1062. return;
  1063. }else{
  1064. var reg = /^(0?(13[0-9]|15[012356789]|17[013678]|18[0-9]|14[57])[0-9]{8})$/
  1065. if(!reg.test(ticketOpeningInfo.ticketOpeningPhone)){
  1066. layer.msg("请填写正确的手机号码!", {icon: 5, time: 3000});
  1067. return;
  1068. }
  1069. }
  1070. if(ticketOpeningInfo.enterpriseAddress == "" || ticketOpeningInfo.enterpriseAddress == null ){
  1071. layer.msg("企业地址不能为空");
  1072. return;
  1073. }else if(getByteLen(ticketOpeningInfo.enterpriseAddress) > 30){
  1074. layer.msg("企业地址长度超限");
  1075. return;
  1076. }
  1077. }else{
  1078. if(ticketOpeningInfo.enterpriseName == "" || ticketOpeningInfo.enterpriseName == null ){
  1079. layer.msg("企业名称不能为空");
  1080. return;
  1081. }else if(getByteLen(ticketOpeningInfo.enterpriseName) > 30){
  1082. layer.msg("企业名称长度超限");
  1083. return;
  1084. }
  1085. if(ticketOpeningInfo.taxpayerIdentificationNum == "" || ticketOpeningInfo.taxpayerIdentificationNum == null ){
  1086. layer.msg("纳税人识别号不能为空");
  1087. return;
  1088. }else if(getByteLen(ticketOpeningInfo.taxpayerIdentificationNum) > 30){
  1089. layer.msg("纳税人识别号长度超限");
  1090. return;
  1091. }
  1092. }
  1093. }
  1094. //发送保存请求
  1095. /*alert("request ...Start...");
  1096. customerBasicInfoSaveForm.customerBasicInfo = customerBasicInfo;
  1097. customerBasicInfoSaveForm.dockedContactInfoList = dockedContactInfoList;
  1098. customerBasicInfoSaveForm.channelSaleInfoList = channelSaleInfoList;
  1099. customerBasicInfoSaveForm.billingInfo = billingInfo;
  1100. customerBasicInfoSaveForm.ticketOpeningInfo = ticketOpeningInfo;*/
  1101. var saveStates = "";
  1102. var customerInfoJson = JSON.stringify(customerBasicInfo);
  1103. var billingInfoJson = JSON.stringify(billingInfo);
  1104. var ticketOpeningInfoJson = JSON.stringify(ticketOpeningInfo);
  1105. var dockedContactInfoListJson = JSON.stringify(dockedContactInfoList);
  1106. var channelSaleInfoListJson = JSON.stringify(channelSaleInfoList);
  1107. //$.post("${path}/admin/customerBasic/save_customer_info",customerBasicInfoSaveForm, function(res){});
  1108. $.ajax({
  1109. type: "POST",
  1110. data: {
  1111. customerInfoJson:customerInfoJson,
  1112. dockedContactInfoListJson:dockedContactInfoListJson,
  1113. channelSaleInfoListJson:channelSaleInfoListJson,
  1114. billingInfoJson : billingInfoJson,
  1115. ticketOpeningInfoJson:ticketOpeningInfoJson
  1116. },
  1117. url: "${path}/admin/customerBasic/save_customer_info",
  1118. async: true,
  1119. success: function(data){
  1120. if (data.returnCode == 200) {
  1121. saveStates = "保存成功";
  1122. layer.msg(saveStates);
  1123. window.location.href= "${path}/admin/customerBasic/listCustomerBasic";
  1124. }else{
  1125. saveStates = "保存失败";
  1126. layer.msg(saveStates);
  1127. }
  1128. },
  1129. error: function(XmlHttpRequest, textStatus, errorThrown){
  1130. saveStates = "保存失败";
  1131. layer.msg(saveStates);
  1132. }
  1133. });
  1134. }
  1135. // 删除对接联系人函数
  1136. function deleteContact(x){
  1137. $(x).parent().parent().remove();
  1138. // tr.parentNode.removeChild(tr);
  1139. initContactInfoListBody();
  1140. }
  1141. // 删除客户销售渠道信息函数
  1142. function deleteChannelSale(x){
  1143. $(x).parent().parent().remove();
  1144. /*var tr = x.parentNode.parentNode;
  1145. tr.parentNode.removeChild(tr);*/
  1146. initChannelSaleInfoListBody();
  1147. }
  1148. //监听对接联系人
  1149. function initContactInfoListBody() {
  1150. var dockedContactInfoList = new Array();
  1151. $("#contactListId").find("tr").each(function (){
  1152. var dockedContactInfo = {};
  1153. dockedContactInfo.contactName = $("[name='contactName']").val();
  1154. dockedContactInfo.contactPhone = $("[name='contactPhone']").val();
  1155. dockedContactInfo.contactType = $("[name='contactType']").val();
  1156. dockedContactInfo.contactEmail = $("[name='contactEmail']").val();
  1157. dockedContactInfoList.push(dockedContactInfo);
  1158. })
  1159. if(dockedContactInfoList.length<2){
  1160. $("#contactTbodyId").show();
  1161. //document.getElementById("contactListId").innerHTML = "<tr><td colspan=\"5\" class=\"td-manage text-c\" >暂时没有联系人信息,请添加!</td></tr>";
  1162. }
  1163. }
  1164. //监听销售渠道
  1165. function initChannelSaleInfoListBody() {
  1166. var channelSaleInfoList = new Array();
  1167. $("#channelSaleListId").find("tr").each(function (){
  1168. var channelSaleInfo = {};
  1169. channelSaleInfo.channelCategory = $("[name='channelCategory']").val();
  1170. channelSaleInfo.channelType = $("[name='channelType']").val();
  1171. channelSaleInfo.channelName = $("[name='channelName']").val();
  1172. channelSaleInfo.promotingProducts = $("[name='promotingProducts']").val();
  1173. channelSaleInfo.supplyPrice = $("[name='supplyPrice']").val();
  1174. channelSaleInfo.accountPeriod = $("[name='accountPeriod']").val();
  1175. channelSaleInfoList.push(channelSaleInfo);
  1176. })
  1177. if(channelSaleInfoList.length<2){
  1178. $("#channelTbodyId").show();
  1179. //document.getElementById("channelSaleListId").innerHTML = "<tr><td colspan=\"7\" class=\"td-manage text-c\" >暂时没有客户销售渠道信息,请添加!</td></tr>";
  1180. }
  1181. }
  1182. /*业务逻辑js控制 end*/
  1183. </script>
  1184. </body>
  1185. </html>