1
luxiaotao1123
2021-10-29 686b0de3a8959ebad5a5ce5ee71e70e190b04611
src/main/webapp/views/pda/locNormalMove.html
@@ -13,7 +13,7 @@
</head>
<body>
<!-- 头部 -->
<header>
<header class="layui-form">
    <div>
        <div class="layui-input-inline">
            <label class="layui-form-label">物料编码</label>
@@ -24,15 +24,25 @@
    <div>
        <div class="layui-input-inline">
            <label class="layui-form-label" style="margin-left: 16px">源库区</label>
            <input class="layui-input" type="number" id="warehouse1" onkeyup="find()" placeholder="扫码 / 输入"
                   autocomplete="off" style="width: 60%">
            <!--<input class="layui-input" id="warehouse1" onkeyup="find(true)" placeholder="扫码 / 输入"-->
                   <!--autocomplete="off" style="width: 60%">-->
            <div class="layui-input-inline" style="width: 180px">
                <select id="warehouse1" lay-filter="warehouse1">
                    <option value="">请选择</option>
                </select>
            </div>
        </div>
    </div>
    <div>
        <div class="layui-input-inline">
            <label class="layui-form-label">目标库区</label>
            <input class="layui-input" type="number" id="warehouse2" placeholder="扫码 / 输入"
                   autocomplete="off" style="width: 60%">
            <!--<input class="layui-input" id="warehouse2" placeholder="扫码 / 输入"-->
                   <!--autocomplete="off" style="width: 60%" onkeyup="exist('uuid', 'locArea', 'warehouse2')">-->
            <div class="layui-input-inline" style="width: 180px">
                <select id="warehouse2">
                    <option value="">请选择</option>
                </select>
            </div>
        </div>
    </div>
</header>
@@ -72,12 +82,41 @@
            limit: 500,
            cellMinWidth: 50,
            cols: [[
                {type: 'checkbox', fixed: 'left', width: 30},
                {field: 'matnr', align: 'center', title: '编码', event: 'detail', width: 80},
                {field: 'maktx', align: 'center', title: '名称', event: 'detail'},
                {field: 'warehouse', align: 'center', title: '库区', event: 'detail', width: 50}
                {field: 'warehouse', align: 'center', title: '库区', event: 'detail', width: 50},
                {type: 'checkbox', fixed: 'right', width: 30},
            ]],
            done: function (res, curr, count) {
            }
        });
        form.on('select(warehouse1)', function (data) {
            var val = data.value;
            find(true);
        });
        // 获取仓库下拉
        $.ajax({
            url: baseUrl + "/locArea/queryAll/auth",
            headers: {'token': localStorage.getItem('token')},
            method: 'POST',
            success: function (res) {
                if (res.code === 200) {
                    var html = "";
                    if (res.data && res.data.length > 0) {
                        html += res.data.map(function (item) {
                            return "<Option value=" + item.uuid + ">" + item.name + "</Option>";
                        });
                    }
                    $('#warehouse1').append(html);
                    $('#warehouse2').append(html);
                    layui.form.render('select');
                } else if (res.code === 403) {
                    top.location.href = baseUrl + "/pda";
                } else {
                    layer.msg(res.msg)
                }
            }
        });
    });
@@ -92,7 +131,7 @@
            return;
        }
        if (warehouse1 == warehouse2) {
            layer.msg("目标库区和源库区一致");
            layer.msg("目标库区和源库区不能一致");
            return;
        }
        // 判断勾选数据是否为空
@@ -131,7 +170,10 @@
    }
    /* 根据库区号检索物料信息 */
    find = () => {
    find = (flag) => {
        if (flag) {
            exist('uuid', 'locArea', 'warehouse1');
        }
        var warehouse = $("#warehouse1").val();
        var matnr = $("#matnr").val();
        // 查询接口
@@ -144,7 +186,7 @@
                if (res.code === 200) {
                    tableIns.reload({
                        data: res.data,
                    })
                    });
                } else if (res.code === 403) {
                    top.location.href = baseUrl + "/pda";
                } else {
@@ -168,14 +210,16 @@
     * @param warn true:红色字体
     */
    function tips(msg, warn) {
        layer.msg(msg, {icon: warn?2:1})
        layer.msg(msg, {icon: warn ? 2 : 1})
    }
    function reset() {
        $('#warehouse1').val("");
        $('#warehouse2').val("");
        $('#matnr').val("");
        layui.form.render('select');
        tableIns.reload({data: []});
        layer.closeAll();
    }
</script>
</html>