From da2d7be1a34015d921ead5d74b69c55bb422f50a Mon Sep 17 00:00:00 2001
From: 647556386 <647556386@qq.com>
Date: 星期五, 09 一月 2026 16:45:03 +0800
Subject: [PATCH] 1

---
 项目代码/WMS无仓储版/WIDESEA_WMSServer/WIDESEA_WMSServer/Controllers/Allocate/AllocateOrderController.cs |    4 ++--
 项目代码/WIDESEA_WMSClient/src/extension/inbound/extend/OrderStockTake.vue                           |   34 ++++++++++++++++++++++++----------
 2 files changed, 26 insertions(+), 12 deletions(-)

diff --git "a/\351\241\271\347\233\256\344\273\243\347\240\201/WIDESEA_WMSClient/src/extension/inbound/extend/OrderStockTake.vue" "b/\351\241\271\347\233\256\344\273\243\347\240\201/WIDESEA_WMSClient/src/extension/inbound/extend/OrderStockTake.vue"
index 6d19fbd..92a0bb3 100644
--- "a/\351\241\271\347\233\256\344\273\243\347\240\201/WIDESEA_WMSClient/src/extension/inbound/extend/OrderStockTake.vue"
+++ "b/\351\241\271\347\233\256\344\273\243\347\240\201/WIDESEA_WMSClient/src/extension/inbound/extend/OrderStockTake.vue"
@@ -165,7 +165,7 @@
               @keydown.enter="handleStockTakeComplete"
               :disabled="!formData.stockQuantity || loading"
               class="custom-input"
-              :class="{ 'has-value': formData.actualQuantity }"
+              :class="{ 'has-value': formData.actualQuantity !== '' }"
             ></el-input>
           </el-form-item>
         </el-form>
@@ -185,13 +185,7 @@
             type="primary"
             size="small"
             @click="handleStockTakeComplete"
-            :disabled="
-              loading ||
-              !formData.boxNo.trim() ||
-              !formData.barcode.trim() ||
-              !formData.stockQuantity ||
-              !formData.actualQuantity
-            "
+            :disabled="isFormCompleteDisabled"
             class="complete-btn"
           >
             <Check /> 鐩樼偣瀹屾垚
@@ -251,6 +245,20 @@
 // 妫�娴嬫槸鍚︿负绉诲姩绔�
 const isMobile = computed(() => {
   return window.innerWidth < 768;
+});
+
+// 璁$畻灞炴�э細鐩樼偣瀹屾垚鎸夐挳鏄惁绂佺敤
+const isFormCompleteDisabled = computed(() => {
+  return (
+    loading.value ||
+    !formData.boxNo.trim() ||
+    !formData.barcode.trim() ||
+    !formData.stockQuantity ||
+    formData.actualQuantity === "" ||
+    formData.actualQuantity === null ||
+    formData.actualQuantity === undefined ||
+    Number(formData.actualQuantity) < 0 // 灏忎簬0鏃剁鐢紝0鏄厑璁哥殑
+  );
 });
 
 // 缁勪欢鎸傝浇鏃惰仛鐒﹀埌鏂欑鍙疯緭鍏ユ
@@ -334,7 +342,7 @@
   }
 };
 
-// 瀹為檯鐩樼偣鏁伴噺楠岃瘉锛氫粎楠岃瘉鏁板�间笉灏忎簬0
+// 瀹為檯鐩樼偣鏁伴噺楠岃瘉锛氬厑璁�0锛屼絾涓嶅厑璁稿皬浜�0
 const validateActualQuantity = (rule, value, callback) => {
   // 绌哄�肩敱required瑙勫垯澶勭悊锛岃繖閲屽彧楠岃瘉鏁板�煎悎娉曟��
   if (value === null || value === undefined || value === "") {
@@ -344,7 +352,7 @@
   else if (value < 0) {
     callback(new Error("瀹為檯鐩樼偣鏁伴噺涓嶈兘灏忎簬0"));
   } 
-  // 楠岃瘉閫氳繃
+  // 楠岃瘉閫氳繃锛堝厑璁�0锛�
   else {
     callback();
   }
@@ -474,6 +482,12 @@
   const valid = await formRef.value.validate();
   if (!valid) return;
 
+  // 棰濆妫�鏌ュ疄闄呯洏鐐规暟閲忔槸鍚﹀皬浜�0
+  if (formData.actualQuantity < 0) {
+    ElMessage.error("瀹為檯鐩樼偣鏁伴噺涓嶈兘灏忎簬0");
+    return;
+  }
+
   const { boxNo, barcode, actualQuantity, stockQuantity } = formData;
   const receiptNo = orderNo.value;
 
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/Allocate/AllocateOrderController.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/Allocate/AllocateOrderController.cs"
index ba9350e..9f06e30 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/Allocate/AllocateOrderController.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/Allocate/AllocateOrderController.cs"
@@ -78,7 +78,7 @@
                     {
                         Dt_AllocateOrderDetail orderDetail = new Dt_AllocateOrderDetail
                         {
-                            WarehouseCode = detailDto.WarehouseCode,
+                            WarehouseCode = model.toWarehouse,
                             MaterielCode = detailDto.MaterialCode,
                             MaterielName = materialName,
                             LineNo = detailDto.LineNo,
@@ -99,7 +99,7 @@
                 {
                     Dt_AllocateOrderDetail orderDetail = new Dt_AllocateOrderDetail
                     {
-                        WarehouseCode = detailDto.WarehouseCode,
+                        WarehouseCode = model.toWarehouse,
                         MaterielCode = detailDto.MaterialCode,
                         LineNo = detailDto.LineNo,
                         OrderQuantity = detailDto.Qty,

--
Gitblit v1.9.3