From 15d69d9f596a7529ce5a8b8d5a38b94e5c50b6b6 Mon Sep 17 00:00:00 2001
From: luxiaotao1123 <t1341870251@163.com>
Date: 星期五, 18 六月 2021 09:21:56 +0800
Subject: [PATCH] # 库存跳转上报erp

---
 src/main/webapp/views/pda/comb.html |   24 ++++++++++++++++--------
 1 files changed, 16 insertions(+), 8 deletions(-)

diff --git a/src/main/webapp/views/pda/comb.html b/src/main/webapp/views/pda/comb.html
index 4f06e8f..b2bb877 100644
--- a/src/main/webapp/views/pda/comb.html
+++ b/src/main/webapp/views/pda/comb.html
@@ -20,7 +20,7 @@
 <header>
     <div class="layui-input-inline">
         <label class="layui-form-label">鏉$爜</label>
-        <input class="layui-input" type="text" id="code" placeholder="鎵爜 / 杈撳叆" autocomplete="off">
+        <input class="layui-input" type="number" id="code" onkeyup="findCode(this)" oninput="if(value.length>8)value=value.slice(0,8)" placeholder="鎵爜 / 杈撳叆" autocomplete="off">
     </div>
     <div style="margin: 5px 5px">
         <button id="mat-btn" type="button" class="layui-btn layui-btn-normal" onclick="getMat()"><i class="layui-icon">+</i>鎻愬彇</button>
@@ -55,8 +55,8 @@
             cellMinWidth: 50,
             cols: [[
                 {fixed: 'left', align: 'center', field: 'count', title: '鏁伴噺', style:'color: blue', width:50},
-                {field: 'matNo', align: 'center', title: '鐗╂枡缂栫爜'},
-                {field: 'matName', align: 'center', title: '鐗╂枡鍚嶇О'}
+                {field: 'matNo', align: 'center', title: '鍟嗗搧缂栧彿'},
+                {field: 'matName', align: 'center', title: '鍟嗗搧鍚嶇О'}
             ]],
             done: function (res, curr, count) {
             }
@@ -65,6 +65,13 @@
     });
 
     window.onload = function(){document.getElementById("code").focus();}
+
+    function findCode(el) {
+        if (el.value.length === 8) {
+            $('#mat-btn').focus();
+            getMat();
+        }
+    }
 
     var matCodeLayerIdx;
     function getMat() {
@@ -87,7 +94,7 @@
     var matData = [];
     function addTableData(data) {
         if (isEmpty(data.matName)){
-            tips("鎻愬彇澶辫触");
+            tips("鎻愬彇澶辫触", true);
             return;
         }
         let toPush = true;
@@ -109,7 +116,6 @@
         $('#code').val("");
         matData = [];
         tableIns.reload({data: matData});
-        tips("");
     }
 
     // 缁勬墭
@@ -157,9 +163,10 @@
      * @param warn true锛氱孩鑹插瓧浣�
      */
     function tips(msg, warn) {
-        let tips = $('#tips');
-        tips.html(msg);
-        tips.css("color", warn?"red":'#666');
+        // var tips = $('#tips');
+        // tips.html(msg);
+        // tips.css("color", warn?"red":'#666');
+        layer.msg(msg, {icon: warn?2:1})
     }
 
     document.onkeyup = function (e) {
@@ -170,6 +177,7 @@
             $("#comb-btn").focus();
             comb();
         } else if (key === 113) {
+            $("#code").val("");
             $("#code").focus();
         }
     }

--
Gitblit v1.9.1