From 06372ae6f71fd776fc3db320c410c38966576c7c Mon Sep 17 00:00:00 2001
From: liding <756868258@qq.com>
Date: 星期四, 18 六月 2026 14:58:59 +0800
Subject: [PATCH] fix:含税单价改成4位小数
---
src/views/customerService/feedbackRegistration/components/formDia.vue | 2
src/views/procurementManagement/invoiceEntry/components/ExpandTable.vue | 2
src/views/safeProduction/safeWorkApproval/components/approvalDia.vue | 2
src/views/salesManagement/salesLedger/index.vue | 18 ++++----
src/views/salesManagement/invoiceRegistration/index.vue | 4 +-
src/views/equipmentManagement/ledger/Form.vue | 3 +
src/views/collaborativeApproval/approvalProcess/components/approvalDia.vue | 2
src/views/procurementManagement/procurementLedger/index.vue | 14 ++++---
src/views/collaborativeApproval/purchaseApproval/index.vue | 14 +++---
src/views/projectManagement/Management/components/formDia.vue | 11 +++--
src/views/procurementManagement/purchaseReturnOrder/New.vue | 4 +
src/views/procurementManagement/purchaseReturnOrder/index.vue | 2
src/views/procurementManagement/purchaseReturnOrder/ProductList.vue | 4 +
src/views/procurementManagement/invoiceEntry/components/Modal.vue | 6 +-
14 files changed, 48 insertions(+), 40 deletions(-)
diff --git a/src/views/collaborativeApproval/approvalProcess/components/approvalDia.vue b/src/views/collaborativeApproval/approvalProcess/components/approvalDia.vue
index 20a4ee6..5e02fbe 100644
--- a/src/views/collaborativeApproval/approvalProcess/components/approvalDia.vue
+++ b/src/views/collaborativeApproval/approvalProcess/components/approvalDia.vue
@@ -156,7 +156,7 @@
<el-table-column prop="unit" label="鍗曚綅" />
<el-table-column prop="quantity" label="鏁伴噺" />
<el-table-column prop="taxInclusiveUnitPrice" label="鍚◣鍗曚环">
- <template #default="scope">楼{{ Number(scope.row.taxInclusiveUnitPrice ?? 0).toFixed(2) }}</template>
+ <template #default="scope">楼{{ Number(scope.row.taxInclusiveUnitPrice ?? 0).toFixed(4) }}</template>
</el-table-column>
<el-table-column prop="taxInclusiveTotalPrice" label="鍚◣鎬讳环">
<template #default="scope">楼{{ Number(scope.row.taxInclusiveTotalPrice ?? 0).toFixed(2) }}</template>
diff --git a/src/views/collaborativeApproval/purchaseApproval/index.vue b/src/views/collaborativeApproval/purchaseApproval/index.vue
index af17bbe..8ea46d9 100644
--- a/src/views/collaborativeApproval/purchaseApproval/index.vue
+++ b/src/views/collaborativeApproval/purchaseApproval/index.vue
@@ -448,7 +448,7 @@
"taxInclusiveUnitPrice",
"taxInclusiveTotalPrice",
"taxExclusiveTotalPrice",
- ]);
+ ], { taxInclusiveUnitPrice: { decimalPlaces: 4 } });
};
// 鎵撳紑寮规
const openForm = (type, row) => {
@@ -813,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);
}
// 鍙嶇畻涓嶅惈绋庢�讳环
@@ -830,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);
}
}
diff --git a/src/views/customerService/feedbackRegistration/components/formDia.vue b/src/views/customerService/feedbackRegistration/components/formDia.vue
index 93e5c6b..530435c 100644
--- a/src/views/customerService/feedbackRegistration/components/formDia.vue
+++ b/src/views/customerService/feedbackRegistration/components/formDia.vue
@@ -179,7 +179,7 @@
const formatCurrency = (val) => {
if (val === null || val === undefined || val === '') return '-'
const num = Number(val)
- return Number.isFinite(num) ? num.toFixed(2) : '-'
+ return Number.isFinite(num) ? num.toFixed(4) : '-'
}
const { post_sale_waiting_list, degree_of_urgency } = proxy.useDict(
diff --git a/src/views/equipmentManagement/ledger/Form.vue b/src/views/equipmentManagement/ledger/Form.vue
index 72d594e..cff3932 100644
--- a/src/views/equipmentManagement/ledger/Form.vue
+++ b/src/views/equipmentManagement/ledger/Form.vue
@@ -80,9 +80,10 @@
</el-col>
<el-col :span="12">
<el-form-item label="鍚◣鍗曚环" prop="taxIncludingPriceUnit">
- <el-input-number :step="0.01" :min="0" style="width: 100%"
+ <el-input-number :step="0.0001" :min="0" style="width: 100%"
v-model="form.taxIncludingPriceUnit"
placeholder="璇疯緭鍏ュ惈绋庡崟浠�"
+ :precision="4"
maxlength="10"
@change="mathNum"
/>
diff --git a/src/views/procurementManagement/invoiceEntry/components/ExpandTable.vue b/src/views/procurementManagement/invoiceEntry/components/ExpandTable.vue
index d329768..2d2e240 100644
--- a/src/views/procurementManagement/invoiceEntry/components/ExpandTable.vue
+++ b/src/views/procurementManagement/invoiceEntry/components/ExpandTable.vue
@@ -62,7 +62,7 @@
prop: "taxInclusiveUnitPrice",
width:200,
formatData: (val) => {
- return val ? parseFloat(val).toFixed(2) : "-";
+ return val ? parseFloat(val).toFixed(4) : "-";
},
},
{
diff --git a/src/views/procurementManagement/invoiceEntry/components/Modal.vue b/src/views/procurementManagement/invoiceEntry/components/Modal.vue
index 33d5144..15f9d42 100644
--- a/src/views/procurementManagement/invoiceEntry/components/Modal.vue
+++ b/src/views/procurementManagement/invoiceEntry/components/Modal.vue
@@ -293,7 +293,7 @@
prop: "taxInclusiveUnitPrice",
width: 150,
formatData: (val) => {
- return val ? parseFloat(val).toFixed(2) : 0;
+ return val ? parseFloat(val).toFixed(4) : 0;
},
},
{
@@ -341,10 +341,10 @@
];
const formattedNumber = (row, column, cellValue) => {
if (cellValue == 0) {
- return parseFloat(cellValue).toFixed(2);
+ return parseFloat(cellValue).toFixed(column.property === "taxInclusiveUnitPrice" ? 4 : 2);
}
if (cellValue) {
- return parseFloat(cellValue).toFixed(2);
+ return parseFloat(cellValue).toFixed(column.property === "taxInclusiveUnitPrice" ? 4 : 2);
} else {
return cellValue;
}
diff --git a/src/views/procurementManagement/procurementLedger/index.vue b/src/views/procurementManagement/procurementLedger/index.vue
index 76dc5d6..ab16053 100644
--- a/src/views/procurementManagement/procurementLedger/index.vue
+++ b/src/views/procurementManagement/procurementLedger/index.vue
@@ -604,8 +604,8 @@
<el-form-item label="鍚◣鍗曚环(鍏�)锛�"
prop="taxInclusiveUnitPrice">
<el-input-number v-model="productForm.taxInclusiveUnitPrice"
- :precision="2"
- :step="0.1"
+ :precision="4"
+ :step="0.0001"
:min="0"
clearable
style="width: 100%"
@@ -1072,7 +1072,9 @@
};
const formattedNumber = (row, column, cellValue) => {
- return parseFloat(cellValue).toFixed(2);
+ const val = Number(cellValue ?? 0);
+ if (!Number.isFinite(val)) return "0.00";
+ return column.property === "taxInclusiveUnitPrice" ? val.toFixed(4) : val.toFixed(2);
};
// 鏌ヨ鍒楄〃
/** 鎼滅储鎸夐挳鎿嶄綔 */
@@ -1267,7 +1269,7 @@
"taxInclusiveUnitPrice",
"taxInclusiveTotalPrice",
"taxExclusiveTotalPrice",
- ]);
+ ], { taxInclusiveUnitPrice: { decimalPlaces: 4 } });
};
// 鎵撳紑寮规
const openForm = async (type, row) => {
@@ -1769,7 +1771,7 @@
productForm.value.taxInclusiveUnitPrice = (
Number(productForm.value.taxInclusiveTotalPrice) /
Number(productForm.value.quantity)
- ).toFixed(2);
+ ).toFixed(4);
// 纭繚缁撴灉涓嶄负璐熸暟
if (Number(productForm.value.taxInclusiveUnitPrice) < 0) {
productForm.value.taxInclusiveUnitPrice = "0";
@@ -1810,7 +1812,7 @@
productForm.value.taxInclusiveUnitPrice = (
Number(productForm.value.taxInclusiveTotalPrice) /
Number(productForm.value.quantity)
- ).toFixed(2);
+ ).toFixed(4);
// 纭繚缁撴灉涓嶄负璐熸暟
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 17e36dc..552d207 100644
--- a/src/views/procurementManagement/purchaseReturnOrder/New.vue
+++ b/src/views/procurementManagement/purchaseReturnOrder/New.vue
@@ -498,7 +498,9 @@
});
const formattedNumber = (row, column, cellValue) => {
- return parseFloat(cellValue).toFixed(2);
+ const val = Number(cellValue ?? 0);
+ if (!Number.isFinite(val)) return "0.00";
+ return column.property === "taxInclusiveUnitPrice" ? val.toFixed(4) : val.toFixed(2);
};
const formatAmount = (value) => {
diff --git a/src/views/procurementManagement/purchaseReturnOrder/ProductList.vue b/src/views/procurementManagement/purchaseReturnOrder/ProductList.vue
index 3eeb167..a5055b3 100644
--- a/src/views/procurementManagement/purchaseReturnOrder/ProductList.vue
+++ b/src/views/procurementManagement/purchaseReturnOrder/ProductList.vue
@@ -107,7 +107,9 @@
})
const total = ref(0)
const formattedNumber = (row, column, cellValue) => {
- return parseFloat(cellValue).toFixed(2);
+ const val = Number(cellValue ?? 0);
+ if (!Number.isFinite(val)) return "0.00";
+ return column.property === "taxInclusiveUnitPrice" ? val.toFixed(4) : val.toFixed(2);
};
const paginationChange = (obj) => {
diff --git a/src/views/procurementManagement/purchaseReturnOrder/index.vue b/src/views/procurementManagement/purchaseReturnOrder/index.vue
index 8de2877..f939031 100644
--- a/src/views/procurementManagement/purchaseReturnOrder/index.vue
+++ b/src/views/procurementManagement/purchaseReturnOrder/index.vue
@@ -86,7 +86,7 @@
<el-table-column label="搴撳瓨棰勮鏁伴噺" prop="warnNum" width="120" />
<el-table-column label="绋庣巼(%)" prop="taxRate" width="90" />
<el-table-column label="鍚◣鍗曚环(鍏�)" prop="taxInclusiveUnitPrice" width="130">
- <template #default="scope">{{ formatAmount(scope.row.taxInclusiveUnitPrice) }}</template>
+ <template #default="scope">{{ scope.row.taxInclusiveUnitPrice != null ? Number(scope.row.taxInclusiveUnitPrice).toFixed(4) : '--' }}</template>
</el-table-column>
<el-table-column label="鍚◣鎬讳环(鍏�)" prop="taxInclusiveTotalPrice" width="130">
<template #default="scope">{{ formatAmount(scope.row.taxInclusiveTotalPrice) }}</template>
diff --git a/src/views/projectManagement/Management/components/formDia.vue b/src/views/projectManagement/Management/components/formDia.vue
index f29512b..6b53ce5 100644
--- a/src/views/projectManagement/Management/components/formDia.vue
+++ b/src/views/projectManagement/Management/components/formDia.vue
@@ -583,9 +583,9 @@
<el-form-item label="鍚◣鍗曚环(鍏�)锛�" prop="taxInclusiveUnitPrice">
<el-input-number
v-model="productForm.taxInclusiveUnitPrice"
- :step="0.01"
+ :step="0.0001"
:min="0"
- :precision="2"
+ :precision="4"
style="width: 100%"
placeholder="璇疯緭鍏�"
clearable
@@ -863,7 +863,8 @@
function formattedNumber(row, column, cellValue) {
const val = Number(cellValue ?? 0)
- return Number.isFinite(val) ? val.toFixed(2) : '0.00'
+ if (!Number.isFinite(val)) return '0.00'
+ return column.property === 'taxInclusiveUnitPrice' ? val.toFixed(4) : val.toFixed(2)
}
function summarizeProductTable(param) {
@@ -1029,7 +1030,7 @@
const quantity = parseFloat(productForm.value.quantity)
if (!totalPrice || !quantity || quantity <= 0) return
isCalculating.value = true
- productForm.value.taxInclusiveUnitPrice = (totalPrice / quantity).toFixed(2)
+ productForm.value.taxInclusiveUnitPrice = (totalPrice / quantity).toFixed(4)
if (productForm.value.taxRate) {
productForm.value.taxExclusiveTotalPrice = proxy.calculateTaxExclusiveTotalPrice(totalPrice, productForm.value.taxRate)
}
@@ -1050,7 +1051,7 @@
const taxRateDecimal = taxRate / 100
const inclusiveTotalPrice = exclusiveTotalPrice / (1 - taxRateDecimal)
productForm.value.taxInclusiveTotalPrice = inclusiveTotalPrice.toFixed(2)
- productForm.value.taxInclusiveUnitPrice = (inclusiveTotalPrice / quantity).toFixed(2)
+ productForm.value.taxInclusiveUnitPrice = (inclusiveTotalPrice / quantity).toFixed(4)
isCalculating.value = false
}
diff --git a/src/views/safeProduction/safeWorkApproval/components/approvalDia.vue b/src/views/safeProduction/safeWorkApproval/components/approvalDia.vue
index 8d40a2e..26f922a 100644
--- a/src/views/safeProduction/safeWorkApproval/components/approvalDia.vue
+++ b/src/views/safeProduction/safeWorkApproval/components/approvalDia.vue
@@ -183,7 +183,7 @@
label="鏁伴噺" />
<el-table-column prop="taxInclusiveUnitPrice"
label="鍚◣鍗曚环">
- <template #default="scope">楼{{ Number(scope.row.taxInclusiveUnitPrice ?? 0).toFixed(2) }}</template>
+ <template #default="scope">楼{{ Number(scope.row.taxInclusiveUnitPrice ?? 0).toFixed(4) }}</template>
</el-table-column>
<el-table-column prop="taxInclusiveTotalPrice"
label="鍚◣鎬讳环">
diff --git a/src/views/salesManagement/invoiceRegistration/index.vue b/src/views/salesManagement/invoiceRegistration/index.vue
index 44e1c4e..b72474e 100644
--- a/src/views/salesManagement/invoiceRegistration/index.vue
+++ b/src/views/salesManagement/invoiceRegistration/index.vue
@@ -543,8 +543,8 @@
};
// 瀛愯〃鍚堣鏂规硶
const summarizeChildrenTable = (param) => {
- return proxy.summarizeTable(param, [
- "taxInclusiveUnitPrice",
+ return proxy.summarizeTable(param, [
+ "taxInclusiveUnitPrice",
"taxInclusiveTotalPrice",
"taxExclusiveTotalPrice",
"invoiceNum",
diff --git a/src/views/salesManagement/salesLedger/index.vue b/src/views/salesManagement/salesLedger/index.vue
index 271adeb..6ebd984 100644
--- a/src/views/salesManagement/salesLedger/index.vue
+++ b/src/views/salesManagement/salesLedger/index.vue
@@ -377,8 +377,8 @@
<el-row :gutter="30">
<el-col :span="12">
<el-form-item label="鍚◣鍗曚环(鍏�)锛�" prop="taxInclusiveUnitPrice">
- <el-input-number :step="0.001" :min="0" v-model="productForm.taxInclusiveUnitPrice" style="width: 100%"
- :precision="3"
+ <el-input-number :step="0.0001" :min="0" v-model="productForm.taxInclusiveUnitPrice" style="width: 100%"
+ :precision="4"
placeholder="璇疯緭鍏�" clearable @change="calculateFromUnitPrice" />
</el-form-item>
</el-col>
@@ -923,11 +923,11 @@
});
};
const formattedNumber = (row, column, cellValue) => {
- return parseFloat(cellValue).toFixed(3);
+ return parseFloat(cellValue).toFixed(4);
};
-/** 閿�鍞彴璐﹀崟浠�/鎬讳环缁熶竴淇濈暀 3 浣嶅皬鏁帮紙涓庡叏灞� calculateTax* 鐨� 2 浣嶅尯鍒嗭級 */
+/** 閿�鍞彴璐﹀崟浠�/鎬讳环缁熶竴淇濈暀 4 浣嶅皬鏁帮紙涓庡叏灞� calculateTax* 鐨� 2 浣嶅尯鍒嗭級 */
const calculateSalesTaxIncludeTotalPrice = (taxInclusiveUnitPrice, quantity) => {
- return (Number(taxInclusiveUnitPrice) * Number(quantity)).toFixed(3);
+ return (Number(taxInclusiveUnitPrice) * Number(quantity)).toFixed(4);
};
const calculateSalesTaxExclusiveTotalPrice = (taxInclusiveTotalPrice, taxRate) => {
const taxRateDecimal = Number(taxRate) / 100;
@@ -1052,7 +1052,7 @@
"taxInclusiveUnitPrice",
"taxInclusiveTotalPrice",
"taxExclusiveTotalPrice",
- ]);
+ ], { taxInclusiveUnitPrice: { decimalPlaces: 4 }, taxInclusiveTotalPrice: { decimalPlaces: 4 }, taxExclusiveTotalPrice: { decimalPlaces: 4 } });
};
// 鎵撳紑寮规
const openForm = async (type, row) => {
@@ -1176,7 +1176,7 @@
unit: p.unit || "",
quantity: quantity,
taxRate: taxRate,
- taxInclusiveUnitPrice: unitPrice.toFixed(3),
+ taxInclusiveUnitPrice: unitPrice.toFixed(4),
taxInclusiveTotalPrice: taxInclusiveTotalPrice,
taxExclusiveTotalPrice: taxExclusiveTotalPrice,
invoiceType: "澧炴櫘绁�",
@@ -1880,7 +1880,7 @@
isCalculating.value = true;
// 璁$畻鍚◣鍗曚环 = 鍚◣鎬讳环 / 鏁伴噺
- productForm.value.taxInclusiveUnitPrice = (totalPrice / quantity).toFixed(3);
+ productForm.value.taxInclusiveUnitPrice = (totalPrice / quantity).toFixed(4);
// 濡傛灉鏈夌◣鐜囷紝璁$畻涓嶅惈绋庢�讳环
if (productForm.value.taxRate) {
@@ -1917,7 +1917,7 @@
productForm.value.taxInclusiveTotalPrice = inclusiveTotalPrice.toFixed(3);
// 璁$畻鍚◣鍗曚环 = 鍚◣鎬讳环 / 鏁伴噺
- productForm.value.taxInclusiveUnitPrice = (inclusiveTotalPrice / quantity).toFixed(3);
+ productForm.value.taxInclusiveUnitPrice = (inclusiveTotalPrice / quantity).toFixed(4);
isCalculating.value = false;
};
--
Gitblit v1.9.3