| | |
| | | var pageCurr; |
| | | var tableData; |
| | | layui.use(['table','laydate', 'form'], function(){ |
| | | var table = layui.table; |
| | | var $ = layui.jquery; |
| | |
| | | // ,{field: 'hostName', align: 'center',title: '授权商户'} |
| | | ,{field: 'mobile', align: 'center',title: '账号'} |
| | | ,{field: 'username', align: 'center',title: '名称'} |
| | | ,{field: 'password', align: 'center',title: '密码'} |
| | | // ,{field: 'password', align: 'center',title: '密码'} |
| | | ,{field: 'roleName', align: 'center',title: '角色'} |
| | | // ,{field: 'createTime$', align: 'center',title: '注册时间'} |
| | | ,{field: 'status$', align: 'center',title: '状态'} |
| | | ,{field: 'status$', align: 'center',title: '状态', templet: '#statusTpl', width: 120, unresize: true} |
| | | |
| | | ,{fixed: 'right', title:'操作', align: 'center', toolbar: '#operate', width:100} |
| | | ]], |
| | |
| | | if (res.code === 403) { |
| | | top.location.href = baseUrl+"/"; |
| | | } |
| | | tableData = table.cache.user; |
| | | pageCurr=curr; |
| | | limit(); |
| | | } |
| | | }); |
| | | |
| | | // 修改状态 |
| | | form.on('switch(statusSwitch)', function (obj) { |
| | | var index = obj.othis.parents('tr').attr("data-index"); |
| | | var data = tableData[index]; |
| | | data[this.name] = obj.elem.checked?1:0; |
| | | http.post(baseUrl+"/user/edit/auth", {id: data.id, status: data[this.name]}, function (res) { |
| | | $(".layui-laypage-btn")[0].click(); |
| | | layer.msg("操作成功") |
| | | }) |
| | | }) |
| | | |
| | | // 监听排序事件 |
| | | table.on('sort(user)', function (obj) { |
| | |
| | | if (res.code === 403) { |
| | | top.location.href = baseUrl+"/"; |
| | | } |
| | | tableData = table.cache.user; |
| | | pageCurr=curr; |
| | | limit(); |
| | | } |
| | |
| | | type: 2, |
| | | title: '新增', |
| | | maxmin: true, |
| | | area: [top.detailWidth, top.detailHeight], |
| | | area: ['30%', top.detailHeight], |
| | | shadeClose: true, |
| | | content: 'user_detail.html', |
| | | success: function(layero, index){ |
| | |
| | | type: 2, |
| | | title: '修改', |
| | | maxmin: true, |
| | | area: [top.detailWidth, top.detailHeight], |
| | | area: ['30%', top.detailHeight], |
| | | shadeClose: true, |
| | | content: 'user_detail.html', |
| | | success: function(layero, index){ |
| | |
| | | type: 'datetime' |
| | | }); |
| | | layDate.render({ |
| | | elem: '#create_time\\>', |
| | | type: 'datetime' |
| | | elem: '.layui-laydate-range' |
| | | ,type: 'datetime' |
| | | ,range: true |
| | | }); |
| | | layDate.render({ |
| | | elem: '#create_time\\<', |
| | | type: 'datetime' |
| | | }); |
| | | |
| | | }); |
| | | |
| | | // 关闭动作 |
| | |
| | | if (res.code === 403) { |
| | | top.location.href = baseUrl+"/"; |
| | | } |
| | | tableData = table.cache.user; |
| | | pageCurr=curr; |
| | | if (res.data.length === 0 && count !== 0) { |
| | | tableIns.reload({ |