From 4aaae263a6c728eaa2a3f45a1ae36082619b52a0 Mon Sep 17 00:00:00 2001
From: gaoluyang <2820782392@qq.com>
Date: 星期一, 25 五月 2026 17:32:01 +0800
Subject: [PATCH] 宝东 1.小数点后四位修改
---
src/views/financialManagement/payable/input-invoice.vue | 32 ++++++++++++++++----------------
1 files changed, 16 insertions(+), 16 deletions(-)
diff --git a/src/views/financialManagement/payable/input-invoice.vue b/src/views/financialManagement/payable/input-invoice.vue
index 86ebd09..4f8cb7f 100644
--- a/src/views/financialManagement/payable/input-invoice.vue
+++ b/src/views/financialManagement/payable/input-invoice.vue
@@ -200,7 +200,7 @@
<el-input-number
v-model="form.amount"
:min="0"
- :precision="2"
+ :precision="4"
style="width: 100%;"
:disabled="isView"
placeholder="鏍规嵁鍏ュ簱鍗曞惈绋庨噾棰濊嚜鍔ㄦ崲绠楋紝鍙慨鏀�"
@@ -213,7 +213,7 @@
<el-input-number
v-model="form.taxAmount"
:min="0"
- :precision="2"
+ :precision="4"
:controls="false"
style="width: 100%;"
disabled
@@ -225,7 +225,7 @@
<el-input-number
v-model="form.totalAmount"
:min="0"
- :precision="2"
+ :precision="4"
:controls="false"
style="width: 100%;"
disabled
@@ -377,7 +377,7 @@
const formatMoney = (value) => {
if (value === undefined || value === null) return "0.00";
- return Number(value).toFixed(2).replace(/\B(?=(\d{3})+(?!\d))/g, ",");
+ return Number(value).toFixed(4).replace(/\B(?=(\d{3})+(?!\d))/g, ",");
};
const normalizeStatus = (status) => {
@@ -440,8 +440,8 @@
/** 涓嶅惈绋庨噾棰濆彉鏇达細绋庨銆佷环绋庡悎璁℃鍚戣绠� */
const calculateTaxFromExclusive = () => {
- form.taxAmount = Number((form.amount * form.taxRate / 100).toFixed(2));
- form.totalAmount = Number((form.amount + form.taxAmount).toFixed(2));
+ form.taxAmount = Number((form.amount * form.taxRate / 100).toFixed(4));
+ form.totalAmount = Number((form.amount + form.taxAmount).toFixed(4));
};
/** 浠风◣鍚堣鍙樻洿锛氭寜绋庣巼鍙嶇畻涓嶅惈绋庨噾棰濄�佺◣棰� */
@@ -454,9 +454,9 @@
return;
}
const rate = Number(form.taxRate) / 100;
- form.totalAmount = Number(total.toFixed(2));
- form.amount = Number((form.totalAmount / (1 + rate)).toFixed(2));
- form.taxAmount = Number((form.totalAmount - form.amount).toFixed(2));
+ form.totalAmount = Number(total.toFixed(4));
+ form.amount = Number((form.totalAmount / (1 + rate)).toFixed(4));
+ form.taxAmount = Number((form.totalAmount - form.amount).toFixed(4));
};
const handleTaxRateChange = () => {
@@ -481,7 +481,7 @@
.reduce((acc, row) => acc + getInboundRowTaxInclusiveAmount(row), 0);
}
- calculateTaxFromInclusive(taxInclusiveSum > 0 ? Number(taxInclusiveSum.toFixed(2)) : 0);
+ calculateTaxFromInclusive(taxInclusiveSum > 0 ? Number(taxInclusiveSum.toFixed(4)) : 0);
};
const inboundBatchDisplayText = computed(() => {
@@ -520,15 +520,15 @@
const taxRate = toFormNumber(row.taxRate) || 13;
if (totalAmount > 0 && amount === 0 && taxAmount === 0) {
- amount = Number((totalAmount / (1 + taxRate / 100)).toFixed(2));
- taxAmount = Number((totalAmount - amount).toFixed(2));
+ amount = Number((totalAmount / (1 + taxRate / 100)).toFixed(4));
+ taxAmount = Number((totalAmount - amount).toFixed(4));
} else if (totalAmount > 0 && amount > 0 && taxAmount === 0) {
- taxAmount = Number((totalAmount - amount).toFixed(2));
+ taxAmount = Number((totalAmount - amount).toFixed(4));
} else if (amount > 0 && taxAmount === 0 && totalAmount === 0) {
- taxAmount = Number((amount * taxRate / 100).toFixed(2));
- totalAmount = Number((amount + taxAmount).toFixed(2));
+ taxAmount = Number((amount * taxRate / 100).toFixed(4));
+ totalAmount = Number((amount + taxAmount).toFixed(4));
} else if (amount > 0 && taxAmount > 0 && totalAmount === 0) {
- totalAmount = Number((amount + taxAmount).toFixed(2));
+ totalAmount = Number((amount + taxAmount).toFixed(4));
}
return { amount, taxAmount, totalAmount };
--
Gitblit v1.9.3