From 396187f90061319f013ad72bf04cb4804d1596cd Mon Sep 17 00:00:00 2001
From: heshaofeng <heshaofeng@hnkhzn.com>
Date: 星期二, 06 一月 2026 18:42:59 +0800
Subject: [PATCH] 增加手动关闭功能

---
 项目代码/WMS无仓储版/WIDESEA_WMSServer/WIDESEA_InboundService/InboundOrderService.cs                   |   22 +++++++++++
 项目代码/WMS无仓储版/WIDESEA_WMSServer/WIDESEA_WMSServer/Controllers/Inbound/InboundOrderController.cs |    6 +++
 项目代码/WMS无仓储版/WIDESEA_WMSServer/WIDESEA_IInboundService/IInboundOrderService.cs                 |    2 +
 项目代码/WMS无仓储版/WIDESEA_WMSServer/WIDESEA_Common/OrderEnum/InboundOrderMenu.cs                    |    6 +-
 项目代码/WIDESEA_WMSClient/config/buttons.js                                                       |    8 ++++
 项目代码/WMS无仓储版/WIDESEA_WMSServer/WIDESEA_InboundService/InboundService.cs                        |    5 ++
 项目代码/WIDESEA_WMSClient/src/extension/inbound/inboundOrder.js                                   |   29 ++++++++++++++
 7 files changed, 75 insertions(+), 3 deletions(-)

diff --git "a/\351\241\271\347\233\256\344\273\243\347\240\201/WIDESEA_WMSClient/config/buttons.js" "b/\351\241\271\347\233\256\344\273\243\347\240\201/WIDESEA_WMSClient/config/buttons.js"
index 456f9a8..cd0b5f0 100644
--- "a/\351\241\271\347\233\256\344\273\243\347\240\201/WIDESEA_WMSClient/config/buttons.js"
+++ "b/\351\241\271\347\233\256\344\273\243\347\240\201/WIDESEA_WMSClient/config/buttons.js"
@@ -315,6 +315,14 @@
     type: 'warning',
     onClick: function () {
     }
+},,{
+    name: "鍏抽棴鍗曟嵁",
+    icon: '',
+    class: '',
+    value: 'CloseOrder',
+    type: 'warning',
+    onClick: function () {
+    }
 },
 ]
 
diff --git "a/\351\241\271\347\233\256\344\273\243\347\240\201/WIDESEA_WMSClient/src/extension/inbound/inboundOrder.js" "b/\351\241\271\347\233\256\344\273\243\347\240\201/WIDESEA_WMSClient/src/extension/inbound/inboundOrder.js"
index 9d75572..9c780c9 100644
--- "a/\351\241\271\347\233\256\344\273\243\347\240\201/WIDESEA_WMSClient/src/extension/inbound/inboundOrder.js"
+++ "b/\351\241\271\347\233\256\344\273\243\347\240\201/WIDESEA_WMSClient/src/extension/inbound/inboundOrder.js"
@@ -68,6 +68,35 @@
             });
         };
       }
+
+      var CloseOrderBtn = this.buttons.find(
+        (x) => x.value == "CloseOrder"
+      );
+      if (CloseOrderBtn != null) {
+        CloseOrderBtn.onClick = () => {
+          var rows = this.$refs.table.getSelected();
+          // 鏍¢獙鏄惁鏈夐�変腑鏁版嵁
+          if (!rows || rows.length === 0) {
+            return this.$Message.error("璇峰厛閫夋嫨闇�瑕佸叧闂殑鍗曟嵁");
+          }
+          if (rows.length > 1) {
+            return this.$Message.error("璇烽�夋嫨涓�鏉″崟鎹�");
+          }
+          this.http.post(`api/InboundOrder/HandCloseOrder?orderIds=${rows[0].id}`, {}, "鏁版嵁澶勭悊涓�...")
+            .then((x) => {
+              if (x.status) {
+                this.$Message.success(x.message);
+                this.refresh();
+              } else {
+                return this.$Message.error(x.message);
+              }
+            })
+            .catch((error) => {
+              // 澧炲姞寮傚父鎹曡幏锛屽鐞嗙綉缁滈敊璇瓑鎯呭喌
+              //_this.$Message.error('璇锋眰澶辫触锛�' + (error.message || '鏈煡閿欒'));
+            });
+        };
+      }
       var GroupPalletBtn = this.buttons.find((x) => x.value == "GroupPallet");
       if (GroupPalletBtn != null) {
         GroupPalletBtn.onClick = () => {
diff --git "a/\351\241\271\347\233\256\344\273\243\347\240\201/WMS\346\227\240\344\273\223\345\202\250\347\211\210/WIDESEA_WMSServer/WIDESEA_Common/OrderEnum/InboundOrderMenu.cs" "b/\351\241\271\347\233\256\344\273\243\347\240\201/WMS\346\227\240\344\273\223\345\202\250\347\211\210/WIDESEA_WMSServer/WIDESEA_Common/OrderEnum/InboundOrderMenu.cs"
index 61b81fc..9d04d93 100644
--- "a/\351\241\271\347\233\256\344\273\243\347\240\201/WMS\346\227\240\344\273\223\345\202\250\347\211\210/WIDESEA_WMSServer/WIDESEA_Common/OrderEnum/InboundOrderMenu.cs"
+++ "b/\351\241\271\347\233\256\344\273\243\347\240\201/WMS\346\227\240\344\273\223\345\202\250\347\211\210/WIDESEA_WMSServer/WIDESEA_Common/OrderEnum/InboundOrderMenu.cs"
@@ -31,10 +31,10 @@
         鍏ュ簱瀹屾垚 = 2,
 
         /// <summary>
-        /// 鍏抽棴
+        /// 鎵嬪姩鍏抽棴
         /// </summary>
-        [Description("鍏抽棴")]
-        鍏抽棴 = 99,
+        [Description("鎵嬪姩鍏抽棴")]
+        鎵嬪姩鍏抽棴 = 99,
 
         /// <summary>
         /// 鍙栨秷
diff --git "a/\351\241\271\347\233\256\344\273\243\347\240\201/WMS\346\227\240\344\273\223\345\202\250\347\211\210/WIDESEA_WMSServer/WIDESEA_IInboundService/IInboundOrderService.cs" "b/\351\241\271\347\233\256\344\273\243\347\240\201/WMS\346\227\240\344\273\223\345\202\250\347\211\210/WIDESEA_WMSServer/WIDESEA_IInboundService/IInboundOrderService.cs"
index dc0d91e..2b061e8 100644
--- "a/\351\241\271\347\233\256\344\273\243\347\240\201/WMS\346\227\240\344\273\223\345\202\250\347\211\210/WIDESEA_WMSServer/WIDESEA_IInboundService/IInboundOrderService.cs"
+++ "b/\351\241\271\347\233\256\344\273\243\347\240\201/WMS\346\227\240\344\273\223\345\202\250\347\211\210/WIDESEA_WMSServer/WIDESEA_IInboundService/IInboundOrderService.cs"
@@ -27,5 +27,7 @@
         WebResponseContent UndoPalletGroup(string code);
 
         WebResponseContent UnPalletGroupBarcode(string orderNo);
+
+        WebResponseContent HandCloseOrder(List<int> orderIds);
     }
 }
diff --git "a/\351\241\271\347\233\256\344\273\243\347\240\201/WMS\346\227\240\344\273\223\345\202\250\347\211\210/WIDESEA_WMSServer/WIDESEA_InboundService/InboundOrderService.cs" "b/\351\241\271\347\233\256\344\273\243\347\240\201/WMS\346\227\240\344\273\223\345\202\250\347\211\210/WIDESEA_WMSServer/WIDESEA_InboundService/InboundOrderService.cs"
index 1e5d637..b905ce3 100644
--- "a/\351\241\271\347\233\256\344\273\243\347\240\201/WMS\346\227\240\344\273\223\345\202\250\347\211\210/WIDESEA_WMSServer/WIDESEA_InboundService/InboundOrderService.cs"
+++ "b/\351\241\271\347\233\256\344\273\243\347\240\201/WMS\346\227\240\344\273\223\345\202\250\347\211\210/WIDESEA_WMSServer/WIDESEA_InboundService/InboundOrderService.cs"
@@ -966,5 +966,27 @@
 
             return content.OK(data: details);
         }
+
+        public WebResponseContent HandCloseOrder(List<int> orderIds)
+        {
+            try
+            {
+                foreach (int id in orderIds)
+                {
+                    var inbound = _inboundOrderRepository.QueryFirst(x => x.Id == id);
+                    if(inbound.OrderStatus !=(int)InOrderStatusEnum.鏈紑濮� && inbound.OrderStatus != (int)InOrderStatusEnum.鍏ュ簱涓�)
+                    {
+                        return WebResponseContent.Instance.Error($"璇ュ崟鎹姸鎬佷笉鍙互鍏抽棴");
+                    }
+                    inbound.OrderStatus = (int)InOrderStatusEnum.鎵嬪姩鍏抽棴;
+                    _inboundOrderRepository.UpdateData(inbound);
+                }
+                return WebResponseContent.Instance.OK($"鍗曟嵁鍏抽棴鎴愬姛");
+            }
+            catch (Exception e)
+            {
+                return WebResponseContent.Instance.Error(e.Message);
+            }
+        }
     }
 }
diff --git "a/\351\241\271\347\233\256\344\273\243\347\240\201/WMS\346\227\240\344\273\223\345\202\250\347\211\210/WIDESEA_WMSServer/WIDESEA_InboundService/InboundService.cs" "b/\351\241\271\347\233\256\344\273\243\347\240\201/WMS\346\227\240\344\273\223\345\202\250\347\211\210/WIDESEA_WMSServer/WIDESEA_InboundService/InboundService.cs"
index 38f2aa6..5d5dd37 100644
--- "a/\351\241\271\347\233\256\344\273\243\347\240\201/WMS\346\227\240\344\273\223\345\202\250\347\211\210/WIDESEA_WMSServer/WIDESEA_InboundService/InboundService.cs"
+++ "b/\351\241\271\347\233\256\344\273\243\347\240\201/WMS\346\227\240\344\273\223\345\202\250\347\211\210/WIDESEA_WMSServer/WIDESEA_InboundService/InboundService.cs"
@@ -83,6 +83,7 @@
                 }
 
                 Dt_InboundOrder inboundOrder = new Dt_InboundOrder();
+                
                 var details = _inboundOrderDetailRepository.QueryData(x => (x.OutBoxbarcodes == palletDto.Barcode|| x.Barcode == palletDto.Barcode) && x.OrderDetailStatus == (int)InOrderStatusEnum.鏈紑濮�);
 
                 if (details.Count() <= 0)
@@ -95,6 +96,10 @@
                 {
                     return content.Error("鏈壘鍒拌鏉$爜涓诲崟淇℃伅");
                 }
+                if(inboundOrder.OrderStatus == (int)InOrderStatusEnum.鎵嬪姩鍏抽棴)
+                {
+                    return content.Error("璇ュ崟鎹殑鐘舵�佷笉鑳界粍鐩�");
+                }
                 var warehouse =_warehouseAreaRepository.QueryFirst(x => x.Code == palletDto.WarehouseType);
                 if(inboundOrder.BusinessType=="11" && inboundOrder.FactoryArea != warehouse.FactoryArea)
                 {
diff --git "a/\351\241\271\347\233\256\344\273\243\347\240\201/WMS\346\227\240\344\273\223\345\202\250\347\211\210/WIDESEA_WMSServer/WIDESEA_WMSServer/Controllers/Inbound/InboundOrderController.cs" "b/\351\241\271\347\233\256\344\273\243\347\240\201/WMS\346\227\240\344\273\223\345\202\250\347\211\210/WIDESEA_WMSServer/WIDESEA_WMSServer/Controllers/Inbound/InboundOrderController.cs"
index 519d52e..f1189fa 100644
--- "a/\351\241\271\347\233\256\344\273\243\347\240\201/WMS\346\227\240\344\273\223\345\202\250\347\211\210/WIDESEA_WMSServer/WIDESEA_WMSServer/Controllers/Inbound/InboundOrderController.cs"
+++ "b/\351\241\271\347\233\256\344\273\243\347\240\201/WMS\346\227\240\344\273\223\345\202\250\347\211\210/WIDESEA_WMSServer/WIDESEA_WMSServer/Controllers/Inbound/InboundOrderController.cs"
@@ -258,5 +258,11 @@
             return await _invokeMESService.BatchOrderFeedbackToMes(request.orderNos, request.inout);
         }
 
+
+        [HttpPost, Route("HandCloseOrder"), AllowAnonymous, MethodParamsValidate]
+        public WebResponseContent HandCloseOrder(List<int> orderIds)
+        {
+            return Service.HandCloseOrder(orderIds);
+        }
     }
 }

--
Gitblit v1.9.3