|  |  |  | 
|---|
|  |  |  | <div class="layui-col-md10"> | 
|---|
|  |  |  | <div class="layui-form-item"> | 
|---|
|  |  |  | <div class="layui-inline"> | 
|---|
|  |  |  | <label class="layui-form-label">名称:</label> | 
|---|
|  |  |  | <div class="layui-input-inline"> | 
|---|
|  |  |  | <input type="text" placeholder="用户名" name="name" autocomplete="off" class="layui-input"> | 
|---|
|  |  |  | <input type="text" placeholder="名称" name="name" autocomplete="off" class="layui-input"> | 
|---|
|  |  |  | </div> | 
|---|
|  |  |  | </div> | 
|---|
|  |  |  | <div class="layui-inline"> | 
|---|
|  |  |  | <label class="layui-form-label">账号:</label> | 
|---|
|  |  |  | <div class="layui-input-inline"> | 
|---|
|  |  |  | <input type="text" placeholder="手机号" name="account" autocomplete="off" class="layui-input"> | 
|---|
|  |  |  | <input type="text" placeholder="账号" name="account" autocomplete="off" class="layui-input"> | 
|---|
|  |  |  | </div> | 
|---|
|  |  |  | </div> | 
|---|
|  |  |  | <div class="layui-inline"> | 
|---|
|  |  |  | <label class="layui-form-label layui-form-label-sm">账户状态</label> | 
|---|
|  |  |  | <label class="layui-form-label">代理层级:</label> | 
|---|
|  |  |  | <div class="layui-input-inline"> | 
|---|
|  |  |  | <select name="level"> | 
|---|
|  |  |  | <option value="">请选择</option> | 
|---|
|  |  |  | <option value="FIRST_LEVEL">FIRST_LEVEL</option> | 
|---|
|  |  |  | <option value="SECOND_LEVEL">SECOND_LEVEL</option> | 
|---|
|  |  |  | <option value="ZERO_LEVEL">普通会员</option> | 
|---|
|  |  |  | <option value="SECOND_LEVEL">1星</option> | 
|---|
|  |  |  | <option value="THIRD_LEVEL">2星</option> | 
|---|
|  |  |  | <option value="FOUR_LEVEL">3星</option> | 
|---|
|  |  |  | <option value="FIFTH_LEVEL">4星</option> | 
|---|
|  |  |  | <option value="SIX_LEVEL">5星</option> | 
|---|
|  |  |  | <option value="SEVEN_LEVEL">6星</option> | 
|---|
|  |  |  | </select> | 
|---|
|  |  |  | </div> | 
|---|
|  |  |  | </div> | 
|---|
|  |  |  | 
|---|
|  |  |  | <a lay-event="edit" shiro:hasPermission="user:update"><i | 
|---|
|  |  |  | class="layui-icon febs-edit-area febs-blue"></i></a> | 
|---|
|  |  |  | </script> | 
|---|
|  |  |  |  | 
|---|
|  |  |  | <!-- 表格操作栏 start --> | 
|---|
|  |  |  | <script type="text/html" id="agentList-option"> | 
|---|
|  |  |  | <button class="layui-btn layui-btn-normal layui-btn-xs" type="button" shiro:hasPermission="agentList:tdView">字段显示隐藏</button> | 
|---|
|  |  |  | </script> | 
|---|
|  |  |  | <!-- 表格操作栏 end --> | 
|---|
|  |  |  | <script data-th-inline="none" type="text/javascript"> | 
|---|
|  |  |  | // 引入组件并初始化 | 
|---|
|  |  |  | 
|---|
|  |  |  | sortObject = {field: 'phone', type: null}, | 
|---|
|  |  |  | tableIns; | 
|---|
|  |  |  |  | 
|---|
|  |  |  | let toolbarAgentList = $.trim($("#agentList-option").html())==="" ? true : false; | 
|---|
|  |  |  |  | 
|---|
|  |  |  | form.render(); | 
|---|
|  |  |  |  | 
|---|
|  |  |  | // 表格初始化 | 
|---|
|  |  |  | 
|---|
|  |  |  | table.on('tool(userAgentTable)', function (obj) { | 
|---|
|  |  |  | var data = obj.data, | 
|---|
|  |  |  | layEvent = obj.event; | 
|---|
|  |  |  | // if (layEvent === 'close') { | 
|---|
|  |  |  | //     febs.modal.confirm('禁用', '确认禁用该账号?', function () { | 
|---|
|  |  |  | //         closeAccount(data.id); | 
|---|
|  |  |  | //     }); | 
|---|
|  |  |  | // } | 
|---|
|  |  |  | // if (layEvent === 'open') { | 
|---|
|  |  |  | //     febs.modal.confirm('开启', '确认开启该账号?', function () { | 
|---|
|  |  |  | //         openAccount(data.id); | 
|---|
|  |  |  | //     }); | 
|---|
|  |  |  | // } | 
|---|
|  |  |  | // if (layEvent === 'see') { | 
|---|
|  |  |  | //     febs.modal.open( '个人信息', 'modules/mallMember/detail/' + data.id, { | 
|---|
|  |  |  | //         maxmin: true, | 
|---|
|  |  |  | //     }); | 
|---|
|  |  |  | // } | 
|---|
|  |  |  | // if (layEvent === 'moneyFlow') { | 
|---|
|  |  |  | //     febs.modal.open( '用户资金流水', 'modules/mallMember/moneyFlow/' + data.id, { | 
|---|
|  |  |  | //         maxmin: true, | 
|---|
|  |  |  | //     }); | 
|---|
|  |  |  | // } | 
|---|
|  |  |  | if (layEvent === 'agentAllMember') { | 
|---|
|  |  |  | febs.modal.open( '全部成员', 'modules/mallMember/agentAllMember/' + data.id, { | 
|---|
|  |  |  | 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 closeAccount(id) { | 
|---|
|  |  |  | //     febs.get(ctx + 'admin/mallMember/closeAccount/' + id, null, function () { | 
|---|
|  |  |  | //         febs.alert.success('禁用成功'); | 
|---|
|  |  |  | //         $query.click(); | 
|---|
|  |  |  | //     }); | 
|---|
|  |  |  | // } | 
|---|
|  |  |  | // function openAccount(id) { | 
|---|
|  |  |  | //     febs.get(ctx + 'admin/mallMember/openAccount/' + id, null, function () { | 
|---|
|  |  |  | //         febs.alert.success('开启成功'); | 
|---|
|  |  |  | //         $query.click(); | 
|---|
|  |  |  | //     }); | 
|---|
|  |  |  | // } | 
|---|
|  |  |  |  | 
|---|
|  |  |  | 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',hide:toolbarAgentList}, | 
|---|
|  |  |  | {field: 'name', title: '名称', minWidth: 100,align:'left'}, | 
|---|
|  |  |  | {field: 'inviteId', title: '邀请码', minWidth: 100,align:'left'}, | 
|---|
|  |  |  | {field: 'level', title: '代理层级', minWidth: 100,align:'left'}, | 
|---|
|  |  |  | {field: 'levelName', title: '代理层级', minWidth: 100,align:'left'}, | 
|---|
|  |  |  | {field: 'memberNum', title: '下级', minWidth: 100,align:'left'}, | 
|---|
|  |  |  | {field: 'allMemberNum', title: '我的团队总数', minWidth: 100,align:'left'}, | 
|---|
|  |  |  | // {title: '操作', | 
|---|
|  |  |  | //     templet: function (d) { | 
|---|
|  |  |  | //         if (d.accountStatus === 1) { | 
|---|
|  |  |  | //             return '<button class="layui-btn layui-btn-normal layui-btn-xs" lay-event="see" shiro:hasPermission="user:update">详情</button>' | 
|---|
|  |  |  | //                 +'<button class="layui-btn layui-btn-normal layui-btn-xs" lay-event="close" shiro:hasPermission="user:update">禁用</button>' | 
|---|
|  |  |  | //                 +'<button class="layui-btn layui-btn-normal layui-btn-xs" lay-event="moneyFlow" shiro:hasPermission="user:update">资金流水</button>' | 
|---|
|  |  |  | // | 
|---|
|  |  |  | //         }else{ | 
|---|
|  |  |  | //             return '<button class="layui-btn layui-btn-normal layui-btn-xs" lay-event="see" shiro:hasPermission="user:update">详情</button>' | 
|---|
|  |  |  | //                 +'<button class="layui-btn layui-btn-normal layui-btn-xs" lay-event="open" shiro:hasPermission="user:update">启用</button>' | 
|---|
|  |  |  | //                 +'<button class="layui-btn layui-btn-normal layui-btn-xs" lay-event="moneyFlow" shiro:hasPermission="user:update">资金流水</button>' | 
|---|
|  |  |  | // | 
|---|
|  |  |  | //         } | 
|---|
|  |  |  | //     },minWidth: 300,align:'center'} | 
|---|
|  |  |  | {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>' | 
|---|
|  |  |  | },minWidth: 300,align:'center'} | 
|---|
|  |  |  | ]] | 
|---|
|  |  |  | }); | 
|---|
|  |  |  | } | 
|---|