自动化立体仓库 - WMS系统
skyouc
2 天以前 644b6194f8e5bfbe8d4c431eb53e6b3d36026351
src/main/webapp/static/js/locCache/locCache.js
@@ -18,43 +18,26 @@
        limit: 15,
        limits: [15, 30, 50, 100, 200, 500],
        toolbar: '#toolbar',
        cellMinWidth: 50,
        cellMinWidth: 80,
        height: 'full-120',
        cols: [[{type: 'checkbox'}, {field: 'locNo', align: 'center', title: '库位号'}, {
            field: 'barcode',
            align: 'center',
            title: '托盘码'
        }, {field: 'areaName', align: 'center', title: '库区名称'}, {
            field: 'whsType$',
            align: 'center',
            title: '库位类型'
        }, {field: 'locSts', align: 'center', title: '库位状态'}, {
            field: 'row1',
            align: 'center',
            title: '排'
        }, {field: 'bay1', align: 'center', title: '列'}, {
            field: 'lev1',
            align: 'center',
            title: '层'
        }, {field: 'locType', align: 'center', title: '库位类型'}
            ,{field: 'sort', align: 'center', title: '优先级'}
            ,{field: 'modiUser$', align: 'center', title: '修改人员'
        }, {field: 'modiTime$', align: 'center', title: '修改时间'}, {
            field: 'appeUser$',
            align: 'center',
            title: '创建者'
        }, {field: 'appeTime$', align: 'center', title: '添加时间'}, {
            field: 'frozen',
            align: 'center',
            title: '是否冻结,0.未冻结,1.已冻结',
            hide: true
        }, {field: 'frozenMemo', align: 'center', title: '冻结备注', hide: true}, {
            fixed: 'right',
            title: '操作',
            align: 'center',
            toolbar: '#operate',
            width: 120
        }]],
        cols: [[{type: 'checkbox'}, {field: 'locNo', align: 'center', title: '库位号', width: 120}
            , {field: 'barcode', align: 'center', title: '托盘码'}
            , {field: 'areaName', align: 'center', title: '库区名称'}
            , {field: 'locSts$', align: 'center', title: '库位状态'}
            , {field: 'row1', align: 'center', title: '排'}
            , {field: 'bay1', align: 'center', title: '列'}
            , {field: 'lev1', align: 'center', title: '层'}
            , {field: 'sort', align: 'center', title: '优先级', sort: true}
            , {field: 'modiUser$', align: 'center', title: '修改人员'}
            , {field: 'modiTime$', align: 'center', title: '修改时间'}
            , {field: 'appeUser$', align: 'center', title: '创建者'}
            , {field: 'appeTime$', align: 'center', title: '添加时间'}
            , {field: 'frozen', align: 'center', title: '是否冻结,0.未冻结,1.已冻结', hide: true}
            , {field: 'frozenMemo', align: 'center', title: '冻结备注', hide: true}
            , {fixed: 'right', title: '操作', align: 'center', toolbar: '#operate', width: 160}]
        ],
        request: {
            pageName: 'curr', pageSize: 'limit'
        },
@@ -95,6 +78,13 @@
            case 'addData':
                showEditModel();
                break;
            case 'batchModifties':
                if (checkStatus.length === 0) {
                    layer.msg('请选择需要修改的数据信息', {icon: 2});
                    return;
                }
                batchModifies();
                break;
            case 'deleteData':
                if (checkStatus.length === 0) {
                    layer.msg('请选择要删除的数据', {icon: 2});
@@ -129,10 +119,11 @@
        }
    });
    // 监听行工具事件
    table.on('tool(locCache)', function (obj) {
        var data = obj.data;
        console.log(data)
        switch (obj.event) {
            case 'showDetl':
                locNo = data?.locNo;
@@ -144,7 +135,8 @@
                    area: [top.detailWidth, top.detailHeight],
                    shadeClose: true,
                    content: 'locDetail.html',
                    success: function(layero, index){
                    success: function (layero, index) {
                    }
                });
                break;
@@ -159,7 +151,6 @@
    // 初始化保存
    form.on('submit(initDo)', function (data) {
        console.log(data.field)
        $.ajax({
            url: baseUrl + "/locCache/init/auth",
            headers: {'token': localStorage.getItem('token')},
@@ -180,6 +171,62 @@
        })
    });
    // 修改优先级
    form.on('submit(updateProi)', function (data) {
        var checkStatus = table.checkStatus('locCache').data;
        if (checkStatus.length === 0) {
            layer.msg('请选择需要修改的数据信息', {icon: 2});
            return false;
        }
        var sortVal = data.field.identifying;
        var loadIndex = layer.load(2);
        var promises = checkStatus.map(function (item) {
            return new Promise(function (resolve, reject) {
                $.ajax({
                    url: baseUrl + "/locCache/update/auth",
                    headers: {'token': localStorage.getItem('token')},
                    data: {
                        id: item.id,
                        locNo: item.locNo,
                        sort: sortVal
                    },
                    method: 'POST',
                    success: function (res) {
                        if (res.code === 200) resolve(res);
                        else reject(res);
                    },
                    error: function (err) {
                        reject(err);
                    }
                });
            });
        });
        Promise.all(promises).then(function () {
            layer.close(loadIndex);
            layer.closeAll();
            layer.msg("修改成功");
            tableReload(false);
        }).catch(function (err) {
            layer.close(loadIndex);
            layer.msg("修改失败: " + (err.msg || "未知错误"));
        });
        return false;
    });
    function batchModifies() {
        layer.open({
            type: 1,
            title: '批量修改',
            maxmin: true,
            area: ["400px"],
            shadeClose: true,
            content: $('#batchModify'),
            success: function (layero, index) {
            }
        });
    }
    /* 弹窗 - 新增、修改 */
    function showEditModel(mData) {
@@ -221,7 +268,6 @@
    /* 删除 */
    function del(ids) {
        console.log(ids)
        layer.confirm('确定要删除选中数据吗?', {
            skin: 'layui-layer-admin', shade: .1
        }, function (i) {