save_customer_info.ftl 61 KB

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