| | |
| | | <div class="layui-col-md10"> |
| | | <div class="layui-form-item"> |
| | | <div class="layui-inline"> |
| | | <label class="layui-form-label layui-form-label-sm">用户昵称</label> |
| | | <label class="layui-form-label layui-form-label-sm">用户名</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 layui-form-label-sm">手机号码</label> |
| | | <label class="layui-form-label layui-form-label-sm">联系方式</label> |
| | | <div class="layui-input-inline"> |
| | | <input type="text" placeholder="手机号码" name="phone" autocomplete="off" class="layui-input"> |
| | | <input type="text" placeholder="联系方式" name="phone" autocomplete="off" class="layui-input"> |
| | | </div> |
| | | </div> |
| | | |
| | | <div class="layui-inline"> |
| | | <label class="layui-form-label layui-form-label-sm">会员等级</label> |
| | | <div class="layui-input-inline"> |
| | | <select name="director" class="director-type"> |
| | | <option value="">请选择</option> |
| | | </select> |
| | | </div> |
| | | </div> |
| | | |
| | | <div class="layui-inline"> |
| | | <label class="layui-form-label layui-form-label-sm">分销等级</label> |
| | | <div class="layui-input-inline"> |
| | | <select name="storeMaster" class="storeMaster-type"> |
| | | <option value="">请选择</option> |
| | | </select> |
| | | </div> |
| | | </div> |
| | | <div class="layui-inline"> |
| | | <label class="layui-form-label layui-form-label-sm">状态</label> |
| | | <div class="layui-input-inline"> |
| | | <select name="accountStatus"> |
| | | <option value="">请选择</option> |
| | | <option value="1">启用</option> |
| | | <option value="2">停用</option> |
| | | </select> |
| | | </div> |
| | | </div> |
| | | <div class="layui-inline"> |
| | |
| | | <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="switchStatus"> |
| | | <script type="text/html" id="accountStatusSwitch"> |
| | | {{# if(d.accountStatus === 1) { }} |
| | | <input type="checkbox" value={{d.id}} lay-text="正常|禁用" checked lay-skin="switch" lay-filter="switchStatus"> |
| | | <input type="checkbox" value={{d.id}} lay-text="启用|停用" checked lay-skin="switch" lay-filter="accountStatusSwitch"> |
| | | {{# } else { }} |
| | | <input type="checkbox" value={{d.id}} lay-text="正常|禁用" lay-skin="switch" lay-filter="switchStatus"> |
| | | <input type="checkbox" value={{d.id}} lay-text="启用|停用" lay-skin="switch" lay-filter="accountStatusSwitch"> |
| | | {{# } }} |
| | | </script> |
| | | <script type="text/html" id="switchStoreMaster"> |
| | |
| | | background-color: #5FB878 !important; |
| | | } |
| | | </style> |
| | | <script type="text/html" id="toolbar"> |
| | | <script type="text/html" id="memberToolbar"> |
| | | <div class="layui-btn-container"> |
| | | <!-- <button class="layui-btn layui-btn-normal layui-btn-sm" type="button" lay-event="updateReferer">修改推荐人</button>--> |
| | | <!-- <button class="layui-btn layui-btn-normal layui-btn-sm" type="button" lay-event="updateVipLevel">修改会员等级</button>--> |
| | | <button class="layui-btn layui-btn-normal layui-btn-sm" type="button" shiro:hasPermission="updateMemberLevel:update" lay-event="updateMemberLevel">修改会员等级</button> |
| | | <button class="layui-btn layui-btn-normal layui-btn-sm" type="button" shiro:hasPermission="updateSaleLevel:update" lay-event="updateSaleLevel">修改分销等级</button> |
| | | <!-- <button class="layui-btn layui-btn-normal layui-btn-sm" type="button" lay-event="addCoupon">优惠券派送</button>--> |
| | | </div> |
| | | </script> |
| | |
| | | elem: '#febs-member-benefits-list-birthday-start', |
| | | format:'MM-dd' |
| | | }); |
| | | //(下拉框) |
| | | $.get(ctx + 'admin/level/levelAll', function (res) { |
| | | var data = res.data; |
| | | for (let k in data) |
| | | { |
| | | $(".director-type").append("<option value='" + data[k].code + "'>" + data[k].name + "</option>"); |
| | | } |
| | | layui.use('form', function () { |
| | | var form = layui.form; |
| | | form.render(); |
| | | }); |
| | | }); |
| | | //(下拉框) |
| | | $.get(ctx + 'admin/level/saleLevelAll', function (res) { |
| | | var data = res.data; |
| | | for (let k in data) |
| | | { |
| | | $(".storeMaster-type").append("<option value='" + data[k].code + "'>" + data[k].name + "</option>"); |
| | | } |
| | | layui.use('form', function () { |
| | | var form = layui.form; |
| | | form.render(); |
| | | }); |
| | | }); |
| | | |
| | | // 表格初始化 |
| | | initTable(); |
| | | initMemberListTable(); |
| | | |
| | | // 初始化表格操作栏各个按钮功能 |
| | | table.on('tool(userTable)', function (obj) { |
| | |
| | | } |
| | | function closeAccount(id) { |
| | | febs.get(ctx + 'admin/mallMember/closeAccount/' + id, null, function () { |
| | | febs.alert.success('禁用成功'); |
| | | febs.alert.success('操作成功'); |
| | | $query.click(); |
| | | }); |
| | | } |
| | | function openAccount(id) { |
| | | febs.get(ctx + 'admin/mallMember/openAccount/' + id, null, function () { |
| | | febs.alert.success('开启成功'); |
| | | febs.alert.success('操作成功'); |
| | | $query.click(); |
| | | }); |
| | | } |
| | |
| | | tableIns.reload({where: getQueryParams(), page: {curr: 1}, initSort: sortObject}); |
| | | }); |
| | | |
| | | function initTable() { |
| | | function initMemberListTable() { |
| | | tableIns = febs.table.init({ |
| | | elem: $view.find('table'), |
| | | id: 'userTable', |
| | | url: ctx + 'admin/mallMember/getMallMemberList', |
| | | toolbar:"#toolbar", |
| | | toolbar:"#memberToolbar", |
| | | defaultToolbar:[], |
| | | cols: [[ |
| | | {type: 'checkbox'}, |
| | |
| | | {field: 'name', title: '用户名', minWidth: 100,align:'left'}, |
| | | {field: 'realName', title: '真实姓名', minWidth: 100,align:'left'}, |
| | | {field: 'phone', title: '联系方式', minWidth: 150,align:'left'}, |
| | | {field: 'directorName', title: '会员等级', minWidth: 150,align:'left'}, |
| | | {field: 'storeMasterName', title: '分销等级', minWidth: 150,align:'left'}, |
| | | {field: 'inviteId', title: '邀请码', minWidth: 100,align:'left'}, |
| | | {field: 'checkOrder', title: '状态', templet: '#accountStatusSwitch', minWidth: 100,align:'center'}, |
| | | {field: 'checkOrder', title: '核销员', templet: '#checkOrderSwitch', minWidth: 100,align:'center'}, |
| | | {field: 'createdTime', title: '注册时间', minWidth: 180,align:'center'}, |
| | | ]] |
| | |
| | | }); |
| | | } |
| | | |
| | | if (layEvent === 'updateVipLevel') { |
| | | if (layEvent === 'updateSaleLevel') { |
| | | var checkData = table.checkStatus('userTable').data; |
| | | if (checkData.length > 1) { |
| | | febs.alert.warn('每次只能修改一个用户'); |
| | | return; |
| | | } |
| | | // var idList = []; |
| | | // for (var i = 0; i < checkData.length; i++) { |
| | | // idList.push(checkData[i].id); |
| | | // } |
| | | febs.modal.open('设置分销等级', 'modules/mallMember/saleLevelSetting/' + checkData[0].id, { |
| | | btn: ['确认', '取消'], |
| | | yes: function (index, layero) { |
| | | $('#sale-level-set').find('#submit').trigger('click'); |
| | | }, |
| | | btn2: function () { |
| | | layer.closeAll(); |
| | | } |
| | | }); |
| | | } |
| | | |
| | | if (layEvent === 'updateMemberLevel') { |
| | | var checkData = table.checkStatus('userTable').data; |
| | | if (checkData.length > 1) { |
| | | febs.alert.warn('每次只能修改一个用户'); |
| | | return; |
| | | } |
| | | febs.modal.open('设置会员等级', 'modules/mallMember/vipLevelSetting/' + checkData[0].id, { |
| | | btn: ['确认', '取消'], |
| | | yes: function (index, layero) { |
| | |
| | | name: $searchForm.find('input[name="name"]').val().trim(), |
| | | phone: $searchForm.find('input[name="phone"]').val().trim(), |
| | | checkOrder: $searchForm.find("select[name='checkOrder']").val(), |
| | | accountStatus: $searchForm.find("select[name='accountStatus']").val(), |
| | | director: $searchForm.find("select[name='director']").val(), |
| | | storeMaster: $searchForm.find("select[name='storeMaster']").val(), |
| | | }; |
| | | } |
| | | |
| | | form.on('switch(switchStatus)', function (data) { |
| | | form.on('switch(accountStatusSwitch)', function (data) { |
| | | if (data.elem.checked) { |
| | | openAccount(data.value); |
| | | } else { |