王佳豪
2021-03-16 d9cd01b4a8ff8f02d155a02d832a7ea407f180e6
1.0.3
pda-优化库区输入提示
5个文件已修改
101 ■■■■■ 已修改文件
src/main/webapp/static/css/pda.css 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/webapp/static/js/cool.js 35 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/webapp/views/pda/locNormalIn.html 32 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/webapp/views/pda/locNormalMove.html 18 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/webapp/views/pda/locNormalOut.html 14 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/webapp/static/css/pda.css
@@ -35,7 +35,7 @@
    height: 40px;
    margin-right: 0;
}
#warehouse {
#uuid {
    width: 65%;
    height: 40px;
    margin-right: 0;
src/main/webapp/static/js/cool.js
@@ -150,4 +150,39 @@
            }
        }
    });
}
var tips2;
// 是否存在校验
function exist(id, domain, dom) {
    var param = {
        key: id,
        val: $('#'+ (dom ? dom : id)).val()
    };
    $.ajax({
        url: baseUrl+"/"+domain+"/check/column/auth",
        headers: {'token': localStorage.getItem('token')},
        data: JSON.stringify(param),
        dataType:'json',
        contentType:'application/json;charset=UTF-8',
        method: 'POST',
        success: function (res) {
            if (res.code === 200) {
                tips2 = layer.tips(
                    "<span style='color:red;'>不存在</span>",
                    '#'+(dom ? dom : id),
                    {
                        // tipsMore: true,
                        tips: [3,'#fff'],
                        time:0
                        ,area: 'auto'
                        ,maxWidth:500
                    });
            } else if (res.code === 403) {
                top.location.href = baseUrl+"/";
            } else if (res.code === 407) {
                layer.close(tips2);
            }
        }
    });
}
src/main/webapp/views/pda/locNormalIn.html
@@ -21,7 +21,7 @@
    <div>
        <div class="layui-input-inline">
            <label class="layui-form-label">库区</label>
            <input class="layui-input" type="number" id="warehouse" onkeyup="findCode(this)" placeholder="扫码 / 输入"
            <input class="layui-input" id="uuid" onkeyup="exist(this.id, 'locArea')" placeholder="扫码 / 输入"
                   autocomplete="off">
        </div>
    </div>
@@ -76,14 +76,11 @@
    });
    window.onload = function () {
        document.getElementById("warehouse").focus();
        document.getElementById("uuid").focus();
    }
    function findCode(el) {
        if (el.value.length === 7) {
            $('#mat-btn').focus();
            getMat();
        }
    }
    var matCodeLayerIdx;
@@ -126,19 +123,12 @@
        tableIns.reload({data: matData});
    }
    // 重置
    function reset() {
        $('#warehouse').val("");
        matData = [];
        tableIns.reload({data: matData});
    }
    // 组托
    function comb() {
        let barcode = $('#warehouse').val();
        let barcode = $('#uuid').val();
        if (isEmpty(barcode)) {
            tips("库区条码为空", true);
            document.getElementById("warehouse").focus();
            document.getElementById("uuid").focus();
            return;
        }
        if (matData.length === 0) {
@@ -202,13 +192,21 @@
            $("#comb-btn").focus();
            comb();
        } else if (key === 113) {
            $("#warehouse").val("");
            $("#warehouse").focus();
            $("#uuid").val("");
            $("#uuid").focus();
        }
    }
    function back() {
        parent.backIndex();
    }
    // 重置
    function reset() {
        $('#uuid').val("");
        matData = [];
        tableIns.reload({data: matData});
        layer.closeAll();
    }
</script>
</html>
src/main/webapp/views/pda/locNormalMove.html
@@ -24,15 +24,15 @@
    <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="扫码 / 输入"
            <input class="layui-input" id="warehouse1" onkeyup="find(true)" placeholder="扫码 / 输入"
                   autocomplete="off" style="width: 60%">
        </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>
    </div>
</header>
@@ -92,7 +92,7 @@
            return;
        }
        if (warehouse1 == warehouse2) {
            layer.msg("目标库区和源库区一致");
            layer.msg("目标库区和源库区不能一致");
            return;
        }
        // 判断勾选数据是否为空
@@ -131,7 +131,10 @@
    }
    /* 根据库区号检索物料信息 */
    find = () => {
    find = (flag) => {
        if (flag) {
            exist('uuid', 'locArea', 'warehouse1');
        }
        var warehouse = $("#warehouse1").val();
        var matnr = $("#matnr").val();
        // 查询接口
@@ -144,7 +147,7 @@
                if (res.code === 200) {
                    tableIns.reload({
                        data: res.data,
                    })
                    });
                } else if (res.code === 403) {
                    top.location.href = baseUrl + "/pda";
                } else {
@@ -168,7 +171,7 @@
     * @param warn true:红色字体
     */
    function tips(msg, warn) {
        layer.msg(msg, {icon: warn?2:1})
        layer.msg(msg, {icon: warn ? 2 : 1})
    }
    function reset() {
@@ -176,6 +179,7 @@
        $('#warehouse2').val("");
        $('#matnr').val("");
        tableIns.reload({data: []});
        layer.closeAll();
    }
</script>
</html>
src/main/webapp/views/pda/locNormalOut.html
@@ -47,7 +47,7 @@
    <div>
        <div class="layui-input-inline">
            <label class="layui-form-label" style="margin-left: 32px">库区</label>
            <input class="layui-input" type="number" id="warehouse" onkeyup="findCode(this, 'warehouse')" placeholder="扫码 / 输入"
            <input class="layui-input" id="uuid" onkeyup="findCode(this, 'uuid')" placeholder="扫码 / 输入"
                   autocomplete="off">
        </div>
        <div class="layui-input-inline">
@@ -105,7 +105,7 @@
    // 表格数据
    var normalOutList = [];
    window.onload = function () {
        document.getElementById("warehouse").focus();
        document.getElementById("uuid").focus();
    }
    /**
@@ -176,8 +176,9 @@
    /* 扫码、输入库区和物料编码 */
    function findCode(el, type) {
        switch (type) {
            case 'warehouse':
            case 'uuid':
                warehouseBar = el.value;
                exist('uuid', 'locArea');
                break;
            case 'matnr':
                matnrBar =  el.value;
@@ -279,7 +280,7 @@
            return;
        }
        // 库区赋值
        var warehouse = $('#warehouse').val();
        var warehouse = $('#uuid').val();
        data.map(function (item) {
           item.warehouse =  warehouse;
        });
@@ -297,7 +298,7 @@
                if (res.code === 200) {
                    layer.msg("出库成功");
                    $("#matnr").val(null);
                    $("#warehouse").val(null);
                    $("#uuid").val(null);
                    warehouseBar = null;
                    matnrBar = null;
                    normalOutList = [];
@@ -314,10 +315,11 @@
    }
    function reset() {
        $("#warehouse").val(null);
        $("#uuid").val(null);
        $("#matnr").val(null);
        normalOutList = [];
        tableIns.reload({data: normalOutList});
        layer.closeAll();
    }
</script>
</html>