自动化立体仓库 - WMS系统
#
luxiaotao1123
2020-06-30 de5996788779f7388d3d3ccc22911914eaaf8fcc
src/main/webapp/static/js/user/user.js
@@ -1,4 +1,5 @@
var pageCurr;
var tableData;
layui.use(['table','laydate', 'form'], function(){
    var table = layui.table;
    var $ = layui.jquery;
@@ -23,10 +24,10 @@
            // ,{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}
        ]],
@@ -49,10 +50,22 @@
            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) {
@@ -71,6 +84,7 @@
                if (res.code === 403) {
                    top.location.href = baseUrl+"/";
                }
                tableData = table.cache.user;
                pageCurr=curr;
                limit();
            }
@@ -86,7 +100,7 @@
                    type: 2,
                    title: '新增',
                    maxmin: true,
                    area: [top.detailWidth, top.detailHeight],
                    area: ['30%', top.detailHeight],
                    shadeClose: true,
                    content: 'user_detail.html',
                    success: function(layero, index){
@@ -202,7 +216,7 @@
                    type: 2,
                    title: '修改',
                    maxmin: true,
                    area: [top.detailWidth, top.detailHeight],
                    area: ['30%', top.detailHeight],
                    shadeClose: true,
                    content: 'user_detail.html',
                    success: function(layero, index){
@@ -344,14 +358,10 @@
        type: 'datetime'
    });
    layDate.render({
        elem: '#create_time\\>',
        type: 'datetime'
        elem: '.layui-laydate-range'
        ,type: 'datetime'
        ,range: true
    });
    layDate.render({
        elem: '#create_time\\<',
        type: 'datetime'
    });
});
// 关闭动作
@@ -373,6 +383,7 @@
            if (res.code === 403) {
                top.location.href = baseUrl+"/";
            }
            tableData = table.cache.user;
            pageCurr=curr;
            if (res.data.length === 0 && count !== 0) {
                tableIns.reload({