|  |  |  | 
|---|
|  |  |  | <div class="layui-input-inline"> | 
|---|
|  |  |  | <select name="level"> | 
|---|
|  |  |  | <option value="">请选择</option> | 
|---|
|  |  |  | <option value="ZERO_LEVEL">未激活</option> | 
|---|
|  |  |  | <option value="FIRST_LEVEL">普通会员</option> | 
|---|
|  |  |  | <option value="SECOND_LEVEL">业务经理</option> | 
|---|
|  |  |  | <option value="THIRD_LEVEL">区域代理</option> | 
|---|
|  |  |  | 
|---|
|  |  |  | maxmin: true, | 
|---|
|  |  |  | }); | 
|---|
|  |  |  | } | 
|---|
|  |  |  | if (layEvent === 'activate') { | 
|---|
|  |  |  | febs.modal.confirm('激活', '确认激活该账号?', function () { | 
|---|
|  |  |  | activateAccount(data.id); | 
|---|
|  |  |  | }); | 
|---|
|  |  |  | } | 
|---|
|  |  |  | if (layEvent === 'agentLevelSet') { | 
|---|
|  |  |  | febs.modal.open('设置代理级别', 'modules/mallMember/agentLevelSet/' + data.id, { | 
|---|
|  |  |  | btn: ['确认', '取消'], | 
|---|
|  |  |  | yes: function (index, layero) { | 
|---|
|  |  |  | $('#agent-level-set').find('#submit').trigger('click'); | 
|---|
|  |  |  | }, | 
|---|
|  |  |  | btn2: function () { | 
|---|
|  |  |  | layer.closeAll(); | 
|---|
|  |  |  | } | 
|---|
|  |  |  | }); | 
|---|
|  |  |  | } | 
|---|
|  |  |  | }); | 
|---|
|  |  |  |  | 
|---|
|  |  |  | function activateAccount(id) { | 
|---|
|  |  |  | febs.get(ctx + 'admin/mallMember/activateAccount/' + id, null, function () { | 
|---|
|  |  |  | febs.alert.success('操作成功'); | 
|---|
|  |  |  | $query.click(); | 
|---|
|  |  |  | }); | 
|---|
|  |  |  | } | 
|---|
|  |  |  |  | 
|---|
|  |  |  | // 查询按钮 | 
|---|
|  |  |  | $query.on('click', function () { | 
|---|
|  |  |  | 
|---|
|  |  |  | id: 'userAgentTable', | 
|---|
|  |  |  | url: ctx + 'admin/mallMember/getAgentList', | 
|---|
|  |  |  | cols: [[ | 
|---|
|  |  |  | {field: 'phone', title: '手机号', minWidth: 150,align:'left'}, | 
|---|
|  |  |  | {field: 'bindPhone', title: '手机号', minWidth: 150,align:'left'}, | 
|---|
|  |  |  | {field: 'phone', title: '账号', minWidth: 150,align:'left'}, | 
|---|
|  |  |  | {field: 'name', title: '名称', minWidth: 100,align:'left'}, | 
|---|
|  |  |  | {field: 'inviteId', title: '邀请码', minWidth: 100,align:'left'}, | 
|---|
|  |  |  | {field: 'levelName', title: '代理层级', minWidth: 100,align:'left'}, | 
|---|
|  |  |  | 
|---|
|  |  |  | {field: 'amount', title: '团队业绩', minWidth: 100,align:'left'}, | 
|---|
|  |  |  | {title: '操作', | 
|---|
|  |  |  | templet: function (d) { | 
|---|
|  |  |  | return '<button class="layui-btn layui-btn-normal layui-btn-xs" lay-event="agentAllMember" shiro:hasPermission="user:update">全部成员</button>' | 
|---|
|  |  |  | if (d.level === 'ZERO_LEVEL'){ | 
|---|
|  |  |  | return '<button class="layui-btn layui-btn-normal layui-btn-xs" lay-event="activate" shiro:hasPermission="user:update">激活</button>' | 
|---|
|  |  |  | + '<button class="layui-btn layui-btn-normal layui-btn-xs" lay-event="agentLevelSet" shiro:hasPermission="user:update">设置代理等级</button>' | 
|---|
|  |  |  | + '<button class="layui-btn layui-btn-normal layui-btn-xs" lay-event="agentAllMember" shiro:hasPermission="user:update">全部成员</button>' | 
|---|
|  |  |  | }else{ | 
|---|
|  |  |  | return '<button class="layui-btn layui-btn-normal layui-btn-xs" lay-event="agentLevelSet" shiro:hasPermission="user:update">设置代理等级</button>' | 
|---|
|  |  |  | + '<button class="layui-btn layui-btn-normal layui-btn-xs" lay-event="agentAllMember" shiro:hasPermission="user:update">全部成员</button>' | 
|---|
|  |  |  | } | 
|---|
|  |  |  | },minWidth: 300,align:'center'} | 
|---|
|  |  |  | ]] | 
|---|
|  |  |  | }); | 
|---|