stay_wiped_list.html 13 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543
  1. {extend name="public/layout" /} {block name="title"}日常任务{/block}
  2. {block name="body"}
  3. <style>
  4. .layui-fluid {
  5. display: block;
  6. box-shadow: 0 0 4px 0 #B6CADE;
  7. border-radius: 5px;
  8. /* margin: 15px; */
  9. background-color: #ffffff;
  10. min-height: calc(100vh - 80px);
  11. }
  12. .cardheader {
  13. padding-left: 10px;
  14. }
  15. .layui-table thead tr,
  16. .layui-table-header {
  17. background-color: #D8E6F1 !important;
  18. }
  19. .layui-btn-primary {
  20. color: #249EFB;
  21. border: 1px solid #249EFB;
  22. }
  23. .layui-btn-primary:hover {
  24. background-color: #E3F7FF;
  25. color: #249EFB;
  26. }
  27. .layui-card .layui-tab-brief .layui-tab-title li.layui-this {
  28. color: #249EFB;
  29. }
  30. .layui-tab-brief>.layui-tab-more li.layui-this:after,
  31. .layui-tab-brief>.layui-tab-title .layui-this:after {
  32. border: none;
  33. }
  34. .layui-card .layui-tab-brief .layui-tab-title .layui-this:after {
  35. width: 50px;
  36. height: 4px;
  37. background-color: #249EFB;
  38. top: 37px;
  39. left: 50%;
  40. transform: translateX(-50%);
  41. }
  42. .layui-card .layui-tab-brief .layui-tab-title li {
  43. margin: 0px 5px;
  44. padding: 0px 15px;
  45. }
  46. .layui-btn-xs,
  47. .layui-btn-xs:hover {
  48. border: 1px solid #249EFB;
  49. background-color: #fff;
  50. color: #249EFB;
  51. padding: 0px 10px;
  52. }
  53. .layui-btn-danger,
  54. .layui-btn-danger:hover {
  55. color: #FF5722;
  56. background-color: #fff;
  57. border: 1px solid #FF5722;
  58. padding: 0px 10px;
  59. }
  60. .layui-card .layui-tab-brief .layui-tab-title li {
  61. margin-left: 0 !important;
  62. margin-right: 15px;
  63. }
  64. /* .layui-card .layui-tab-brief .layui-tab-title{margin-left:15px;} */
  65. .flex-row {
  66. display: flex;
  67. justify-content: space-around;
  68. align-items: center;
  69. background-color: #fff;
  70. /*margin: 15px;*/
  71. height: 111px;
  72. box-shadow: 0 0 4px 0 #b6cade;
  73. border-radius: 5px;
  74. }
  75. .flex-item {
  76. display: flex;
  77. flex-direction: column;
  78. justify-content: center;
  79. align-items: center;
  80. }
  81. .font-weight {
  82. font-weight: 600;
  83. }
  84. .font24 {
  85. font-size: 24px;
  86. }
  87. .mt10 {
  88. margin-top: 10px;
  89. }
  90. .flex-box {
  91. flex: none;
  92. display: flex;
  93. justify-content: space-around;
  94. align-items: center;
  95. background-color: #FAFAFA;
  96. margin: 17px;
  97. box-sizing: border-box;
  98. border-radius: 5px;
  99. padding: 16px;
  100. width: 100%;
  101. margin-left: 0;
  102. margin-top: 0;
  103. }
  104. .flex-box-title {
  105. font-size: 17px;
  106. font-weight: 600;
  107. }
  108. .flex-column {
  109. flex: 1;
  110. display: flex;
  111. flex-direction: column;
  112. overflow: hidden;
  113. }
  114. .box-title {
  115. border-left: 4px solid #249EFB;
  116. display: inline-block;
  117. height: 20px;
  118. line-height: 20px;
  119. padding-left: 5px;
  120. font-size: 16px;
  121. font-weight: 700;
  122. }
  123. .box-little {
  124. margin-top: 4px;
  125. color: #999999;
  126. white-space: nowrap;
  127. overflow: hidden;
  128. text-overflow: ellipsis;
  129. }
  130. .box-content {
  131. width: 100%;
  132. color: #aaa;
  133. white-space: nowrap;
  134. overflow: hidden;
  135. text-overflow: ellipsis;
  136. font-size: 12px;
  137. }
  138. .box-img {
  139. display: flex;
  140. height: 70px;
  141. margin-top: 4px;
  142. }
  143. .box-img img {
  144. width: 40px;
  145. height: 40px;
  146. margin-right: 10px;
  147. }
  148. .box-tips {
  149. font-size: 12px;
  150. }
  151. .box-operate {
  152. width: 205px;
  153. height: 100%;
  154. display: flex;
  155. justify-content: center;
  156. align-items: center;
  157. /*border-left: 1px solid #cccccc;*/
  158. padding-left: 16px;
  159. }
  160. .box-del {
  161. width: 100%;
  162. display: flex;
  163. justify-content: flex-end;
  164. align-items: center;
  165. }
  166. .color249EFB {
  167. color: #249EFB;
  168. }
  169. .ml10 {
  170. margin-left: 10px;
  171. }
  172. #page_container {
  173. padding: 0px 35px;
  174. }
  175. html {
  176. background: none;
  177. }
  178. .noneimgs {
  179. margin: 50px auto 0;
  180. width: 20%;
  181. }
  182. .layui-card {
  183. box-shadow: none !important;
  184. }
  185. .layui-card-body {
  186. padding: 0 !important;
  187. }
  188. .employeeStyle {
  189. color: #249EFB;
  190. }
  191. .integralStyle {
  192. color: #999999;
  193. margin-left: 15px;
  194. }
  195. .wechatStyle {
  196. color: #999999;
  197. }
  198. .integralNumber {
  199. color: #249EFB;
  200. }
  201. .timeStyle {
  202. color: #999999;
  203. }
  204. .box-column {
  205. display: flex;
  206. flex-direction: column;
  207. align-items: flex-end;
  208. }
  209. .passStyle {
  210. color: #249EFB;
  211. margin-left: 8px;
  212. }
  213. .employName {
  214. color: #333333;
  215. }
  216. .rejectStyle {
  217. color: red;
  218. }
  219. .color999 {
  220. color: #999999;
  221. }
  222. .font14 {
  223. font-size: 13px !important;
  224. }
  225. .flexcenter {
  226. display: flex;
  227. align-items: center;
  228. justify-content: center;
  229. }
  230. </style>
  231. <body>
  232. <div class="layui-fluid" style="box-shadow: none;">
  233. <div class="layui-card">
  234. <div class="layui-card-body">
  235. <div class="layui-form layui-card-header layuiadmin-card-header-auto">
  236. <div class="layui-form-item">
  237. <div style="float:right;">
  238. <div class="layui-inline">
  239. <div class="layui-input-inline" style="width:280px;">
  240. <input type="text" name="keyword" placeholder="请输入业务员姓名/装修推荐官姓名/审核人员"
  241. autocomplete="off" class="layui-input">
  242. </div>
  243. </div>
  244. <div class="layui-inline">
  245. <div class="layui-input-inline select-date">
  246. <input type="text" name="date" id="select_date" placeholder="选择审核时间"
  247. autocomplete="off" class="layui-input">
  248. </div>
  249. </div>
  250. <div class="layui-inline">
  251. <button class="layui-btn layuiadmin-btn-course searchBtn" lay-submit
  252. lay-filter="LAY-user-front-search">
  253. <i class="layui-icon layui-icon-search layuiadmin-button-btn"></i>
  254. </button>
  255. </div>
  256. </div>
  257. </div>
  258. </div>
  259. <div class="layui-row">
  260. <div class="layui-col-md12 layui-col-xs12 layui-col-sm12">
  261. <div class="layui-tab layui-tab-brief" lay-filter="component-tabs-hash">
  262. <ul class="layui-tab-title">
  263. <li class="layui-this" lay-id="1">全部</li>
  264. <li lay-id="2">待核销</li>
  265. <li lay-id="3">已核销</li>
  266. <li lay-id="4">已驳回</li>
  267. </ul>
  268. <div class="layui-tab-content">
  269. <div class="layui-tab-item" id="con"
  270. style="display:flex !important;flex-wrap:wrap !important;">
  271. </div>
  272. </div>
  273. <div id="page_container"></div>
  274. <input type="hidden" name="count" value="0">
  275. </div>
  276. </div>
  277. </div>
  278. </div>
  279. </div>
  280. <div class="width56_" style="display: none;">
  281. <button type="button" class="layui-btn layui-btn-normal pdlr30" lay-filter="spellgroup-submit"
  282. id="spellgroup-submit">保存</button>
  283. </div>
  284. </div>
  285. {/block}
  286. {block name="js"}
  287. <script>
  288. layui.config({
  289. base: '__LAYUI__/',
  290. urlbase: '/sys'
  291. }).extend({
  292. index: 'lib/index' //主入口模块
  293. }).use(['index', 'table', 'laypage', 'element', 'laydate'], function () {
  294. var $ = layui.$,
  295. table = layui.table,
  296. laypage = layui.laypage,
  297. element = layui.element,
  298. form = layui.form,
  299. laydate = layui.laydate;
  300. var page = 1;//当前页
  301. var date = keyword = '';
  302. //日期范围
  303. laydate.render({
  304. elem: '#select_date',
  305. format: "yyyy/MM/dd"
  306. });
  307. //选项卡切换
  308. element.on('tab(component-tabs-hash)', function (data) {
  309. var index = data.index;
  310. page = 1;
  311. if (index == 0) {
  312. active.list(page);
  313. } else if (index == 1) {
  314. active.list(page, 2);
  315. } else if (index == 2) {
  316. active.list(page, 3);
  317. } else if (index == 3) {
  318. active.list(page, 4);
  319. }
  320. });
  321. //监听搜索
  322. form.on('submit(LAY-user-front-search)', function (data) {
  323. //var field = data.field;
  324. date = $("#select_date").val();
  325. keyword = $("[name=keyword]").val();
  326. active.list(page,0,date,keyword);
  327. });
  328. //一键核销
  329. $('#spellgroup-submit').click(function () {
  330. $.ajax({
  331. url: '{:url("agents/all_operation_wiped")}',
  332. type: 'post',
  333. data: '',
  334. dataType: 'json',
  335. processData: false,
  336. contentType: false,
  337. success: function (res) {
  338. if (res.code === 0) {
  339. layer.msg(res.msg, {
  340. anim: 0, time: 1000, icon: 6,
  341. }, function () {
  342. var index = parent.layer.getFrameIndex(window.name);
  343. parent.layui.table.reload('dev-table'); //重载表格
  344. parent.layer.close(index); //再执行关闭
  345. });
  346. } else {
  347. layer.msg(res.msg, { anim: 0, time: 1000, icon: 5 });
  348. }
  349. }
  350. });
  351. return false;
  352. })
  353. var active = {
  354. list: function (page, type = '',date = '',keyword = '') {
  355. $.ajax({
  356. url: '{:url("agents/stay_wiped_list")}',
  357. type: 'post',
  358. data: {
  359. page:page,
  360. status:type,
  361. review_time:date,
  362. keyword:keyword
  363. },
  364. success: function (res) {
  365. if (res.code == 0) {
  366. var data = res.data;
  367. if (data.length != 0) {
  368. var html = '';
  369. data.forEach(function (elem, index) {
  370. html += "<div class='flex-box'>";
  371. html += "<div class='flex-column'>";
  372. html += "<div class='box-img'>";
  373. html += "<div class='flexcenter'><img src=" + '__STATIC__/img/default.png' + " /></div>";
  374. html += "<div><p><span>" + elem.agent.agent_name + "</span>" + "<span class='employeeStyle'>" + "【业务员: " + elem.employee.name + "】</span><span class='integralStyle'>核销积分: " + "</span>" + "<span class='integralNumber'>" + elem.integral + "</span>" + "</p><p>" + "<span>"+ (elem.good_name?`兑奖商品:${elem.good_name}`:`核销了${elem.integral}积分即${elem.money}元`) +"</span>"+"</p><p class='timeStyle font14'>申请时间: " + elem.addtime + "</p></div></div>";
  375. html += "</div>";
  376. html += "<div class='box-operate'>";
  377. if (elem.status == 2) {
  378. html += "<div class='box-del del_task' data-id=" + elem.id + "><button type='button' data-id=" + elem.id + " class='layui-btn layui-btn-primary layui-border-blue layui-btn-sm laypass'>通过</button>";
  379. html += "<button type='button' data-id=" + elem.id + " class='layui-btn layui-btn-primary layui-border-red layui-btn-sm layreject'>驳回</button></div>";
  380. } else if (elem.status == 3) {
  381. html += "<div class='box-column' data-id=" + elem.id + "><p><span class='employName'>" + elem.review_name + "审核</span> <span class='passStyle'>已通过</span></p><p class='color999 font14'>通过时间: " + elem.review_time + "</p></div>";
  382. } else if (elem.status == 4) {
  383. html += "<div class='box-column' data-id=" + elem.id + "><p><span class='employName'>" + elem.review_name + "审核</span> <span class='rejectStyle'>已驳回</span></p><p class='color999 font14'>驳回时间: " + elem.review_time + "</p></div>";
  384. }
  385. html += "</div>";
  386. html += "</div>";
  387. });
  388. $('#con').empty();
  389. $('#con').html(html);
  390. active.page(res.count);
  391. setTimeout(() => {
  392. $('.laypass').click(function() {
  393. let id = $(this).prop('dataset').id;
  394. //alert(id);
  395. set(id,1);
  396. })
  397. $('.layreject').click(function() {
  398. let id = $(this).prop('dataset').id;
  399. //alert(id);
  400. set(id,2);
  401. })
  402. },300)
  403. } else {
  404. $('#con').html('<img class="noneimgs" src="__STATIC__/img/nonedata.png"/>');
  405. }
  406. }
  407. },
  408. error: function (res) {
  409. // layer.close(index);
  410. }
  411. });
  412. },
  413. page: function (count) {
  414. laypage.render({
  415. elem: 'page_container',
  416. count: count,
  417. limit: 6,
  418. curr: page,
  419. jump: function (obj, first) {
  420. // console.log(obj)
  421. //获取到当前的页数
  422. if (!first) {
  423. if (page != obj.curr) {
  424. page = obj.curr;
  425. active.list(page);
  426. }
  427. }
  428. }
  429. })
  430. }
  431. };
  432. active.list(page);
  433. // //删除任务
  434. // $("#con").on('click', '.del_task', function () {
  435. // var id = $(this).data("id");
  436. // $.ajax({
  437. // url: '{:url("agents/operation_wiped_integral")}',
  438. // data: {
  439. // id:id
  440. // },
  441. // type: 'post',
  442. // success: function (res) {
  443. // if (res.code === 0) {
  444. // layer.msg(res.msg, { anim: 0 });
  445. // active.list(page);
  446. // } else {
  447. // layer.msg(res.msg, { anim: 6 });
  448. // }
  449. // },
  450. // error: function (res) {
  451. // active.list(page);
  452. // }
  453. // });
  454. // });
  455. function set(id,type)
  456. {
  457. $.ajax({
  458. url: '{:url("agents/operation_wiped_integral")}',
  459. data: {
  460. id:id,
  461. type:type
  462. },
  463. type: 'post',
  464. success: function (res) {
  465. if (res.code === 0) {
  466. layer.msg(res.msg, { anim: 0 });
  467. active.list(page);
  468. } else {
  469. layer.msg(res.msg, { anim: 6 });
  470. }
  471. },
  472. error: function (res) {
  473. active.list(page);
  474. }
  475. });
  476. }
  477. //完成情况
  478. $("#con").on('click', '.color249EFB', function () {
  479. var id = $(this).data("id");
  480. var type = $(this).data("type");
  481. layer.open({
  482. type: 2,
  483. title: ['新建案例', 'color:#333333;background-color:#D8E6F1;'],
  484. content: "{:url('dailyTasks/person')}?id=" + id + '&type=' + type,
  485. resize: false,
  486. area: ['80%', '80%'],
  487. });
  488. });
  489. });
  490. </script>
  491. {/block}