自动化立体仓库 - WMS系统
#
lfd
2025-03-06 d3234825d804a6a205dba1c6092acc8e29981b81
src/main/webapp/static/js/locDetl/locDetl.js
@@ -1,4 +1,49 @@
var pageCurr;
function getCol() {
    var cols = [
        {field: 'locNo$', align: 'center',title: '库位号'},
        {field: 'matnr', align: 'center',title: '商品编号', sort:true}
        ,{field: 'maktx', align: 'center',title: '商品名称', sort:true}
        ,{field: 'orderNo', align: 'center',title: '单据编号', hide: false}
        ,{field: 'batch', align: 'center',title: '批号', width: 300, sort:true}
        ,{field: 'anfme', align: 'center',title: '数量'}
        ,{field: 'zpallet', align: 'center',title: '托盘条码'}
        ,{field: 'specs', align: 'center',title: '规格'}
        ,{field: 'model', align: 'center',title: '代码', hide: true}
        ,{field: 'color', align: 'center',title: '颜色', hide: true}
        ,{field: 'brand', align: 'center',title: '品牌', hide: true}
        ,{field: 'unit', align: 'center',title: '单位', hide: true}
        ,{field: 'price', align: 'center',title: '单价', hide: true}
        ,{field: 'sku', align: 'center',title: 'sku', hide: true}
        ,{field: 'units', align: 'center',title: '单位量', hide: true}
        ,{field: 'barcode', align: 'center',title: '条码', hide: true}
        ,{field: 'origin', align: 'center',title: '产地', hide: true}
        ,{field: 'manu', align: 'center',title: '厂家', hide: true}
        ,{field: 'manuDate', align: 'center',title: '生产日期', hide: true}
        ,{field: 'itemNum', align: 'center',title: '品项数', hide: true}
        ,{field: 'safeQty', align: 'center',title: '安全库存量', hide: true}
        ,{field: 'weight', align: 'center',title: '单箱净重', hide: true}
        ,{field: 'length', align: 'center',title: '单箱毛重', hide: true}
        ,{field: 'volume', align: 'center',title: '单箱体积', hide: true}
        ,{field: 'threeCode', align: 'center',title: '箱子尺寸', hide: true}
        ,{field: 'supp', align: 'center',title: '供应商', hide: true}
        ,{field: 'suppCode', align: 'center',title: '供应商编码', hide: true}
        ,{field: 'beBatch$', align: 'center',title: '是否批次', hide: true}
        ,{field: 'deadTime', align: 'center',title: '保质期', hide: true}
        ,{field: 'deadWarn', align: 'center',title: '预警天数', hide: true}
        ,{field: 'source$', align: 'center',title: '制购', hide: true}
        ,{field: 'check$', align: 'center',title: '要求检验', hide: true}
        ,{field: 'danger$', align: 'center',title: '危险品', hide: true}
    ];
    // cols.push.apply(cols, detlCols);
    cols.push({field: 'modiUser$', align: 'center',title: '修改人员',hide: true}
        ,{field: 'modiTime$', align: 'center',title: '修改时间'}
    )
    return cols;
}
layui.use(['table','laydate', 'form'], function(){
    var table = layui.table;
    var $ = layui.jquery;
@@ -12,30 +57,12 @@
        headers: {token: localStorage.getItem('token')},
        url: baseUrl+'/locDetl/list/auth',
        page: true,
        limit: 10,
        skin: 'line',
        limit: 16,
        limits: [16, 30, 50, 100, 200, 500],
        even: true,
        toolbar: '#toolbar',
        cellMinWidth: 50,
        cols: [[
            {type: 'checkbox'}
//            ,{field: 'id', title: 'ID', sort: true,align: 'center', fixed: 'left', width: 80}
            ,{field: 'locNo$', align: 'center',title: '库位号',event: 'locNo', style: 'cursor:pointer'}
            ,{field: 'matnr', align: 'center',title: '物料'}
            ,{field: 'lgnum', align: 'center',title: '仓库号', width:80}
            ,{field: 'tbnum', align: 'center',title: '转储请求编号'}
            // ,{field: 'tbpos', align: 'center',title: '行项目'}
            ,{field: 'zmatid', align: 'center',title: '物料标签ID', width:200}
            ,{field: 'maktx', align: 'center',title: '物料描述', width:150}
            ,{field: 'werks', align: 'center',title: '工厂'}
            ,{field: 'anfme', align: 'center',title: '数量', width:80}
            ,{field: 'altme', align: 'center',title: '单位', width:80}
            ,{field: 'zpallet', align: 'center',title: '托盘条码'}
            ,{field: 'bname', align: 'center',title: '用户ID'}
            // ,{field: 'memo', align: 'center',title: '备注'}
            // ,{fixed: 'right', title:'操作', align: 'center', toolbar: '#operate', width:150}
        ]],
        cols: [getCol()],
        request: {
            pageName: 'curr',
            pageSize: 'limit'
@@ -53,7 +80,7 @@
        },
        done: function(res, curr, count) {
            if (res.code === 403) {
                top.location.href = "/";
                top.location.href = baseUrl+"/";
            }
            pageCurr=curr;
            limit();
@@ -83,7 +110,7 @@
            },
            done: function (res, curr, count) {
                if (res.code === 403) {
                    top.location.href = "/";
                    top.location.href = baseUrl+"/";
                }
                pageCurr=curr;
                limit();
@@ -135,7 +162,7 @@
                                    layer.closeAll();
                                    tableReload(false);
                                } else if (res.code === 403){
                                    top.location.href = "/";
                                    top.location.href = baseUrl+"/";
                                } else {
                                    layer.msg(res.msg)
                                }
@@ -145,7 +172,7 @@
                }
                break;
            case 'exportData':
                layer.confirm('确定导出Excel吗', function(){
                layer.confirm('确定导出Excel吗', {shadeClose: true}, function(){
                    var titles=[];
                    var fields=[];
                    obj.config.cols[0].map(function (col) {
@@ -162,6 +189,7 @@
                        'locDetl': exportData,
                        'fields': fields
                    };
                    var loadIndex = layer.msg('正在导出...', {icon: 16, shade: 0.01, time: false});
                    $.ajax({
                        url: baseUrl+"/locDetl/export/auth",
                        headers: {'token': localStorage.getItem('token')},
@@ -170,11 +198,12 @@
                        contentType:'application/json;charset=UTF-8',
                        method: 'POST',
                        success: function (res) {
                            layer.close(loadIndex);
                            layer.closeAll();
                            if (res.code === 200) {
                                table.exportFile(titles,res.data,'xls');
                            } else if (res.code === 403) {
                                top.location.href = "/";
                                top.location.href = baseUrl+"/";
                            } else {
                                layer.msg(res.msg)
                            }
@@ -392,7 +421,7 @@
                        $(this).val("");
                    });
                } else if (res.code === 403){
                    top.location.href = "/";
                    top.location.href = baseUrl+"/";
                }else {
                    layer.msg(res.msg)
                }
@@ -416,6 +445,7 @@
        pageCurr = 1;
        tableReload(false);
    });
    // 搜索栏重置事件
    form.on('submit(reset)', function (data) {
@@ -443,7 +473,8 @@
});
function tableReload(child) {
    var searchData = {};
    var searchData = {
    };
    $.each($('#search-box [name]').serializeArray(), function() {
        searchData[this.name] = this.value;
    });
@@ -454,7 +485,7 @@
        },
        done: function (res, curr, count) {
            if (res.code === 403) {
                top.location.href = "/";
                top.location.href = baseUrl+"/";
            }
            pageCurr=curr;
            if (res.data.length === 0 && count !== 0) {