jiaoding_list.html 20 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748
  1. {extend name="public/layout"}
  2. {block name="body"}
  3. <link rel="stylesheet" href="__LAYUI__/layui/css/layui.css" media="all">
  4. <link rel="stylesheet" " href=" /static/css/common.css">
  5. <script src="/static/js/jquery.min.js"></script>
  6. <style>
  7. body {
  8. padding-bottom: 40px;
  9. }
  10. .searchtitlebox {
  11. display: block;
  12. padding: 15px 10px;
  13. border: 1px solid #F0F0F0;
  14. background: #FCFCFC;
  15. margin-top: 5px;
  16. margin-bottom: 10px;
  17. position: relative;
  18. min-width: 800px;
  19. }
  20. .searchbox {
  21. display: block;
  22. margin-top: 8px;
  23. text-align: center;
  24. }
  25. .searchbox input {
  26. display: inline-block;
  27. height: 26px;
  28. line-height: 26px;
  29. padding-left: 3px;
  30. vertical-align: middle;
  31. border: 2px solid #4479ba;
  32. }
  33. body {
  34. font-size: 12px;
  35. font-family: "宋体";
  36. }
  37. .searchbox .searchbtn {
  38. display: inline-block;
  39. float: right;
  40. border: none;
  41. width: 98px;
  42. height: 30px;
  43. color: #fff;
  44. font-size: 14px;
  45. font-weight: bold;
  46. text-align: center;
  47. background: url(__STATIC__/img/icon-sub.png) no-repeat;
  48. cursor: pointer;
  49. vertical-align: middle;
  50. }
  51. .selectbox {
  52. float: left;
  53. }
  54. .leftselect {
  55. float: left;
  56. height: 26px;
  57. line-height: 26px;
  58. }
  59. .selectbox select {
  60. float: left;
  61. height: 26px;
  62. }
  63. .searchtext {
  64. border: 1px solid #ccc;
  65. background: #fff url(__STATIC__/img/icon071402.png) no-repeat;
  66. padding: 1px 2px;
  67. height: 24px;
  68. line-height: 24px;
  69. vertical-align: middle;
  70. text-indent: 3px;
  71. margin-left: 4px;
  72. }
  73. .searchbtn1 {
  74. margin-left: 4px;
  75. cursor: pointer;
  76. color: #000;
  77. background: url(__STATIC__/img/btn_bg.gif) repeat-x;
  78. border: 1px solid #C0C0C0;
  79. padding: 0 12px;
  80. *padding: 0 6px;
  81. height: 26px;
  82. }
  83. .layui-table td,
  84. .layui-table th {
  85. font-size: 12px;
  86. }
  87. .layui-table th {
  88. font-weight: bold;
  89. }
  90. .dingjingorder {
  91. height: 25px;
  92. width: 40px;
  93. background-color: #65c001;
  94. color: #FFF;
  95. text-align: center;
  96. line-height: 25px;
  97. z-index: 100;
  98. display: block;
  99. position: absolute;
  100. top: 1px;
  101. right: 3px;
  102. border-radius: 11px;
  103. font-size: 12px;
  104. }
  105. .addvx {
  106. position: absolute;
  107. top: -5px;
  108. right: 1px;
  109. height: 14px;
  110. line-height: 14px;
  111. font-size: 16px;
  112. color: #666;
  113. font-family: "宋体";
  114. }
  115. .statebox {
  116. width: 40px;
  117. text-align: center;
  118. z-index: 100;
  119. display: block;
  120. position: absolute;
  121. font-size: 12px;
  122. top: -5px;
  123. right: 0px;
  124. border-radius: 0px;
  125. background: #4285f4;
  126. color: #efefef;
  127. height: 20px;
  128. line-height: 20px;
  129. }
  130. .layui-table-cell {
  131. overflow: initial;
  132. }
  133. #customer_detail {
  134. display: block;
  135. width: 435px;
  136. height: 100%;
  137. position: absolute;
  138. top: 0;
  139. left: 0;
  140. }
  141. .rightbox {
  142. display: block;
  143. width: calc(100% - 435px);
  144. margin-left: 435px;
  145. }
  146. .unstatusbox {
  147. display: block;
  148. position: absolute;
  149. top: -5px;
  150. left: 0;
  151. width: 100%;
  152. height: 37px;
  153. background-color: #FF6600;
  154. text-align: center;
  155. color: #FFF;
  156. }
  157. .statusbox {
  158. position: absolute;
  159. top: 0px;
  160. right: 0px;
  161. color: #666;
  162. text-align: right;
  163. z-index: 100;
  164. display: block;
  165. font-size: 12px;
  166. }
  167. .layui-table-view .layui-form-checkbox {
  168. width: 16px;
  169. height: 16px;
  170. line-height: 16px;
  171. padding-right: 0;
  172. }
  173. .layui-table-view .layui-form-checkbox i {
  174. height: 16px;
  175. width: 16px;
  176. font-size: 14px;
  177. }
  178. .novisitlog {
  179. background-color: #9139db !important;
  180. color: #FFF;
  181. }
  182. .novisitlog a {
  183. color: #FFF;
  184. }
  185. .crmsearchlist {
  186. max-height: 760px;
  187. cursor: pointer;
  188. height:auto !important;
  189. }
  190. .tablebox .layui-form.layui-border-box.layui-table-view {
  191. max-height: 760px !important;
  192. height:auto !important;
  193. }
  194. .layui-table-body {
  195. max-height: 670px !important;
  196. height:auto !important;
  197. }
  198. .layui-table-view .layui-table td {
  199. cursor: pointer;
  200. overflow: hidden;
  201. }
  202. .layui-table-tips-c:before{right: 1px !important;top: -3px !important;}
  203. .searchbox .layui-form-select{float:left;width:130px;}
  204. .searchbox input{border:1px solid #e6e6e6 !important;}
  205. .layui-table {
  206. width: 100% !important;
  207. }
  208. ::-webkit-scrollbar {
  209. width: auto;
  210. height: auto;
  211. }
  212. ::-webkit-scrollbar-thumb {
  213. border-radius: 10px;
  214. -webkit-box-shadow: inset 0 0 2px rgba(0, 0, 0, 0.2);
  215. background: #DFDFDF;
  216. }
  217. ::-webkit-scrollbar-track {
  218. -webkit-box-shadow: inset 0 0 2px rgba(0, 0, 0, 0.2);
  219. border-radius: 10px;
  220. background: #f5f5f5;
  221. }
  222. .dingjingorder_title{display: inline-block;width: 73%;overflow: hidden;text-overflow: ellipsis;white-space: nowrap;}
  223. .layui-table-cell {
  224. position: relative;
  225. }
  226. .rightPosition {
  227. position: absolute;
  228. right: 5px;
  229. top: 8px;
  230. }
  231. .warnningStyle {
  232. background-color: #ffe9b3;
  233. color: #000 !important;
  234. }
  235. .dangerStyle {
  236. background-color: #fdafab;
  237. color: #000 !important;
  238. }
  239. .layui-table-hovers {
  240. background-color: transparent !important;
  241. color: #333333 !important;
  242. }
  243. .tipsMessage {
  244. display: inline-block;
  245. margin-left: 15px;
  246. }
  247. .colorBlock1 {
  248. display: inline-block;
  249. background-color: #ffe9b3;
  250. width: 10px;
  251. height: 10px;
  252. }
  253. .colorBlock2 {
  254. display: inline-block;
  255. background-color: #fdafab;
  256. width: 10px;
  257. height: 10px;
  258. margin-left: 8px;
  259. }
  260. </style>
  261. <body class="clearfix">
  262. <iframe id="customer_detail" style="display: none;" src=""></iframe>
  263. <div class="crmbox">
  264. <form class="layui-form">
  265. <div class="searchtitlebox">
  266. <div style="margin-bottom:8px;">您当前的操作 · <b>所有定金客户</b>
  267. <div class="tipsMessage layui-hide">
  268. <div class="colorBlock1"></div>
  269. <span>3至7天未跟进</span>
  270. <div class="colorBlock2"></div>
  271. <span>7天及7天以上未跟进</span>
  272. </div>
  273. </div>
  274. <div class="searchbox clearfix">
  275. <div class="selectbox">
  276. <div class="leftselect">检索:</div>
  277. <select name="source_id" lay-search>
  278. <option value="">==客户来源==</option>
  279. {volist name="soudata" id="vo"}
  280. <option value="{$vo.id}">{$vo.name}</option>
  281. {/volist}
  282. </select>
  283. <select name="customer_type" lay-search>
  284. <option value="">==客户种类==</option>
  285. {volist name="customer_type" id="vo"}
  286. <option value="{$vo.id}">{$vo.name}</option>
  287. {/volist}
  288. </select>
  289. <select name="designer_id" lay-search>
  290. <option value="">==设计师==</option>
  291. {volist name="designers.arr" id="vo"}
  292. <option value="{$vo.id}">{$vo.name}</option>
  293. {/volist}
  294. </select>
  295. <select name="employee_id" lay-search>
  296. <option value="">==客服专员==</option>
  297. {volist name="employee_list" id="vo"}
  298. <option value="{$vo.id}">{$vo.name}</option>
  299. {/volist}
  300. </select>
  301. <select name="level">
  302. <option value="">==客户等级==</option>
  303. {volist name="level" id="vo"}
  304. <option value="{$vo.name}">{$vo.name}</option>
  305. {/volist}
  306. </select>
  307. <select name="times">
  308. <option value="">==时间筛选==</option>
  309. <option value="1">报名时间正序</option>
  310. <option value="2">报名时间倒序</option>
  311. </select>
  312. <input style="width: 160px;" type="text" class="left searchtext" style="border-color: #ccc;" name="visitime" id="visitime" placeholder="选择时间"
  313. readonly />
  314. <input class="left searchtext" type="text" name="keyname" autocomplete="off" placeholder="输入关键字....." title="客户名、小区名其中任意一部分" />
  315. <button class="left searchbtn1" type="button" lay-submit lay-filter="search">搜索</button>
  316. </div>
  317. <button class="searchbtn" type="button">添加新客户</button>
  318. </div>
  319. </div>
  320. <div class="crmsearchlist">
  321. <table lay-filter="crmsearchlist" id="crmsearchlist"></table>
  322. </div>
  323. </form>
  324. </div>
  325. </body>
  326. <script src="__LAYUI__/layui/layui.js"></script>
  327. {/block}{block name="js"}
  328. <script type="text/html" id="crmname">
  329. <span class="dingjingorder_title">{{d.name?d.name:'未知'}}</span>
  330. {{# if(d.jiaoding_time){ }}
  331. {{# if(d.xinjushang == 1){ }}
  332. <span class="dingjingorder">定金</span>
  333. {{# }else{ }}
  334. <span class="dingjingorder">定金</span>
  335. {{# } }}
  336. {{# }else{ }}
  337. {{# } }}
  338. </script>
  339. <script type="text/html" id="empname">
  340. {{# if(d.employee){ }}
  341. <span class="dingjingorder_title">{{d.employee.name}}</span>
  342. {{# if(d.add_wechat_time){ }}
  343. <img src="__STATIC__/img/wxchatad.png" width="14px" class="rightPosition" alt="">
  344. {{# }else{ }}
  345. {{# } }}
  346. {{# }else{ }}
  347. <span style="color: #cccccc;">无</span>
  348. {{# if(d.add_wechat_time){ }}
  349. <img src="__STATIC__/img/wxchatad.png" width="14px" class="rightPosition" alt="">
  350. {{# }else{ }}
  351. {{# } }}
  352. {{# } }}
  353. </script>
  354. <script type="text/html" id="square">
  355. {{# if(d.square>200){ }}
  356. <span style="font-weight: bold;color: #ff6600;">{{d.square}}</span>
  357. {{# }else if(d.square){ }}
  358. <span >{{d.square}}</span>
  359. {{# }else{ }}
  360. {{# } }}
  361. </script>
  362. <script type="text/html" id="labeltpl">
  363. {{# if(d.label){ }}
  364. <span>{{d.label}}</span>
  365. {{# }else{ }}
  366. <span style="color: #cccccc;">无</span>
  367. {{# } }}
  368. </script>
  369. <script type="text/html" id="source">
  370. {{# if(d.source){ }}
  371. <span>{{d.source.source}}</span>
  372. {{# }else{ }}
  373. <span style="color: #cccccc;">无</span>
  374. {{# } }}
  375. </script>
  376. <script type="text/html" id="designer_name">
  377. {{# if(d.designer){ }}
  378. <span>{{d.designer.name}}</span>
  379. {{# }else{ }}
  380. <span style="color: #cccccc;">无</span>
  381. {{# } }}
  382. </script>
  383. <script type="text/html" id="editbox">
  384. {{# if(d.state=="待确认"){ }}
  385. <a style="display:inline-block;" lay-event="edit" href="javascript:void(0);">编辑</a>
  386. {{# }else { }}
  387. <a style="display:inline-block;" lay-event="editstate" href="javascript:void(0);">状态</a><span style="padding:0 4px;">/</span><a lay-event="edit" style="display:inline-block;" href="javascript:void(0);">编辑</a>
  388. {{# } }}
  389. </script>
  390. <script type="text/html" id="community">
  391. {{d.community_name?d.community_name:''}}
  392. {{# if(d.into_owner_group){ }}
  393. <!-- <span class="dingjingorder jieshaokehu">求介绍</span> -->
  394. <img src="__STATIC__/img/jinqun.png" width="15px" class="rightPosition" alt="">
  395. {{# }else{ }}
  396. {{# } }}
  397. </script>
  398. <script type="text/javascript">
  399. var reload = null, resizefun = null;
  400. layui.config({
  401. base: '__LAYUI__/',
  402. urlbase: '/sys'
  403. }).extend({
  404. index: 'lib/index' //主入口模块
  405. }).use(['table', 'laydate'], function () {
  406. var table = layui.table, laydate = layui.laydate,
  407. $ = layui.$;
  408. form = layui.form;
  409. var controlColor = "{$need_follow_tips}";
  410. if (controlColor == 1) {
  411. $(".tipsMessage").removeClass('layui-hide');
  412. }
  413. laydate.render({
  414. elem: '#visitime',
  415. max:0
  416. ,trigger:'click'
  417. ,range: true
  418. });
  419. var field = {};
  420. form.on('submit(search)', function (data) {
  421. var source_id = $('[name=source_id]').val();
  422. var designer_id = $('[name=designer_id]').val();
  423. var employee_id = $('[name=employee_id]').val();
  424. var level = $('[name=level]').val();
  425. var keyname = $('[name=keyname]').val();
  426. var date = $('#visitime').val();
  427. var times = $('[name=times]').val();
  428. var customer_type = $('[name=customer_type]').val();
  429. field['keyname'] = keyname;
  430. field['source_id'] = source_id;
  431. field['designer_id'] = designer_id;
  432. field['employee_id'] = employee_id;
  433. field['level'] = level;
  434. field['date'] = date;
  435. field['times'] = times;
  436. field['customer_type'] = customer_type;
  437. //执行重载
  438. table.reload('crmsearchlist', {
  439. where: field
  440. , page: { curr: 1}
  441. });
  442. });
  443. resizefun = function () {
  444. table.resize('crmsearchlist');
  445. };
  446. reload = function () {
  447. table.reload('crmsearchlist', { where: field }, true);
  448. };
  449. var xinjushang = '{$xinjushang}';
  450. var jd = '定金';
  451. table.render({
  452. elem: '#crmsearchlist',
  453. url: '{:url("community/jiaoding_list")}',
  454. //even: true,
  455. cols: [
  456. [
  457. {
  458. title: '客户姓名',
  459. field: 'name',
  460. // align: 'center',
  461. minWidth:140,
  462. templet: '#crmname',
  463. },
  464. {
  465. title: '小区名称',
  466. field: 'community_name',
  467. // align: 'center',
  468. minWidth: 160,
  469. templet: '#community',
  470. },
  471. {
  472. title: '重要级',
  473. field: 'level',
  474. align: 'center',
  475. minWidth: 60,
  476. },
  477. {
  478. title: '手机号',
  479. field: 'phone',
  480. align: 'center',
  481. minWidth: 100,
  482. },
  483. {
  484. title: '面积',
  485. field: 'square',
  486. align: 'center',
  487. templet: '#square',
  488. minWidth: 80,
  489. },
  490. {
  491. title: '楼栋',
  492. field: 'unit_number',
  493. align: 'center',
  494. minWidth: 80,
  495. },
  496. {
  497. title: '所属员工',
  498. field: 'empname',
  499. align: 'center',
  500. templet: '#empname',
  501. minWidth: 80,
  502. },
  503. {
  504. title: '设计师',
  505. field: 'designer_name',
  506. align: 'center',
  507. templet: '#designer_name',
  508. minWidth: 80,
  509. },
  510. {
  511. title: '客户种类',
  512. field: 'customer_type',
  513. align: 'center',
  514. minWidth: 80,
  515. },
  516. {
  517. title: '客户来源',
  518. field: 'source',
  519. align: 'center',
  520. templet: '#source',
  521. minWidth: 80,
  522. },
  523. {
  524. title: '首次见面',
  525. field: 'fisttime',
  526. align: 'center',
  527. minWidth:150,
  528. },
  529. {
  530. title: '报名时间',
  531. field: 'sign_time',
  532. align: 'center',
  533. minWidth: 100,
  534. },
  535. {
  536. title: jd+'时间',
  537. field: 'jiaoding_time',
  538. align: 'center',
  539. minWidth: 150,
  540. },
  541. {
  542. title: jd+'金额',
  543. field: 'deposit_money',
  544. align: 'center',
  545. minWidth: 80,
  546. //templet: '#status'
  547. },
  548. {
  549. title: jd+'天数',
  550. field: 'jiaoding_day',
  551. align: 'center',
  552. minWidth: 60,
  553. },
  554. {
  555. title: '属性',
  556. field: 'jiaofang',
  557. align: 'center',
  558. minWidth: 100,
  559. },
  560. {
  561. title: '编辑',
  562. field: 'clue_count',
  563. align: 'center',
  564. fixed: 'right',
  565. minWidth: 105,
  566. templet: '#editbox'
  567. },
  568. ]
  569. ],
  570. page: true,
  571. limits: [17],
  572. limit: 17, //每页默认显示的数量,
  573. height: 'full-120',
  574. text: '对不起,加载出现异常!',
  575. done: function (res, curr, count) {
  576. // res.data.forEach(function (item, index) {
  577. // // if(item.visit_log_count==0){
  578. // // $('.layui-table').find('tr[data-index="' + index + '"]').addClass('novisitlog');
  579. // // }
  580. // });
  581. if (controlColor == 1) {
  582. $.each(res.data, function (index, item) {
  583. if (item.no_visit_day >= 3 && item.no_visit_day < 7) {
  584. $('.layui-table').find('tr[data-index="' + index + '"]').addClass('warnningStyle');
  585. } else if (item.no_visit_day >= 7) {
  586. $('.layui-table').find('tr[data-index="' + index + '"]').addClass('dangerStyle');
  587. }
  588. })
  589. $('tr').hover(function(){
  590. let idx = $(this).prop('dataset').index;
  591. if (idx || idx == 0) {
  592. $('.layui-table').find('tr[data-index="' + idx + '"]').addClass('layui-table-hovers');
  593. }
  594. },function(){
  595. let idx = $(this).prop('dataset').index;
  596. if (idx || idx == 0) {
  597. $('.layui-table').find('tr[data-index="' + idx + '"]').removeClass('layui-table-hovers');
  598. }
  599. })
  600. }
  601. }
  602. });
  603. var flag = true;
  604. table.on('tool(crmsearchlist)', function (result) {
  605. let event = result.event;
  606. let row = result.data;
  607. flag = true;
  608. if(event === "edit"){
  609. $.ajax({
  610. url: '{:url("community/checkCustomer")}'
  611. , data: {
  612. id: result.data.id,
  613. }
  614. , type: 'post'
  615. , success: function (rs) {
  616. if(rs.code==0){
  617. flag = false;
  618. window.parent.editcrmsg(result.data.id,'jiaoding_list.html','community')
  619. }else{
  620. alert(rs.msg)
  621. }
  622. }
  623. })
  624. return false;
  625. }else if (event === "editstate") {
  626. $.ajax({
  627. url: '{:url("community/checkCustomer")}'
  628. , data: {
  629. id: result.data.id,
  630. }
  631. , type: 'post'
  632. , success: function (rs) {
  633. if(rs.code==0){
  634. flag = false;
  635. window.parent.statemsg(result.data.id, 'jiaoding_list.html','community');
  636. }else{
  637. alert(rs.msg)
  638. }
  639. }
  640. })
  641. return false;
  642. }
  643. })
  644. $('.crmsearchlist').on('click', 'td', function (e) {
  645. var _event = $(this).find('[lay-event]').attr('lay-event');
  646. var _obj = table.cache.crmsearchlist[parseInt($(this).parent('tr').attr('data-index'))];
  647. switch (_event) {
  648. case 'edit':
  649. break;
  650. case 'editstate':
  651. break;
  652. default:
  653. $.ajax({
  654. url: '{:url("community/checkCustomer")}'
  655. , data: {
  656. id: _obj.id,
  657. }
  658. , type: 'post'
  659. , success: function (rs) {
  660. if(rs.code==0){
  661. flag = true;
  662. $('#customer_detail')[0].src = "/empcrm/community/addlog.html?cid=" + _obj.id;
  663. $('.crmbox').addClass('rightbox');
  664. $('#customer_detail').show();
  665. resizefun();
  666. }else{
  667. alert(rs.msg)
  668. }
  669. }
  670. })
  671. }
  672. return false; //阻止事件冒泡
  673. })
  674. table.on('row(crmsearchlist)', function (obj) {
  675. var data = obj.data;
  676. if (flag) {
  677. $.ajax({
  678. url: '{:url("community/checkCustomer")}'
  679. , data: {
  680. id: data.id,
  681. }
  682. , type: 'post'
  683. , success: function (rs) {
  684. if(rs.code==0){
  685. $('#customer_detail')[0].src="/empcrm/community/addlog.html?cid="+ data.id;
  686. $('.crmbox').addClass('rightbox');
  687. $('#customer_detail').show();
  688. for (let i = 0; i < $('.crmsearchlist .layui-table-view .layui-table-box .layui-table tr').length; i++) {
  689. $($('.crmsearchlist .layui-table-view .layui-table-box .layui-table tr')[i]).removeClass('onclickbg');
  690. }
  691. $(obj.tr).addClass('onclickbg');
  692. resizefun();
  693. }else{
  694. alert(rs.msg)
  695. }
  696. }
  697. })
  698. }
  699. });
  700. $('.searchbtn').click(function () {
  701. window.parent.addcrmmsg('jiaoding_list.html','community')
  702. })
  703. })
  704. function removealog(params) {
  705. $('#customer_detail').hide();
  706. $('.crmbox').removeClass('rightbox');
  707. }
  708. </script>
  709. {/block}