From 0a7f62f18d322dcb82ec3134075ea4e71f010825 Mon Sep 17 00:00:00 2001
From: yuan <123@>
Date: 星期四, 25 六月 2026 09:09:09 +0800
Subject: [PATCH] fix: 报价、审核、采购台账、供应商往来、销售台账、客户往来小数点保留6位小数
---
src/views/procurementManagement/procurementLedger/index.vue | 68 ++++++++++++++++++++++------------
1 files changed, 44 insertions(+), 24 deletions(-)
diff --git a/src/views/procurementManagement/procurementLedger/index.vue b/src/views/procurementManagement/procurementLedger/index.vue
index 2c9cec6..c0978ef 100644
--- a/src/views/procurementManagement/procurementLedger/index.vue
+++ b/src/views/procurementManagement/procurementLedger/index.vue
@@ -310,7 +310,7 @@
<el-row :gutter="30">
<el-col :span="12">
<el-form-item label="鍚◣鍗曚环(鍏�)锛�" prop="taxInclusiveUnitPrice">
- <el-input-number v-model="productForm.taxInclusiveUnitPrice" :precision="2" :step="0.1" :min="0" clearable
+ <el-input-number v-model="productForm.taxInclusiveUnitPrice" :precision="6" :step="0.000001" :min="0" clearable
style="width: 100%" @change="mathNum" />
</el-form-item>
</el-col>
@@ -324,13 +324,13 @@
<el-row :gutter="30">
<el-col :span="12">
<el-form-item label="鍚◣鎬讳环(鍏�)锛�" prop="taxInclusiveTotalPrice">
- <el-input-number v-model="productForm.taxInclusiveTotalPrice" :precision="2" :step="0.1" :min="0"
+ <el-input-number v-model="productForm.taxInclusiveTotalPrice" :precision="6" :step="0.000001" :min="0"
clearable style="width: 100%" @change="reverseMathNum('taxInclusiveTotalPrice')" />
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="涓嶅惈绋庢�讳环(鍏�)锛�" prop="taxExclusiveTotalPrice">
- <el-input-number v-model="productForm.taxExclusiveTotalPrice" :precision="2" :step="0.1" :min="0"
+ <el-input-number v-model="productForm.taxExclusiveTotalPrice" :precision="6" :step="0.000001" :min="0"
clearable style="width: 100%" @change="reverseMathNum('taxExclusiveTotalPrice')" />
</el-form-item>
</el-col>
@@ -445,6 +445,7 @@
import { modelList, productTreeList } from "@/api/basicData/product.js";
import dayjs from "dayjs";
import FileUpload from "@/components/AttachmentUpload/file/index.vue";
+import { tableAmountFormatter, formatDecimal, buildAmountSummaryFormat } from '@/utils/numberFormat';
const userStore = useUserStore();
@@ -771,9 +772,7 @@
handleQuery();
};
-const formattedNumber = (row, column, cellValue) => {
- return parseFloat(cellValue).toFixed(2);
-};
+const formattedNumber = tableAmountFormatter;
// 鏌ヨ鍒楄〃
/** 鎼滅储鎸夐挳鎿嶄綔 */
const handleQuery = () => {
@@ -891,10 +890,19 @@
"futureTickets",
"futureTicketsAmount",
],
- {
- ticketsNum: { noDecimal: true }, // 涓嶄繚鐣欏皬鏁�
- futureTickets: { noDecimal: true }, // 涓嶄繚鐣欏皬鏁�
- }
+ buildAmountSummaryFormat(
+ [
+ "taxInclusiveUnitPrice",
+ "taxInclusiveTotalPrice",
+ "taxExclusiveTotalPrice",
+ "ticketsAmount",
+ "futureTicketsAmount",
+ ],
+ {
+ ticketsNum: { noDecimal: true },
+ futureTickets: { noDecimal: true },
+ }
+ )
);
};
const paginationChange = obj => {
@@ -957,15 +965,27 @@
};
// 涓昏〃鍚堣鏂规硶
const summarizeMainTable = param => {
- return proxy.summarizeTable(param, ["contractAmount"]);
+ return proxy.summarizeTable(
+ param,
+ ["contractAmount"],
+ buildAmountSummaryFormat(["contractAmount"])
+ );
};
// 瀛愯〃鍚堣鏂规硶
const summarizeProTable = param => {
- return proxy.summarizeTable(param, [
- "taxInclusiveUnitPrice",
- "taxInclusiveTotalPrice",
- "taxExclusiveTotalPrice",
- ]);
+ return proxy.summarizeTable(
+ param,
+ [
+ "taxInclusiveUnitPrice",
+ "taxInclusiveTotalPrice",
+ "taxExclusiveTotalPrice",
+ ],
+ buildAmountSummaryFormat([
+ "taxInclusiveUnitPrice",
+ "taxInclusiveTotalPrice",
+ "taxExclusiveTotalPrice",
+ ])
+ );
};
// 鎵撳紑寮规
const openForm = async (type, row) => {
@@ -1474,10 +1494,10 @@
if (field === "taxInclusiveTotalPrice") {
// 宸茬煡鍚◣鎬讳环鍜屾暟閲忥紝鍙嶇畻鍚◣鍗曚环
if (productForm.value.quantity) {
- productForm.value.taxInclusiveUnitPrice = (
+ productForm.value.taxInclusiveUnitPrice = formatDecimal(
Number(productForm.value.taxInclusiveTotalPrice) /
Number(productForm.value.quantity)
- ).toFixed(2);
+ );
// 纭繚缁撴灉涓嶄负璐熸暟
if (Number(productForm.value.taxInclusiveUnitPrice) < 0) {
productForm.value.taxInclusiveUnitPrice = "0";
@@ -1495,30 +1515,30 @@
}
}
// 鍙嶇畻涓嶅惈绋庢�讳环
- productForm.value.taxExclusiveTotalPrice = (
+ productForm.value.taxExclusiveTotalPrice = formatDecimal(
Number(productForm.value.taxInclusiveTotalPrice) /
(1 + taxRate / 100)
- ).toFixed(2);
+ );
// 纭繚缁撴灉涓嶄负璐熸暟
if (Number(productForm.value.taxExclusiveTotalPrice) < 0) {
productForm.value.taxExclusiveTotalPrice = "0";
}
} else if (field === "taxExclusiveTotalPrice") {
// 鍙嶇畻鍚◣鎬讳环
- productForm.value.taxInclusiveTotalPrice = (
+ productForm.value.taxInclusiveTotalPrice = formatDecimal(
Number(productForm.value.taxExclusiveTotalPrice) *
(1 + taxRate / 100)
- ).toFixed(2);
+ );
// 纭繚缁撴灉涓嶄负璐熸暟
if (Number(productForm.value.taxInclusiveTotalPrice) < 0) {
productForm.value.taxInclusiveTotalPrice = "0";
}
// 宸茬煡鏁伴噺锛屽弽绠楀惈绋庡崟浠�
if (productForm.value.quantity) {
- productForm.value.taxInclusiveUnitPrice = (
+ productForm.value.taxInclusiveUnitPrice = formatDecimal(
Number(productForm.value.taxInclusiveTotalPrice) /
Number(productForm.value.quantity)
- ).toFixed(2);
+ );
// 纭繚缁撴灉涓嶄负璐熸暟
if (Number(productForm.value.taxInclusiveUnitPrice) < 0) {
productForm.value.taxInclusiveUnitPrice = "0";
--
Gitblit v1.9.3