From fff32ac1833fffba10307d5022b174b20ce2bff2 Mon Sep 17 00:00:00 2001
From: yuan <123@>
Date: 星期六, 29 八月 2026 17:16:28 +0800
Subject: [PATCH] fix: 统一销售和采购相关页面金额、单价、数量、总价保留6位小数
---
src/utils/summarizeTable.js | 20 ++++++++++++++------
1 files changed, 14 insertions(+), 6 deletions(-)
diff --git a/src/utils/summarizeTable.js b/src/utils/summarizeTable.js
index 1ad480d..b25cc74 100644
--- a/src/utils/summarizeTable.js
+++ b/src/utils/summarizeTable.js
@@ -40,14 +40,22 @@
});
return sums;
};
-// 涓嶅惈绋庢�讳环璁$畻
-const calculateTaxExclusiveTotalPrice = (taxInclusiveTotalPrice, taxRate) => {
+// 涓嶅惈绋庢�讳环璁$畻锛宒ecimals 涓轰繚鐣欏皬鏁颁綅鏁帮紙閿�鍞�/閲囪喘鐩稿叧椤甸潰浼� 6锛�
+const calculateTaxExclusiveTotalPrice = (
+ taxInclusiveTotalPrice,
+ taxRate,
+ decimals = 2
+) => {
const taxRateDecimal = taxRate / 100;
- return (taxInclusiveTotalPrice / (1 + taxRateDecimal)).toFixed(2);
+ return (taxInclusiveTotalPrice / (1 + taxRateDecimal)).toFixed(decimals);
};
-// 鍚◣鎬讳环璁$畻
-const calculateTaxIncludeTotalPrice = (taxInclusiveUnitPrice, quantity) => {
- return (taxInclusiveUnitPrice * quantity).toFixed(2);
+// 鍚◣鎬讳环璁$畻锛宒ecimals 涓轰繚鐣欏皬鏁颁綅鏁帮紙閿�鍞�/閲囪喘鐩稿叧椤甸潰浼� 6锛�
+const calculateTaxIncludeTotalPrice = (
+ taxInclusiveUnitPrice,
+ quantity,
+ decimals = 2
+) => {
+ return (taxInclusiveUnitPrice * quantity).toFixed(decimals);
};
// 瀵煎嚭鍑芥暟渚涘叾浠栨枃浠朵娇鐢�
export {
--
Gitblit v1.9.3