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

---
 src/views/collaborativeApproval/approvalProcess/components/approvalDia.vue |    4 +-
 src/views/procurementManagement/procurementLedger/index.vue                |   13 ++++--
 src/views/procurementManagement/procurementLedger/detail.vue               |   12 +++++-
 src/views/procurementManagement/purchaseReturnOrder/New.vue                |    2 
 src/views/salesManagement/salesLedger/index.vue                            |   26 +++++++++---
 src/views/salesManagement/salesQuotation/index.vue                         |    9 ++--
 6 files changed, 45 insertions(+), 21 deletions(-)

diff --git a/src/views/collaborativeApproval/approvalProcess/components/approvalDia.vue b/src/views/collaborativeApproval/approvalProcess/components/approvalDia.vue
index 0605fe5..667bdaa 100644
--- a/src/views/collaborativeApproval/approvalProcess/components/approvalDia.vue
+++ b/src/views/collaborativeApproval/approvalProcess/components/approvalDia.vue
@@ -75,7 +75,7 @@
                 <el-descriptions-item label="鎶ヤ环鎬婚"
                                       :span="2">
                   <span style="font-size: 18px; color: #e6a23c; font-weight: bold;">
-                    楼{{ Number(currentQuotation.totalAmount ?? 0).toFixed(2) }}
+                    楼{{ Number(currentQuotation.totalAmount ?? 0).toFixed(6) }}
                   </span>
                 </el-descriptions-item>
               </el-descriptions>
@@ -92,7 +92,7 @@
                                    label="鍗曚綅" />
                   <el-table-column prop="unitPrice"
                                    label="鍗曚环">
-                    <template #default="scope">楼{{ Number(scope.row.unitPrice ?? 0).toFixed(2) }}</template>
+                    <template #default="scope">楼{{ Number(scope.row.unitPrice ?? 0).toFixed(6) }}</template>
                   </el-table-column>
                 </el-table>
               </div>
diff --git a/src/views/procurementManagement/procurementLedger/detail.vue b/src/views/procurementManagement/procurementLedger/detail.vue
index 37b7fdb..9566fa5 100644
--- a/src/views/procurementManagement/procurementLedger/detail.vue
+++ b/src/views/procurementManagement/procurementLedger/detail.vue
@@ -61,14 +61,14 @@
         <el-table-column label="鏁伴噺" prop="quantity" />
         <el-table-column label="搴撳瓨棰勭暀鏁伴噺" prop="stockReservedQuantity" />
         <el-table-column label="绋庣巼(%)" prop="taxRate" />
-        <el-table-column label="鍚◣鍗曚环(鍏�)" prop="taxInclusiveUnitPrice" :formatter="formattedNumber" width="150" />
+        <el-table-column label="鍚◣鍗曚环(鍏�)" prop="taxInclusiveUnitPrice" :formatter="unitPriceFormattedNumber" width="150" />
         <el-table-column label="鍚◣鎬讳环(鍏�)" prop="taxInclusiveTotalPrice" :formatter="formattedNumber" width="150" />
         <el-table-column label="涓嶅惈绋庢�讳环(鍏�)" prop="taxExclusiveTotalPrice" :formatter="formattedNumber" width="150" />
         <template #append>
           <div class="summary-row" v-if="productData.length > 0">
             <div class="summary-label">鍚堣</div>
             <div class="summary-value" style="width: 150px">
-              {{ formattedNumber(null, null, sumTaxInclusiveUnitPrice) }}
+              {{ unitPriceFormattedNumber(null, null, sumTaxInclusiveUnitPrice) }}
             </div>
             <div class="summary-value" style="width: 150px">
               {{ formattedNumber(null, null, sumTaxInclusiveTotalPrice) }}
@@ -164,6 +164,14 @@
   return cellValue
 }
 
+
+const unitPriceFormattedNumber = (row, column, cellValue) => {
+  if (cellValue != null && !isNaN(cellValue)) {
+    return Number(cellValue).toFixed(6)
+  }
+  return cellValue
+}
+
 const sumTaxInclusiveUnitPrice = computed(() => {
   return productData.value.reduce((sum, item) => {
     return sum + (Number(item.taxInclusiveUnitPrice) || 0)
diff --git a/src/views/procurementManagement/procurementLedger/index.vue b/src/views/procurementManagement/procurementLedger/index.vue
index 9bbe87e..1b6b268 100644
--- a/src/views/procurementManagement/procurementLedger/index.vue
+++ b/src/views/procurementManagement/procurementLedger/index.vue
@@ -68,7 +68,7 @@
               <el-table-column label="鍙敤鏁伴噺" prop="availableQuality" />
               <el-table-column label="閫�璐ф暟閲�" prop="returnQuality" />
               <el-table-column label="绋庣巼(%)" prop="taxRate" />
-              <el-table-column label="鍚◣鍗曚环(鍏�)" prop="taxInclusiveUnitPrice" :formatter="formattedNumber" />
+              <el-table-column label="鍚◣鍗曚环(鍏�)" prop="taxInclusiveUnitPrice" :formatter="unitPriceFormatter" />
               <el-table-column label="鍚◣鎬讳环(鍏�)" prop="taxInclusiveTotalPrice" :formatter="formattedNumber" />
               <el-table-column label="涓嶅惈绋庢�讳环(鍏�)" prop="taxExclusiveTotalPrice" :formatter="formattedNumber" />
             </el-table>
@@ -210,7 +210,7 @@
           <el-table-column label="鏁伴噺" prop="quantity" width="70" />
           <el-table-column label="搴撳瓨棰勮鏁伴噺" prop="warnNum" width="120" show-overflow-tooltip />
           <el-table-column label="绋庣巼(%)" prop="taxRate" width="80" />
-          <el-table-column label="鍚◣鍗曚环(鍏�)" prop="taxInclusiveUnitPrice" :formatter="formattedNumber" width="150" />
+          <el-table-column label="鍚◣鍗曚环(鍏�)" prop="taxInclusiveUnitPrice" :formatter="unitPriceFormatter" width="150" />
           <el-table-column label="鍚◣鎬讳环(鍏�)" prop="taxInclusiveTotalPrice" :formatter="formattedNumber" width="150" />
           <el-table-column label="涓嶅惈绋庢�讳环(鍏�)" prop="taxExclusiveTotalPrice" :formatter="formattedNumber" width="150" />
           <el-table-column label="鏄惁璐ㄦ" prop="isChecked" width="150">
@@ -310,7 +310,7 @@
         <el-row :gutter="30">
           <el-col :span="12">
             <el-form-item label="鍚◣鍗曚环(鍏�)锛�" prop="taxInclusiveUnitPrice">
-              <el-input-number v-model="productForm.taxInclusiveUnitPrice" :precision="2" :step="0.1" :min="0" clearable
+              <el-input-number v-model="productForm.taxInclusiveUnitPrice" :precision="6" :step="0.1" :min="0" clearable
                 style="width: 100%" @change="mathNum" />
             </el-form-item>
           </el-col>
@@ -772,6 +772,9 @@
 
 const formattedNumber = (row, column, cellValue) => {
   return parseFloat(cellValue).toFixed(2);
+};
+const unitPriceFormatter = (row, column, cellValue) => {
+  return parseFloat(cellValue).toFixed(6);
 };
 // 鏌ヨ鍒楄〃
 /** 鎼滅储鎸夐挳鎿嶄綔 */
@@ -1476,7 +1479,7 @@
       productForm.value.taxInclusiveUnitPrice = (
         Number(productForm.value.taxInclusiveTotalPrice) /
         Number(productForm.value.quantity)
-      ).toFixed(2);
+      ).toFixed(6);
       // 纭繚缁撴灉涓嶄负璐熸暟
       if (Number(productForm.value.taxInclusiveUnitPrice) < 0) {
         productForm.value.taxInclusiveUnitPrice = "0";
@@ -1517,7 +1520,7 @@
       productForm.value.taxInclusiveUnitPrice = (
         Number(productForm.value.taxInclusiveTotalPrice) /
         Number(productForm.value.quantity)
-      ).toFixed(2);
+      ).toFixed(6);
       // 纭繚缁撴灉涓嶄负璐熸暟
       if (Number(productForm.value.taxInclusiveUnitPrice) < 0) {
         productForm.value.taxInclusiveUnitPrice = "0";
diff --git a/src/views/procurementManagement/purchaseReturnOrder/New.vue b/src/views/procurementManagement/purchaseReturnOrder/New.vue
index 9474b11..902f00a 100644
--- a/src/views/procurementManagement/purchaseReturnOrder/New.vue
+++ b/src/views/procurementManagement/purchaseReturnOrder/New.vue
@@ -511,7 +511,7 @@
 });
 
 const formattedNumber = (row, column, cellValue) => {
-  return parseFloat(cellValue).toFixed(2);
+  return parseFloat(cellValue).toFixed(6);
 };
 
 const formatAmount = (value) => {
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;
   };
diff --git a/src/views/salesManagement/salesQuotation/index.vue b/src/views/salesManagement/salesQuotation/index.vue
index fce764f..c79dd4c 100644
--- a/src/views/salesManagement/salesQuotation/index.vue
+++ b/src/views/salesManagement/salesQuotation/index.vue
@@ -65,7 +65,7 @@
         </el-table-column>
         <el-table-column prop="totalAmount" label="鎶ヤ环閲戦" width="120">
           <template #default="scope">
-            楼{{ scope.row.totalAmount.toFixed(2) }}
+            楼{{ scope.row.totalAmount.toFixed(6) }}
           </template>
         </el-table-column>
         <el-table-column label="鎿嶄綔" width="200" fixed="right" align="center">
@@ -215,7 +215,7 @@
             <el-table-column prop="unitPrice" label="鍗曚环">
               <template #default="scope">
                 <el-form-item :prop="`products.${scope.$index}.unitPrice`" class="product-table-form-item">
-                  <el-input-number v-model="scope.row.unitPrice" :min="0" :precision="2" style="width: 100%" />
+                  <el-input-number v-model="scope.row.unitPrice" :min="0" :precision="6" style="width: 100%" />
                 </el-form-item>
               </template>
             </el-table-column>
@@ -267,7 +267,7 @@
 <!--          <el-tag :type="getStatusType(currentQuotation.status)">{{ currentQuotation.status }}</el-tag>-->
 <!--        </el-descriptions-item>-->
         <el-descriptions-item label="鎶ヤ环鎬婚" :span="2">
-          <span style="font-size: 18px; color: #e6a23c; font-weight: bold;">楼{{ currentQuotation.totalAmount?.toFixed(2) }}</span>
+          <span style="font-size: 18px; color: #e6a23c; font-weight: bold;">楼{{ currentQuotation.totalAmount?.toFixed(6) }}</span>
         </el-descriptions-item>
       </el-descriptions>
 
@@ -279,7 +279,7 @@
           <el-table-column prop="unit" label="鍗曚綅" />
           <el-table-column prop="unitPrice" label="鍗曚环">
             <template #default="scope">
-              楼{{ scope.row.unitPrice.toFixed(2) }}
+              楼{{ scope.row.unitPrice.toFixed(6) }}
             </template>
           </el-table-column>
         </el-table>
@@ -536,6 +536,7 @@
 }
 
 const handleEdit = async (row) => {
+  console.log("1111111111111111111", row)
   dialogTitle.value = '缂栬緫鎶ヤ环'
   isEdit.value = true
   editId.value = row.id

--
Gitblit v1.9.3