achment_list.html 15 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597
  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. }
  32. body {
  33. font-size: 12px;
  34. font-family: "宋体";
  35. }
  36. .selectbox {
  37. float: left;
  38. }
  39. .leftselect {
  40. float: left;
  41. height: 26px;
  42. line-height: 26px;
  43. }
  44. .selectbox select {
  45. float: left;
  46. height: 26px;
  47. }
  48. .searchtext {
  49. border: 1px solid #ccc;
  50. background: #fff url(__STATIC__/img/icon071402.png) no-repeat;
  51. padding: 1px 2px;
  52. height: 24px;
  53. line-height: 24px;
  54. vertical-align: middle;
  55. text-indent: 3px;
  56. margin-left: 4px;
  57. }
  58. .searchbtn1 {
  59. margin-left: 4px;
  60. cursor: pointer;
  61. color: #000;
  62. background: url(__STATIC__/img/btn_bg.gif) repeat-x;
  63. border: 1px solid #C0C0C0;
  64. padding: 0 12px;
  65. *padding: 0 6px;
  66. height: 26px;
  67. }
  68. .layui-table td,
  69. .layui-table th {
  70. font-size: 12px;
  71. }
  72. .layui-table th {
  73. font-weight: bold;
  74. }
  75. .dingjingorder {
  76. height: 25px;
  77. width: 40px;
  78. background-color: #65c001;
  79. color: #FFF;
  80. text-align: center;
  81. line-height: 25px;
  82. z-index: 100;
  83. display: block;
  84. position: absolute;
  85. top: 1px;
  86. right: 3px;
  87. border-radius: 11px;
  88. font-size: 12px;
  89. }
  90. .addvx {
  91. position: absolute;
  92. top: -5px;
  93. right: 1px;
  94. height: 14px;
  95. line-height: 14px;
  96. font-size: 16px;
  97. color: #666;
  98. font-family: "宋体";
  99. }
  100. .statebox {
  101. width: 40px;
  102. text-align: center;
  103. z-index: 100;
  104. display: block;
  105. position: absolute;
  106. font-size: 12px;
  107. top: -5px;
  108. right: 0px;
  109. border-radius: 0px;
  110. background: #4285f4;
  111. color: #efefef;
  112. height: 20px;
  113. line-height: 20px;
  114. }
  115. .layui-table-cell {
  116. overflow: initial;
  117. }
  118. #customer_detail {
  119. display: block;
  120. width: 435px;
  121. height: 100%;
  122. position: absolute;
  123. top: 0;
  124. left: 0;
  125. }
  126. .rightbox {
  127. display: block;
  128. width: calc(100% - 435px);
  129. margin-left: 435px;
  130. }
  131. .unstatusbox {
  132. display: block;
  133. position: absolute;
  134. top: -5px;
  135. left: 0;
  136. width: 100%;
  137. height: 37px;
  138. background-color: #FF6600;
  139. text-align: center;
  140. color: #FFF;
  141. }
  142. .statusbox {
  143. position: absolute;
  144. top: 0px;
  145. right: 0px;
  146. color: #666;
  147. text-align: right;
  148. z-index: 100;
  149. display: block;
  150. font-size: 12px;
  151. }
  152. .layui-table-view .layui-form-checkbox {
  153. width: 16px;
  154. height: 16px;
  155. line-height: 16px;
  156. padding-right: 0;
  157. }
  158. .layui-table-view .layui-form-checkbox i {
  159. height: 16px;
  160. width: 16px;
  161. font-size: 14px;
  162. }
  163. .novisitlog {
  164. background-color: #9139db !important;
  165. color: #FFF;
  166. }
  167. .novisitlog a {
  168. color: #FFF;
  169. }
  170. .crmsearchlist {
  171. max-height: 760px;
  172. cursor: pointer;
  173. }
  174. .tablebox .layui-form.layui-border-box.layui-table-view {
  175. max-height: 760px !important;
  176. height: auto !important;
  177. }
  178. .searchbox .layui-form-select{float:left;width:130px;}
  179. .searchbox input{border:1px solid #e6e6e6 !important;}
  180. .layui-table-body {
  181. max-height: 670px !important;
  182. height: auto !important;
  183. }
  184. .layui-table-view .layui-table td {
  185. cursor: pointer;
  186. overflow: hidden;
  187. }
  188. .layui-form-checked {
  189. background-color: #37AF6E;
  190. }
  191. .layui-table-view .layui-form-checked i {
  192. color: #fff;
  193. }
  194. .rightPosition {
  195. position: absolute;
  196. right: 5px;
  197. top: 8px;
  198. }
  199. </style>
  200. <body class="clearfix">
  201. <iframe id="customer_detail" style="display: none;" src=""></iframe>
  202. <div class="crmbox">
  203. <form class="layui-form">
  204. <div class="searchtitlebox">
  205. <div style="margin-bottom:8px;">您当前的操作 · <b>所有合同客户</b></div>
  206. <div class="searchbox clearfix">
  207. <div class="selectbox">
  208. <div class="leftselect">检索:</div>
  209. <select name="source_id" lay-search>
  210. <option value="">==来源账户==</option>
  211. {volist name="soudata" id="vo"}
  212. <option value="{$vo.id}">{$vo.name}</option>
  213. {/volist}
  214. </select>
  215. <select name="customer_type" lay-search>
  216. <option value="">==客户种类==</option>
  217. {volist name="customer_type" id="vo"}
  218. <option value="{$vo.id}">{$vo.name}</option>
  219. {/volist}
  220. </select>
  221. <select name="designer_id" lay-search>
  222. <option value="">==设计师==</option>
  223. {volist name="designers.arr" id="vo"}
  224. <option value="{$vo.id}">{$vo.name}</option>
  225. {/volist}
  226. </select>
  227. <select name="employee_id" lay-search>
  228. <option value="">==客服专员==</option>
  229. {volist name="employee_list" id="vo"}
  230. <option value="{$vo.id}">{$vo.name}</option>
  231. {/volist}
  232. </select>
  233. <select name="level" lay-search>
  234. <option value="">==客户等级==</option>
  235. {volist name="level" id="vo"}
  236. <option value="{$vo.name}">{$vo.name}</option>
  237. {/volist}
  238. </select>
  239. <input style="width:160px" type="text" class="left searchtext" autocomplete="off" style="border-color: #ccc;" name="visitime" id="visitime" placeholder="选择合同时间"
  240. readonly />
  241. <input class="left searchtext" type="text" name="keyname" placeholder="输入关键字....." autocomplete="off" title="客户名、小区名其中任意一部分" />
  242. <button class="left searchbtn1" type="button" lay-submit lay-filter="search">搜索</button>
  243. </div>
  244. </div>
  245. </div>
  246. <div class="crmsearchlist">
  247. <table lay-filter="crmsearchlist" id="crmsearchlist"></table>
  248. </div>
  249. </form>
  250. </div>
  251. </body>
  252. <script src="__LAYUI__/layui/layui.js"></script>
  253. {/block}{block name="js"}
  254. <script type="text/html" id="square">
  255. {{# if(d.square>200){ }}
  256. <span style="font-weight: bold;color: #ff6600;">{{d.square}}</span>
  257. {{# }else if(d.square){ }}
  258. <span >{{d.square}}</span>
  259. {{# }else{ }}
  260. {{# } }}
  261. </script>
  262. <script type="text/html" id="designer_name">
  263. {{# if(d.designer){ }}
  264. <span>{{d.designer.name}}</span>
  265. {{# }else{ }}
  266. <span style="color: #cccccc;">无</span>
  267. {{# } }}
  268. </script>
  269. <script type="text/html" id="empname">
  270. {{# if(d.employee){ }}
  271. <span>{{d.employee.name}}</span>
  272. {{# if(d.add_wechat_time){ }}
  273. <img src="__STATIC__/img/wxchatad.png" width="14px" class="rightPosition" alt="">
  274. {{# }else{ }}
  275. {{# } }}
  276. {{# }else{ }}
  277. <span style="color: #cccccc;">无</span>
  278. {{# if(d.add_wechat_time){ }}
  279. <img src="__STATIC__/img/wxchatad.png" width="14px" class="rightPosition" alt="">
  280. {{# }else{ }}
  281. {{# } }}
  282. {{# } }}
  283. </script>
  284. <script type="text/html" id="source">
  285. {{# if(d.source){ }}
  286. <span>{{d.source.source}}</span>
  287. {{# }else{ }}
  288. <span style="color: #cccccc;">无</span>
  289. {{# } }}
  290. </script>
  291. <script type="text/html" id="sign">
  292. {{# if(d.sign){ }}
  293. <span>{{d.sign.confirm_date}}</span>
  294. {{# }else{ }}
  295. <span style="color: #cccccc;">无</span>
  296. {{# } }}
  297. </script>
  298. <script type="text/html" id="other_money">
  299. {{# if(d.sign.other_money){ }}
  300. <span>{{d.sign.other_money}}</span>
  301. {{# }else{ }}
  302. <span style="color: #cccccc;">0</span>
  303. {{# } }}
  304. </script>
  305. <script type="text/html" id="community">
  306. {{d.community_name?d.community_name:''}}
  307. {{# if(d.into_owner_group){ }}
  308. <!-- <span class="dingjingorder jieshaokehu">求介绍</span> -->
  309. <img src="__STATIC__/img/jinqun.png" width="15px" class="rightPosition" alt="">
  310. {{# }else{ }}
  311. {{# } }}
  312. </script>
  313. <script type="text/html" id="editbox">
  314. <a style="display:inline-block;" lay-event="edit" href="javascript:void(0);">更新</a>
  315. </script>
  316. <script type="text/javascript">
  317. var reload=null, resizefun=null;
  318. layui.config({
  319. base: '__LAYUI__/',
  320. urlbase: '/sys'
  321. }).extend({
  322. index: 'lib/index' //主入口模块
  323. }).use(['table','laydate'], function () {
  324. var table = layui.table, laydate = layui.laydate,
  325. $ = layui.$;
  326. form = layui.form;
  327. var field = {};
  328. form.on('submit(search)', function (data) {
  329. var source_id = $('[name=source_id]').val();
  330. var designer_id = $('[name=designer_id]').val();
  331. var employee_id = $('[name=employee_id]').val();
  332. var level = $('[name=level]').val();
  333. var keyname = $('[name=keyname]').val();
  334. var date = $('#visitime').val();
  335. var customer_type = $('[name=customer_type]').val();
  336. field['keyname'] = keyname;
  337. field['source_id'] = source_id;
  338. field['designer_id'] = designer_id;
  339. field['employee_id'] = employee_id;
  340. field['level'] = level;
  341. field['date'] = date;
  342. field['customer_type'] = customer_type;
  343. //执行重载
  344. table.reload('crmsearchlist', {
  345. where: field
  346. , page: { curr: 1}
  347. });
  348. });
  349. laydate.render({
  350. elem: '#visitime',
  351. max:0
  352. ,trigger:'click'
  353. ,range: true
  354. });
  355. table.render({
  356. elem: '#crmsearchlist',
  357. url: '{:url("community/achment_list")}',
  358. //even: true,
  359. cols: [
  360. [
  361. {
  362. title: '客户姓名',
  363. field: 'name',
  364. align: 'center'
  365. },
  366. {
  367. title: '小区名称',
  368. field: 'community_name',
  369. align: 'center',
  370. templet: '#community',
  371. width:160,
  372. },
  373. {
  374. title: '面积',
  375. field: 'square',
  376. align: 'center',
  377. templet: '#square'
  378. },
  379. {
  380. title: '楼栋',
  381. field: 'unit_number',
  382. align: 'center'
  383. },
  384. {
  385. title: '所属员工',
  386. field: 'empname',
  387. align: 'center',
  388. templet: '#empname'
  389. },
  390. {
  391. title: '设计师',
  392. field: 'designer_name',
  393. align: 'center',
  394. templet: '#designer_name'
  395. },
  396. {
  397. title: '客户种类',
  398. field: 'customer_type',
  399. align: 'center',
  400. },
  401. {
  402. title: '客户来源',
  403. field: 'source',
  404. align: 'center',
  405. templet: '#source'
  406. },
  407. {
  408. title: '产品',
  409. field: 'package_name',
  410. align: 'center',
  411. },
  412. {
  413. title: '首次见面',
  414. field: 'fisttime',
  415. align: 'center',
  416. width: 120,
  417. },
  418. {
  419. title: '定金时间',
  420. field: 'jiaoding_time',
  421. align: 'center',
  422. width: 120,
  423. },
  424. {
  425. title: '合同时间',
  426. field: 'sign',
  427. align: 'center',
  428. width: 120,
  429. templet: '#sign'
  430. },
  431. {
  432. title: '业绩金额',
  433. field: 'signed_money',
  434. align: 'center',
  435. },
  436. {
  437. title: '定金合同天数',
  438. field: 'dingqian_day',
  439. align: 'center',
  440. },
  441. {
  442. title: '到店合同天数',
  443. field: 'daoqian_day',
  444. align: 'center',
  445. },
  446. {
  447. title: '单平方价',
  448. field: 'pf_money',
  449. align: 'center',
  450. },
  451. {
  452. title: '编辑',
  453. field: 'clue_count',
  454. align: 'center',
  455. fixed: 'right',
  456. templet: '#editbox'
  457. },
  458. ]
  459. ],
  460. page: true,
  461. limits: [17],
  462. limit: 17, //每页默认显示的数量,
  463. height: 'full-120',
  464. text: '对不起,加载出现异常!'
  465. });
  466. resizefun = function () {
  467. table.resize('crmsearchlist');
  468. };
  469. window.resizefun2 = function () {
  470. table.resize('crmsearchlist');
  471. };
  472. reload = function () {
  473. table.reload('crmsearchlist', { where: field }, true);
  474. };
  475. var flag=true;
  476. table.on('tool(crmsearchlist)', function (result) {
  477. let event = result.event;
  478. let row = result.data;
  479. flag = true;
  480. if(event === "edit"){
  481. $.ajax({
  482. url: '{:url("community/checkCustomer")}'
  483. , data: {
  484. id: result.data.id,
  485. }
  486. , type: 'post'
  487. , success: function (rs) {
  488. if(rs.code==0){
  489. flag = false;
  490. window.parent.editsigncrmsg(result.data.id,'achment_list.html','community')
  491. }else{
  492. alert(rs.msg)
  493. }
  494. }
  495. })
  496. return false;
  497. }else{
  498. flag = true;
  499. }
  500. flag = true;
  501. })
  502. $('.crmsearchlist').on('click', 'td', function (e) {
  503. var _event = $(this).find('[lay-event]').attr('lay-event');
  504. var _obj = table.cache.crmsearchlist[parseInt($(this).parent('tr').attr('data-index'))];
  505. switch (_event) {
  506. case 'edit':
  507. break;
  508. default:
  509. $.ajax({
  510. url: '{:url("community/checkCustomer")}'
  511. , data: {
  512. id: _obj.id,
  513. }
  514. , type: 'post'
  515. , success: function (rs) {
  516. if(rs.code==0){
  517. flag = true;
  518. $('#customer_detail')[0].src = "/empcrm/community/addlog.html?cid=" + _obj.id;
  519. $('.crmbox').addClass('rightbox');
  520. $('#customer_detail').show();
  521. resizefun();
  522. }else{
  523. alert(rs.msg)
  524. }
  525. }
  526. })
  527. }
  528. return false; //阻止事件冒泡
  529. })
  530. table.on('row(crmsearchlist)', function (obj) {
  531. var data = obj.data;
  532. if(flag){
  533. $.ajax({
  534. url: '{:url("community/checkCustomer")}'
  535. , data: {
  536. id: data.id,
  537. }
  538. , type: 'post'
  539. , success: function (rs) {
  540. if(rs.code==0){
  541. $('#customer_detail')[0].src = "/empcrm/community/addlog.html?cid=" + data.id;
  542. $('.crmbox').addClass('rightbox');
  543. resizefun();
  544. $('#customer_detail').show();
  545. for(let i=0;i<$('.crmsearchlist .layui-table-view .layui-table-box .layui-table tr').length;i++){
  546. $($('.crmsearchlist .layui-table-view .layui-table-box .layui-table tr')[i]).removeClass('onclickbg');
  547. }
  548. $(obj.tr).addClass('onclickbg');
  549. }else{
  550. alert(rs.msg)
  551. }
  552. }
  553. })
  554. }
  555. });
  556. })
  557. function removealog(params) {
  558. $('#customer_detail').hide();
  559. $('.crmbox').removeClass('rightbox');
  560. }
  561. </script>
  562. {/block}