save_customer_info.ftl 55 KB

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