From ce6b5be6c0e1544bcc66f9fce9efec3ced724d95 Mon Sep 17 00:00:00 2001 From: luxiaotao1123 <t1341870251@163.com> Date: 星期六, 11 七月 2020 15:46:29 +0800 Subject: [PATCH] # --- src/main/webapp/views/pdaCe/index.html | 73 +++++++++++++++++++++++++----------- 1 files changed, 50 insertions(+), 23 deletions(-) diff --git a/src/main/webapp/views/pdaCe/index.html b/src/main/webapp/views/pdaCe/index.html index a253204..ae2e4cb 100644 --- a/src/main/webapp/views/pdaCe/index.html +++ b/src/main/webapp/views/pdaCe/index.html @@ -3,12 +3,14 @@ <head> <meta charset="UTF-8"> <meta name="viewport" content="width=device-width, target-densitydpi=high-dpi, initial-scale=1.0, user-scalable=no"/> - <title>涓壃鐗╂祦</title> + <title>娴欐睙涓壃鍌ㄥ瓨璁惧鏈夐檺鍏徃</title> <script type="text/javascript" src="../../static/js/common.js" charset="utf-8"></script> <style> - * { font-size: 12px; + } + html { + background-color: #fff; } .mat-msg { @@ -64,6 +66,7 @@ } #tips { font-size: 12px; + margin-top: 2px; margin-left: 10px; display: inline-block; vertical-align: middle; @@ -110,6 +113,7 @@ </style> </head> <body> +<button onclick="help()" style="padding: 0 3px; position: absolute; top: 0%; right: 0%">?</button> <div> <span>鏉$爜</span> <input type="text" id="code"> @@ -117,6 +121,7 @@ <div> <span>鐗╂枡</span> <input type="text" id="matNo" onkeyup="find(this)" autocomplete="off"> + <button onclick="find()">鏌ヨ</button> </div> <div class="mat-msg" id="mat-msg-id"> @@ -134,12 +139,16 @@ <div id="btn-con"> <button style="margin-right: 20px" onclick="reset()">閲嶇疆</button> - <button onclick="comb()">缁勬墭</button> + <button id="comb" onclick="comb()">缁勬墭</button> <span id="tips"></span> </div> <!-- 璇︽儏 --> <div class="form-box" id="mat-detail"> + <div class="form-item form-count"> + <span style="margin-right: 10px">鏁伴噺</span> + <button onclick="reduce()">-</button><input id="count" type="number" style="text-align: center"><button onclick="add()">+</button> + </div> <div class="form-item"> <span>鍚嶇О</span> <input id="matName" type="text" disabled="disabled" style="background-color: #ececec;color: #000"> @@ -147,10 +156,6 @@ <div class="form-item"> <span>鍗曚綅</span> <input id="str1" type="text" disabled="disabled" style="background-color: #ececec;color: #000; text-align: center;"> - </div> - <div class="form-item form-count"> - <span style="margin-right: 10px">鏁伴噺</span> - <button onclick="reduce()">-</button><input id="count" type="number" style="text-align: center"><button onclick="add()">+</button> </div> <div class="form-item form-btn-con"> <button id="confirm" onclick="confirm()">鎻愬彇</button> @@ -161,6 +166,7 @@ </body> <script> + var matMsgTableBlankRows = 0; // 绌虹櫧琛屾暟 var matData = []; // 琛ㄦ牸鏁版嵁 var code = document.getElementById("code") @@ -171,14 +177,17 @@ var ttbody = document.getElementById("ttbody"); var btnCon = document.getElementById("btn-con"); var tipDom = document.getElementById("tips"); + var combBtn = document.getElementById("comb"); var matDetail = document.getElementById("mat-detail"); var matName = document.getElementById("matName"); var str1 = document.getElementById("str1"); var count = document.getElementById("count"); + var confirmBtn = document.getElementById("confirm"); matDetail.style.display = 'none'; var initMatCount = 1; + window.onload = function(){matMsg.focus();} // 鏌ヨ鐗╂祦 function find(el) { @@ -187,7 +196,7 @@ type: 'post', headers: [{token: getCookie('token')}], data: { - id: el.value + id: matNo.value }, }, function (res) { if (res.code === 200) { @@ -199,7 +208,10 @@ // 濉厖鏁版嵁 matName.value = res.data.matName; str1.value = res.data.str1; + + // count.focus(); count.value = initMatCount; + confirmBtn.focus(); } else { matMsg.style.display = 'block'; btnCon.style.display = 'block'; @@ -217,7 +229,12 @@ function comb() { var barcode = code.value; if (isEmpty(barcode)) { - tips("鎵樼洏鏉$爜涓虹┖", true); + tips("璇疯緭鍏ユ墭鐩樻潯鐮�", true); + // document.getElementById("code").focus(); + return; + } + if (barcode.length !== 8) { + tips("鏉$爜蹇呴』涓�8浣�", true); // document.getElementById("code").focus(); return; } @@ -248,7 +265,7 @@ }) } - initCrnMsgTable(); + // initCrnMsgTable(); function initCrnMsgTable(row) { var line; if (row === undefined){ @@ -410,7 +427,6 @@ requestData += name + '='+ paramData[name] + '&'; } requestData = requestData === '' ? '' : requestData.substring(0,requestData.length - 1); - console.log(requestData) /*璇锋眰鎺ユ敹*/ xmlhttp.onreadystatechange = function() { if(xmlhttp.readyState === 4 && xmlhttp.status === 200) { @@ -448,21 +464,32 @@ document.onkeyup = function (e) { if (window.event)//濡傛灉window.event瀵硅薄瀛樺湪锛屽氨浠ユ浜嬩欢瀵硅薄涓哄噯 e = window.event; - var code = e.charCode || e.keyCode; - if (code === 13) { + var key = e.charCode || e.keyCode; + if (key === 112) { + code.focus(); + } else if (key === 113) { + matNo.focus(); + } else if (key === 114) { + combBtn.focus(); + } else if (key === 13) { + confirmBtn.focus(); + } + } + + document.onkeydown = function (e) { + if (window.event)//濡傛灉window.event瀵硅薄瀛樺湪锛屽氨浠ユ浜嬩欢瀵硅薄涓哄噯 + e = window.event; + var key = e.charCode || e.keyCode; + if (key === 114) { comb() } } - // todo - setTimeout(function () { - code.value = "888" - addTableData({ - matNo: "1902980-11/14", - matName: "閾濆甫|1100-O|0.33*475|", - str1: "浠�", - count: 1 - }) - }, 200) + function help() { + window.alert("鈶� 鎸塅1杈撳叆鏉$爜\n" + + "鈶� 鎸塅2杈撳叆鐗╂枡鍙凤紝鎸塃NTER鏌ヨ锛岄�夋嫨鏁伴噺鍚庢彁鍙朶n" + + "鈶� 鎸塅3寮�濮嬬粍鎵榎n" + + "鍏跺畠锛氭寜F5鍒锋柊椤甸潰"); + } </script> </html> \ No newline at end of file -- Gitblit v1.9.1