From 1555d7397fa044d95533b62d6ef75f5bcdc3da8f Mon Sep 17 00:00:00 2001
From: yuan <123@>
Date: 星期六, 23 五月 2026 22:24:41 +0800
Subject: [PATCH] 修改单价保留6位小数

---
 src/views/salesManagement/salesLedger/index.vue |   26 +++++++++++++++++++-------
 1 files changed, 19 insertions(+), 7 deletions(-)

diff --git a/src/views/salesManagement/salesLedger/index.vue b/src/views/salesManagement/salesLedger/index.vue
index 56f9fd2..ea656cf 100644
--- a/src/views/salesManagement/salesLedger/index.vue
+++ b/src/views/salesManagement/salesLedger/index.vue
@@ -161,7 +161,7 @@
                                prop="taxRate" />
               <el-table-column label="鍚◣鍗曚环(鍏�)"
                                prop="taxInclusiveUnitPrice"
-                               :formatter="sensitiveAmountFormatter" />
+                               :formatter="sensitiveUnitPriceFormatter" />
               <el-table-column label="鍚◣鎬讳环(鍏�)"
                                prop="taxInclusiveTotalPrice"
                                :formatter="sensitiveAmountFormatter" />
@@ -455,8 +455,8 @@
           <el-table-column label="绋庣巼(%)"
                            prop="taxRate" />
           <el-table-column label="鍚◣鍗曚环(鍏�)"
-                           prop="taxInclusiveUnitPrice"
-                           :formatter="formattedNumber" />
+                            prop="taxInclusiveUnitPrice"
+                            :formatter="unitPriceFormatter" />
           <el-table-column label="鍚◣鎬讳环(鍏�)"
                            prop="taxInclusiveTotalPrice"
                            :formatter="formattedNumber" />
@@ -668,7 +668,7 @@
                                :min="0"
                                v-model="productForm.taxInclusiveUnitPrice"
                                style="width: 100%"
-                               :precision="2"
+                               :precision="6"
                                placeholder="璇疯緭鍏�"
                                clearable
                                @change="calculateFromUnitPrice" />
@@ -1402,6 +1402,12 @@
     }
     return parseFloat(cellValue).toFixed(2);
   };
+  const unitPriceFormatter = (row, column, cellValue) => {
+    if (cellValue === undefined || cellValue === null || cellValue === "") {
+      return "0.000000";
+    }
+    return parseFloat(cellValue).toFixed(6);
+  };
   const findLedgerRecordByRow = row => {
     if (!row) return null;
     if (
@@ -1454,6 +1460,12 @@
       return "*****";
     }
     return formattedNumber(row, column, cellValue);
+  };
+  const sensitiveUnitPriceFormatter = (row, column, cellValue) => {
+    if (!isCurrentUserMaintainer(row)) {
+      return "*****";
+    }
+    return unitPriceFormatter(row, column, cellValue);
   };
   // 鑾峰彇tree瀛愭暟鎹�
   const getModels = value => {
@@ -1734,7 +1746,7 @@
         unit: p.unit || "",
         quantity: quantity,
         taxRate: taxRate,
-        taxInclusiveUnitPrice: unitPrice.toFixed(2),
+        taxInclusiveUnitPrice: unitPrice.toFixed(6),
         taxInclusiveTotalPrice: taxInclusiveTotalPrice,
         taxExclusiveTotalPrice: taxExclusiveTotalPrice,
         invoiceType: "澧炴櫘绁�",
@@ -2466,7 +2478,7 @@
     isCalculating.value = true;
 
     // 璁$畻鍚◣鍗曚环 = 鍚◣鎬讳环 / 鏁伴噺
-    productForm.value.taxInclusiveUnitPrice = (totalPrice / quantity).toFixed(2);
+    productForm.value.taxInclusiveUnitPrice = (totalPrice / quantity).toFixed(6);
 
     // 濡傛灉鏈夌◣鐜囷紝璁$畻涓嶅惈绋庢�讳环
     if (productForm.value.taxRate) {
@@ -2508,7 +2520,7 @@
     // 璁$畻鍚◣鍗曚环 = 鍚◣鎬讳环 / 鏁伴噺
     productForm.value.taxInclusiveUnitPrice = (
       inclusiveTotalPrice / quantity
-    ).toFixed(2);
+    ).toFixed(6);
 
     isCalculating.value = false;
   };

--
Gitblit v1.9.3