王佳豪
2021-05-05 e72d75462010729913d1127bd3c1418726b41992
src/main/webapp/static/js/locNormal/locNormalIn.js
@@ -15,12 +15,17 @@
            style: 'color: blue;font-weight: bold'
        }
    ];
    locNormalCols.map(function (item) {
        if (item.field === 'supplier') {
            item.edit = 'text';
        }
    })
    cols.push.apply(cols, locNormalCols);
    var locNormalColsSelf = [
        {field: 'mnemonic', align: 'center',title: '生产单号', edit: 'text'}
        ,{field: 'supplier', align: 'center',title: '通知单号', edit: 'text'}
        ,{field: 'matnr', align: 'center',title: '物料编码'}
        ,{field: 'maktx', align: 'center',title: '物料名称', width: 400}
        ,{field: 'lgnum', align: 'center',title: '规格'}
        ,{field: 'type', align: 'center',title: '物料类别'}
        ,{field: 'brand', align: 'center',title: '品牌', hide: true}
        ,{field: 'altme', align: 'center',title: '单位', hide: true}
    ];
    cols.push.apply(cols, locNormalColsSelf);
    // cols.push({field: 'matStatus', title: '物料状态', align: 'center', width: 120, templet: '#matStatus'});
    cols.push({fixed: 'right', title: '操作', align: 'center', toolbar: '#operate', width: 80});
    return cols;
@@ -54,6 +59,9 @@
        if (obj.field === 'anfme') {
            updateMatCodeData(obj.data.matnr, Number(obj.value), obj.data.index);
        }
        if (obj.field === 'supplier' || obj.field === 'mnemonic') {
            updateMatCodeData2(obj.data.matnr, obj.value, obj.data.index, obj.field);
        }
    });
    // 监听头工具栏事件
@@ -75,6 +83,14 @@
                    }
                    if (matCodeData[i].anfme === 0) {
                        layer.msg("数量不能为零");
                        return;
                    }
                    if (matCodeData[i].mnemonic == null || matCodeData[i].mnemonic == '' || matCodeData[i].mnemonic == undefined) {
                        layer.msg("请输入生产单号");
                        return;
                    }
                    if (matCodeData[i].supplier == null || matCodeData[i].supplier == '' || matCodeData[i].supplier == undefined) {
                        layer.msg("请输入通知单号");
                        return;
                    }
                }
@@ -163,6 +179,18 @@
        });
    }
    function updateMatCodeData2(matnr, value, index, field) {
        for (var i = 0; i < matCodeData.length; i++) {
            if (matCodeData[i]["matnr"] === matnr && matCodeData[i]["index"] === index) {
                matCodeData[i][field] = value;
            }
        }
        tableIns.reload({
            data: matCodeData,
        });
    }
    // 获取可用入库站点
    function getInBound() {
        // 获取仓库下拉
@@ -175,7 +203,7 @@
                    var html = "";
                    if (res.data && res.data.length > 0) {
                        html += res.data.map(function (item) {
                            return "<Option value=" + item.id + ">" + item.name + "</Option>";
                            return "<Option value=" + item.uuid + ">" + item.name + "</Option>";
                        });
                    }
                    $('#putSiteSelect').append(html);