自动化立体仓库 - WMS系统
#
luxiaotao1123
2020-07-09 2281e3ac9929818587d658c78741a8f5351cded6
src/main/webapp/views/pdaCe/index.html
@@ -134,7 +134,7 @@
<div id="btn-con">
    <button style="margin-right: 20px" onclick="reset()">重置</button>
    <button >组托</button>
    <button onclick="comb()">组托</button>
    <span id="tips"></span>
</div>
@@ -207,7 +207,68 @@
            } else {
                alert(res.msg);
            }
        })
    }
    // 组托
    function comb() {
        var barcode = code.value;
        if (isEmpty(barcode)) {
            tips("托盘条码为空", true);
            // document.getElementById("code").focus();
            return;
        }
        if (matData.length === 0) {
            tips("请提取物料", true);
            return;
        }
        httpRequest({
            httpUrl: baseUrl+"/mobile/comb/auth",
            type: 'post',
            data: JSON.stringify({
                barcode: barcode,
                combMats: matData
            }),
        }, function (res) {
            if (res.code === 200) {
                if (res.data != null) {
                    // 样式
                    matMsg.style.display = 'none';
                    btnCon.style.display = 'none';
                    matDetail.style.display = 'block';
                    // 填充数据
                    matName.value = res.data.matName;
                    str1.value = res.data.str1;
                    count.value = initMatCount;
                } else {
                    matMsg.style.display = 'block';
                    btnCon.style.display = 'block';
                    matDetail.style.display = 'none';
                }
            } else {
                alert(res.msg);
            }
        })
        $.ajax({
            url: baseUrl+"/mobile/comb/auth",
            headers: {'token': localStorage.getItem('token')},
            data: JSON.stringify({
                barcode: barcode,
                combMats: matData
            }),
            contentType:'application/json;charset=UTF-8',
            method: 'POST',
            async: false,
            success: function (res) {
                if (res.code === 200) {
                    reset();
                    tips("组托成功")
                } else if (res.code === 403) {
                    top.location.href = baseUrl + "/pda";
                } else {
                    tips(res.msg, true)
                }
            }
        })
    }
@@ -251,24 +312,29 @@
        }
        if (toPush) {
            matData.push(data);
            var html = "";
            for (var i=0;i<matData.length;i++) {
                html += " <div>\n" +
                    "       <span>" + matData[i].matnr + "</span>\n" +
                    "       <span>" + matData[i].matName + "</span>\n" +
                    "       <span>" + matData[i].str1 + "</span>\n" +
                    "       <span>" + matData[i].count + "</span>\n" +
                    "     </div>\n";
            }
            ttbody.innerHTML = html;
        }
        var html = "";
        for (var i=0;i<matData.length;i++) {
            html += " <div class='table-data'>\n" +
                "       <span>" + matData[i].matnr + "</span>\n" +
                "       <span>" + matData[i].matName + "</span>\n" +
                "       <span>" + matData[i].str1 + "</span>\n" +
                "       <span>" + matData[i].count + "</span>\n" +
                "     </div>\n";
        }
        ttbody.innerHTML = html;
    }
    // 重置
    function reset() {
        code.value = "";
        matnr.value = "";
        cancel();
        while(ttbody.hasChildNodes()) {
            ttbody.removeChild(ttbody.firstChild);
        }
    }
    /**