From 52e11442179d464ff3b419954d1482bf7c81bb57 Mon Sep 17 00:00:00 2001
From: huminmin <mac@MacBook-Pro.local>
Date: 星期一, 15 六月 2026 14:08:35 +0800
Subject: [PATCH] 修改入库数量

---
 src/views/procurementManagement/procurementLedger/index.vue |   34 ++++++++++++++++++++--------------
 1 files changed, 20 insertions(+), 14 deletions(-)

diff --git a/src/views/procurementManagement/procurementLedger/index.vue b/src/views/procurementManagement/procurementLedger/index.vue
index cab2a26..2e2b8b7 100644
--- a/src/views/procurementManagement/procurementLedger/index.vue
+++ b/src/views/procurementManagement/procurementLedger/index.vue
@@ -786,7 +786,7 @@
                            prop="unit"
                            width="70" />
           <el-table-column label="寰呭叆搴撴暟閲�"
-                           prop="availableQuality"
+                           prop="pendingInboundQuantity"
                            width="100" />
           <el-table-column label="鏈鍏ュ簱鏁伴噺"
                            width="130">
@@ -794,7 +794,7 @@
               <el-input-number v-model="scope.row.inboundQuantity"
                                :step="0.01"
                                :min="0"
-                               :max="scope.row.availableQuality"
+                               :max="scope.row.pendingInboundQuantity"
                                @change="handleInboundChange(scope.row)"
                                controls-position="right"
                                style="width: 100%" />
@@ -877,6 +877,9 @@
     batchGeneratePurchaseInboundSteps,
     manualStockIn,
   } from "@/api/procurementManagement/procurementLedger.js";
+  import { modelList, productTreeList } from "@/api/basicData/product.js";
+  import dayjs from "dayjs";
+  import FileUpload from "@/components/AttachmentUpload/file/index.vue";
   import useFormData from "@/hooks/useFormData.js";
   const FileList = defineAsyncComponent(() =>
     import("@/components/Dialog/FileList.vue")
@@ -910,9 +913,6 @@
   });
   const total = ref(0);
   const fileList = ref([]);
-  import { modelList, productTreeList } from "@/api/basicData/product.js";
-  import dayjs from "dayjs";
-  import FileUpload from "@/components/AttachmentUpload/file/index.vue";
 
   // 璁㈠崟瀹℃壒鐘舵�佹樉绀烘枃鏈�
   const approvalStatusText = {
@@ -1416,16 +1416,22 @@
       proxy.$modal.loading("姝e湪鍔犺浇浜у搧淇℃伅...");
       const res = await productList({ salesLedgerId: row.id, type: 2 });
       if (res.code === 200) {
-        // 杩囨护鎺夊凡缁忓畬鍏ㄥ叆搴撶殑浜у搧锛堝鏋滄湁杩欎釜鐘舵�佺殑璇濓紝鎴栬�呯洿鎺ユ樉绀烘墍鏈夊彲鐢ㄦ暟閲忓ぇ浜�0鐨勪骇鍝侊級
-        stockInForm.details = (res.data || [])
-          .filter(item => (item.availableQuality || 0) > 0)
-          .map(item => ({
+        const productDetails = (res.data || []).map(item => {
+          const pendingInboundQuantity = Number(item.pendingInboundQuantity || 0);
+          return {
             ...item,
-            inboundQuantity: item.availableQuality || 0, // 榛樿鍏ュ簱鍏ㄩ儴鍙敤鏁伴噺
+            pendingInboundQuantity,
+            inboundQuantity: pendingInboundQuantity, // 榛樿鍏ュ簱鍏ㄩ儴寰呭叆搴撴暟閲�
             isContainsWater: false,
             waterContent: 0,
-            actualInboundQuantity: item.availableQuality || 0,
-          }));
+            actualInboundQuantity: pendingInboundQuantity,
+          };
+        });
+
+        // 杩囨护鎺夊凡缁忓畬鍏ㄥ叆搴撶殑浜у搧
+        stockInForm.details = productDetails.filter(
+          item => (item.pendingInboundQuantity || 0) > 0
+        );
 
         if (stockInForm.details.length === 0) {
           proxy.$modal.msgWarning("璇ュ悎鍚屼笅娌℃湁鍙叆搴撶殑浜у搧璁板綍");
@@ -1469,10 +1475,10 @@
     }
 
     const overLimit = stockInForm.details.some(
-      item => item.inboundQuantity > item.availableQuality
+      item => item.inboundQuantity > item.pendingInboundQuantity
     );
     if (overLimit) {
-      proxy.$modal.msgWarning("鍏ュ簱鏁伴噺涓嶈兘瓒呰繃鍙敤鏁伴噺");
+      proxy.$modal.msgWarning("鍏ュ簱鏁伴噺涓嶈兘瓒呰繃寰呭叆搴撴暟閲�");
       return;
     }
 

--
Gitblit v1.9.3