|  |  | 
 |  |  |     <meta name="viewport" content="width=device-width, target-densitydpi=high-dpi, initial-scale=1.0, user-scalable=no"/> | 
 |  |  |     <title>中扬物流</title> | 
 |  |  |     <script type="text/javascript" src="../../static/js/common.js" charset="utf-8"></script> | 
 |  |  |     <style> | 
 |  |  |  | 
 |  |  |         * { | 
 |  |  |             font-size: 12px; | 
 |  |  |         } | 
 |  |  |  | 
 |  |  |         .mat-msg { | 
 |  |  |             overflow-y: scroll; | 
 |  |  |             margin-top: 10px; | 
 |  |  |             height: 115px; | 
 |  |  |             background-color: #fff; | 
 |  |  |             border-radius: 5px; | 
 |  |  |             border: 1px solid #c2c2c2; | 
 |  |  |         } | 
 |  |  |         #mat-msg-table { | 
 |  |  |             font-size: 12px; | 
 |  |  |             border-collapse: collapse; | 
 |  |  |             margin: 0 auto; | 
 |  |  |             text-align: center; | 
 |  |  |         } | 
 |  |  |         #tthead { | 
 |  |  |             padding-top: 4px; | 
 |  |  |             background-color: #ececec; | 
 |  |  |             height: 18px; | 
 |  |  |         } | 
 |  |  |         #tthead span { | 
 |  |  |             border-right: 1px solid #b3b3b3; | 
 |  |  |             float: left; | 
 |  |  |             width: 24%; | 
 |  |  |         } | 
 |  |  |         #ttbody { | 
 |  |  |             padding-top: 4px; | 
 |  |  |         } | 
 |  |  |         #ttbody div { | 
 |  |  |             content: ""; | 
 |  |  |             clear: both; | 
 |  |  |             display: table; | 
 |  |  |         } | 
 |  |  |         #ttbody span { | 
 |  |  |             border-right: 1px solid #b3b3b3; | 
 |  |  |             float: left; | 
 |  |  |             width: 22%; | 
 |  |  |             overflow:hidden; | 
 |  |  |             white-space:nowrap; | 
 |  |  |             text-overflow:ellipsis; | 
 |  |  |         } | 
 |  |  |  | 
 |  |  |         #btn-con { | 
 |  |  |             padding-left: 10px; | 
 |  |  |             position: absolute; | 
 |  |  |             bottom: 10px; | 
 |  |  |             width: 100%; | 
 |  |  |         } | 
 |  |  |         #btn-con button { | 
 |  |  |             display: inline-block; | 
 |  |  |             vertical-align: middle; | 
 |  |  |         } | 
 |  |  |         #tips { | 
 |  |  |             font-size: 12px; | 
 |  |  |             margin-left: 10px; | 
 |  |  |             display: inline-block; | 
 |  |  |             vertical-align: middle; | 
 |  |  |             width: 90px; | 
 |  |  |             overflow:hidden; | 
 |  |  |             white-space:nowrap; | 
 |  |  |             text-overflow:ellipsis; | 
 |  |  |         } | 
 |  |  |  | 
 |  |  |         /* 详情 */ | 
 |  |  |         .form-box { | 
 |  |  |             margin-top: 10px; | 
 |  |  |             padding: 15px 0 10px 0; | 
 |  |  |             text-align: center; | 
 |  |  |             border: 1px solid #BBBBBB; | 
 |  |  |         } | 
 |  |  |  | 
 |  |  |         .form-item { | 
 |  |  |             margin-bottom: 5px; | 
 |  |  |         } | 
 |  |  |         .form-box span { | 
 |  |  |         } | 
 |  |  |         .form-box input { | 
 |  |  |             overflow:hidden; | 
 |  |  |             white-space:nowrap; | 
 |  |  |             text-overflow:ellipsis; | 
 |  |  |         } | 
 |  |  |         .form-count button { | 
 |  |  |             width: 25px; | 
 |  |  |             height: 20px; | 
 |  |  |         } | 
 |  |  |         .form-count input { | 
 |  |  |             margin: 0 7px; | 
 |  |  |             width: 40px; | 
 |  |  |         } | 
 |  |  |         .form-btn-con { | 
 |  |  |             margin-top: 10px; | 
 |  |  |         } | 
 |  |  |         .form-btn-con button { | 
 |  |  |             padding: 4px 0; | 
 |  |  |             height: 25px; | 
 |  |  |             margin: 0 15px; | 
 |  |  |         } | 
 |  |  |     </style> | 
 |  |  | </head> | 
 |  |  | <body> | 
 |  |  |     Hello World | 
 |  |  | <!--    <button onclick="her()">页面跳转</button>--> | 
 |  |  | <div> | 
 |  |  |     <span>条码</span> | 
 |  |  |     <input type="text" id="code"> | 
 |  |  | </div> | 
 |  |  | <div> | 
 |  |  |     <span>物料</span> | 
 |  |  |     <input type="text" id="matnr" onkeyup="find(this)" autocomplete="off"> | 
 |  |  | </div> | 
 |  |  |  | 
 |  |  | <div class="mat-msg" id="mat-msg-id"> | 
 |  |  |     <div id="mat-msg-table"> | 
 |  |  |         <div id="tthead"> | 
 |  |  |             <span>编码</span> | 
 |  |  |             <span>名称</span> | 
 |  |  |             <span>单位</span> | 
 |  |  |             <span>数量</span> | 
 |  |  |         </div> | 
 |  |  |         <div id="ttbody"> | 
 |  |  |         </div> | 
 |  |  |     </div> | 
 |  |  | </div> | 
 |  |  |  | 
 |  |  | <div id="btn-con"> | 
 |  |  |     <button style="margin-right: 20px" onclick="reset()">重置</button> | 
 |  |  |     <button >组托</button> | 
 |  |  |     <span id="tips"></span> | 
 |  |  | </div> | 
 |  |  |  | 
 |  |  | <!-- 详情 --> | 
 |  |  | <div class="form-box"> | 
 |  |  |     <div class="form-item"> | 
 |  |  |         <span>名称</span> | 
 |  |  |         <input id="matName" type="text" disabled="disabled" style="background-color: #ececec"> | 
 |  |  |     </div> | 
 |  |  |     <div class="form-item"> | 
 |  |  |         <span>单位</span> | 
 |  |  |         <input id="str1" type="text" disabled="disabled" style="background-color: #ececec"> | 
 |  |  |     </div> | 
 |  |  |     <div class="form-item form-count"> | 
 |  |  |         <span style="margin-right: 10px">数量</span> | 
 |  |  |         <button onclick="reduce()">-</button><input id="count" type="number"><button onclick="add()">+</button> | 
 |  |  |     </div> | 
 |  |  |     <div class="form-item form-btn-con"> | 
 |  |  |         <button id="confirm" onclick="confirm()">提取</button> | 
 |  |  |         <button id="cancel" onclick="cancel()" style="background-color: #fff">取消</button> | 
 |  |  |     </div> | 
 |  |  | </div> | 
 |  |  |  | 
 |  |  |  | 
 |  |  | </body> | 
 |  |  | <script> | 
 |  |  |     function her() { | 
 |  |  |         window.location.href="login.html"; | 
 |  |  |     // initCrnMsgTable() | 
 |  |  |     var matMsgTableBlankRows = 0;   // 空白行数 | 
 |  |  |     var code = document.getElementById("code") | 
 |  |  |     var matnr = document.getElementById("matnr") | 
 |  |  |     var matMsg = document.getElementById("mat-msg-id"); | 
 |  |  |     var matMsgTable = document.getElementById("mat-msg-table"); | 
 |  |  |     var tthead = document.getElementById("tthead"); | 
 |  |  |     var ttbody = document.getElementById("ttbody"); | 
 |  |  |     var btnCon = document.getElementById("btn-con"); | 
 |  |  |     var tipDom = document.getElementById("tips"); | 
 |  |  |  | 
 |  |  |     // todo | 
 |  |  |     matMsg.style.display = 'none'; | 
 |  |  |     btnCon.style.display = 'none'; | 
 |  |  |  | 
 |  |  |     // 查询物流 | 
 |  |  |     function find(el) { | 
 |  |  |         httpRequest({ | 
 |  |  |             httpUrl: baseUrl + "/matCode/auth", | 
 |  |  |             type: 'post', | 
 |  |  |             data: { | 
 |  |  |                 id: el.value | 
 |  |  |             }, | 
 |  |  |         }, function (res) { | 
 |  |  |             if (res.code === 200) { | 
 |  |  |                 if (res.data != null) { | 
 |  |  |                     matMsg.style.display = 'none'; | 
 |  |  |                     btnCon.style.display = 'none'; | 
 |  |  |                 } else { | 
 |  |  |                     matMsg.style.display = 'block'; | 
 |  |  |                     btnCon.style.display = 'block'; | 
 |  |  |                 } | 
 |  |  |             } else { | 
 |  |  |                 alert(res.msg); | 
 |  |  |             } | 
 |  |  |  | 
 |  |  |         }) | 
 |  |  |     } | 
 |  |  |  | 
 |  |  |     initCrnMsgTable(); | 
 |  |  |     // 堆垛机数据表获取  ----- 表二 | 
 |  |  |     function initCrnMsgTable(row) { | 
 |  |  |         var line; | 
 |  |  |         if (row === undefined){ | 
 |  |  |             var one = 15; | 
 |  |  |             var total = matMsg.offsetHeight; | 
 |  |  |             var count = total / one; | 
 |  |  |             count = parseInt(count) - 1; | 
 |  |  |             matMsgTableBlankRows = count; | 
 |  |  |             line = count; | 
 |  |  |         } else { | 
 |  |  |             line = row; | 
 |  |  |         } | 
 |  |  |  | 
 |  |  |         var html = ""; | 
 |  |  |         for (var i = 0; i < line; i ++){ | 
 |  |  |             html += " <div>\n" + | 
 |  |  |                 "       <span></span>\n" + | 
 |  |  |                 "       <span></span>\n" + | 
 |  |  |                 "       <span></span>\n" + | 
 |  |  |                 "       <span></span>\n" + | 
 |  |  |                 "     </div>\n"; | 
 |  |  |         } | 
 |  |  |         ttbody.innerHTML = html; | 
 |  |  |     } | 
 |  |  |  | 
 |  |  |     // 重置 | 
 |  |  |     function reset() { | 
 |  |  |         code.value = ""; | 
 |  |  |         matnr.value = ""; | 
 |  |  |     } | 
 |  |  |  | 
 |  |  |     /** | 
 |  |  |      * 提示信息 | 
 |  |  |      * @param msg 提示内容 | 
 |  |  |      * @param warn true:红色字体 | 
 |  |  |      */ | 
 |  |  |     function tips(msg, warn) { | 
 |  |  |         tipDom.innerText = msg; | 
 |  |  |         if (warn) { | 
 |  |  |             tipDom.style.color = "red"; | 
 |  |  |         } else { | 
 |  |  |             tipDom.style.color = "#000"; | 
 |  |  |         } | 
 |  |  |     } | 
 |  |  |  | 
 |  |  |     function httpRequest(paramObj,fun,errFun) { | 
 |  |  |         var xmlhttp = null; | 
 |  |  |         /*创建XMLHttpRequest对象, | 
 |  |  |          *老版本的 Internet Explorer(IE5 和 IE6)使用 ActiveX 对象:new ActiveXObject("Microsoft.XMLHTTP") | 
 |  |  |          * */ | 
 |  |  |         if(window.XMLHttpRequest) { | 
 |  |  |             xmlhttp = new XMLHttpRequest(); | 
 |  |  |         }else if(window.ActiveXObject) { | 
 |  |  |             xmlhttp = new ActiveXObject("Microsoft.XMLHTTP"); | 
 |  |  |         } | 
 |  |  |         /*判断是否支持请求*/ | 
 |  |  |         if(xmlhttp == null) { | 
 |  |  |             alert('你的浏览器不支持XMLHttp'); | 
 |  |  |             return; | 
 |  |  |         } | 
 |  |  |         /*请求方式,并且转换为大写*/ | 
 |  |  |         var httpType = (paramObj.type || 'GET').toUpperCase(); | 
 |  |  |         /*数据类型*/ | 
 |  |  |         var dataType = paramObj.dataType || 'json'; | 
 |  |  |         /*请求接口*/ | 
 |  |  |         var httpUrl = paramObj.httpUrl || ''; | 
 |  |  |         /*是否异步请求*/ | 
 |  |  |         var async = paramObj.async || true; | 
 |  |  |         /*请求参数--post请求参数格式为:foo=bar&lorem=ipsum*/ | 
 |  |  |         var paramData = paramObj.data || []; | 
 |  |  |         var requestData = ''; | 
 |  |  |         for(var name in paramData) { | 
 |  |  |             requestData += name + '='+ paramData[name] + '&'; | 
 |  |  |         } | 
 |  |  |         requestData = requestData === '' ? '' : requestData.substring(0,requestData.length - 1); | 
 |  |  |  | 
 |  |  |         /*请求接收*/ | 
 |  |  |         xmlhttp.onreadystatechange = function() { | 
 |  |  |             if(xmlhttp.readyState === 4 && xmlhttp.status === 200) { | 
 |  |  |                 /*成功回调函数*/ | 
 |  |  |                 fun(JSON.parse(xmlhttp.responseText)); | 
 |  |  |             }else{ | 
 |  |  |                 /*失败回调函数*/ | 
 |  |  |                 errFun; | 
 |  |  |             } | 
 |  |  |         } | 
 |  |  |  | 
 |  |  |         /*接口连接,先判断连接类型是post还是get*/ | 
 |  |  |         if(httpType === 'GET') { | 
 |  |  |             xmlhttp.open("GET",httpUrl,async); | 
 |  |  |             xmlhttp.send(null); | 
 |  |  |         }else if(httpType === 'POST'){ | 
 |  |  |             xmlhttp.open("POST",httpUrl,async); | 
 |  |  |             //发送合适的请求头信息 | 
 |  |  |             xmlhttp.setRequestHeader("Content-type", "application/x-www-form-urlencoded"); | 
 |  |  |             xmlhttp.send(requestData); | 
 |  |  |         } | 
 |  |  |     } | 
 |  |  | </script> | 
 |  |  | </html> |