自动化立体仓库 - WMS系统
#
luxiaotao1123
2020-07-10 ec3e9c8b3cd8d31359ce0a25e8eb97d84a55a284
#
4个文件已修改
130 ■■■■■ 已修改文件
src/main/java/com/zy/asrs/controller/MatCodeController.java 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/zy/asrs/controller/MobileController.java 11 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/webapp/views/pdaCe/index.html 101 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/webapp/views/pdaCe/login.html 16 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/zy/asrs/controller/MatCodeController.java
@@ -46,7 +46,7 @@
    }
    @RequestMapping(value = "/matCode/auth")
//    @ManagerAuth
    @ManagerAuth
    public R find(@RequestParam("id") String id) {
        return R.ok(matCodeService.selectById(String.valueOf(id)));
    }
src/main/java/com/zy/asrs/controller/MobileController.java
@@ -47,6 +47,17 @@
        return R.ok();
    }
    /**
     * 组托
     */
    @RequestMapping("/comb/form")
    @ManagerAuth(memo = "组托")
    public R combForm(@RequestParam CombParam combParam){
        mobileService.comb(combParam, getUserId());
        return R.ok();
    }
    /**
     *  根据库位号查找库存明细
     */
src/main/webapp/views/pdaCe/index.html
@@ -116,7 +116,7 @@
</div>
<div>
    <span>物料</span>
    <input type="text" id="matnr" onkeyup="find(this)" autocomplete="off">
    <input type="text" id="matNo" onkeyup="find(this)" autocomplete="off">
</div>
<div class="mat-msg" id="mat-msg-id">
@@ -164,7 +164,7 @@
    var matMsgTableBlankRows = 0;   // 空白行数
    var matData = []; // 表格数据
    var code = document.getElementById("code")
    var matnr = document.getElementById("matnr")
    var matNo = document.getElementById("matNo")
    var matMsg = document.getElementById("mat-msg-id");
    var matMsgTable = document.getElementById("mat-msg-table");
    var tthead = document.getElementById("tthead");
@@ -185,6 +185,7 @@
        httpRequest({
            httpUrl: baseUrl + "/matCode/auth",
            type: 'post',
            headers: [{token: getCookie('token')}],
            data: {
                id: el.value
            },
@@ -204,8 +205,10 @@
                    btnCon.style.display = 'block';
                    matDetail.style.display = 'none';
                }
            } else if (res.code === 403) {
                window.location.href = baseUrl + "/pda/ce";
            } else {
                alert(res.msg);
                tips(res.msg, true)
            }
        })
    }
@@ -222,52 +225,26 @@
            tips("请提取物料", true);
            return;
        }
        console.log(JSON.stringify({
            barcode: barcode,
            combMats: matData
        }))
        httpRequest({
            httpUrl: baseUrl+"/mobile/comb/auth",
            httpUrl: baseUrl+"/mobile/comb/form",
            type: 'post',
            data: JSON.stringify({
            headers: [{token: getCookie('token')}],
            data: {
                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';
                }
                reset();
                tips("组托成功")
            } else if (res.code === 403) {
                window.location.href = baseUrl + "/pda/ce";
            } 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)
                }
                tips(res.msg, true)
            }
        })
    }
@@ -305,7 +282,7 @@
        }
        var toPush = true;
        for (var j=0;j<matData.length;j++){
            if (data.matnr === matData[j].matnr) {
            if (data.matNo === matData[j].matNo) {
                matData[j].count = Number(matData[j].count) + Number(data.count);
                toPush  = false;
            }
@@ -316,7 +293,7 @@
        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].matNo + "</span>\n" +
                "       <span>" + matData[i].matName + "</span>\n" +
                "       <span>" + matData[i].str1 + "</span>\n" +
                "       <span>" + matData[i].count + "</span>\n" +
@@ -329,7 +306,7 @@
    // 重置
    function reset() {
        code.value = "";
        matnr.value = "";
        matNo.value = "";
        cancel();
        while(ttbody.hasChildNodes()) {
            ttbody.removeChild(ttbody.firstChild);
@@ -357,7 +334,7 @@
    // 提取
    function confirm() {
        addTableData({
            matnr: matnr.value,
            matNo: matNo.value,
            matName: matName.value,
            str1: str1.value,
            count: count.value
@@ -367,7 +344,7 @@
    }
    // 取消
    function cancel() {
        matnr.value = "";
        matNo.value = "";
        matName.value = "";
        str1.value = "";
        count.value = initMatCount;
@@ -385,6 +362,21 @@
            return;
        }
        count.value = count.value - 1;
    }
    //获取 cookie
    function getCookie(objName){//获取指定名称的cookie的值
        //多个cookie 保存的时候是以 ;空格  分开的
        var arrStr = document.cookie.split("; ");
        for (var i = 0; i < arrStr.length; i++) {
            var temp = arrStr[i].split("=");
            if (temp[0] === objName){
                return decodeURIComponent(temp[1]);
            }else{
                return "";
            }
        }
    }
    function httpRequest(paramObj,fun,errFun) {
@@ -410,6 +402,8 @@
        var httpUrl = paramObj.httpUrl || '';
        /*是否异步请求*/
        var async = paramObj.async || true;
        /*请求头参数*/
        var headerData = paramObj.headers || [];
        /*请求参数--post请求参数格式为:foo=bar&lorem=ipsum*/
        var paramData = paramObj.data || [];
        var requestData = '';
@@ -436,7 +430,18 @@
        }else if(httpType === 'POST'){
            xmlhttp.open("POST",httpUrl,async);
            //发送合适的请求头信息
            xmlhttp.setRequestHeader("Content-type", "application/x-www-form-urlencoded");
            var defaultContentType = true;
            for (var i=0;i<headerData.length;i++) {
                for(var key in headerData[i]) {
                    if (key === "Content-type") {
                        defaultContentType = false;
                    }
                    xmlhttp.setRequestHeader(key, headerData[i][key]);
                }
            }
            if (defaultContentType) {
                xmlhttp.setRequestHeader("Content-type", "application/x-www-form-urlencoded");
            }
            xmlhttp.send(requestData);
        }
    }
src/main/webapp/views/pdaCe/login.html
@@ -59,6 +59,9 @@
            }
        }, function (res) {
            if (res.code === 200) {
                // localStorage.setItem("token", res.data.token);
                // localStorage.setItem("username", res.data.username);
                setCookie("token", res.data.token);
                window.location.href = "index.html";
            } else {
                alert(res.msg);
@@ -67,6 +70,19 @@
        })
    }
    // 设置cookie
    function setCookie(objName, objValue){//添加cookie
        var str = objName + "=" + encodeURIComponent(objValue);
        // if (objHours > 0) {//为0时不设定过期时间,浏览器关闭时cookie自动消失
        //     var date = new Date();
        //     var ms = objHours * 3600 * 1000;
        //     date.setTime(date.getTime() + ms);
        //     str += "; expires=" + date.toUTCString();
        // }
        str += "; path=/";
        document.cookie = str;
    }
    function httpRequest(paramObj,fun,errFun) {
        var xmlhttp = null;
        /*创建XMLHttpRequest对象,