index.html 61 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290
  1. {extend name="public/layout"/} {block name="title"}客户设置{/block} {block name="body"}
  2. <link rel="stylesheet" href="__STATIC__/css/csspc.css">
  3. <link rel="stylesheet" href="__STATIC__/css/font.css">
  4. <style>
  5. * {
  6. box-sizing: initial;
  7. }
  8. .font16 {
  9. font-size: 16px !important;
  10. }
  11. html {
  12. min-width: 1100px;
  13. margin: 0 auto;
  14. width: 100%;
  15. height: 98%;
  16. }
  17. body {
  18. background: #EEEEEE;
  19. height: 98%;
  20. width: 100%;
  21. color: #333;
  22. font-size: 14px !important;
  23. overflow: hidden;
  24. }
  25. .layui-fluid {
  26. display: block;
  27. box-shadow: 0 0 4px 0 #B6CADE;
  28. border-radius: 5px;
  29. margin: 15px;
  30. background-color: #ffffff;
  31. }
  32. .layui-card {
  33. background: #fff;
  34. }
  35. .rst_box_top {
  36. background: #fff;
  37. padding: 0px 0px 1px;
  38. border-radius: 8px;
  39. }
  40. .mdt20 {
  41. margin-top: 20px;
  42. }
  43. .layui-tab-brief>.layui-tab-more li.layui-this:after,
  44. .layui-tab-brief>.layui-tab-title .layui-this:after {
  45. border-bottom: 4px solid #28A1FF !important;
  46. }
  47. .layadmin-iframe {
  48. position: initial;
  49. }
  50. /* .layui-border-box{margin-top:20px !important;} */
  51. .layui-btn-xs,
  52. .layui-btn-xs:hover {
  53. border: 1px solid #249EFB;
  54. background-color: #fff;
  55. color: #249EFB;
  56. padding: 0px 10px;
  57. }
  58. input {
  59. font-size: 14px !important;
  60. }
  61. .layui-btn-danger {
  62. color: #ff5722 !important;
  63. border: 1px solid #ff5722 !important;
  64. }
  65. .layui-tab-item .layui-form-label {
  66. float: none;
  67. width: auto;
  68. padding: 0;
  69. text-align: left;
  70. padding-left: 10px;
  71. border-left: 6px solid #333;
  72. border-radius: 2px;
  73. }
  74. .layui-tab-item .layui-input-block {
  75. margin: 10px 0 0 15px;
  76. }
  77. .layui-btn-primary {
  78. color: #249efb;
  79. border: 1px solid #249efb;
  80. }
  81. .layui-btn-primary:hover {
  82. background-color: #E3F7FF;
  83. color: #249EFB;
  84. }
  85. .xxx {
  86. font-size: 16px;
  87. cursor: pointer;
  88. width: 16px;
  89. vertical-align: -8%;
  90. margin-left: 5px
  91. }
  92. #courtom .layui-btn {
  93. margin: 10px 10px 0 0 !important;
  94. }
  95. .custom {
  96. border: 1px solid #999;
  97. background: #f7f7f7;
  98. color: #999;
  99. }
  100. #addpackage {
  101. margin: 20px 20px 0px 0px;
  102. display: none;
  103. }
  104. .layui-card {
  105. box-shadow: none !important;
  106. }
  107. .layui-tab-content {
  108. overflow-y: auto;
  109. }
  110. /*里面的代码可以根据自己需求去进行更改*/
  111. /* 设置滚动条的样式 */
  112. ::-webkit-scrollbar {
  113. width: 12px;
  114. }
  115. /* 滚动槽 */
  116. ::-webkit-scrollbar-track {
  117. -webkit-box-shadow: inset006pxrgba(0, 0, 0, 0.3);
  118. border-radius: 10px;
  119. }
  120. /* 滚动条滑块 */
  121. ::-webkit-scrollbar-thumb {
  122. border-radius: 10px;
  123. background: rgba(0, 0, 0, 0.1);
  124. -webkit-box-shadow: inset006pxrgba(0, 0, 0, 0.5);
  125. }
  126. ::-webkit-scrollbar-thumb:window-inactive {
  127. background: rgba(255, 0, 0, 0.4);
  128. }
  129. .overflowHidden {
  130. overflow: hidden;
  131. }
  132. .flex {
  133. display: flex;
  134. align-items: center;
  135. }
  136. .layui-form-switch {
  137. margin-top: 0px;
  138. }
  139. .layui-card .layui-tab-brief .layui-tab-content{padding:0 !important;}
  140. #rangeDepart {
  141. width: 600px;
  142. }
  143. #designerEle {
  144. width: 500px;
  145. }
  146. </style>
  147. <body>
  148. <div class="layui-fluid">
  149. <div class="layui-card">
  150. <div class="layui-tab layui-tab-brief" lay-filter="docDemoTabBrief">
  151. <ul class="layui-tab-title rst_box_top ">
  152. <!-- <li data-type="1" class="layui-this font14">自定义</li>
  153. <li data-type="2" class="font14 layui-tjbtn">倾向风格设置</li> -->
  154. <li data-type="3" class="layui-this font14">客户画像设置</li>
  155. <li data-type="4" class="font14 layui-tjbtn">客户跟进设置</li>
  156. <li data-type="5" class="font14 layui-tjbtn">产品设置</li>
  157. <li data-type="6" class="font14 layui-tjbtn">客户保护规则设置</li>
  158. <li data-type="7" class="font14 layui-zdysz">自定义设置</li>
  159. <li data-type="8" class="font14 layui-sjtjsz">数据统计设置</li>
  160. </ul>
  161. <div class="layui-tab-content overflowHidden">
  162. <!-- <div class="layui-tab-item layui-show" style="height:85vh;" id="courtom"> -->
  163. <!-- <div class="rst_box_b">
  164. <a href="javascript:void(0)" class="layui-btn layui-btn-primary" id="cate_add" data-type="source">添加渠道来源</a>
  165. <table id="source" class="mdt20 clear" lay-filter="source"></table>
  166. </div> -->
  167. <!-- </div> -->
  168. <!-- <div class="layui-tab-item" style="height:85vh;">
  169. <div class="rst_box_b_left width100_ ">
  170. <a href="javascript:void(0)" class="layui-btn layui-btn-primary" id="cate_add1"
  171. data-type="decostyle">添加倾向风格</a>
  172. <table id="decostyle" class="mdt20 clear" lay-filter="decostyle"></table>
  173. </div>
  174. </div> -->
  175. <div class="layui-tab-item layui-show" style="height:85vh;">
  176. <div class="rst_box_b_left width100_ height100_" style="overflow: hidden;">
  177. <iframe src="/dashboard/customer_new_portrait/index.html" frameborder="0"
  178. class="layadmin-iframe"></iframe>
  179. </div>
  180. </div>
  181. <div class="layui-tab-item layui-form" style="height:85vh;">
  182. <div class="rst_box_b_left width100_ pdtb15">
  183. <div class="layui-form-item">
  184. <label class="layui-form-label">加微设置: </label>
  185. <div class="layui-input-block">
  186. <input lay-filter="switchTest" type="checkbox" name="addwechat" title="常规加微" {if
  187. condition="$wechat1" } checked {/if} value="常规加微">
  188. <input lay-filter="switchTest" type="checkbox" name="addwechat" title="社群加微" {if
  189. condition="$wechat2" } checked {/if} value="社群加微">
  190. <input lay-filter="switchTest" type="checkbox" name="addwechat" title="历史加微" {if
  191. condition="$wechat3" } checked {/if} value="历史加微">
  192. </div>
  193. </div>
  194. </div>
  195. <div class="rst_box_b_left width100_ pdtb15">
  196. <div class="layui-form-item">
  197. <label class="layui-form-label">量房设置: </label>
  198. <div class="layui-input-block">
  199. <input lay-filter="house" type="checkbox" name="house" title="量房图片" {if
  200. condition="$lf1" } checked {/if} value="量房图片">
  201. <input lay-filter="house" type="checkbox" name="house" title="量房报告图片" {if
  202. condition="$lf2" } checked {/if} value="量房报告图片">
  203. <input lay-filter="house" type="checkbox" name="house" title="客户需求图片" {if
  204. condition="$lf3" } checked {/if} value="客户需求图片">
  205. </div>
  206. </div>
  207. </div>
  208. <div class="rst_box_b_left width100_ pdtb15 layui-form">
  209. <div class="layui-form-item">
  210. <label class="layui-form-label" style="width: 173px;">下次回访时间是否必传: </label>
  211. <div class="layui-input-block">
  212. <input type="radio" name="visit" value=1 title="是" {if condition="$visit_save eq 1"
  213. } checked {/if}>
  214. <input type="radio" name="visit" value=0 title="否" {if condition="$visit_save eq 0"
  215. } checked {/if}>
  216. </div>
  217. </div>
  218. </div>
  219. <div class="rst_box_b_left width100_ pdtb15 layui-form">
  220. <div class="layui-form-item">
  221. <label class="layui-form-label" style="width: 173px;">运营后台资源分配设置:非上传人员不可分配 </label>
  222. <div class="layui-input-block">
  223. <input type="radio" name="resource" value=1 title="是" {if condition="$resource_fp eq 1" } checked {/if}>
  224. <input type="radio" name="resource" value=0 title="否" {if condition="$resource_fp eq 0" } checked {/if}>
  225. </div>
  226. </div>
  227. </div>
  228. <div class="rst_box_b_left width100_ pdtb15 layui-form">
  229. <div class="layui-form-item">
  230. <label class="layui-form-label" style="width: 173px;">最迟加微天数: </label>
  231. <div class="layui-input-block flex" style="position: relative;width:300px;">
  232. <div style="width: 230px;margin-right: 10px;">
  233. <input style="width:230px;" type='number' onchange="RegularInt(this)"
  234. name="value3" placeholder="请输入最迟加微天数" class="layui-input input-indent-box"
  235. min="1" lay-verify="" value={$addWechatDay}>
  236. </div>
  237. <input type="checkbox" name="value33" value="1" {if
  238. condition="$addWechatDaySwitch eq 1" }checked{/if} lay-skin="switch"
  239. lay-text="开启|关闭">
  240. </div>
  241. </div>
  242. </div>
  243. <div class="rst_box_b_left width100_ pdtb15 layui-form">
  244. <div class="layui-form-item">
  245. <label class="layui-form-label">当客户达到</label>
  246. <div style="display: flex;align-items: center;margin-top: 10px;padding-left: 15px;">
  247. <!-- <div class="layui-input-inline layui-input-inline-bottom" style="width: 40%;">
  248. <div id="qrcode-user" style="width: 100%;"></div>
  249. </div> -->
  250. <!-- <input lay-filter="forbidden_state" type="checkbox" name="forbidden_state" title="确认到店" {if
  251. condition="$l1" } checked {/if} value="确认到店">
  252. <input lay-filter="forbidden_state" type="checkbox" name="forbidden_state" title="确认到场" {if
  253. condition="$l2" } checked {/if} value="确认到场">
  254. <input lay-filter="forbidden_state" type="checkbox" name="forbidden_state" title="确认量房" {if
  255. condition="$l3" } checked {/if} value="确认量房"> -->
  256. <input lay-filter="forbidden_state" type="checkbox" name="forbidden_state"
  257. title="{$jiaoding}" {if condition="$l4" } checked {/if} value="交定">
  258. <input lay-filter="forbidden_state" type="checkbox" name="forbidden_state"
  259. title="{$qiandan}" {if condition="$l5" } checked {/if} value="签单">
  260. <span class="plr10">其他人不能跟进</span>
  261. </div>
  262. </div>
  263. </div>
  264. <div class="rst_box_b_left width100_ pdtb15 layui-form">
  265. <div class="layui-form-item">
  266. <label class="layui-form-label">到店确认人</label>
  267. <div style="display: flex;align-items: center;margin-top: 10px;padding-left: 15px;">
  268. <input type="checkbox" name="visit_shop_confirm" title="扫码确认" {if
  269. condition="in_array('scan_the_code', $visitShopConfirm)" } checked {/if}
  270. value="scan_the_code">
  271. <input type="checkbox" name="visit_shop_confirm" title="设计师确认" {if
  272. condition="in_array('designer', $visitShopConfirm)" } checked {/if}
  273. value="designer">
  274. <input type="checkbox" name="visit_shop_confirm" title="销售确认" {if
  275. condition="in_array('salesperson', $visitShopConfirm)" } checked {/if}
  276. value="salesperson">
  277. </div>
  278. </div>
  279. </div>
  280. <div class="rst_box_b_left width100_ pdtb15 layui-form">
  281. <div class="layui-form-item">
  282. <label class="layui-form-label">到场确认人</label>
  283. <div style="display: flex;align-items: center;margin-top: 10px;padding-left: 15px;">
  284. <input type="checkbox" name="visit_site_confirm" title="扫码确认" {if
  285. condition="in_array('scan_the_code', $visitSiteConfirm)" } checked {/if}
  286. value="scan_the_code">
  287. <input type="checkbox" name="visit_site_confirm" title="设计师确认" {if
  288. condition="in_array('designer', $visitSiteConfirm)" } checked {/if}
  289. value="designer">
  290. <input type="checkbox" name="visit_site_confirm" title="销售确认" {if
  291. condition="in_array('salesperson', $visitSiteConfirm)" } checked {/if}
  292. value="salesperson">
  293. </div>
  294. </div>
  295. </div>
  296. <div class="rst_box_b_left width100_ pdtb15 layui-form">
  297. <div class="layui-form-item">
  298. <label class="layui-form-label">量房确认人</label>
  299. <div style="display: flex;align-items: center;margin-top: 10px;padding-left: 15px;">
  300. <input type="checkbox" name="measure_confirm" title="设计师确认" {if
  301. condition="in_array('designer', $measureConfirm)" } checked {/if}
  302. value="designer">
  303. <input type="checkbox" name="measure_confirm" title="销售确认" {if
  304. condition="in_array('salesperson', $measureConfirm)" } checked {/if}
  305. value="salesperson">
  306. </div>
  307. </div>
  308. </div>
  309. <div class="rst_box_b_left width100_ pdtb15 layui-form">
  310. <div class="layui-form-item">
  311. <label class="layui-form-label">定金确认人</label>
  312. <div style="display: flex;align-items: center;margin-top: 10px;padding-left: 15px;">
  313. <input type="checkbox" name="deposit_confirm" title="设计师确认" {if
  314. condition="in_array('designer', $depositConfirm)" } checked {/if}
  315. value="designer">
  316. <input type="checkbox" name="deposit_confirm" title="销售确认" {if
  317. condition="in_array('salesperson', $depositConfirm)" } checked {/if}
  318. value="salesperson">
  319. </div>
  320. </div>
  321. </div>
  322. <div class="rst_box_b_left width100_ pdtb15 layui-form">
  323. <div class="layui-form-item">
  324. <label class="layui-form-label">合同确认人</label>
  325. <div style="display: flex;align-items: center;margin-top: 10px;padding-left: 15px;">
  326. <input type="checkbox" name="sign_confirm" title="设计师确认" {if
  327. condition="in_array('designer', $signConfirm)" } checked {/if} value="designer">
  328. <input type="checkbox" name="sign_confirm" title="销售确认" {if
  329. condition="in_array('salesperson', $signConfirm)" } checked {/if}
  330. value="salesperson">
  331. </div>
  332. </div>
  333. </div>
  334. <div class="rst_box_b_left width100_ pdtb15 layui-form">
  335. <div class="layui-form-item">
  336. <label class="layui-form-label">指派设计师客户数量</label>
  337. <div style="display: flex;align-items: center;margin-top: 10px;padding-left: 15px;">
  338. <input type="number" name="designer_num" title="设计师确认" min="0"
  339. value="{$designerNum??0}" class="layui-input" style="width: 100px;"
  340. oninput="if(value.length>5)value=value.slice(0,8)"
  341. onkeyup="value=zhzs(this.value)">
  342. <span class="plr10" style="color:#ff8080;margin-left: 10px;"> 注:0表示不限制</span>
  343. </div>
  344. </div>
  345. </div>
  346. <div class="rst_box_b_left width100_ pdtb15 layui-form">
  347. <div class="layui-form-item">
  348. <label class="layui-form-label" style="width: 173px;">只显示员工跟进记录: </label>
  349. <div class="layui-input-block flex" style="position: relative;width:300px;">
  350. <input type="checkbox" name="showempvistlog" value="1" {if
  351. condition="$showEmpVistlog eq 1" }checked{/if} lay-skin="switch"
  352. lay-text="开启|关闭">
  353. </div>
  354. </div>
  355. </div>
  356. <div class="rst_box_b_left width100_ pdtb15 layui-form">
  357. <div class="layui-form-item">
  358. <label class="layui-form-label">指派类型设置</label>
  359. <div style="display: flex;align-items: center;margin-top: 10px;padding-left: 15px;">
  360. <input type="checkbox" name="assign_type" title="意向客户指派" {if condition="in_array('yixiang', $assign_type)" } checked {/if} value="yixiang">
  361. <input type="checkbox" name="assign_type" title="量房客户指派" {if condition="in_array('liangfang', $assign_type)" } checked {/if}
  362. value="liangfang">
  363. <input type="checkbox" name="assign_type" title="到店客户指派" {if condition="in_array('daodian', $assign_type)" } checked {/if} value="daodian">
  364. </div>
  365. </div>
  366. </div>
  367. <div class="rst_box_b_left width100_ pdtb15 layui-form">
  368. <div class="layui-form-item">
  369. <label class="layui-form-label">客户分配后是否显示已联系信息</label>
  370. <div style="display: flex;align-items: center;margin-top: 10px;padding-left: 15px;">
  371. <input type="radio" name="visit_reset" value=1 title="是" {if
  372. condition="$visit_reset eq 1" } checked {/if}>
  373. <input type="radio" name="visit_reset" value=0 title="否" {if
  374. condition="$visit_reset eq 0" } checked {/if}>
  375. </div>
  376. </div>
  377. </div>
  378. <div class="rst_box_b_left width100_ pdtb15 layui-form">
  379. <div class="layui-form-item">
  380. <label class="layui-form-label" style="width: 173px;">网销端客户池统计:</label>
  381. <div class="layui-input-block flex" style="position: relative;width:300px;">
  382. <input type="checkbox" name="empcrm_pool_statistics" value="1" {if
  383. condition="$empcrm_pool_statistics eq 1" }checked{/if} lay-skin="switch"
  384. lay-text="开启|关闭">
  385. </div>
  386. </div>
  387. </div>
  388. <div class="rst_box_b_left width100_ pdtb15 layui-form">
  389. <div class="layui-form-item">
  390. <label class="layui-form-label" style="width: 173px;">网销端客户不可重复报备:</label>
  391. <div class="layui-input-block flex" style="position: relative;width:600px;">
  392. <div id="rangeDepart"></div>
  393. </div>
  394. </div>
  395. </div>
  396. <div class="rst_box_b_left width100_ pdtb15 layui-form">
  397. <div class="layui-form-item">
  398. <label class="layui-form-label" style="width: 173px;">管理层消息通知: </label>
  399. <div class="layui-input-block flex" style="position: relative;width:300px;">
  400. <input type="checkbox" name="magnotify" value="1" {if
  401. condition="$magnotify eq 1" }checked{/if} lay-skin="switch"
  402. lay-text="开启|关闭">
  403. </div>
  404. </div>
  405. </div>
  406. <div class="rst_box_b_left width100_ pdtb15 layui-form">
  407. <div class="layui-form-item">
  408. <label class="layui-form-label" style="width: 173px;">设计师设置:</label>
  409. <div class="layui-input-block" style="position: relative;width:800px;">
  410. <div style="font-size: 13px;margin-bottom: 10px;">对于客户处于以下状态确认时必须指派设计师</div>
  411. <div>
  412. <input type="checkbox" name="need_designer" title="量房" {if
  413. condition="in_array('liangfang', $need_designer)" } checked {/if} value="liangfang">
  414. <input type="checkbox" name="need_designer" title="到店" {if
  415. condition="in_array('daodian', $need_designer)" } checked {/if}
  416. value="daodian">
  417. <input type="checkbox" name="need_designer" title="到场" {if
  418. condition="in_array('daochang', $need_designer)" } checked {/if} value="daochang">
  419. <input type="checkbox" name="need_designer" title="定金" {if
  420. condition="in_array('qiandan', $need_designer)" } checked {/if}
  421. value="qiandan">
  422. <input type="checkbox" name="need_designer" title="合同" {if
  423. condition="in_array('zhuandan', $need_designer)" } checked {/if} value="zhuandan">
  424. </div>
  425. </div>
  426. </div>
  427. </div>
  428. <div class="rst_box_b_left width100_ pdtb15 layui-form">
  429. <div class="layui-form-item">
  430. <label class="layui-form-label" style="width: 173px;">设计师能否报备、获取客户: </label>
  431. <div class="layui-input-block flex" style="position: relative;width:300px;">
  432. <input type="checkbox" name="designer_get_customer" value="1" {if
  433. condition="$designer_get_customer eq 1" }checked{/if} lay-skin="switch"
  434. lay-text="开启|关闭">
  435. </div>
  436. </div>
  437. </div>
  438. <div class="rst_box_b_left width100_ pdtb15 layui-form">
  439. <div class="layui-form-item">
  440. <label class="layui-form-label" style="width: 203px;">超过3、7天未跟进客户标记颜色: </label>
  441. <div class="layui-input-block flex" style="position: relative;width:300px;">
  442. <input type="checkbox" name="no_follow_tips" value="1" {if
  443. condition="$no_follow_tips eq 1" }checked{/if} lay-skin="switch"
  444. lay-text="开启|关闭">
  445. </div>
  446. </div>
  447. </div>
  448. <div class="rst_box_b_left width100_ pdtb15 layui-form">
  449. <div class="layui-form-item">
  450. <label class="layui-form-label" style="width: 203px;">是否开启领导层跟进权限<br>(默认:关闭,直属领导可跟进): </label>
  451. <div class="layui-input-block flex" style="position: relative;width:300px;">
  452. <input type="checkbox" name="is_all_manager_oprate_able" value="1" {notempty
  453. name="$is_all_manager_oprate_able"}checked{/notempty} lay-skin="switch"
  454. lay-text="开启|关闭">
  455. </div>
  456. </div>
  457. </div>
  458. <div class="rst_box_b_left width100_ pdtb15 layui-form">
  459. <div class="layui-form-item">
  460. <label class="layui-form-label" style="width: 203px;">有效申请人: </label>
  461. <div class="layui-input-block flex" style="position: relative;width:300px;">
  462. <input type="checkbox" name="valid_check_person" title="销售" {if
  463. condition="in_array('xiaoshou', $valid_check_person)" } checked {/if} value="xiaoshou">
  464. <input type="checkbox" name="valid_check_person" title="设计师" {if
  465. condition="in_array('sheji', $valid_check_person)" } checked {/if}
  466. value="sheji">
  467. </div>
  468. </div>
  469. </div>
  470. <button type="button" class="layui-btn mdt15 mdl15" id="save_all"
  471. style="margin-bottom: 80px;">保存</button>
  472. </div>
  473. <div class="layui-tab-item" style="height:85vh;">
  474. <div class="rst_box_b_left width100_ ">
  475. <a href="javascript:void(0)" class="layui-btn layui-btn-primary" id="addpackage_button"
  476. data-type="package">添加产品</a>
  477. <table id="package" class="mdt20 clear" lay-filter="package"></table>
  478. </div>
  479. </div>
  480. <div class="layui-tab-item" style="height:85vh;">
  481. <div class="rst_box_b_left width100_ height100_">
  482. <iframe src="{:url('customer_setting/subscribe_protected')}" frameborder="0"
  483. class="layadmin-iframe"></iframe>
  484. </div>
  485. </div>
  486. <div class="layui-tab-item" style="height:85vh;">
  487. <div class="rst_box_b_left width100_ height100_" style="overflow: hidden;">
  488. <iframe src="/dashboard/customer_setting/moduleSetting.html" frameborder="0"
  489. class="layadmin-iframe"></iframe>
  490. </div>
  491. </div>
  492. <div class="layui-tab-item" style="height:85vh;">
  493. <div class="rst_box_b_left width100_ height100_" style="overflow: hidden;">
  494. <iframe src="/dashboard/customer_setting/get_statistics.html" frameborder="0"
  495. class="layadmin-iframe"></iframe>
  496. </div>
  497. </div>
  498. </div>
  499. </div>
  500. </div>
  501. </div>
  502. <div id="addpackage">
  503. <form class="layui-form">
  504. <div class="layui-form-item">
  505. <label class="layui-form-label">产品名称 : </label>
  506. <div class="layui-input-block">
  507. <input type="text" name="name" id="name" class="layui-input" autocomplete="off"
  508. oninput="if(value.length>5)value=value.slice(0,30)">
  509. </div>
  510. </div>
  511. <div class="layui-form-item">
  512. <label class="layui-form-label">总价 : </label>
  513. <div class="layui-input-block">
  514. <input type="number" name="total_price" id="total_price" class="layui-input" min="0"
  515. oninput="if(value.length>5)value=value.slice(0,8)" onkeyup="value=zhzs(this.value)">
  516. </div>
  517. </div>
  518. </form>
  519. </div>
  520. </body>
  521. {/block} {block name="js"}
  522. <script type="text/javascript">
  523. //转化正整数
  524. function zhzs(value) {
  525. value = value.replace(/[^\d]/g, '');
  526. if ('' != value) {
  527. value = parseInt(value);
  528. }
  529. return value;
  530. }
  531. function RegularInt(obj) {
  532. obj.value = obj.value.replace(/[^\d]/g, ""); //清除"数字以外的字符
  533. obj.value = obj.value.replace(/^\./g, ""); //验证第一个字符是数字
  534. if (obj.value == 0) {
  535. obj.value = 1;
  536. }
  537. }
  538. </script>
  539. <script type="text/html" id="op">
  540. <a class="layui-btn layui-btn-xs" lay-event="edit">编辑</a>
  541. <a class="layui-btn layui-btn-xs layui-btn-danger" lay-event="del">删除</a>
  542. </script>
  543. <script type="text/html" id="de">
  544. <a class="layui-btn layui-btn-xs" lay-event="edit">编辑</a>
  545. <a class="layui-btn layui-btn-xs layui-btn-danger" lay-event="del">删除</a>
  546. </script>
  547. <script src="__STATIC__/layui/layui/lay/modules/xm-select.js" type="text/javascript" charset="utf-8"></script>
  548. <script>
  549. layui.config({
  550. base: '__LAYUI__/',
  551. urlbase: '/sys'
  552. }).extend({
  553. index: 'lib/index' //主入口模块
  554. }).use(['index', 'form', 'layedit', 'element', 'upload', 'table'], function () {
  555. var form = layui.form,
  556. upload = layui.upload,
  557. element = layui.element,
  558. layedit = layui.layedit;
  559. table = layui.table;
  560. $ = layui.jquery;
  561. var edit = function (type, data) {
  562. var urls = {
  563. source: '{:url("crm/apisourceadding")}',
  564. decostyle: '{:url("material/apidecostyleadding")}',
  565. package: '{:url("customerSetting/editPackage")}'
  566. };
  567. requestAjax(type, urls[type], data)
  568. }
  569. var del = function (type, id) {
  570. var urls = {
  571. source: '{:url("crm/delsource")}',
  572. decostyle: '{:url("crm/deldecostyle")}',
  573. package: '{:url("customerSetting/delPackage")}'
  574. };
  575. requestAjax(type, urls[type], { id: id })
  576. }
  577. $('.rst_box_top li').click(function () {
  578. let type = $(this).prop('dataset').type;
  579. if (type == 3) {
  580. $('.layui-tab-content').addClass('overflowHidden')
  581. } else {
  582. $('.layui-tab-content').removeClass('overflowHidden')
  583. }
  584. })
  585. var requestAjax = function (type, url, data) {
  586. $.post(url, data, function (res) {
  587. if (res.code === 0) {
  588. layer.msg(res.msg, {
  589. icon: 1,
  590. time: 2000
  591. }, function () {
  592. table.reload(type);
  593. });
  594. } else {
  595. layer.msg(res.msg, {
  596. icon: 0,
  597. time: 2000
  598. });
  599. }
  600. })
  601. }
  602. //选项卡
  603. element.on('tab(docDemoTabBrief)', function (data) {
  604. if (data.index == 0) {
  605. } else if (data.index == 1) {
  606. // table.render({
  607. // elem: '#decostyle',
  608. // autoSort: false,
  609. // url: '{:url("crm/decostyle")}?type=0',
  610. // cols: [
  611. // [{
  612. // type: 'numbers',
  613. // field: 'id',
  614. // width: 80,
  615. // title: '序号',
  616. // sort: true
  617. // }, {
  618. // field: 'decostyle',
  619. // title: '风格'
  620. // }, {
  621. // title: '操作',
  622. // width: 240,
  623. // align: 'center',
  624. // fixed: 'right',
  625. // toolbar: '#de'
  626. // }]
  627. // ],
  628. // page: true,
  629. // limit: 30,
  630. // height: 'full-200',
  631. // text: '对不起,加载出现异常!'
  632. // });
  633. // table.on('tool(decostyle)', function (obj) {
  634. // var data = obj.data;
  635. // if (obj.event == 'del') {
  636. // layer.confirm('确定删除该数据么?', { title: ['信息', 'color:#333333;background-color:#D8E6F1;'] }, function (index) {
  637. // del('decostyle', data.id);
  638. // layer.close(index);
  639. // });
  640. // } else {
  641. // layer.prompt({ title: [`编辑倾向风格`, 'color:#333333;background-color:#D8E6F1;'], value: data['decostyle'] }, function (value, index) {
  642. // var sent = {};
  643. // sent['decostyle'] = value;
  644. // sent['id'] = data.id;
  645. // sent['type'] = 0;
  646. // edit('decostyle', sent);
  647. // layer.close(index);
  648. // });
  649. // }
  650. // });
  651. } else if (data.index == 2) {
  652. table.render({
  653. elem: '#package',
  654. autoSort: false,
  655. url: '{:url("customerSetting/package")}',
  656. cols: [
  657. [{
  658. type: 'numbers',
  659. field: 'id',
  660. width: 80,
  661. title: '序号',
  662. sort: true
  663. }, {
  664. field: 'name',
  665. title: '产品名称'
  666. }, {
  667. field: 'total_price',
  668. title: '总价'
  669. }, {
  670. title: '操作',
  671. width: 240,
  672. align: 'center',
  673. fixed: 'right',
  674. toolbar: '#de'
  675. }]
  676. ],
  677. page: true,
  678. limit: 30,
  679. height: 'full-200',
  680. text: '对不起,加载出现异常!'
  681. });
  682. } else if (data.index == 3) {
  683. } else if (data.index == 4) {
  684. }
  685. });
  686. table.render({
  687. elem: '#source',
  688. autoSort: false,
  689. url: '{:url("crm/source")}',
  690. cols: [
  691. [{
  692. type: 'numbers',
  693. field: 'id',
  694. width: 80,
  695. title: '序号',
  696. sort: true
  697. }, {
  698. field: 'source',
  699. title: '渠道来源'
  700. }, {
  701. title: '操作',
  702. width: 240,
  703. align: 'center',
  704. fixed: 'right',
  705. toolbar: '#op'
  706. }]
  707. ],
  708. page: true,
  709. limit: 30,
  710. height: 'full-200',
  711. text: '对不起,加载出现异常!'
  712. });
  713. table.on('tool(source)', function (obj) {
  714. var data = obj.data;
  715. if (obj.event == 'del') {
  716. layer.confirm('确定删除该数据么?', { title: ['信息', 'color:#333333;background-color:#D8E6F1;'] }, function (index) {
  717. del('source', data.id);
  718. layer.close(index);
  719. });
  720. } else {
  721. layer.prompt({ title: [`编辑渠道来源`, 'color:#333333;background-color:#D8E6F1;'], value: data['source'] }, function (value, index) {
  722. var sent = {};
  723. sent['source'] = value;
  724. sent['id'] = data.id;
  725. sent['type'] = 1;
  726. edit('source', sent);
  727. layer.close(index);
  728. });
  729. }
  730. });
  731. table.on('tool(package)', function (obj) {
  732. var data = obj.data;
  733. if (obj.event == 'del') {
  734. layer.confirm('确定删除该数据么?', { title: ['信息', 'color:#333333;background-color:#D8E6F1;'] }, function (index) {
  735. del('package', data.id);
  736. layer.close(index);
  737. });
  738. } else {
  739. $('#addpackage').find('#name').val(data.name);
  740. $('#addpackage').find('#total_price').val(data.total_price);
  741. layer.open({
  742. type: 1,
  743. title: ['编辑产品', 'color:#333333;background-color:#D8E6F1;'],
  744. content: $('#addpackage'),
  745. btn: ['保存'],
  746. yes: function (index, layero) {
  747. let form = $(layero).find('form')[0];
  748. let formData = new FormData(form);
  749. let name = formData.get('name');
  750. let value = formData.get('total_price');
  751. if (name.trim().length == 0) {
  752. layer.msg('请输入产品名'); return;
  753. }
  754. if (value <= 0) {
  755. layer.msg('请输入产品总价'); return;
  756. }
  757. edit('package', { id: data.id, name, value });
  758. $('#addpackage').find('#name').val("");
  759. $('#addpackage').find('#total_price').val("");
  760. layer.close(index);
  761. }
  762. });
  763. }
  764. });
  765. //保存加微设置
  766. $('#wechat_save').click(function () {
  767. var value = [];
  768. $("input:checkbox[name='addwechat']:checked").each(function () {
  769. value.push($(this).val());
  770. });
  771. if (value.length == 0) {
  772. layer.msg('请至少选择一个加微类型', { anim: 0, time: 800 });
  773. return false;
  774. }
  775. $.ajax({
  776. type: "post",
  777. url: '{:url("customerSetting/setting")}',
  778. data: { type: 'customerWechatSetting', arr: value },
  779. success: function (res) {
  780. layer.msg(res.msg, { anim: 0, time: 800 });
  781. }
  782. })
  783. })
  784. //保存量房设置
  785. $('#house_save').click(function () {
  786. var value = [];
  787. $("input:checkbox[name='house']:checked").each(function () {
  788. value.push($(this).val());
  789. });
  790. if (value.length == 0) {
  791. layer.msg('请至少选择一个量房图片类型', { anim: 0, time: 800 });
  792. return false;
  793. }
  794. $.ajax({
  795. type: "post",
  796. url: '{:url("customerSetting/setting")}',
  797. data: { type: 'customerLfSetting', arr: value },
  798. success: function (res) {
  799. layer.msg(res.msg, { anim: 0, time: 800 });
  800. }
  801. })
  802. })
  803. //下次回访时间是否必传
  804. $('#visit_save').click(function () {
  805. var value = $("input[name='visit']:checked").val();
  806. $.ajax({
  807. type: "post",
  808. url: '{:url("customerSetting/setting")}',
  809. data: { type: 'nextVisitTimeIsOk', value: value },
  810. success: function (res) {
  811. layer.msg(res.msg, { anim: 0, time: 800 });
  812. }
  813. })
  814. })
  815. //合并保存
  816. $('#save_all').click(function () {
  817. //加微设置
  818. var value = [];
  819. $("input:checkbox[name='addwechat']:checked").each(function () {
  820. value.push($(this).val());
  821. });
  822. if (value.length == 0) {
  823. layer.msg('请至少选择一个加微类型', { anim: 0, time: 800 });
  824. return false;
  825. }
  826. //量房设置
  827. var value1 = [];
  828. $("input:checkbox[name='house']:checked").each(function () {
  829. value1.push($(this).val());
  830. });
  831. if (value1.length == 0) {
  832. layer.msg('请至少选择一个量房图片类型', { anim: 0, time: 800 });
  833. return false;
  834. }
  835. //下次回访时间是否必传
  836. var value2 = $("input[name='visit']:checked").val();
  837. var resource_fp = $("input[name='resource']:checked").val();
  838. var value3 = $("input[name='value3']").val();//最迟加微天数
  839. var value33 = $("input[name='value33']:checked").val() ? 1 : 0;//最迟加微天数开关
  840. // let value4 = xmSelectElement.getValue('valueStr');
  841. // var value4 = $("input[name='forbidden_state']:checked").val();
  842. var value4 = [];
  843. $("input:checkbox[name='forbidden_state']:checked").each(function () {
  844. value4.push($(this).val());
  845. });
  846. // 确认
  847. let visitShopConfirm = []; $(':checkbox[name="visit_shop_confirm"]:checked').each(function () {
  848. visitShopConfirm.push($(this).val());
  849. });
  850. let visitSiteConfirm = []; $(':checkbox[name="visit_site_confirm"]:checked').each(function () {
  851. visitSiteConfirm.push($(this).val());
  852. });
  853. let measureConfirm = []; $(':checkbox[name="measure_confirm"]:checked').each(function () {
  854. measureConfirm.push($(this).val());
  855. });
  856. let depositConfirm = []; $(':checkbox[name="deposit_confirm"]:checked').each(function () {
  857. depositConfirm.push($(this).val());
  858. });
  859. let signConfirm = []; $(':checkbox[name="sign_confirm"]:checked').each(function () {
  860. signConfirm.push($(this).val());
  861. });
  862. let need_designer = []; $(':checkbox[name="need_designer"]:checked').each(function () {
  863. need_designer.push($(this).val());
  864. });
  865. let designerNum = $('input[name="designer_num"]').val();
  866. let showEmpVistlog = $("input[name='showempvistlog']:checked").val() ? 1 : 0;//只展示员工跟进记录开关
  867. let assign_type = []; $(':checkbox[name="assign_type"]:checked').each(function () {
  868. assign_type.push($(this).val());
  869. });
  870. var visit_reset = $("input[name='visit_reset']:checked").val();
  871. let empcrm_pool_statistics = $("input[name='empcrm_pool_statistics']:checked").val() ? 1 : 0;
  872. let empcrm_pool = departTree.getValue();
  873. let empcrm_customer_repeat = [];
  874. $(empcrm_pool).each(function (k,v) {
  875. empcrm_customer_repeat.push(v.id);
  876. });
  877. let magnotify = $("input[name='magnotify']:checked").val() ? 1 : 0;//管理层通知开关
  878. let designer_get_customer = $("input[name='designer_get_customer']:checked").val() ? 1 : 0;//设计师能否获取客户
  879. let no_follow_tips = $("input[name='no_follow_tips']:checked").val() ? 1 : 0;//管理层通知开关
  880. let is_all_manager_oprate_able = $("input[name='is_all_manager_oprate_able']:checked").val() ? 1 : 0;
  881. let valid_check_person = []; $(':checkbox[name="valid_check_person"]:checked').each(function () {
  882. valid_check_person.push($(this).val());
  883. });
  884. //保存
  885. $.ajax({
  886. type: "post",
  887. url: '{:url("customerSetting/setting")}',
  888. data: { value: value, value1: value1, value2: value2, value3: value3, value4: value4, value33: value33, visitShopConfirm, visitSiteConfirm, measureConfirm, depositConfirm, signConfirm, designerNum, showEmpVistlog, assign_type,resource_fp,visit_reset,empcrm_pool_statistics,empcrm_customer_repeat,magnotify,need_designer,designer_get_customer:designer_get_customer,no_follow_tips: no_follow_tips,is_all_manager_oprate_able,valid_check_person},
  889. success: function (res) {
  890. layer.msg(res.msg, { anim: 0, time: 800 });
  891. }
  892. })
  893. });
  894. let departarr=null;
  895. var departTree = xmSelect.render({
  896. el: "#rangeDepart",
  897. name: 'org_id',
  898. autoRow: true,
  899. filterable: true,
  900. tips: '请选择',
  901. checkbox: true,
  902. tree: {
  903. show: true,
  904. showFolderIcon: true,
  905. showLine: true,
  906. indent: 20,
  907. expandedKeys: [-3],
  908. //是否严格遵守父子模式
  909. strict: false,
  910. },
  911. height: "200px",
  912. data: [],
  913. on:function(data){
  914. if(data.isAdd){
  915. for(let i in departarr){
  916. if(departarr[i].id==data.change[0].id){
  917. let arr=[];
  918. for(let j in departarr[i].children){
  919. let arr1=mpersonfun(departarr[i].children[j],data.arr,data.change);
  920. if(!!arr1&&arr1.length>0){
  921. data.arr=data.arr.concat(arr1);
  922. }
  923. let flag=false;
  924. for(let t in data.arr){
  925. if(data.arr[t].id==departarr[i].children[j].id){
  926. flag=true;
  927. }
  928. }
  929. if(!flag){
  930. arr.push(departarr[i].children[j]);
  931. }
  932. }
  933. data.arr=data.arr.concat(arr);
  934. return data.arr;
  935. }else{
  936. let arr1=personfun(departarr[i],data.arr,data.change);
  937. data.arr=data.arr.concat(arr1);
  938. return data.arr;
  939. }
  940. }
  941. }
  942. }
  943. });
  944. function personfun(obj,warr,obj1){
  945. let arr=obj.children;
  946. if(arr.length==0||!arr){
  947. return [];
  948. }
  949. let arr1=[];
  950. for(let i in arr){
  951. if(arr[i].id==obj1[0].id){
  952. for(let j in arr[i].children){
  953. let arr2=mpersonfun(arr[i].children[j],warr,obj1);
  954. if(!!arr2&&arr2.length>0){
  955. arr1=arr1.concat(arr2);
  956. }
  957. let flag=false;
  958. for(let t in warr){
  959. if(warr[t].id==arr[i].children[j].id){
  960. flag=true;
  961. }
  962. }
  963. if(!flag){
  964. arr1.push(arr[i].children[j]);
  965. }
  966. }
  967. return arr1;
  968. }else{
  969. let arr3=personfun(arr[i],warr,obj1);
  970. arr1=arr1.concat(arr3);
  971. }
  972. }
  973. return arr1;
  974. }
  975. function mpersonfun(obj,warr,obj1){
  976. let arr=obj.children;
  977. if(arr.length==0||!arr){
  978. return [];
  979. }
  980. let arr1=[];
  981. for(let i in arr){
  982. let flag1=false;
  983. for(let t in warr){
  984. if(warr[t].id==arr[i].id){
  985. flag1=true;
  986. }
  987. }
  988. if(!flag1){
  989. arr1.push(arr[i]);
  990. }
  991. for(let j in arr[i].children){
  992. let arr2=mpersonfun(arr[i].children[j],warr,obj1);
  993. if(!!arr2&&arr2.length>0){
  994. arr1=arr1.concat(arr2);
  995. }
  996. let flag=false;
  997. for(let t in warr){
  998. if(warr[t].id==arr[i].children[j].id){
  999. flag=true;
  1000. }
  1001. }
  1002. if(!flag){
  1003. arr1.push(arr[i].children[j]);
  1004. }
  1005. }
  1006. }
  1007. return arr1;
  1008. }
  1009. $.ajax({
  1010. url: '{:url("customer_setting/get_person")}',
  1011. type: "post",
  1012. data: {},
  1013. success: function(res) {
  1014. departarr=res;
  1015. departTree.update({data:res})
  1016. }
  1017. })
  1018. //添加来源
  1019. $('#cate_add').click(function () {
  1020. var type = 'source';
  1021. layer.prompt({ title: ['添加渠道来源', 'color:#333333;background-color:#D8E6F1;'], }, function (value, index) {
  1022. var data = {};
  1023. data[type] = value;
  1024. data['type'] = 1;
  1025. edit(type, data);
  1026. layer.close(index);
  1027. });
  1028. });
  1029. //添加风格
  1030. $('#cate_add1').click(function () {
  1031. var type = 'decostyle';
  1032. layer.prompt({ title: ['添加倾向风格', 'color:#333333;background-color:#D8E6F1;'], }, function (value, index) {
  1033. var data = {};
  1034. data[type] = value;
  1035. data['type'] = 0;
  1036. edit(type, data);
  1037. layer.close(index);
  1038. });
  1039. });
  1040. $('#addpackage_button').click(function () {
  1041. layer.open({
  1042. type: 1,
  1043. title: ['添加产品', 'color:#333333;background-color:#D8E6F1;'],
  1044. content: $('#addpackage'),
  1045. btn: ['保存'],
  1046. yes: function (index, layero) {
  1047. let form = $(layero).find('form')[0];
  1048. let formData = new FormData(form)
  1049. let name = formData.get('name');
  1050. let value = formData.get('total_price');
  1051. if (name.trim().length == 0) {
  1052. layer.msg('请输入产品名'); return;
  1053. }
  1054. if (value <= 0) {
  1055. layer.msg('请输入产品总价'); return;
  1056. }
  1057. edit('package', { name, value });
  1058. layer.close(index);
  1059. }
  1060. });
  1061. });
  1062. //自定义客户信息初始化
  1063. var action = {
  1064. setting: function () {
  1065. $.get("{:url('customerSetting/getCustom')}", function (res) {
  1066. if (res.code == 0) {
  1067. var html = '';
  1068. for (var key in res.data) {
  1069. const title = res.data[key].title;
  1070. const arr = res.data[key].arr;
  1071. html += '<div class="rst_box_b_left width100_ pdtb15">';
  1072. html += '<div class="layui-form-item">';
  1073. html += '<label class="layui-form-label">' + title + '设置: </label>';
  1074. html += '<div class="layui-input-block ' + key + 'add">';
  1075. html += '<button class="layui-btn layui-btn-primary onclickadd" data-type="add" data-cate="' + key + '">添加' + title + '</button>';
  1076. for (let i = 0; i < arr.length; i++) {
  1077. const element = arr[i];
  1078. html += '<button class="layui-btn custom layui-btn-primary ' + key + i + 'del"><span class="edit_html ' + key + i + '" data-key=' + i + ' data-cate="' + key + '">' + element + '</span><img class="deletebtns xxx ids" data-cate="' + key + '" data-del="' + key + i + '" src="__STATIC__/img/xxx.png"/></button>';
  1079. }
  1080. html += '</div>';
  1081. html += '</div>';
  1082. html += '</div>';
  1083. }
  1084. $('#courtom').html(html);
  1085. $('.edit_html').on('click', function () {
  1086. var cate = $(this).data('cate');
  1087. var value = $(this).html();
  1088. var key = $(this).data('key');
  1089. action.edit(cate, value, key);
  1090. })
  1091. $('.deletebtns').on('click', function () {
  1092. var del = $(this).data('del');
  1093. var cate = $(this).data('cate');
  1094. action.delete(del, cate);
  1095. })
  1096. $('.onclickadd').on('click', function () {
  1097. var cate = $(this).data('cate');
  1098. var title = $(this).html();
  1099. action.add(cate, title);
  1100. })
  1101. }
  1102. });
  1103. },
  1104. //添加自定义内容
  1105. add: function (cate, title) {
  1106. layer.prompt({
  1107. formType: 0,
  1108. title: title,
  1109. // area: ['500px', '150px'],
  1110. btnAlign: 'c',
  1111. yes: function (index, layero) {
  1112. // 获取文本框输入的值
  1113. var value = layero.find(".layui-layer-input").val();
  1114. if (value) {
  1115. $.post("{:url('customerSetting/addCustom')}", { type: cate, key: value }, function (res) {
  1116. if (res.code == 0) {
  1117. layer.msg(res.data, {
  1118. anim: 0, time: 1000, icon: 6,
  1119. }, function () {
  1120. layer.close(index); //再执行关闭
  1121. });
  1122. var i = parseInt(Math.random() * 999999999);
  1123. var class_id1 = 'edit_html' + i;
  1124. var class_id2 = 'deletebtns' + i;
  1125. var html = '<button class="layui-btn custom layui-btn-primary ' + cate + i + 'del"><span class="' + class_id1 + ' ' + cate + i + '" data-cate="' + cate + '" data-key=' + i + '>' + value + '</span><img class="' + class_id2 + ' xxx ids" data-cate="' + cate + '" data-del="' + cate + i + '" src="__STATIC__/img/xxx.png"/></button>';
  1126. $('.' + cate + 'add').append(html);
  1127. $('.' + class_id1).on('click', function () {
  1128. var cate = $(this).data('cate');
  1129. var value = $(this).html();
  1130. var key = $(this).data('key');
  1131. action.edit(cate, value, key);
  1132. })
  1133. $('.' + class_id2).on('click', function () {
  1134. var del = $(this).data('del');
  1135. var cate = $(this).data('cate');
  1136. action.delete(del, cate);
  1137. })
  1138. } else {
  1139. layer.msg(res.data);
  1140. }
  1141. });
  1142. } else {
  1143. layer.msg('请输入内容');
  1144. }
  1145. }
  1146. });
  1147. },
  1148. //编辑自定义内容
  1149. edit: function (type, val, key) {
  1150. layer.prompt({
  1151. formType: 0,
  1152. title: '编辑',
  1153. // area: ['500px', '150px'],
  1154. value: val,
  1155. btnAlign: 'c',
  1156. yes: function (index, layero) {
  1157. // 获取文本框输入的值
  1158. var value = layero.find(".layui-layer-input").val();
  1159. if (value) {
  1160. $.post("{:url('customerSetting/editCustom')}", { type: type, key: value, y_key: val }, function (res) {
  1161. if (res.code == 0) {
  1162. layer.msg(res.data, {
  1163. anim: 0, time: 1000, icon: 6,
  1164. }, function () {
  1165. layer.close(index); //再执行关闭
  1166. });
  1167. $('.' + type + key).html(value);
  1168. } else {
  1169. layer.msg(res.data);
  1170. }
  1171. });
  1172. } else {
  1173. layer.msg('请输入内容');
  1174. }
  1175. }
  1176. });
  1177. },
  1178. //删除
  1179. delete: function (id, cate) {
  1180. layer.confirm('确定删除?', { title: ['信息', 'color:#333333;background-color:#D8E6F1;'], }, function (index) {
  1181. var val = $('.' + id).html();
  1182. $.post("{:url('customerSetting/deleteCustom')}", { type: cate, key: val }, function (res) {
  1183. if (res.code == 0) {
  1184. layer.msg(res.data, {
  1185. anim: 0, time: 1000, icon: 6,
  1186. }, function () {
  1187. layer.close(index); //再执行关闭
  1188. });
  1189. $('.' + id + 'del').remove();
  1190. } else {
  1191. layer.msg(res.data);
  1192. }
  1193. });
  1194. });
  1195. }
  1196. }
  1197. action.setting();
  1198. $('.onclick').on('click', function () {
  1199. var type = $(this).data('type');
  1200. action[type] ? action[type].call(this) : '';
  1201. });
  1202. })
  1203. </script>
  1204. {/block}