自动化立体仓库 - WMS系统
whycq
2024-10-16 405e94c5d08e89c9bf2bd0820d39ceeaa049211d
src/main/webapp/static/js/locDetl/locDetl.js
@@ -1,7 +1,33 @@
var pageCurr;
var tableData;
function getCol() {
    var cols = [{field: 'locNo$', align: 'center',title: '库位号'}];
    cols.push.apply(cols, detlCols);
    var cols = [
        {field: 'locNo$', align: 'center',title: '库位号'}
        ,{field: 'suppCode', align: 'center',title: '货架码', sort:true}
        ,{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: '序列码', sort:true}
        ,{field: 'anfme', align: 'center',title: '数量'}
        ,{field: 'threeCode', align: 'center',title: '销售订单号', hide: true}
        ,{field: 'deadTime', align: 'center',title: '销售订单行号', hide: true}
        ,{field: 'zpallet', align: 'center',title: '托盘条码'}
        ,{field: 'specs', align: 'center',title: '规格型号', hide: true}
        ,{field: 'model', align: 'center',title: '通用型号', hide: true}
        ,{field: 'brand', align: 'center',title: '商品分类编码', hide: true}
        ,{field: 'color', align: 'center',title: '商品分类名称', hide: true}
        ,{field: 'unit', align: 'center',title: '计量单位', hide: true}
        ,{field: 'price', align: 'center',title: '进项税', hide: true}
        ,{field: 'units', align: 'center',title: '销项税', hide: true}
        ,{field: 'memo', align: 'center',title: '备注', hide: true}
    ];
    // cols.push.apply(cols, detlCols);
    cols.push({field: 'modiUser$', align: 'center',title: '修改人员',hide: true}
        ,{field: 'modiTime$', align: 'center',title: '修改时间'}
        ,{field: 'stockFreeze', align: 'center',title: '库存冻结', templet: '#stockFreezeTpl'}
    )
    return cols;
}
@@ -18,8 +44,11 @@
        headers: {token: localStorage.getItem('token')},
        url: baseUrl+'/locDetl/list/auth',
        page: true,
        limit: 16,
        limits: [16, 30, 50, 100, 200, 500],
        limit: 20,
        where:{
          unreason: false
        },
        limits: [20, 30, 50, 100, 200, 500],
        even: true,
        toolbar: '#toolbar',
        cellMinWidth: 50,
@@ -43,6 +72,7 @@
            if (res.code === 403) {
                top.location.href = baseUrl+"/";
            }
            tableData = table.cache.locDetl;
            pageCurr=curr;
            limit();
            form.on('checkbox(tableCheckbox)', function (data) {
@@ -150,6 +180,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')},
@@ -158,8 +189,20 @@
                        contentType:'application/json;charset=UTF-8',
                        method: 'POST',
                        success: function (res) {
                            layer.close(loadIndex);
                            layer.closeAll();
                            if (res.code === 200) {
                                res.data.forEach((item,index) => {
                                    if (item[0] != null) {
                                        item[0] = "'" + item[0];
                                    }
                                    if (item[1] != null) {
                                        item[1] = "'" + item[1];
                                    }
                                    if (item[2] != null) {
                                        item[2] = "'" + item[2];
                                    }
                                })
                                table.exportFile(titles,res.data,'xls');
                            } else if (res.code === 403) {
                                top.location.href = baseUrl+"/";
@@ -405,11 +448,35 @@
        tableReload(false);
    });
    // 搜索栏重置事件
    form.on('submit(reset)', function (data) {
        pageCurr = 1;
        clearFormVal($('#search-box'));
        tableReload(false);
    });
    //查看异常数据
    form.on('submit(unreason)', function (data) {
        pageCurr = 1;
        tableIns.reload({
            where: {
                unreason: true
            },
            page: {
                curr: pageCurr
            },
            done: function (res, curr, count) {
                if (res.code === 403) {
                    top.location.href = baseUrl+"/";
                }
                pageCurr=curr;
                limit(child);
            }
        });
    });
    // 时间选择器
@@ -422,6 +489,19 @@
        type: 'datetime'
    });
    form.on('switch(stockFreezeSwitch)', function (obj) {
        let index  = obj.othis.parents('tr').attr("data-index");
        let data = tableData[index];
        data[this.stockFreeze] = obj.elem.checked?1:0;
        http.post(baseUrl + "/locDetl/updateStockFreeze/auth", {
            locNo: data.locNo,
            matnr: data.matnr,
            stockFreeze: data[this.stockFreeze]
        }, function (res) {
            layer.msg(res.msg, {icon: 1});
        });
    })
});
@@ -431,7 +511,9 @@
});
function tableReload(child) {
    var searchData = {};
    var searchData = {
        unreason: false
    };
    $.each($('#search-box [name]').serializeArray(), function() {
        searchData[this.name] = this.value;
    });