From 4d9ce4d87bcae1f27cffe03befaeb50eea69dde1 Mon Sep 17 00:00:00 2001
From: yuan <123@>
Date: 星期日, 13 九月 2026 12:35:07 +0800
Subject: [PATCH] fix: 将数量字段的输入精度更新为8位小数

---
 src/views/productionManagement/productStructure/Detail/index.vue                   |    8 ++++----
 src/views/productionManagement/productionOrder/components/MaterialLedgerDialog.vue |    2 +-
 src/views/productionManagement/productStructure/DetailNew/MaterialCard.vue         |    2 +-
 src/views/productionManagement/processRoute/processRouteItem/index.vue             |    8 ++++----
 src/views/productionManagement/productStructure/DetailNew/index.vue                |    6 +++---
 src/views/productionManagement/productStructure/StructureEdit.vue                  |    2 +-
 6 files changed, 14 insertions(+), 14 deletions(-)

diff --git a/src/views/productionManagement/processRoute/processRouteItem/index.vue b/src/views/productionManagement/processRoute/processRouteItem/index.vue
index b41fb15..0f54aef 100644
--- a/src/views/productionManagement/processRoute/processRouteItem/index.vue
+++ b/src/views/productionManagement/processRoute/processRouteItem/index.vue
@@ -340,7 +340,7 @@
                                 style="margin: 0">
                     <el-input-number v-model="row.unitQuantity"
                                      :min="0"
-                                     :precision="2"
+                                     :precision="8"
                                      :step="1"
                                      controls-position="right"
                                      style="width: 100%"
@@ -1198,19 +1198,19 @@
     });
   };
 
-  const toQuantityNumber = value => {
+  const toQuantityNumber = (value, scale = 2) => {
     const numberValue = Number(value);
     if (!Number.isFinite(numberValue)) {
       return 0;
     }
-    return Number(numberValue.toFixed(2));
+    return Number(numberValue.toFixed(scale));
   };
 
   const syncDemandedQuantityTree = (items, parentDemandedQuantity = null) => {
     items.forEach(item => {
       if (parentDemandedQuantity !== null) {
         item.demandedQuantity = toQuantityNumber(
-          parentDemandedQuantity * toQuantityNumber(item.unitQuantity)
+          parentDemandedQuantity * toQuantityNumber(item.unitQuantity, 8)
         );
       }
 
diff --git a/src/views/productionManagement/productStructure/Detail/index.vue b/src/views/productionManagement/productStructure/Detail/index.vue
index 5cb08e8..5898bd0 100644
--- a/src/views/productionManagement/productStructure/Detail/index.vue
+++ b/src/views/productionManagement/productStructure/Detail/index.vue
@@ -82,7 +82,7 @@
                                 style="margin: 0">
                     <el-input-number v-model="row.unitQuantity"
                                      :min="0"
-                                     :precision="2"
+                                     :precision="8"
                                      :step="1"
                                      controls-position="right"
                                      style="width: 100%"
@@ -269,12 +269,12 @@
     });
   };
 
-  const toQuantityNumber = (value: any) => {
+  const toQuantityNumber = (value: any, scale: number = 2) => {
     const numberValue = Number(value);
     if (!Number.isFinite(numberValue)) {
       return 0;
     }
-    return Number(numberValue.toFixed(2));
+    return Number(numberValue.toFixed(scale));
   };
 
   const syncDemandedQuantityTree = (
@@ -284,7 +284,7 @@
     items.forEach((item: any) => {
       if (parentDemandedQuantity !== null) {
         item.demandedQuantity = toQuantityNumber(
-          parentDemandedQuantity * toQuantityNumber(item.unitQuantity)
+          parentDemandedQuantity * toQuantityNumber(item.unitQuantity, 8)
         );
       }
 
diff --git a/src/views/productionManagement/productStructure/DetailNew/MaterialCard.vue b/src/views/productionManagement/productStructure/DetailNew/MaterialCard.vue
index f0ac5a6..0b197d7 100644
--- a/src/views/productionManagement/productStructure/DetailNew/MaterialCard.vue
+++ b/src/views/productionManagement/productStructure/DetailNew/MaterialCard.vue
@@ -82,7 +82,7 @@
             <el-form-item label="鏁伴噺" :rules="[{ required: true, message: '璇峰~鍐欐暟閲�' }]" style="margin:0">
               <el-input-number v-model="row.unitQuantity"
                                :min="0"
-                               :precision="2"
+                               :precision="8"
                                :step="1"
                                controls-position="right"
                                style="width:100%"
diff --git a/src/views/productionManagement/productStructure/DetailNew/index.vue b/src/views/productionManagement/productStructure/DetailNew/index.vue
index 1262c80..05919ca 100644
--- a/src/views/productionManagement/productStructure/DetailNew/index.vue
+++ b/src/views/productionManagement/productStructure/DetailNew/index.vue
@@ -201,12 +201,12 @@
     });
   };
 
-  const toQuantityNumber = (value: any) => {
+  const toQuantityNumber = (value: any, scale: number = 2) => {
     const numberValue = Number(value);
     if (!Number.isFinite(numberValue)) {
       return 0;
     }
-    return Number(numberValue.toFixed(2));
+    return Number(numberValue.toFixed(scale));
   };
 
   const syncDemandedQuantityTree = (
@@ -216,7 +216,7 @@
     items.forEach((item: any) => {
       if (parentDemandedQuantity !== null) {
         item.demandedQuantity = toQuantityNumber(
-          parentDemandedQuantity * toQuantityNumber(item.unitQuantity)
+          parentDemandedQuantity * toQuantityNumber(item.unitQuantity, 8)
         );
       }
 
diff --git a/src/views/productionManagement/productStructure/StructureEdit.vue b/src/views/productionManagement/productStructure/StructureEdit.vue
index 4d07f5d..0ae1539 100644
--- a/src/views/productionManagement/productStructure/StructureEdit.vue
+++ b/src/views/productionManagement/productStructure/StructureEdit.vue
@@ -86,7 +86,7 @@
                                 style="margin: 0">
                     <el-input-number v-model="row.unitQuantity"
                                      :min="0"
-                                     :precision="2"
+                                     :precision="8"
                                      :step="1"
                                      controls-position="right"
                                      style="width: 100%"
diff --git a/src/views/productionManagement/productionOrder/components/MaterialLedgerDialog.vue b/src/views/productionManagement/productionOrder/components/MaterialLedgerDialog.vue
index 09e7421..d5ade9b 100644
--- a/src/views/productionManagement/productionOrder/components/MaterialLedgerDialog.vue
+++ b/src/views/productionManagement/productionOrder/components/MaterialLedgerDialog.vue
@@ -90,7 +90,7 @@
           <template #default="{ row }">
             <el-input-number v-model="row.pickQty"
                              :min="0"
-                             :precision="3"
+                             :precision="8"
                              :step="1"
                              controls-position="right"
                              style="width: 100%;" />

--
Gitblit v1.9.3