自动化立体仓库 - WMS系统
dubin
2026-01-20 67826a2c51bbc013db409dd1a5e29dd4ba52fd72
src/main/webapp/views/pda/comb.html
@@ -19,8 +19,8 @@
<!-- 头部 -->
<header>
    <div class="layui-input-inline">
        <label class="layui-form-label">条码</label>
        <input class="layui-input" type="text" id="code" placeholder="扫码 / 输入" autocomplete="off">
        <label class="layui-form-label">托盘条码</label>
        <input class="layui-input" type="number" id="code" onkeyup="findCode(this)" oninput="if(value.length>8)value=value.slice(0,8)" placeholder="扫码 / 输入" autocomplete="off">
    </div>
    <div style="margin: 5px 5px">
        <button id="mat-btn" type="button" class="layui-btn layui-btn-normal" onclick="getMat()"><i class="layui-icon">+</i>提取</button>
@@ -54,17 +54,27 @@
            limit: 500,
            cellMinWidth: 50,
            cols: [[
                {fixed: 'left', align: 'center', field: 'count', title: '数量', style:'color: blue', width:50},
                {field: 'matNo', align: 'center', title: '物料编码'},
                {field: 'matName', align: 'center', title: '物料名称'}
                {fixed: 'left', align: 'center', field: 'anfme', title: '数量', style:'color: blue', width:50},
                {field: 'matnr', align: 'center', title: '商品编号'},
                {field: 'maktx', align: 'center', title: '商品名称'},
                {field: 'specs', align: 'center', title: '规格'},
                {field: 'unit', align: 'center', title: '单位'},
                {field: 'barcode', align: 'center', title: '条码'}
            ]],
            done: function (res, curr, count) {
            done: function (res, curr, anfme) {
            }
        });
    });
    window.onload = function(){document.getElementById("code").focus();}
    function findCode(el) {
        if (el.value.length === 8) {
            $('#mat-btn').focus();
            getMat();
        }
    }
    var matCodeLayerIdx;
    function getMat() {
@@ -86,14 +96,14 @@
    // 添加表格数据
    var matData = [];
    function addTableData(data) {
        if (isEmpty(data.matName)){
            tips("提取失败");
        if (isEmpty(data.maktx)){
            tips("提取失败", true);
            return;
        }
        let toPush = true;
        for (var j=0;j<matData.length;j++){
            if (data.matNo === matData[j].matNo) {
                matData[j].count = Number(matData[j].count) + Number(data.count);
            if (data.matnr === matData[j].matnr) {
                matData[j].anfme = Number(matData[j].anfme) + Number(data.anfme);
                toPush  = false;
            }
        }
@@ -109,7 +119,6 @@
        $('#code').val("");
        matData = [];
        tableIns.reload({data: matData});
        tips("");
    }
    // 组托
@@ -122,6 +131,13 @@
        }
        if (barcode.length !== 8) {
            tips("条码必须为8位", true);
            return;
        }
        if (!barcode.startsWith("5") &&
            !barcode.startsWith("6") &&
            !barcode.startsWith("7") &&
            !barcode.startsWith("8")){
            tips("托盘条码格式错误", true);
            return;
        }
        if (matData.length === 0) {
@@ -157,9 +173,10 @@
     * @param warn true:红色字体
     */
    function tips(msg, warn) {
        let tips = $('#tips');
        tips.html(msg);
        tips.css("color", warn?"red":'#666');
        // var tips = $('#tips');
        // tips.html(msg);
        // tips.css("color", warn?"red":'#666');
        layer.msg(msg, {icon: warn?2:1})
    }
    document.onkeyup = function (e) {
@@ -170,8 +187,9 @@
            $("#comb-btn").focus();
            comb();
        } else if (key === 113) {
            $("#code").val("");
            $("#code").focus();
        }
    }
</script>
</html>
</html>