自动化立体仓库 - WMS系统
#
luxiaotao1123
2022-03-30 88f285842419bdc871ba1a5da897e0ac90ee08fb
src/main/webapp/static/js/pakStore/pakStore.js
@@ -1,21 +1,25 @@
var admin;
var initCountVal = 0;
var matCodeData = [];
function getCol() {
    var cols = [
        {fixed: 'left', field: 'count', title: '数量(必填)', align: 'center', edit:'text', width: 120,  style:'color: blue;font-weight: bold'}
        {fixed: 'left', field: 'count', title: '数量(必填)', align: 'center', edit:'text', width: 120,  style:'color: blue;font-weight: bold'},
        {field: 'batch', title: '批号(选填)', align: 'center', edit:'text', width: 200,  style:'color: blue;font-weight: bold'}
    ];
    cols.push.apply(cols, matCols);
    cols.push({fixed: 'right', title:'操作', align: 'center', toolbar: '#operate', width:80})
    cols.push({fixed: 'right', title:'操作', align: 'center', toolbar: '#operate', width: 80})
    return cols;
}
layui.use(['table','laydate', 'form'], function() {
layui.config({
    base: baseUrl + "/static/layui/lay/modules/"
}).use(['admin', 'table','laydate', 'form'], function() {
    var table = layui.table;
    var $ = layui.jquery;
    var layer = layui.layer;
    var layDate = layui.laydate;
    var form = layui.form;
    admin = layui.admin;
    tableIns = table.render({
        elem: '#chooseData',
@@ -35,6 +39,23 @@
    // 页面修改
    table.on('edit(chooseData)', function (obj) {
        let index = obj.tr.attr("data-index");
        let data = matCodeData[index];
        if (obj.field === 'anfme'){
            let vle = Number(obj.value);
            if (isNaN(vle)) {
                layer.msg("请输入数字", {icon: 2});
                return false;
            } else {
                if (vle <= 0) {
                    layer.msg("数量必须大于零", {icon: 2});
                    return false;
                }
            }
        }
        data[obj.field] = obj.value;
        tableIns.reload({data: matCodeData});
        updateMatCodeData(obj.data.matNo, Number(obj.value));
    });
@@ -93,7 +114,7 @@
        var data = obj.data;
        switch (obj.event) {
            case 'remove':
                for (var i = matCodeData.length - 1; i >= 0; i--) {
                for (let i = matCodeData.length - 1; i >= 0; i--) {
                    if (matCodeData[i].matNo === data.matNo) {
                        matCodeData.splice(i, 1);
                    }
@@ -101,7 +122,6 @@
                tableIns.reload({data: matCodeData,done:function (res) {
                        limit();
                        getInBound();
                        // 覆盖render方法的done
                    }});
                break;
        }
@@ -132,7 +152,6 @@
        tableIns.reload({data: matCodeData,done:function (res) {
                limit();
                getInBound();
                // 覆盖render方法的done
            }});
    }
@@ -152,7 +171,7 @@
                } else if (res.code === 403) {
                    top.location.href = baseUrl + "/";
                } else {
                    layer.msg(res.msg)
                    layer.msg(res.msg, {icon: 2})
                }
            }
        })
@@ -164,7 +183,7 @@
// 提取物料
var matCodeLayerIdx;
function getMat() {
    matCodeLayerIdx = layer.open({
    matCodeLayerIdx = admin.open({
        type: 2,
        title: '提取物料',
        maxmin: true,