From 6aff4dd75413754146914f08483fc7f2dc3fa35e Mon Sep 17 00:00:00 2001
From: luxiaotao1123 <t1341870251@163.com>
Date: 星期四, 25 二月 2021 10:17:11 +0800
Subject: [PATCH] #

---
 src/main/webapp/views/pda/stockIn.html                          |   89 +++++++++++++++++++++-----------------------
 src/main/java/zy/cloud/wms/pda/controller/MobileController.java |   14 +++++++
 2 files changed, 56 insertions(+), 47 deletions(-)

diff --git a/src/main/java/zy/cloud/wms/pda/controller/MobileController.java b/src/main/java/zy/cloud/wms/pda/controller/MobileController.java
index 4f84877..2cfc734 100644
--- a/src/main/java/zy/cloud/wms/pda/controller/MobileController.java
+++ b/src/main/java/zy/cloud/wms/pda/controller/MobileController.java
@@ -7,7 +7,9 @@
 import org.springframework.web.bind.annotation.*;
 import zy.cloud.wms.common.web.BaseController;
 import zy.cloud.wms.manager.entity.Comb;
+import zy.cloud.wms.manager.entity.Node;
 import zy.cloud.wms.manager.service.CombService;
+import zy.cloud.wms.manager.service.NodeService;
 import zy.cloud.wms.pda.entity.CombParam;
 import zy.cloud.wms.pda.service.MobileService;
 
@@ -25,6 +27,8 @@
     private MobileService mobileService;
     @Autowired
     private CombService combService;
+    @Autowired
+    private NodeService nodeService;
 
     /**
      * 缁勬墭
@@ -46,6 +50,16 @@
         return R.ok().add(combs);
     }
 
+    /**
+     *  鏌ユ壘璐т綅
+     */
+    @PostMapping("/inStock/node/auth")
+    @ManagerAuth
+    public R getNode(@RequestParam String node){
+        Node one = nodeService.selectOne(new EntityWrapper<Node>().eq("uuid", node).eq("status", 1));
+        return R.ok().add(one);
+    }
+
 
 //    /**
 //     *  鏍规嵁搴撲綅鍙锋煡鎵惧簱瀛樻槑缁�
diff --git a/src/main/webapp/views/pda/stockIn.html b/src/main/webapp/views/pda/stockIn.html
index a8453b3..1294a6b 100644
--- a/src/main/webapp/views/pda/stockIn.html
+++ b/src/main/webapp/views/pda/stockIn.html
@@ -65,6 +65,17 @@
             transform:rotate(-45deg);
         }
 
+        /**缁胯壊鍕�*/
+        #node-ok {
+            float: left;
+            width: 15px;
+            height: 15px;
+            border-radius: 50%;
+            margin-top: 13px;
+            background-color: #2ac845;
+            display: none;
+        }
+
     </style>
 </head>
 <body>
@@ -76,7 +87,8 @@
     </div>
     <div STYLE="margin: 5px 0" class="layui-input-inline">
         <label class="layui-form-label">涓婃灦璐т綅</label>
-        <input class="layui-input" type="text" id="node" onkeyup="findNode(this)" placeholder="鎵爜 / 杈撳叆" autocomplete="off">
+        <input style="float: left" class="layui-input" type="text" id="node" onkeyup="findNode(this)" placeholder="鎵爜 / 杈撳叆" autocomplete="off">
+        <span id="node-ok"></span>
     </div>
 </header>
 
@@ -111,7 +123,7 @@
             limit: 500,
             cellMinWidth: 50,
             cols: [[
-                {fixed: 'left', align: 'center', field: 'count', title: '鏁伴噺', style:'color: blue', width:50},
+                {fixed: 'left', align: 'center', field: 'anfme', title: '鏁伴噺', style:'color: blue', width:50},
                 {field: 'matnr', align: 'center', title: '鍟嗗搧缂栫爜'},
                 {field: 'maktx', align: 'center', title: '鍟嗗搧鍚嶇О'}
             ]],
@@ -135,8 +147,9 @@
             method: 'POST',
             success: function (res) {
                 if (res.code === 200) {
-                    if (res.data != null) {
-                        addTableData(res.data)
+                    if (res.data.length > 0) {
+                        tableIns.reload({data: res.data});
+                        $('#node').focus();
                     }
                 } else if (res.code === 403) {
                     top.location.href = baseUrl + "/pda";
@@ -148,10 +161,31 @@
     }
 
     function findNode(el) {
-        if (el.value.length === 7) {
-            $('#mat-btn').focus();
-            getMat();
+        if (isEmpty(el.value)) {
+            return;
         }
+        $.ajax({
+            url: baseUrl + "/mobile/inStock/node/auth",
+            headers: {'token': localStorage.getItem('token')},
+            data: {
+                node: el.value
+            },
+            method: 'POST',
+            success: function (res) {
+                if (res.code === 200) {
+                    if (res.data != null) {
+                        $('#pakin').focus();
+                        $('#node-ok').show();
+                    } else {
+                        $('#node-ok').hide();
+                    }
+                } else if (res.code === 403) {
+                    top.location.href = baseUrl + "/pda";
+                } else {
+                    alert(res.msg)
+                }
+            }
+        })
     }
 
     // 鎻愬彇鐗╂枡
@@ -190,7 +224,6 @@
                 matData.push(data[i]);
             }
         }
-        // console.log(matData)
         tableIns.reload({data: matData});
         $("#comb-btn").focus();
     }
@@ -200,9 +233,9 @@
         $('#code').val("");
         matData = [];
         tableIns.reload({data: matData});
+        $('#node-ok').hide();
         $('#putSiteSelect').val("");
         layui.form.render('select');
-        // tips("");
     }
 
     // 鍏ュ簱
@@ -241,44 +274,6 @@
                 if (res.code === 200) {
                     reset();
                     tips("鍏ュ簱鍚姩鎴愬姛")
-                } else if (res.code === 403) {
-                    top.location.href = baseUrl + "/pda";
-                } else {
-                    tips(res.msg, true)
-                }
-            }
-        })
-    }
-
-    // 绌烘澘鍏ュ簱
-    function emptyPakIn() {
-        var barcode = $('#code').val();
-        if (isEmpty(barcode)) {
-            tips("鎵樼洏鏉$爜涓虹┖", true);
-            return;
-        }
-        if (barcode.length !== 7) {
-            tips("鏉$爜蹇呴』涓�7浣�", true);
-            return;
-        }
-        var site = $('#putSiteSelect').val();
-        if (null === site || undefined === site || site === "") {
-            tips("璇烽�夋嫨鍏ュ簱鍙�", true);
-            return;
-        }
-        $.ajax({
-            url: baseUrl+"/empty/plate/in/start",
-            headers: {'token': localStorage.getItem('token')},
-            data: {
-                barcode: barcode,
-                sourceStaNo: site
-            },
-            method: 'POST',
-            async: false,
-            success: function (res) {
-                if (res.code === 200) {
-                    reset();
-                    tips("绌烘澘鍏ュ簱鍚姩鎴愬姛")
                 } else if (res.code === 403) {
                     top.location.href = baseUrl + "/pda";
                 } else {

--
Gitblit v1.9.1