From a67ef1ea9215d52bbdef49061639f91cae5a972b Mon Sep 17 00:00:00 2001
From: luxiaotao1123 <t1341870251@163.com>
Date: 星期五, 10 七月 2020 10:26:19 +0800
Subject: [PATCH] #

---
 src/main/webapp/views/pdaCe/index.html |   47 ++++++++++++++++++++++++++++++++++++-----------
 1 files changed, 36 insertions(+), 11 deletions(-)

diff --git a/src/main/webapp/views/pdaCe/index.html b/src/main/webapp/views/pdaCe/index.html
index 296d1b8..0552383 100644
--- a/src/main/webapp/views/pdaCe/index.html
+++ b/src/main/webapp/views/pdaCe/index.html
@@ -134,7 +134,7 @@
 
 <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>
 
@@ -171,11 +171,13 @@
     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;
@@ -200,6 +202,7 @@
                     matName.value = res.data.matName;
                     str1.value = res.data.str1;
                     count.value = initMatCount;
+                    document.getElementById("confirm").focus();
                 } else {
                     matMsg.style.display = 'block';
                     btnCon.style.display = 'block';
@@ -225,18 +228,17 @@
             tips("璇锋彁鍙栫墿鏂�", true);
             return;
         }
-        console.log(JSON.stringify({
-            barcode: barcode,
-            combMats: matData
-        }))
         httpRequest({
-            httpUrl: baseUrl+"/mobile/comb/form",
+            httpUrl: baseUrl+"/mobile/comb/auth",
             type: 'post',
-            headers: [{token: getCookie('token')}],
-            data: {
+            headers: [
+                {token: getCookie('token')}
+                ,{'Content-type':'application/json;charset=UTF-8',}
+                ],
+            data: JSON.stringify({
                 barcode: barcode,
                 combMats: matData
-            },
+            }) ,
         }, function (res) {
             if (res.code === 200) {
                 reset();
@@ -411,7 +413,6 @@
             requestData += name + '='+ paramData[name] + '&';
         }
         requestData = requestData === '' ? '' : requestData.substring(0,requestData.length - 1);
-
         /*璇锋眰鎺ユ敹*/
         xmlhttp.onreadystatechange = function() {
             if(xmlhttp.readyState === 4 && xmlhttp.status === 200) {
@@ -442,8 +443,32 @@
             if (defaultContentType) {
                 xmlhttp.setRequestHeader("Content-type", "application/x-www-form-urlencoded");
             }
-            xmlhttp.send(requestData);
+            xmlhttp.send(defaultContentType?requestData:paramData);
         }
     }
+
+    document.onkeydown = function (e) {
+        if (window.event)//濡傛灉window.event瀵硅薄瀛樺湪锛屽氨浠ユ浜嬩欢瀵硅薄涓哄噯
+            e = window.event;
+        var code1 = e.charCode || e.keyCode;
+        if (code1 === 13) {
+            if (window.getComputedStyle(matDetail).display === 'block') {
+                confirm()
+            } else if (window.getComputedStyle(btnCon).display === 'block') {
+                comb()
+            }
+        }
+    }
+
+    // todo
+    setTimeout(function () {
+        code.value = "888"
+        addTableData({
+            matNo: "1902980-11/14",
+            matName: "閾濆甫|1100-O|0.33*475|",
+            str1: "浠�",
+            count: 1
+        })
+    }, 200)
 </script>
 </html>
\ No newline at end of file

--
Gitblit v1.9.1