From 0a7f62f18d322dcb82ec3134075ea4e71f010825 Mon Sep 17 00:00:00 2001
From: yuan <123@>
Date: 星期四, 25 六月 2026 09:09:09 +0800
Subject: [PATCH] fix: 报价、审核、采购台账、供应商往来、销售台账、客户往来小数点保留6位小数
---
src/utils/summarizeTable.js | 21 +++++++++++++++------
1 files changed, 15 insertions(+), 6 deletions(-)
diff --git a/src/utils/summarizeTable.js b/src/utils/summarizeTable.js
index 1ad480d..3602523 100644
--- a/src/utils/summarizeTable.js
+++ b/src/utils/summarizeTable.js
@@ -1,3 +1,5 @@
+import { formatDecimal, AMOUNT_DECIMAL_SCALE } from './numberFormat'
+
/**
* 閫氱敤鐨勮〃鏍煎悎璁℃柟娉�
* @param {Object} param - 鍖呭惈琛ㄦ牸鍒楅厤缃拰鏁版嵁婧愮殑瀵硅薄
@@ -26,28 +28,35 @@
// 濡傛灉鎸囧畾浜嗕笉闇�瑕佷繚鐣欏皬鏁帮紝鍒欑洿鎺ヨ浆鎹负鏁存暟
sums[index] = Math.round(sum).toString();
} else {
- // 榛樿淇濈暀涓や綅灏忔暟
- sums[index] = parseFloat(sum).toFixed(
+ sums[index] = formatDecimal(
+ sum,
specialFormat[prop]?.decimalPlaces ?? 2
);
}
} else {
- sums[index] = "";
+ sums[index] = '';
}
} else {
- sums[index] = "";
+ sums[index] = '';
}
});
return sums;
};
+
// 涓嶅惈绋庢�讳环璁$畻
const calculateTaxExclusiveTotalPrice = (taxInclusiveTotalPrice, taxRate) => {
const taxRateDecimal = taxRate / 100;
- return (taxInclusiveTotalPrice / (1 + taxRateDecimal)).toFixed(2);
+ return formatDecimal(
+ Number(taxInclusiveTotalPrice) / (1 + taxRateDecimal),
+ AMOUNT_DECIMAL_SCALE
+ );
};
// 鍚◣鎬讳环璁$畻
const calculateTaxIncludeTotalPrice = (taxInclusiveUnitPrice, quantity) => {
- return (taxInclusiveUnitPrice * quantity).toFixed(2);
+ return formatDecimal(
+ Number(taxInclusiveUnitPrice) * Number(quantity),
+ AMOUNT_DECIMAL_SCALE
+ );
};
// 瀵煎嚭鍑芥暟渚涘叾浠栨枃浠朵娇鐢�
export {
--
Gitblit v1.9.3