agent_list.html 16 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482
  1. {extend name="public/layout" /} {block name="title"}装修推荐官列表{/block} {block name="body"}
  2. <style type="text/css">
  3. html,
  4. body {
  5. display: block;
  6. min-width: 1100px;
  7. }
  8. body::-webkit-scrollbar {
  9. /*滚动条整体样式*/
  10. width: 4px;
  11. /*高宽分别对应横竖滚动条的尺寸*/
  12. height: 1px;
  13. }
  14. body::-webkit-scrollbar-thumb {
  15. /*滚动条里面小方块*/
  16. border-radius: 10px;
  17. box-shadow: inset 0 0 5px rgba(97, 184, 179, 0.1);
  18. background: #78b4b4;
  19. }
  20. body::-webkit-scrollbar-track {
  21. /*滚动条里面轨道*/
  22. box-shadow: inset 0 0 5px rgba(87, 175, 187, 0.1);
  23. border-radius: 10px;
  24. background: #ededed;
  25. }
  26. .layui-table thead tr,
  27. .layui-table-header {
  28. background-color: #D8E6F1 !important;
  29. }
  30. .layui-fluid {
  31. display: block;
  32. box-shadow: 0 0 4px 0 #B6CADE;
  33. border-radius: 5px;
  34. margin: 15px;
  35. background-color: #ffffff;
  36. }
  37. .layui-form-label {
  38. width: auto;
  39. }
  40. .layui-card .layui-tab-brief .layui-tab-title li.layui-this {
  41. color: #249EFB;
  42. }
  43. .layui-tab-brief>.layui-tab-more li.layui-this:after, .layui-tab-brief>.layui-tab-title .layui-this:after {
  44. border: none;
  45. }
  46. .layui-card .layui-tab-brief .layui-tab-title .layui-this:after {
  47. width: 50px;
  48. height: 4px;
  49. background-color: #249EFB;
  50. top: 37px;
  51. left: 50%;
  52. transform: translateX(-50%);
  53. }
  54. .layui-tab-title li {
  55. margin: 0px 5px;
  56. }
  57. .layui-btn-xs,
  58. .layui-btn-xs:hover {
  59. border: 1px solid #249EFB;
  60. background-color: #fff;
  61. color: #249EFB;
  62. padding: 0px 10px;
  63. }
  64. .layui-btn-danger,
  65. .layui-btn-danger:hover {
  66. color: #FF5722;
  67. background-color: #fff;
  68. border: 1px solid #FF5722;
  69. padding: 0px 10px;
  70. }
  71. .layui-btn-primary {
  72. color: #249EFB;
  73. border: 1px solid #249EFB;
  74. }
  75. .layui-btn-primary:hover {
  76. background-color: #E3F7FF;
  77. color: #249EFB;
  78. }
  79. .layui-form-item .layui-inline {
  80. margin-bottom: 0px;
  81. margin-right: 0px !important;
  82. }
  83. .block {
  84. display: inline-block;
  85. width: 100%;
  86. height: 100%;
  87. }
  88. </style>
  89. <body>
  90. <div class="layui-fluid">
  91. <div class="layui-card">
  92. <!-- <div class="layui-tab layui-tab-brief">
  93. <ul class="layui-tab-title">
  94. <li class="layui-this switchTab" data-index="1">
  95. 普通推荐官
  96. </li>
  97. <li class="switchTab" data-index="2">
  98. 网红推荐官
  99. </li>
  100. </ul>
  101. </div> -->
  102. <div class="layui-form layui-card-header layuiadmin-card-header-auto">
  103. <div class="layui-form-item">
  104. <div style="float: left;">
  105. <div class="layui-inline">
  106. <button class="layui-btn layui-btn-primary layuiadmin-btn-course"
  107. data-type="stay_wiped_list">待核销</button>
  108. </div>
  109. </div>
  110. <div style="float:right;" class="flexRow">
  111. <div class="layui-inline">
  112. <!-- <div class="layui-input-inline" style="width: auto;">
  113. <button class="layui-btn layui-btn-primary layuiadmin-btn-course"
  114. data-type="integral_setting">积分设置</button>
  115. </div>
  116. <div class="layui-input-inline" style="width: auto;">
  117. <button class="layui-btn layui-btn-primary layuiadmin-btn-course"
  118. data-type="nuclear_setting">核销设置</button>
  119. </div> -->
  120. <div class="layui-input-inline">
  121. <input type="text" name="keyword" id="" class="layui-input keyword" placeholder="请输入装企销售" autocomplete="off"/>
  122. </div>
  123. </div>
  124. <div class="layui-inline">
  125. <button class="layui-btn layuiadmin-btn-useradmin searchBtn submitbtn" lay-submit lay-filter="search">
  126. <i class="layui-icon layui-icon-search layuiadmin-button-btn"></i>
  127. </button>
  128. </div>
  129. </div>
  130. </div>
  131. </div>
  132. <div class="layui-card-body">
  133. <table lay-filter="management" id="management"></table>
  134. </div>
  135. </div>
  136. </div>
  137. </body>
  138. {/block} {block name="js"}
  139. <script type="text/html" id="table-train-action">
  140. <!-- <a class="layui-btn layui-btn-xs" lay-event="train-nuclear">积分核销</a> -->
  141. </script>
  142. <script type="text/html" id="agent_name">
  143. {{# if(d.agent_name){ }}
  144. <span>{{d.agent_name}}</span>
  145. {{# }else{ }}
  146. <span style="color: #cccccc;">无</span>
  147. {{# } }}
  148. </script>
  149. <script type="text/html" id="agent_wechat">
  150. {{# if(d.wechat){ }}
  151. <span>{{d.wechat}}</span>
  152. {{# }else{ }}
  153. <span style="color: #cccccc;">无</span>
  154. {{# } }}
  155. </script>
  156. <script type="text/html" id="addtimetpl">
  157. {{# if(d.addtime){ }}
  158. <span>{{d.addtime}}</span>
  159. {{# }else{ }}
  160. <span style="color: #cccccc;">无</span>
  161. {{# } }}
  162. </script>
  163. <script type="text/html" id="employee_name">
  164. {{# if(d.employee){ }}
  165. <span>{{d.employee.name}}</span>
  166. {{# }else{ }}
  167. <span style="color: #cccccc;">无</span>
  168. {{# } }}
  169. </script>
  170. <script type="text/html" id="cusdatatpl">
  171. <a href="javascript:void(0)" lay-event="client" style="color:blue;">
  172. {{# if(d.customer_count){ }}
  173. <span>{{d.customer_count}}</span>
  174. {{# }else{ }}
  175. <span style="color: #cccccc;">0</span>
  176. {{# } }}
  177. </a>
  178. </script>
  179. <script type="text/html" id="daodiannumtpl">
  180. <a href="javascript:void(0)" lay-event="visitNumber" style="color:blue;">
  181. {{# if(d.daodiannum){ }}
  182. <span>{{d.daodiannum}}</span>
  183. {{# }else{ }}
  184. <span style="color: #cccccc;">0</span>
  185. {{# } }}
  186. </a>
  187. </script>
  188. <script type="text/html" id="jiaodingnumtpl">
  189. <a href="javascript:void(0)" lay-event="makeupNumber" style="color:blue;">
  190. {{# if(d.jiaodingnum){ }}
  191. <span>{{d.jiaodingnum}}</span>
  192. {{# }else{ }}
  193. <span style="color: #cccccc;">0</span>
  194. {{# } }}</a>
  195. </script>
  196. <script type="text/html" id="qiandannumtpl">
  197. <a href="javascript:void(0)" lay-event="numberSigns" style="color:blue;">
  198. {{# if(d.qiandannum){ }}
  199. <span>{{d.qiandannum}}</span>
  200. {{# }else{ }}
  201. <span style="color: #cccccc;">0</span>
  202. {{# } }}</a>
  203. </script>
  204. <script type="text/html" id="now_integraltpl">
  205. {{# if(d.now_integral){ }}
  206. <span>{{d.now_integral}}</span>
  207. {{# }else{ }}
  208. <span style="color: #cccccc;">0</span>
  209. {{# } }}
  210. </script>
  211. <script type="text/html" id="agent_type">
  212. {{# if(d.agenttype){ }}
  213. <span>{{d.agenttype.type_name}}</span>
  214. {{# }else{ }}
  215. <span style="color: #cccccc;">无</span>
  216. {{# } }}
  217. </script>
  218. <script type="text/html" id="show">
  219. <input type="checkbox" name="show" value="{{d.id}}" lay-skin="switch" lay-filter="show" {{ d.status == 1 ? 'checked' : '' }} id="clickshow">
  220. </script>
  221. <script>
  222. layui.config({
  223. base: '__LAYUI__/',
  224. urlbase: '/sys'
  225. }).extend({
  226. index: 'lib/index'
  227. }).use(['index', 'table', 'layedit', 'element'], function () {
  228. var $ = layui.$,
  229. table = layui.table,
  230. element = layui.element,
  231. form = layui.form;
  232. var field = {};
  233. var is_review = '{$is_review}';
  234. var root_id = '{$employee.root_id}';
  235. var jiaoding = '定金';
  236. var qiandan = '合同';
  237. form.on('submit(search)', function (data) {
  238. var keyword = $('.keyword').val();
  239. field['keyword'] = keyword;
  240. //执行重载
  241. table.reload('management', {
  242. where: field
  243. , page: { curr: 1}
  244. });
  245. });
  246. form.on('switch(show)', function (obj) {
  247. var id = obj.value;
  248. $.ajax({
  249. type: "post",
  250. url: '{:url("agents/up_agt_accnumb")}',
  251. data: {
  252. id: id
  253. },
  254. success: function (res) {
  255. layer.msg(res.msg, { time: 2000 });
  256. }
  257. });
  258. });
  259. //事件
  260. var active = {
  261. stay_wiped_list: function() {
  262. let type = '';//$('.layui-this')[0].dataset.index;
  263. layer.open({
  264. type: 2,
  265. title: ['核销积分', 'color:#333333;background-color:#D8E6F1;'],
  266. content: '{:url("agents/stay_wiped_list")}?type=1',
  267. resize: false,
  268. area: ['60%', '80%'],
  269. btn: ['一键核销', '取消'],
  270. yes: function(index, layero) {
  271. //点击确认触发 iframe 内容中的按钮提交
  272. var submit = layero.find('iframe').contents().find("#spellgroup-submit");
  273. submit.click();
  274. }
  275. });
  276. },
  277. // nuclear_setting: function() {
  278. // layer.open({
  279. // type: 2,
  280. // title: ['核销设置', 'color:#333333;background-color:#D8E6F1;'],
  281. // content: '{:url("agents/integral_setting")}?type=2',
  282. // resize: false,
  283. // area: ['80%', '80%'],
  284. // // btn: ['确定', '取消'],
  285. // yes: function(index, layero) {
  286. // //点击确认触发 iframe 内容中的按钮提交
  287. // // var submit = layero.find('iframe').contents().find("#activity-submit");
  288. // // submit.click();
  289. // }
  290. // });
  291. // }
  292. };
  293. if(is_review != 0){
  294. active.stay_wiped_list();
  295. }
  296. //话术列表
  297. table.render({
  298. elem: '#management',
  299. autoSort: false,
  300. url: "{:url('agents/agent_list')}",
  301. cols: [
  302. [{
  303. type: 'numbers',
  304. field: 'id',
  305. width: 80,
  306. title: '序号',
  307. sort: true
  308. }, {
  309. field: 'title',
  310. title: '装修推荐官',
  311. templet: '#agent_name',
  312. },{
  313. field: 'type',
  314. title: '类别',
  315. templet: '#agent_type',
  316. },{
  317. field: 'employee_count',
  318. title: '时间',
  319. templet: '#addtimetpl'
  320. }, {
  321. title: '装企人员',
  322. field: 'employee_count',
  323. templet: '#employee_name'
  324. }, {
  325. title: '客户总览',
  326. field: 'employee_count',
  327. templet: '#cusdatatpl'
  328. },{
  329. title: '到访人数',
  330. field: 'addtime',
  331. templet: '#daodiannumtpl'
  332. },{
  333. title: jiaoding+'人数',
  334. field: 'addtime',
  335. templet: '#jiaodingnumtpl'
  336. },{
  337. title: qiandan+'人数',
  338. field: 'employee_count',
  339. templet: '#qiandannumtpl'
  340. },{
  341. title: '可核销积分',
  342. field: 'employee_count',
  343. templet: '#now_integraltpl'
  344. },{
  345. title: '账号启停',
  346. templet: '#show',
  347. },
  348. // {
  349. // title: '操作',
  350. // width: 120,
  351. // align: 'center',
  352. // fixed: 'right',
  353. // toolbar: '#table-train-action'
  354. // }
  355. ]
  356. ],
  357. page: true,
  358. limit: 30,
  359. height: 'full-200',
  360. text: '对不起,加载出现异常!'
  361. });
  362. $('.switchTab').click((e) => {
  363. let type = e.target.dataset.index;
  364. console.log(type);
  365. field['type'] = type;
  366. //执行重载
  367. table.reload('management', {
  368. where: field,
  369. page: {
  370. curr: 1
  371. }
  372. });
  373. })
  374. //监听列表
  375. table.on('tool(management)', function(obj) {
  376. console.log(obj);
  377. //return false;
  378. switch(obj.event) {
  379. case 'train-nuclear':
  380. layer.open({
  381. type: 2,
  382. title: ['积分核销', 'color:#333333;background-color:#D8E6F1;'],
  383. content: "{:url('agents/integral_nuclear')}?agentid="+obj.data.id,
  384. resize: false,
  385. area: ['80%', '80%'],
  386. // btn: ['确定', '取消'],
  387. yes: function (index, layero) {
  388. //点击确认触发 iframe 内容中的按钮提交
  389. // var submit = layero.find('iframe').contents().find("#talkskill-submit");
  390. // submit.click();
  391. }
  392. });
  393. break;
  394. case 'client':
  395. layer.open({
  396. type: 2,
  397. title: ['客户总览', 'color:#333333;background-color:#D8E6F1;'],
  398. content: "{:url('agents/agent_customer_list')}?agentid="+obj.data.id,
  399. resize: false,
  400. area: ['80%', '80%'],
  401. // btn: ['确定', '取消'],
  402. yes: function (index, layero) {
  403. //点击确认触发 iframe 内容中的按钮提交
  404. // var submit = layero.find('iframe').contents().find("#talkskill-submit");
  405. // submit.click();
  406. }
  407. });
  408. break;
  409. case 'visitNumber':
  410. layer.open({
  411. type: 2,
  412. title: ['到访人数', 'color:#333333;background-color:#D8E6F1;'],
  413. content: "{:url('agents/agent_kehu_list')}?agentid="+obj.data.id+'&type=1',
  414. resize: false,
  415. area: ['80%', '80%'],
  416. // btn: ['确定', '取消'],
  417. yes: function (index, layero) {
  418. //点击确认触发 iframe 内容中的按钮提交
  419. // var submit = layero.find('iframe').contents().find("#talkskill-submit");
  420. // submit.click();
  421. }
  422. });
  423. break;
  424. case 'makeupNumber':
  425. layer.open({
  426. type: 2,
  427. title: [jiaoding+'人数', 'color:#333333;background-color:#D8E6F1;'],
  428. content: "{:url('agents/agent_kehu_list')}?agentid="+obj.data.id+'&type=2',
  429. resize: false,
  430. area: ['80%', '80%'],
  431. // btn: ['确定', '取消'],
  432. yes: function (index, layero) {
  433. //点击确认触发 iframe 内容中的按钮提交
  434. // var submit = layero.find('iframe').contents().find("#talkskill-submit");
  435. // submit.click();
  436. }
  437. });
  438. break;
  439. case 'numberSigns':
  440. layer.open({
  441. type: 2,
  442. title: [qiandan+'人数', 'color:#333333;background-color:#D8E6F1;'],
  443. content: "{:url('agents/agent_kehu_list')}?agentid="+obj.data.id+'&type=3',
  444. resize: false,
  445. area: ['80%', '80%'],
  446. // btn: ['确定', '取消'],
  447. yes: function (index, layero) {
  448. //点击确认触发 iframe 内容中的按钮提交
  449. // var submit = layero.find('iframe').contents().find("#talkskill-submit");
  450. // submit.click();
  451. }
  452. });
  453. break;
  454. }
  455. });
  456. $('.layui-btn.layuiadmin-btn-course').on('click', function() {
  457. var type = $(this).data('type');
  458. active[type] ? active[type].call(this) : '';
  459. });
  460. });
  461. </script>
  462. {/block}