From d9cd01b4a8ff8f02d155a02d832a7ea407f180e6 Mon Sep 17 00:00:00 2001
From: 王佳豪 <g675230687@126.com>
Date: 星期二, 16 三月 2021 15:29:29 +0800
Subject: [PATCH] 1.0.3 pda-优化库区输入提示

---
 src/main/webapp/views/pda/locNormalMove.html |   18 +++++---
 src/main/webapp/static/css/pda.css           |    2 
 src/main/webapp/views/pda/locNormalIn.html   |   32 +++++++--------
 src/main/webapp/views/pda/locNormalOut.html  |   14 ++++---
 src/main/webapp/static/js/cool.js            |   35 +++++++++++++++++
 5 files changed, 70 insertions(+), 31 deletions(-)

diff --git a/src/main/webapp/static/css/pda.css b/src/main/webapp/static/css/pda.css
index 3fcffb6..cb4dd65 100644
--- a/src/main/webapp/static/css/pda.css
+++ b/src/main/webapp/static/css/pda.css
@@ -35,7 +35,7 @@
     height: 40px;
     margin-right: 0;
 }
-#warehouse {
+#uuid {
     width: 65%;
     height: 40px;
     margin-right: 0;
diff --git a/src/main/webapp/static/js/cool.js b/src/main/webapp/static/js/cool.js
index d817c09..d4828b5 100644
--- a/src/main/webapp/static/js/cool.js
+++ b/src/main/webapp/static/js/cool.js
@@ -150,4 +150,39 @@
             }
         }
     });
+}
+
+var tips2;
+// 鏄惁瀛樺湪鏍¢獙
+function exist(id, domain, dom) {
+    var param = {
+        key: id,
+        val: $('#'+ (dom ? dom : id)).val()
+    };
+    $.ajax({
+        url: baseUrl+"/"+domain+"/check/column/auth",
+        headers: {'token': localStorage.getItem('token')},
+        data: JSON.stringify(param),
+        dataType:'json',
+        contentType:'application/json;charset=UTF-8',
+        method: 'POST',
+        success: function (res) {
+            if (res.code === 200) {
+                tips2 = layer.tips(
+                    "<span style='color:red;'>涓嶅瓨鍦�</span>",
+                    '#'+(dom ? dom : id),
+                    {
+                        // tipsMore: true,
+                        tips: [3,'#fff'],
+                        time:0
+                        ,area: 'auto'
+                        ,maxWidth:500
+                    });
+            } else if (res.code === 403) {
+                top.location.href = baseUrl+"/";
+            } else if (res.code === 407) {
+                layer.close(tips2);
+            }
+        }
+    });
 }
\ No newline at end of file
diff --git a/src/main/webapp/views/pda/locNormalIn.html b/src/main/webapp/views/pda/locNormalIn.html
index f91e840..ec81695 100644
--- a/src/main/webapp/views/pda/locNormalIn.html
+++ b/src/main/webapp/views/pda/locNormalIn.html
@@ -21,7 +21,7 @@
     <div>
         <div class="layui-input-inline">
             <label class="layui-form-label">搴撳尯</label>
-            <input class="layui-input" type="number" id="warehouse" onkeyup="findCode(this)" placeholder="鎵爜 / 杈撳叆"
+            <input class="layui-input" id="uuid" onkeyup="exist(this.id, 'locArea')" placeholder="鎵爜 / 杈撳叆"
                    autocomplete="off">
         </div>
     </div>
@@ -76,14 +76,11 @@
     });
 
     window.onload = function () {
-        document.getElementById("warehouse").focus();
+        document.getElementById("uuid").focus();
     }
 
     function findCode(el) {
-        if (el.value.length === 7) {
-            $('#mat-btn').focus();
-            getMat();
-        }
+
     }
 
     var matCodeLayerIdx;
@@ -126,19 +123,12 @@
         tableIns.reload({data: matData});
     }
 
-    // 閲嶇疆
-    function reset() {
-        $('#warehouse').val("");
-        matData = [];
-        tableIns.reload({data: matData});
-    }
-
     // 缁勬墭
     function comb() {
-        let barcode = $('#warehouse').val();
+        let barcode = $('#uuid').val();
         if (isEmpty(barcode)) {
             tips("搴撳尯鏉$爜涓虹┖", true);
-            document.getElementById("warehouse").focus();
+            document.getElementById("uuid").focus();
             return;
         }
         if (matData.length === 0) {
@@ -202,13 +192,21 @@
             $("#comb-btn").focus();
             comb();
         } else if (key === 113) {
-            $("#warehouse").val("");
-            $("#warehouse").focus();
+            $("#uuid").val("");
+            $("#uuid").focus();
         }
     }
 
     function back() {
         parent.backIndex();
     }
+
+    // 閲嶇疆
+    function reset() {
+        $('#uuid').val("");
+        matData = [];
+        tableIns.reload({data: matData});
+        layer.closeAll();
+    }
 </script>
 </html>
\ No newline at end of file
diff --git a/src/main/webapp/views/pda/locNormalMove.html b/src/main/webapp/views/pda/locNormalMove.html
index 0f7d878..6e9d3bb 100644
--- a/src/main/webapp/views/pda/locNormalMove.html
+++ b/src/main/webapp/views/pda/locNormalMove.html
@@ -24,15 +24,15 @@
     <div>
         <div class="layui-input-inline">
             <label class="layui-form-label" style="margin-left: 16px">婧愬簱鍖�</label>
-            <input class="layui-input" type="number" id="warehouse1" onkeyup="find()" placeholder="鎵爜 / 杈撳叆"
+            <input class="layui-input" id="warehouse1" onkeyup="find(true)" placeholder="鎵爜 / 杈撳叆"
                    autocomplete="off" style="width: 60%">
         </div>
     </div>
     <div>
         <div class="layui-input-inline">
             <label class="layui-form-label">鐩爣搴撳尯</label>
-            <input class="layui-input" type="number" id="warehouse2" placeholder="鎵爜 / 杈撳叆"
-                   autocomplete="off" style="width: 60%">
+            <input class="layui-input" id="warehouse2" placeholder="鎵爜 / 杈撳叆"
+                   autocomplete="off" style="width: 60%" onkeyup="exist('uuid', 'locArea', 'warehouse2')">
         </div>
     </div>
 </header>
@@ -92,7 +92,7 @@
             return;
         }
         if (warehouse1 == warehouse2) {
-            layer.msg("鐩爣搴撳尯鍜屾簮搴撳尯涓�鑷�");
+            layer.msg("鐩爣搴撳尯鍜屾簮搴撳尯涓嶈兘涓�鑷�");
             return;
         }
         // 鍒ゆ柇鍕鹃�夋暟鎹槸鍚︿负绌�
@@ -131,7 +131,10 @@
     }
 
     /* 鏍规嵁搴撳尯鍙锋绱㈢墿鏂欎俊鎭� */
-    find = () => {
+    find = (flag) => {
+        if (flag) {
+            exist('uuid', 'locArea', 'warehouse1');
+        }
         var warehouse = $("#warehouse1").val();
         var matnr = $("#matnr").val();
         // 鏌ヨ鎺ュ彛
@@ -144,7 +147,7 @@
                 if (res.code === 200) {
                     tableIns.reload({
                         data: res.data,
-                    })
+                    });
                 } else if (res.code === 403) {
                     top.location.href = baseUrl + "/pda";
                 } else {
@@ -168,7 +171,7 @@
      * @param warn true锛氱孩鑹插瓧浣�
      */
     function tips(msg, warn) {
-        layer.msg(msg, {icon: warn?2:1})
+        layer.msg(msg, {icon: warn ? 2 : 1})
     }
 
     function reset() {
@@ -176,6 +179,7 @@
         $('#warehouse2').val("");
         $('#matnr').val("");
         tableIns.reload({data: []});
+        layer.closeAll();
     }
 </script>
 </html>
\ No newline at end of file
diff --git a/src/main/webapp/views/pda/locNormalOut.html b/src/main/webapp/views/pda/locNormalOut.html
index 31cce18..9a1e3ff 100644
--- a/src/main/webapp/views/pda/locNormalOut.html
+++ b/src/main/webapp/views/pda/locNormalOut.html
@@ -47,7 +47,7 @@
     <div>
         <div class="layui-input-inline">
             <label class="layui-form-label" style="margin-left: 32px">搴撳尯</label>
-            <input class="layui-input" type="number" id="warehouse" onkeyup="findCode(this, 'warehouse')" placeholder="鎵爜 / 杈撳叆"
+            <input class="layui-input" id="uuid" onkeyup="findCode(this, 'uuid')" placeholder="鎵爜 / 杈撳叆"
                    autocomplete="off">
         </div>
         <div class="layui-input-inline">
@@ -105,7 +105,7 @@
     // 琛ㄦ牸鏁版嵁
     var normalOutList = [];
     window.onload = function () {
-        document.getElementById("warehouse").focus();
+        document.getElementById("uuid").focus();
     }
 
     /**
@@ -176,8 +176,9 @@
     /* 鎵爜銆佽緭鍏ュ簱鍖哄拰鐗╂枡缂栫爜 */
     function findCode(el, type) {
         switch (type) {
-            case 'warehouse':
+            case 'uuid':
                 warehouseBar = el.value;
+                exist('uuid', 'locArea');
                 break;
             case 'matnr':
                 matnrBar =  el.value;
@@ -279,7 +280,7 @@
             return;
         }
         // 搴撳尯璧嬪��
-        var warehouse = $('#warehouse').val();
+        var warehouse = $('#uuid').val();
         data.map(function (item) {
            item.warehouse =  warehouse;
         });
@@ -297,7 +298,7 @@
                 if (res.code === 200) {
                     layer.msg("鍑哄簱鎴愬姛");
                     $("#matnr").val(null);
-                    $("#warehouse").val(null);
+                    $("#uuid").val(null);
                     warehouseBar = null;
                     matnrBar = null;
                     normalOutList = [];
@@ -314,10 +315,11 @@
     }
 
     function reset() {
-        $("#warehouse").val(null);
+        $("#uuid").val(null);
         $("#matnr").val(null);
         normalOutList = [];
         tableIns.reload({data: normalOutList});
+        layer.closeAll();
     }
 </script>
 </html>
\ No newline at end of file

--
Gitblit v1.9.1