From fa636229ea3feb32cdbe6fef3233bcbd19ddd623 Mon Sep 17 00:00:00 2001
From: gongchunyi <deslre0381@gmail.com>
Date: 星期五, 03 七月 2026 16:14:24 +0800
Subject: [PATCH] fix: 去除2位小数点限制

---
 src/views/collaborativeApproval/purchaseApproval/index.vue |   23 ++++++++---------------
 1 files changed, 8 insertions(+), 15 deletions(-)

diff --git a/src/views/collaborativeApproval/purchaseApproval/index.vue b/src/views/collaborativeApproval/purchaseApproval/index.vue
index aeb931e..8ea46d9 100644
--- a/src/views/collaborativeApproval/purchaseApproval/index.vue
+++ b/src/views/collaborativeApproval/purchaseApproval/index.vue
@@ -244,6 +244,7 @@
 import useUserStore from "@/store/modules/user";
 import { modelList, productTreeList } from "@/api/basicData/product.js";
 import dayjs from "dayjs";
+import { getCurrentDate } from "@/utils/index.js";
 
 const userStore = useUserStore();
 
@@ -447,7 +448,7 @@
     "taxInclusiveUnitPrice",
     "taxInclusiveTotalPrice",
     "taxExclusiveTotalPrice",
-  ]);
+  ], { taxInclusiveUnitPrice: { decimalPlaces: 4 } });
 };
 // 鎵撳紑寮规
 const openForm = (type, row) => {
@@ -776,14 +777,6 @@
       proxy.$modal.msg("宸插彇娑�");
     });
 };
-// 鑾峰彇褰撳墠鏃ユ湡骞舵牸寮忓寲涓� YYYY-MM-DD
-function getCurrentDate() {
-  const today = new Date();
-  const year = today.getFullYear();
-  const month = String(today.getMonth() + 1).padStart(2, "0"); // 鏈堜唤浠�0寮�濮�
-  const day = String(today.getDate()).padStart(2, "0");
-  return `${year}-${month}-${day}`;
-}
 const mathNum = () => {
 	if (!productForm.value.taxRate) {
 		proxy.$modal.msgWarning("璇峰厛閫夋嫨绋庣巼");
@@ -820,12 +813,12 @@
   if (field === 'taxInclusiveTotalPrice') {
     // 宸茬煡鍚◣鎬讳环鍜屾暟閲忥紝鍙嶇畻鍚◣鍗曚环
     if (productForm.value.quantity) {
-      productForm.value.taxInclusiveUnitPrice = 
-        (Number(productForm.value.taxInclusiveTotalPrice) / Number(productForm.value.quantity)).toFixed(2);
+      productForm.value.taxInclusiveUnitPrice =
+        (Number(productForm.value.taxInclusiveTotalPrice) / Number(productForm.value.quantity)).toFixed(4);
     }
     // 宸茬煡鍚◣鎬讳环鍜屽惈绋庡崟浠凤紝鍙嶇畻鏁伴噺
     else if (productForm.value.taxInclusiveUnitPrice) {
-      productForm.value.quantity = 
+      productForm.value.quantity =
         (Number(productForm.value.taxInclusiveTotalPrice) / Number(productForm.value.taxInclusiveUnitPrice)).toFixed(2);
     }
     // 鍙嶇畻涓嶅惈绋庢�讳环
@@ -837,12 +830,12 @@
       (Number(productForm.value.taxExclusiveTotalPrice) * (1 + taxRate / 100)).toFixed(2);
     // 宸茬煡鏁伴噺锛屽弽绠楀惈绋庡崟浠�
     if (productForm.value.quantity) {
-      productForm.value.taxInclusiveUnitPrice = 
-        (Number(productForm.value.taxInclusiveTotalPrice) / Number(productForm.value.quantity)).toFixed(2);
+      productForm.value.taxInclusiveUnitPrice =
+        (Number(productForm.value.taxInclusiveTotalPrice) / Number(productForm.value.quantity)).toFixed(4);
     }
     // 宸茬煡鍚◣鍗曚环锛屽弽绠楁暟閲�
     else if (productForm.value.taxInclusiveUnitPrice) {
-      productForm.value.quantity = 
+      productForm.value.quantity =
         (Number(productForm.value.taxInclusiveTotalPrice) / Number(productForm.value.taxInclusiveUnitPrice)).toFixed(2);
     }
   }

--
Gitblit v1.9.3