自动化立体仓库 - WMS系统
skyouc
2026-01-15 1573adab705da74a98ad5a174f031e9171437c0c
src/main/webapp/static/js/locAroundBind/locAroundBind.js
@@ -12,7 +12,7 @@
    // 数据渲染
    tableIns = table.render({
        elem: '#locAroundBind',
        headers: { token: localStorage.getItem('token') },
        headers: {token: localStorage.getItem('token')},
        url: baseUrl + '/locAroundBind/list/auth',
        page: true,
        limit: 15,
@@ -21,16 +21,16 @@
        cellMinWidth: 50,
        height: 'full-120',
        cols: [[
            { type: 'checkbox' }
            , { field: 'id', align: 'center', title: 'ID' , hide: true }
            , { field: 'devId', align: 'center', title: '机台ID', hide: true }
            , { field: 'devNo', align: 'center', title: '机台号' }
            , { field: 'devName', align: 'center', title: '设备名称' }
            , { field: 'blocId', align: 'center', title: '库位ID', hide: true }
            , { field: 'blocNo', align: 'center', title: '工位' }
            ,{field: 'locType$', align:'center', title: '工位状态'}
            , { field: 'def$', align: 'center', title: '工位类型' }
            , { fixed: 'right', title: '操作', align: 'center', toolbar: '#operate', width: 120 }
            {type: 'checkbox'}
            , {field: 'id', align: 'center', title: 'ID', hide: true}
            , {field: 'devId', align: 'center', title: '机台ID', hide: true}
            , {field: 'devNo', align: 'center', title: '机台号'}
            , {field: 'devName', align: 'center', title: '设备名称'}
            , {field: 'blocId', align: 'center', title: '库位ID', hide: true}
            , {field: 'blocNo', align: 'center', title: '工位'}
            , {field: 'locType$', align: 'center', title: '工位状态'}
            , {field: 'def$', align: 'center', title: '工位类型'}
            , {fixed: 'right', title: '操作', align: 'center', toolbar: '#operate', width: 240}
        ]],
        request: {
            pageName: 'curr',
@@ -66,7 +66,7 @@
        searchData['orderByType'] = obj.type;
        tableIns.reload({
            where: searchData,
            page: { curr: 1 }
            page: {curr: 1}
        });
    });
@@ -79,7 +79,7 @@
                break;
            case 'deleteData':
                if (checkStatus.length === 0) {
                    layer.msg('请选择要删除的数据', { icon: 2 });
                    layer.msg('请选择要删除的数据', {icon: 2});
                    return;
                }
                del(checkStatus.map(function (d) {
@@ -87,7 +87,7 @@
                }));
                break;
            case 'exportData':
                admin.confirm('确定导出Excel吗', { shadeClose: true }, function () {
                admin.confirm('确定导出Excel吗', {shadeClose: true}, function () {
                    var titles = [];
                    var fields = [];
                    obj.config.cols[0].map(function (col) {
@@ -106,7 +106,7 @@
                    };
                    $.ajax({
                        url: baseUrl + "/locAroundBind/export/auth",
                        headers: { 'token': localStorage.getItem('token') },
                        headers: {'token': localStorage.getItem('token')},
                        data: JSON.stringify(param),
                        dataType: 'json',
                        contentType: 'application/json;charset=UTF-8',
@@ -118,15 +118,15 @@
                            } else if (res.code === 403) {
                                top.location.href = baseUrl + "/";
                            } else {
                                layer.msg(res.msg, { icon: 2 })
                                layer.msg(res.msg, {icon: 2})
                            }
                        }
                    });
                });
                break;
            case "init":
                layer.prompt({ title: '请输入口令,并重置库位', formType: 1, shadeClose: true }, function (pass, idx) {
                    http.get(baseUrl + "/locMast/init/pwd", { pwd: pass }, function (res) {
                layer.prompt({title: '请输入口令,并重置库位', formType: 1, shadeClose: true}, function (pass, idx) {
                    http.get(baseUrl + "/locMast/init/pwd", {pwd: pass}, function (res) {
                        if (res.data) {
                            layer.open({
                                type: 1,
@@ -149,11 +149,26 @@
        }
    });
    // iframe物料详情
    function locDetlToLayer(val) {
        locNo = val;
        layer.open({
            type: 2,
            title: '库存明细',
            maxmin: true,
            area: [top.detailWidth, top.detailHeight],
            shadeClose: true,
            content: '../report/locDetl.html',
            success: function(layero, index){
            }
        });
    }
    // 初始化保存
    form.on('submit(initDo)', function (data) {
        $.ajax({
            url: baseUrl + "/locAroundBind/bind/init",
            headers: { 'token': localStorage.getItem('token') },
            headers: {'token': localStorage.getItem('token')},
            data: JSON.stringify(data.field),
            contentType: 'application/json;charset=UTF-8',
            method: 'POST',
@@ -182,6 +197,17 @@
            case "del":
                del([data.id]);
                break;
            // 查看明细
            case 'locDetl':
                if (data.locType.trim() === ''
                    || data.locType.trim() === 'S'
                    || data.locType.trim() === 'D'
                    || data.locType.trim() === 'O') {
                    layer.msg("工位的状态不存在物料");
                    return;
                }
                locDetlToLayer(data.blocNo);
                break;
        }
    });
@@ -199,19 +225,19 @@
                    var loadIndex = layer.load(2);
                    $.ajax({
                        url: baseUrl + "/locAroundBind/" + (mData ? 'update' : 'add') + "/auth",
                        headers: { 'token': localStorage.getItem('token') },
                        headers: {'token': localStorage.getItem('token')},
                        data: data.field,
                        method: 'POST',
                        success: function (res) {
                            layer.close(loadIndex);
                            if (res.code === 200) {
                                layer.close(dIndex);
                                layer.msg(res.msg, { icon: 1 });
                                layer.msg(res.msg, {icon: 1});
                                tableReload();
                            } else if (res.code === 403) {
                                top.location.href = baseUrl + "/";
                            } else {
                                layer.msg(res.msg, { icon: 2 });
                                layer.msg(res.msg, {icon: 2});
                            }
                        }
                    })
@@ -233,18 +259,18 @@
            var loadIndex = layer.load(2);
            $.ajax({
                url: baseUrl + "/locAroundBind/delete/auth",
                headers: { 'token': localStorage.getItem('token') },
                data: { ids: ids },
                headers: {'token': localStorage.getItem('token')},
                data: {ids: ids},
                method: 'POST',
                success: function (res) {
                    layer.close(loadIndex);
                    if (res.code === 200) {
                        layer.msg(res.msg, { icon: 1 });
                        layer.msg(res.msg, {icon: 1});
                        tableReload();
                    } else if (res.code === 403) {
                        top.location.href = baseUrl + "/";
                    } else {
                        layer.msg(res.msg, { icon: 2 });
                        layer.msg(res.msg, {icon: 2});
                    }
                }
            })
@@ -270,6 +296,7 @@
        }, 300);
    }
    layDateRender();
});
@@ -286,6 +313,6 @@
    });
    tableIns.reload({
        where: searchData,
        page: { curr: pageCurr }
        page: {curr: pageCurr}
    });
}