save_customer_info.ftl 65 KB

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