|  |  |  | 
|---|
|  |  |  | <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"> | 
|---|
|  |  |  | <script type="text/html" id="onlineStateSwitch"> | 
|---|
|  |  |  | {{# if(d.onlineState === 1) { }} | 
|---|
|  |  |  | <input type="checkbox" value={{d.id}} lay-text="在线|离线" checked lay-skin="switch" lay-filter="onlineStateSwitch"> | 
|---|
|  |  |  | {{# } else { }} | 
|---|
|  |  |  | <input type="checkbox" value={{d.id}} lay-text="开启|关闭" lay-skin="switch" lay-filter="upOrDownSwitch"> | 
|---|
|  |  |  | <input type="checkbox" value={{d.id}} lay-text="在线|离线" lay-skin="switch" lay-filter="onlineStateSwitch"> | 
|---|
|  |  |  | {{# } }} | 
|---|
|  |  |  | </script> | 
|---|
|  |  |  | <script type="text/html" id="profitSwitch"> | 
|---|
|  |  |  | {{# if(d.profitSwitch === 1) { }} | 
|---|
|  |  |  | <input type="checkbox" value={{d.id}} lay-text="开启|关闭" checked lay-skin="switch" lay-filter="profitSwitch"> | 
|---|
|  |  |  | {{# } else { }} | 
|---|
|  |  |  | <input type="checkbox" value={{d.id}} lay-text="开启|关闭" lay-skin="switch" lay-filter="profitSwitch"> | 
|---|
|  |  |  | {{# } }} | 
|---|
|  |  |  | </script> | 
|---|
|  |  |  | <!-- 表格操作栏 end --> | 
|---|
|  |  |  | 
|---|
|  |  |  | area:['100%','100%'], | 
|---|
|  |  |  | yes: function (index, layero) { | 
|---|
|  |  |  | $('#febs-leader-update').find('#submit').trigger('click'); | 
|---|
|  |  |  | }, | 
|---|
|  |  |  | btn2: function () { | 
|---|
|  |  |  | layer.closeAll(); | 
|---|
|  |  |  | } | 
|---|
|  |  |  | }); | 
|---|
|  |  |  | } | 
|---|
|  |  |  | 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(); | 
|---|
|  |  |  | 
|---|
|  |  |  | }, 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: 'totalProfit', title: '收益', minWidth: 150,align:'left'}, | 
|---|
|  |  |  | {field: 'onlineState', title: '在线状态', templet: '#onlineStateSwitch', minWidth: 100,align:'center'}, | 
|---|
|  |  |  | // {field: 'profitSwitch', title: '是否返利', templet: '#profitSwitch', minWidth: 100,align:'center'}, | 
|---|
|  |  |  | // {field: 'bonusPercent', title: '返利比例', minWidth: 150,align:'left'}, | 
|---|
|  |  |  | // {field: 'phone', title: '电话', minWidth: 150,align:'left'}, | 
|---|
|  |  |  | {field: 'state', title: '状态', | 
|---|
|  |  |  | templet: function (d) { | 
|---|
|  |  |  | 
|---|
|  |  |  | }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 '' | 
|---|
|  |  |  | } | 
|---|
|  |  |  | 
|---|
|  |  |  | }else if(d.state === 1) { | 
|---|
|  |  |  | return '' | 
|---|
|  |  |  | + '<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(upOrDownSwitch)', function (data) { | 
|---|
|  |  |  | form.on('switch(onlineStateSwitch)', function (data) { | 
|---|
|  |  |  | if (data.elem.checked) { | 
|---|
|  |  |  | startOnline(data.value); | 
|---|
|  |  |  | } else { | 
|---|
|  |  |  | closeOnline(data.value); | 
|---|
|  |  |  | } | 
|---|
|  |  |  | $query.click(); | 
|---|
|  |  |  | }) | 
|---|
|  |  |  |  | 
|---|
|  |  |  | function startOnline(id) { | 
|---|
|  |  |  | febs.get(ctx + 'admin/leader/startOnline/' + id, null, function () { | 
|---|
|  |  |  | febs.alert.success('在线成功'); | 
|---|
|  |  |  | $query.click(); | 
|---|
|  |  |  | }); | 
|---|
|  |  |  | } | 
|---|
|  |  |  |  | 
|---|
|  |  |  | function closeOnline(id) { | 
|---|
|  |  |  | febs.get(ctx + 'admin/leader/closeOnline/' + id, null, function () { | 
|---|
|  |  |  | febs.alert.success('离线成功'); | 
|---|
|  |  |  | $query.click(); | 
|---|
|  |  |  | }); | 
|---|
|  |  |  | } | 
|---|
|  |  |  |  | 
|---|
|  |  |  | form.on('switch(profitSwitch)', function (data) { | 
|---|
|  |  |  | if (data.elem.checked) { | 
|---|
|  |  |  | startProfit(data.value); | 
|---|
|  |  |  | } else { | 
|---|
|  |  |  | closeProfit(data.value); | 
|---|
|  |  |  | } | 
|---|
|  |  |  | $query.click(); | 
|---|
|  |  |  | }) | 
|---|
|  |  |  |  | 
|---|
|  |  |  | function startProfit(id) { | 
|---|