From 1f7383c5e295f11a66fdfa9b75e596f72b35b4a8 Mon Sep 17 00:00:00 2001 From: xiaoyong931011 <15274802129@163.com> Date: Thu, 15 Sep 2022 16:38:51 +0800 Subject: [PATCH] 20220902 --- src/main/resources/templates/febs/views/modules/leader/leaderList.html | 69 +++++++++++++++++++++++++++++++--- 1 files changed, 62 insertions(+), 7 deletions(-) diff --git a/src/main/resources/templates/febs/views/modules/leader/leaderList.html b/src/main/resources/templates/febs/views/modules/leader/leaderList.html index 841d023..c7ca5e1 100644 --- a/src/main/resources/templates/febs/views/modules/leader/leaderList.html +++ b/src/main/resources/templates/febs/views/modules/leader/leaderList.html @@ -62,6 +62,13 @@ <a lay-event="edit" shiro:hasPermission="user:update"><i class="layui-icon febs-edit-area febs-blue"></i></a> </script> +<script type="text/html" id="upOrDownSwitch"> + {{# if(d.profitSwitch === 1) { }} + <input type="checkbox" value={{d.id}} lay-text="开启|关闭" checked lay-skin="switch" lay-filter="upOrDownSwitch"> + {{# } else { }} + <input type="checkbox" value={{d.id}} lay-text="开启|关闭" lay-skin="switch" lay-filter="upOrDownSwitch"> + {{# } }} +</script> <!-- 表格操作栏 end --> <script data-th-inline="none" type="text/javascript"> // 引入组件并初始化 @@ -86,6 +93,18 @@ table.on('tool(leaderTable)', function (obj) { var data = obj.data, layEvent = obj.event; + if (layEvent === 'leaderGoodsUpdate') { + febs.modal.open('编辑', 'modules/leader/leaderGoodsUpdate/' + data.id, { + btn: ['提交', '取消'], + area:['100%','100%'], + yes: function (index, layero) { + $('#febs-leaderGoods-update').find('#submit').trigger('click'); + }, + btn2: function () { + layer.closeAll(); + } + }); + } if (layEvent === 'leaderUpdate') { febs.modal.open('编辑', 'modules/leader/leaderUpdate/' + data.id, { btn: ['提交', '取消'], @@ -98,8 +117,20 @@ } }); } + if (layEvent === 'fenceAdd') { + febs.modal.open('设置配送范围', 'modules/leader/fenceAdd/' + data.id, { + btn: ['提交', '取消'], + area:['100%','100%'], + yes: function (index, layero) { + $('#user-addLeaderFence').find('#submit').trigger('click'); + }, + btn2: function () { + layer.closeAll(); + } + }); + } if (layEvent === 'leaderCancel') { - febs.modal.confirm('取消', '确认取消该团长?', function () { + febs.modal.confirm('拉黑', '团长被拉黑,将无法再次申请团长', function () { leaderCancel(data.id); }); } @@ -153,6 +184,12 @@ templet: function (d) { return '<a lay-event="seeImgThumb"><img id="seeImgThumb'+d.id+'" src="'+d.addressPic+'" alt=""></a>'; }, minWidth: 150,align:'center'}, + {field: 'addressArea', title: '自提点名称', minWidth: 150,align:'left'}, + {field: 'detailAddress', title: '自提点地址', minWidth: 150,align:'left'}, + {field: 'totalProfit', title: '收益', minWidth: 150,align:'left'}, + {field: 'profitSwitch', title: '是否返利', templet: '#upOrDownSwitch', minWidth: 100,align:'center'}, + {field: 'bonusPercent', title: '返利比例', minWidth: 150,align:'left'}, + // {field: 'phone', title: '电话', minWidth: 150,align:'left'}, {field: 'state', title: '状态', templet: function (d) { if (d.state === 1) { @@ -162,7 +199,7 @@ }else if (d.state === 3) { return '<span style="color:blue;">待审核</span>' }else if (d.state === 4) { - return '<span style="color:blue;">已取消</span>' + return '<span style="color:blue;">已取消资格</span>' }else{ return '' } @@ -174,23 +211,41 @@ + '<button class="layui-btn layui-btn-normal layui-btn-xs" lay-event="leaderUpdate" shiro:hasPermission="user:update">审核</button>' }else if(d.state === 1) { return '' - + '<button class="layui-btn layui-btn-normal layui-btn-xs" lay-event="leaderCancel" shiro:hasPermission="user:update">取消</button>' + + '<button class="layui-btn layui-btn-normal layui-btn-xs" lay-event="leaderUpdate" shiro:hasPermission="user:update">修改</button>' + + '<button class="layui-btn layui-btn-normal layui-btn-xs" lay-event="fenceAdd" shiro:hasPermission="user:update">设置配送范围</button>' + + '<button class="layui-btn layui-btn-normal layui-btn-xs" lay-event="leaderCancel" shiro:hasPermission="user:update">拉黑</button>' + // + '<button class="layui-btn layui-btn-normal layui-btn-xs" lay-event="leaderGoodsUpdate" shiro:hasPermission="user:update">团长商品设置</button>' }else{ return ''; } - },minWidth: 160,align:'center'} + },minWidth: 200,align:'center'} ]] }); } - form.on('switch(startOrCloseSwitch)', function (data) { + form.on('switch(upOrDownSwitch)', function (data) { if (data.elem.checked) { - startAct(data.value); + startProfit(data.value); } else { - closeAct(data.value); + closeProfit(data.value); } + $query.click(); }) + function startProfit(id) { + febs.get(ctx + 'admin/leader/startProfit/' + id, null, function () { + febs.alert.success('开启成功'); + $query.click(); + }); + } + + function closeProfit(id) { + febs.get(ctx + 'admin/leader/closeProfit/' + id, null, function () { + febs.alert.success('关闭成功'); + $query.click(); + }); + } + // 获取查询参数 function getQueryParams() { return { -- Gitblit v1.9.1