|  |  |  | 
|---|
|  |  |  | .layui-table img{ | 
|---|
|  |  |  | max-width:100px | 
|---|
|  |  |  | } | 
|---|
|  |  |  | ::-webkit-scrollbar { | 
|---|
|  |  |  | height: 20px !important; | 
|---|
|  |  |  | background-color: #f4f4f4; | 
|---|
|  |  |  | } | 
|---|
|  |  |  | </style> | 
|---|
|  |  |  | </div> | 
|---|
|  |  |  | </div> | 
|---|
|  |  |  | 
|---|
|  |  |  | layEvent = obj.event; | 
|---|
|  |  |  |  | 
|---|
|  |  |  | if (layEvent === 'salesmanDel') { | 
|---|
|  |  |  | febs.modal.confirm('删除', '确认删除['+data.name+']推荐员?', function () { | 
|---|
|  |  |  | febs.modal.confirm('设置', '确认禁用['+data.name+']推荐员?', function () { | 
|---|
|  |  |  | salesmanDel(data.id); | 
|---|
|  |  |  | }); | 
|---|
|  |  |  | } | 
|---|
|  |  |  |  | 
|---|
|  |  |  | if (layEvent === 'salesmanUse') { | 
|---|
|  |  |  | febs.modal.confirm('设置', '确认启用['+data.name+']推荐员?', function () { | 
|---|
|  |  |  | salesmanUse(data.id); | 
|---|
|  |  |  | }); | 
|---|
|  |  |  | } | 
|---|
|  |  |  | if (layEvent === 'salesmanUpdate') { | 
|---|
|  |  |  | 
|---|
|  |  |  | }); | 
|---|
|  |  |  | function salesmanDel(id) { | 
|---|
|  |  |  | febs.get(ctx + 'admin/mallMember/salesmanDel/' + id, null, function () { | 
|---|
|  |  |  | febs.alert.success('删除成功'); | 
|---|
|  |  |  | febs.alert.success('操作成功'); | 
|---|
|  |  |  | $query.click(); | 
|---|
|  |  |  | }); | 
|---|
|  |  |  | } | 
|---|
|  |  |  | function salesmanUse(id) { | 
|---|
|  |  |  | febs.get(ctx + 'admin/mallMember/salesmanUse/' + id, null, function () { | 
|---|
|  |  |  | febs.alert.success('操作成功'); | 
|---|
|  |  |  | $query.click(); | 
|---|
|  |  |  | }); | 
|---|
|  |  |  | } | 
|---|
|  |  |  | 
|---|
|  |  |  | cols: [[ | 
|---|
|  |  |  | {field: 'id', title: '序号', minWidth: 100,align:'left'}, | 
|---|
|  |  |  | {field: 'name', title: '姓名', minWidth: 100,align:'left'}, | 
|---|
|  |  |  | {field: 'province', title: '省', minWidth: 100,align:'left'}, | 
|---|
|  |  |  | {field: 'city', title: '市', minWidth: 100,align:'left'}, | 
|---|
|  |  |  | {field: 'remark', title: '备注', minWidth: 140,align:'left'}, | 
|---|
|  |  |  | {field: 'state', title: '状态', | 
|---|
|  |  |  | templet: function (d) { | 
|---|
|  |  |  | if (d.state === 2) { | 
|---|
|  |  |  | return '<span style="color:red;">禁用</span>' | 
|---|
|  |  |  | } else{ | 
|---|
|  |  |  | return '<span style="color:green;">启用</span>' | 
|---|
|  |  |  | } | 
|---|
|  |  |  | }, minWidth: 100,align:'center'}, | 
|---|
|  |  |  | {title: '操作', | 
|---|
|  |  |  | templet: function (d) { | 
|---|
|  |  |  | if(d.state === 2){ | 
|---|
|  |  |  | return '<button class="layui-btn layui-btn-normal layui-btn-xs" lay-event="salesmanUpdate" shiro:hasPermission="user:update">编辑</button>' | 
|---|
|  |  |  | + '<button class="layui-btn layui-btn-normal layui-btn-xs febs-bg-red" lay-event="salesmanDel" shiro:hasPermission="user:update">删除</button>' | 
|---|
|  |  |  |  | 
|---|
|  |  |  | + '<button class="layui-btn layui-btn-normal layui-btn-xs febs-bg-green" lay-event="salesmanUse" shiro:hasPermission="user:update">启用</button>' | 
|---|
|  |  |  | }else{ | 
|---|
|  |  |  | return '<button class="layui-btn layui-btn-normal layui-btn-xs" lay-event="salesmanUpdate" shiro:hasPermission="user:update">编辑</button>' | 
|---|
|  |  |  | + '<button class="layui-btn layui-btn-normal layui-btn-xs febs-bg-red" lay-event="salesmanDel" shiro:hasPermission="user:update">禁用</button>' | 
|---|
|  |  |  | } | 
|---|
|  |  |  | },minWidth: 160,align:'center'} | 
|---|
|  |  |  | ]] | 
|---|
|  |  |  | }); | 
|---|