save_customer_info.ftl 66 KB

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