From a45b751080a50d94d3ed2d9f1d801e14a7046b6d Mon Sep 17 00:00:00 2001
From: chen.lin <1442464845@qq.com>
Date: 星期三, 28 一月 2026 10:48:42 +0800
Subject: [PATCH] 生成领料单-pda+后台2

---
 src/main/webapp/views/pda/index.html                                |   29 ++++++++++----
 src/main/java/com/zy/asrs/controller/MaterialReceiveController.java |    3 +
 src/main/webapp/views/pda/materialReceiveOut.html                   |   78 +++++++++++++++++++++++++++++++-------
 3 files changed, 85 insertions(+), 25 deletions(-)

diff --git a/src/main/java/com/zy/asrs/controller/MaterialReceiveController.java b/src/main/java/com/zy/asrs/controller/MaterialReceiveController.java
index c2bc2b2..b8f8348 100644
--- a/src/main/java/com/zy/asrs/controller/MaterialReceiveController.java
+++ b/src/main/java/com/zy/asrs/controller/MaterialReceiveController.java
@@ -304,9 +304,10 @@
 
     @RequestMapping(value = "/materialReceive/checkSyncStatus/auth")
     @ManagerAuth
-    public R checkSyncStatus(@RequestParam String soCode, @RequestParam(required = false) String invCode) {
+    public R checkSyncStatus(@RequestParam String soCode, @RequestParam(required = false) String invCode, @RequestParam(required = false) String fbillno) {
         EntityWrapper<MaterialReceive> wrapper = new EntityWrapper<>();
         wrapper.eq("so_code", soCode);
+        wrapper.eq("fbillno", fbillno);
         if (!Cools.isEmpty(invCode)) {
             wrapper.eq("inv_code", invCode);
         }
diff --git a/src/main/webapp/views/pda/index.html b/src/main/webapp/views/pda/index.html
index 351ea75..470ca3b 100644
--- a/src/main/webapp/views/pda/index.html
+++ b/src/main/webapp/views/pda/index.html
@@ -132,9 +132,14 @@
         <td>
             <div id="combLToP" onclick="nav(this.id)" class="nav-font-size">绔嬪簱绉诲簱缁勬墭</div>
         </td>
-<!--        <td>-->
-<!--            <div id="locNormalOut" onclick="nav(this.id)" class="nav-font-size">骞充粨鎴愬搧鍑哄簱</div>-->
-<!--        </td>-->
+        <td>
+            <div id="materialReceiveOut" onclick="nav(this.id)" class="nav-font-size">鐢熸垚棰嗘枡鍑哄簱</div>
+        </td>
+    </tr>
+    <tr>
+        <td>
+            <div id="materialWwOut" onclick="nav(this.id)" class="nav-font-size">濮斿鍔犲伐鍑哄簱</div>
+        </td>
     </tr>
 </table>
 
@@ -150,21 +155,21 @@
             headers: {'token': localStorage.getItem('token')},
             method: 'GET',
             success: function (res) {
-                if (res.code === 200){
+                if (res && res.code === 200){
                     console.log(res)
-                    if (res.data.code === 'a') {
+                    if (res.data && res.data.code === 'a') {
                         $("#combAgv").parent().hide();
                         $("#combProAgv").parent().hide();
                         $("#comb").parent().hide();
                         $("#combPro").parent().hide();
                         $("#locNormalIn").parent().hide();
                         $("#locNormalOut").parent().hide();
-                    } else if (res.data.code === 'b') {
+                    } else if (res.data && res.data.code === 'b') {
                         $("#locNormalIn1").parent().hide();
                         $("#locNormalOut1").parent().hide();
                         // $("#locNormalIn").parent().hide();
                         // $("#locNormalOut").parent().hide();
-                    } else if (res.data.code === 'c') {
+                    } else if (res.data && res.data.code === 'c') {
                         $("#combAgv").parent().hide();
                         $("#combProAgv").parent().hide();
                         $("#comb").parent().hide();
@@ -172,11 +177,17 @@
                         $("#locNormalIn1").parent().hide();
                         $("#locNormalOut1").parent().hide();
                     }
-                } else if (res.code === 403){
+                } else if (res && res.code === 403){
                     top.location.href = baseUrl+"/";
-                }else {
+                } else if (res && res.msg) {
                     layer.msg(res.msg, {icon: 2});
+                } else {
+                    layer.msg("璇锋眰澶辫触锛岃绋嶅悗閲嶈瘯", {icon: 2});
                 }
+            },
+            error: function(xhr, status, error) {
+                console.error("璇锋眰澶辫触:", status, error);
+                layer.msg("璇锋眰澶辫触锛岃绋嶅悗閲嶈瘯", {icon: 2});
             }
         })
     });
diff --git a/src/main/webapp/views/pda/materialReceiveOut.html b/src/main/webapp/views/pda/materialReceiveOut.html
index 70f98ab..ec172b2 100644
--- a/src/main/webapp/views/pda/materialReceiveOut.html
+++ b/src/main/webapp/views/pda/materialReceiveOut.html
@@ -79,6 +79,14 @@
                style="width: 175px"
                autocomplete="off">
     </div>
+<!--    <div class="layui-input-inline">-->
+<!--        <label class="layui-form-label">寮�宸ユ棩鏈�</label>-->
+<!--        <input class="layui-input" id="fplancommitdate" placeholder="閫夋嫨鎴栬緭鍏ユ棩鏈�"-->
+<!--               style="width: 175px"-->
+<!--               autocomplete="off"-->
+<!--               onkeyup="findCode(this, 'fplancommitdate')"-->
+<!--               onchange="findCode(this, 'fplancommitdate')">-->
+<!--    </div>-->
 </header>
 
 <main>
@@ -165,11 +173,23 @@
     }
 
     var tableIns;
-    layui.use(['table', 'form'], function () {
+    layui.use(['table', 'form', 'laydate'], function () {
         var table = layui.table;
         var $ = layui.jquery;
         var layer = layui.layer;
         var form = layui.form;
+        var laydate = layui.laydate;
+        
+        // 鍒濆鍖栨棩鏈熼�夋嫨鍣紙鏀寔閫夋嫨鏃ユ湡鍜屾墜鍔ㄨ緭鍏ワ級
+        laydate.render({
+            elem: '#fplancommitdate',
+            type: 'date',
+            format: 'yyyy-MM-dd',
+            done: function(value, date, endDate) {
+                // 鏃ユ湡閫夋嫨鍚庤Е鍙戞煡璇�
+                findCode(null, 'fplancommitdate');
+            }
+        });
 
         tableIns = table.render({
             id: 'materialReceiveOut',
@@ -178,16 +198,14 @@
             limit: 500,
             cellMinWidth: 50,
             cols: [[
-                {field: 'invCode', align: 'center', title: '缂栫爜', event: 'detail', width: 80},
+                {field: 'soCode', align: 'center', title: '鐢熸垚鍗曞彿', event: 'detail', width: 100},
                 {field: 'fbillno', align: 'center', title: '浠诲姟鍗曞彿', event: 'detail', width: 100},
-                {field: 'invName', align: 'center', title: '鍚嶇О', event: 'detail'},
+                {field: 'invCode', align: 'center', title: '鐗╂枡缂栫爜', event: 'detail', width: 80},
                 {field: 'whName', align: 'center', title: '搴撳尯', event: 'detail', width: 50},
                 {
                     field: 'remainQty',
                     align: 'center',
                     title: '鏁伴噺',
-                    event: 'detail',
-                    style: 'color: blue',
                     event: 'modify',
                     style: 'cursor: pointer;color: blue',
                     width: 50,
@@ -200,6 +218,24 @@
                         return d.remainQty || 0;
                     }
                 },
+                // {
+                //     field: 'fplancommitdate',
+                //     align: 'center',
+                //     title: '寮�宸ユ棩鏈�',
+                //     event: 'detail',
+                //     width: 100,
+                //     templet: function(d) {
+                //         if (d.fplancommitdate) {
+                //             // 鏍煎紡鍖栨棩鏈熸樉绀猴紙濡傛灉鍚庣杩斿洖鐨勬槸瀹屾暣鏃ユ湡鏃堕棿锛屽彧鏄剧ず鏃ユ湡閮ㄥ垎锛�
+                //             var dateStr = d.fplancommitdate;
+                //             if (dateStr.indexOf(' ') > 0) {
+                //                 return dateStr.split(' ')[0];
+                //             }
+                //             return dateStr;
+                //         }
+                //         return '';
+                //     }
+                // },
                 {type: 'checkbox', fixed: 'right', width: 30},
             ]],
             done: function (res, curr, count) {
@@ -236,12 +272,14 @@
     var soCodeBar;
     var fbillnoBar;
     var invCodeBar;
+    var fplancommitdateBar;
 
-    /* 鎵爜銆佽緭鍏ョ敓浜у崟鍙枫�佷换鍔″崟鍙峰拰鐗╂枡缂栫爜 */
+    /* 鎵爜銆佽緭鍏ョ敓浜у崟鍙枫�佷换鍔″崟鍙枫�佺墿鏂欑紪鐮佸拰寮�宸ユ棩鏈� */
     function findCode(el, type) {
         soCodeBar = $('#soCode').val();
         fbillnoBar = $("#fbillno").val();
         invCodeBar = $("#invCode").val();
+        fplancommitdateBar = $("#fplancommitdate").val();
         
         // 鍘婚櫎绌烘牸
         if (soCodeBar) {
@@ -253,6 +291,9 @@
         if (invCodeBar) {
             invCodeBar = invCodeBar.trim();
         }
+        if (fplancommitdateBar) {
+            fplancommitdateBar = fplancommitdateBar.trim();
+        }
         
         switch (type) {
             case 'soCode':
@@ -261,8 +302,20 @@
                 break;
             case 'invCode':
                 break;
+            case 'fplancommitdate':
+                break;
             default:
                 break;
+        }
+
+        // 濡傛灉鐢熶骇鍗曞彿鍜屼换鍔″崟鍙烽兘涓虹┖锛屼笉鎵ц鏌ヨ
+        if (!soCodeBar && !fbillnoBar) {
+            // 娓呯┖琛ㄦ牸鏁版嵁
+            tableIns.reload({
+                data: [],
+            });
+            materialReceiveList = [];
+            return;
         }
 
         // 鏋勫缓鏌ヨ鍙傛暟
@@ -276,15 +329,8 @@
         if (invCodeBar) {
             params.invCode = invCodeBar;
         }
-
-        // 濡傛灉鎵�鏈夋煡璇㈡潯浠堕兘涓虹┖锛屼笉鎵ц鏌ヨ
-        if (!soCodeBar && !fbillnoBar && !invCodeBar) {
-            // 娓呯┖琛ㄦ牸鏁版嵁
-            tableIns.reload({
-                data: [],
-            });
-            materialReceiveList = [];
-            return;
+        if (fplancommitdateBar) {
+            params.fplancommitdate = fplancommitdateBar;
         }
 
         // PDA鍑哄簱鏌ヨ锛屾坊鍔爌daQuery鍙傛暟锛屽悗绔細杩囨护鎺夊凡鍏ㄩ儴鍑哄簱鐨勭墿鏂�
@@ -464,6 +510,7 @@
                 $("#soCode").val("");
                 $("#fbillno").val("");
                 $("#invCode").val("");
+                $("#fplancommitdate").val("");
                 materialReceiveList = [];
                 tableIns.reload({data: materialReceiveList});
                 document.getElementById("soCode").focus();
@@ -480,6 +527,7 @@
         $("#soCode").val(null);
         $("#fbillno").val(null);
         $("#invCode").val(null);
+        $("#fplancommitdate").val(null);
         materialReceiveList = [];
         tableIns.reload({data: materialReceiveList});
         layer.closeAll();

--
Gitblit v1.9.1