From 394a5fc7f6d3987be8af2e28e84aa94dcf96e596 Mon Sep 17 00:00:00 2001
From: gongchunyi <deslre0381@gmail.com>
Date: 星期三, 19 八月 2026 10:28:52 +0800
Subject: [PATCH] fix: 移除发货小数限制

---
 src/views/productionPlan/productionPlan/index.vue |   31 +++++++++++++++++++------------
 1 files changed, 19 insertions(+), 12 deletions(-)

diff --git a/src/views/productionPlan/productionPlan/index.vue b/src/views/productionPlan/productionPlan/index.vue
index 01a513b..c29530a 100644
--- a/src/views/productionPlan/productionPlan/index.vue
+++ b/src/views/productionPlan/productionPlan/index.vue
@@ -143,6 +143,7 @@
       <template #footer>
         <span class="dialog-footer">
           <el-button type="primary"
+                     :loading="mergeSubmitLoading"
                      @click="handleMergeSubmit">纭畾涓嬪彂</el-button>
           <el-button @click="isShowNewModal = false">鍙栨秷</el-button>
         </span>
@@ -303,6 +304,13 @@
         return params == "閿�鍞�" ? "閿�鍞�" : "鍐呴儴";
       },
     },
+    {
+      label: "閿�鍞悎鍚屽彿",
+      prop: "salesContractNo",
+      width: "200px",
+      dataType: "slot",
+      slot: "salesContractNo",
+    },
 
     {
       label: "浜у搧鍚嶇О",
@@ -328,7 +336,6 @@
       label: "鎵�闇�鏁伴噺",
       prop: "qtyRequired",
       width: "150px",
-      align: "right",
       dataType: "slot",
       slot: "qtyRequired",
       className: "volume-cell",
@@ -377,13 +384,7 @@
       className: "date-cell",
       formatData: cell => (cell ? dayjs(cell).format("YYYY-MM-DD") : ""),
     },
-    {
-      label: "閿�鍞悎鍚屽彿",
-      prop: "salesContractNo",
-      width: "200px",
-      dataType: "slot",
-      slot: "salesContractNo",
-    },
+
     {
       label: "瀹㈡埛鍚嶇О",
       prop: "customerName",
@@ -466,6 +467,7 @@
 
   // 鍚堝苟涓嬪彂寮圭獥鎺у埗
   const isShowNewModal = ref(false);
+  const mergeSubmitLoading = ref(false);
   // 鍚堝苟涓嬪彂琛ㄥ崟鏁版嵁
   const mergeForm = reactive({
     productName: "",
@@ -737,13 +739,14 @@
     // 璁$畻鎬诲埗閫犳暟閲� (榛樿qtyRequired鐨勫拰)
     const totalAssignedQuantity = selectedRows.value.reduce((sum, row) => {
       return sum + Number(row.qtyRequired || 0) - Number(row.quantityIssued || 0);
-    }, 0);
-    sumAssignedQuantity.value = totalAssignedQuantity;
-    console.log(totalAssignedQuantity);
+    }, 0);  // 閬垮厤娴偣鏁扮簿搴﹂棶棰橈紙濡� 37.800000000000004锛�
+    const fixedTotal = Math.round(totalAssignedQuantity * 100) / 100;
+    sumAssignedQuantity.value = fixedTotal;
+    console.log(fixedTotal);
     // 璁剧疆琛ㄥ崟鏁版嵁
     mergeForm.productName = productName;
     mergeForm.model = firstRow.model || "";
-    mergeForm.totalAssignedQuantity = totalAssignedQuantity;
+    mergeForm.totalAssignedQuantity = fixedTotal;
     mergeForm.planCompleteTime = firstRow.requiredDate || "";
     mergeForm.productId = firstRow.productId || "";
     mergeForm.ids = selectedRows.value.map(row => row.id);
@@ -778,6 +781,7 @@
     const payload = {
       ...mergeForm,
     };
+    mergeSubmitLoading.value = true;
     productionPlanCombine(payload)
       .then(res => {
         if (res.code === 200) {
@@ -793,6 +797,9 @@
       .catch(err => {
         console.error("鍚堝苟涓嬪彂寮傚父锛�", err);
         ElMessage.error("绯荤粺寮傚父锛屽悎骞朵笅鍙戝け璐�");
+      })
+      .finally(() => {
+        mergeSubmitLoading.value = false;
       });
     // 鍙互閫夋嫨鍒锋柊鍒楄〃鎴栧叾浠栨搷浣�
   };

--
Gitblit v1.9.3