#
luxiaotao1123
2021-08-03 67da83c698e77ccf178669a31e4bd3a4e8fc1ca7
src/main/webapp/views/pda/locNormalIn.html
@@ -170,6 +170,7 @@
            <button onclick="add()">+</button>
        </div>
    </div>
    <button id="remove" onclick="remove()">移除</button>
    <button id="confirm" onclick="confirm()">保存</button>
</div>
@@ -273,17 +274,39 @@
        var count = $('#count').val();
        var mnemonic = $("#mnemonic").val() === '' ? null : $("#mnemonic").val();
        for (var j = 0; j < matData.length; j++) {
            if (matNo === matData[j].matNo && mnemonic === matData[j].mnemonic) {
                if (count > maxCount || count < minCount) {
                    tips("数量不能超过范围", true);
                    return;
            if (mnemonic) {
                if (matNo === matData[j].matNo && mnemonic === matData[j].mnemonic) {
                    matData[j].count = Number(count);
                }
                matData[j].count = Number(count);
            } else {
                if (matNo === matData[j].matNo) {
                    matData[j].count = Number(count);
                }
            }
        }
        tableIns.reload({data: matData});
        layer.close(countLayer);
        tips("修改成功");
    }
    function remove() {
        var matnr = $('#matNo').val();
        var index = $('#index').val();
        var mnemonic = $("#mnemonic").val() === '' ? null : $("#mnemonic").val();
        for (var j = 0; j < matData.length; j++) {
            if (mnemonic) {
                if (matnr === matData[j].matNo && mnemonic === matData[j].mnemonic) {
                    matData.splice(j, 1);
                }
            } else {
                if (matnr === matData[j].matNo) {
                    matData.splice(j, 1);
                }
            }
        }
        tableIns.reload({data: matData});
        layer.close(countLayer);
        tips("移除成功");
    }
    window.onload = function () {
@@ -361,26 +384,50 @@
        });
        // 请求保存接口
        $.ajax({
            url: baseUrl + "/locNormal/pda/in",
            headers: {'token': localStorage.getItem('token')},
            data: JSON.stringify({
                normalList: data,
            }),
            contentType: 'application/json;charset=UTF-8',
            method: 'POST',
            async: false,
            success: function (res) {
                if (res.code === 200) {
                    reset(true);
                    tips("组托成功")
                } else if (res.code === 403) {
                    top.location.href = baseUrl + "/pda";
                } else {
                    tips(res.msg, true)
                }
            },
        });
        var areaType = getQueryVariable('areaType');
        if (areaType == 1) {
            $.ajax({
                url: baseUrl + "/locNormal/in/source",
                headers: {'token': localStorage.getItem('token')},
                data: JSON.stringify({
                    normalList: data,
                }),
                contentType: 'application/json;charset=UTF-8',
                method: 'POST',
                async: false,
                success: function (res) {
                    if (res.code === 200) {
                        reset(true);
                        tips("组托成功")
                    } else if (res.code === 403) {
                        top.location.href = baseUrl + "/pda";
                    } else {
                        tips(res.msg, true)
                    }
                },
            });
        } else {
            $.ajax({
                url: baseUrl + "/locNormal/pda/in",
                headers: {'token': localStorage.getItem('token')},
                data: JSON.stringify({
                    normalList: data,
                }),
                contentType: 'application/json;charset=UTF-8',
                method: 'POST',
                async: false,
                success: function (res) {
                    if (res.code === 200) {
                        reset(true);
                        tips("组托成功")
                    } else if (res.code === 403) {
                        top.location.href = baseUrl + "/pda";
                    } else {
                        tips(res.msg, true)
                    }
                },
            });
        }
    }
    /**