#
18516761980
2021-11-05 acdc4b3427cbd2a6dc811aed202fbd3e9c309d69
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);
        }
    });
    // 监听头工具栏事件
@@ -77,6 +85,14 @@
                        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;
                    // }
                }
                // 判断库区是否为空
                var warehouse = $('#putSiteSelect').val();
@@ -163,11 +179,23 @@
        });
    }
    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() {
        // 获取仓库下拉
        $.ajax({
            url: baseUrl + "/locArea/queryAll/auth",
            url: baseUrl + "/locArea/query/allArea",
            headers: {'token': localStorage.getItem('token')},
            method: 'POST',
            success: function (res) {
@@ -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);