From b06233aa71b70f7a30ff382ae1ba19c29b134d7c Mon Sep 17 00:00:00 2001
From: zhou zhou <3272660260@qq.com>
Date: 星期五, 28 十一月 2025 15:41:51 +0800
Subject: [PATCH] #库存调整完成

---
 src/main/webapp/static/js/checkOrder/checkOrder.js |   50 ++++++++++++++++++++++++++++++++++++++++++++++----
 1 files changed, 46 insertions(+), 4 deletions(-)

diff --git a/src/main/webapp/static/js/checkOrder/checkOrder.js b/src/main/webapp/static/js/checkOrder/checkOrder.js
index 186aa3c..cb64eb4 100644
--- a/src/main/webapp/static/js/checkOrder/checkOrder.js
+++ b/src/main/webapp/static/js/checkOrder/checkOrder.js
@@ -96,6 +96,8 @@
             showEditModel(data);
         }else if (layEvent === 'createTask') {
             pakoutPreview(data.id);
+        }else if (layEvent === 'createAdjust') {
+            createAdjust(data.id);
         }else if (layEvent === 'export') {
             export1(data.id);
         }else if (layEvent === 'del') {
@@ -332,10 +334,17 @@
                         var isDuplicate = false;
                         for (var j = 0; j < xxDataList.length; j++) {
                             if (xxDataList[j].locNo === data[i].locNo && xxDataList[j].matnr === data[i].matnr && xxDataList[j].batch === data[i].batch) {
-                                isDuplicate = true;
-                                duplicateCount++;
-                                break;
+                                if (xxDataList[j].diffQty !== 0){
+                                    isDuplicate = true;
+                                    duplicateCount++;
+                                    break;
+                                }
+
                             }
+                        }
+                        if (data[j].diffQty !== 0){
+                            isDuplicate = true;
+                            duplicateCount++;
                         }
                         // 濡傛灉涓嶉噸澶嶏紝鍒欐坊鍔犲埌鍒楄〃
                         if (!isDuplicate) {
@@ -346,7 +355,7 @@
                     insTbSSXM.reload({data: xxDataList, page: {curr: 1}});
                     // 鎻愮ず娣诲姞缁撴灉
                     if (duplicateCount > 0) {
-                        layer.msg('鎴愬姛娣诲姞 ' + addedCount + ' 鏉℃暟鎹紝' + duplicateCount + ' 鏉¢噸澶嶆暟鎹凡蹇界暐', {icon: 1});
+                        layer.msg('鎴愬姛娣诲姞 ' + addedCount + ' 鏉℃暟鎹紝' + duplicateCount + ' 鏉℃暟鎹凡蹇界暐', {icon: 1});
                     } else if (addedCount > 0) {
                         layer.msg('鎴愬姛娣诲姞 ' + addedCount + ' 鏉℃暟鎹�', {icon: 1});
                     }
@@ -445,6 +454,39 @@
         });
     }
 
+    function createAdjust(orderId) {
+        layer.confirm('纭畾瑕佺敓鎴愯皟鏁村崟鍚楋紵', {
+            shade: .1,
+            skin: 'layui-layer-admin'
+        }, function (i) {
+            layer.close(i);
+            layer.load(2);
+            $.ajax({
+                url: baseUrl+"/adjustOrder/create/test",
+                headers: {'token': localStorage.getItem('token')},
+                data: {
+                    orderId: orderId
+                },
+                method: 'POST',
+                success: function (res) {
+                    layer.closeAll('loading');
+                    if (res.code === 200){
+                        if (insTbCount === 0) {
+                            insTb.reload({page: {curr: 1}});
+                        } else {
+                            $(".layui-laypage-btn")[0].click();
+                        }
+                        layer.msg(res.msg, {icon: 1});
+                    } else if (res.code === 403){
+                        top.location.href = baseUrl+"/";
+                    }else {
+                        layer.msg(res.msg, {icon: 2});
+                    }
+                }
+            })
+        });
+    }
+
 
     function pakoutPreview(id) {
         let loadIndex = layer.load(2);

--
Gitblit v1.9.1