From 41a639a4a4b6fbf35db7903b5ee3c068c8644430 Mon Sep 17 00:00:00 2001
From: 张诺 <zhang_12370@163.com>
Date: 星期二, 21 四月 2026 10:45:56 +0800
Subject: [PATCH] feat: 统一数值精度为三位小数并添加保养项目字段
---
src/views/procurementManagement/procurementInvoiceLedger/index.vue | 53 ++++++++++++++++++++++++++++++++++++-----------------
1 files changed, 36 insertions(+), 17 deletions(-)
diff --git a/src/views/procurementManagement/procurementInvoiceLedger/index.vue b/src/views/procurementManagement/procurementInvoiceLedger/index.vue
index b90ef0d..9b88bbf 100644
--- a/src/views/procurementManagement/procurementInvoiceLedger/index.vue
+++ b/src/views/procurementManagement/procurementInvoiceLedger/index.vue
@@ -62,16 +62,16 @@
<el-button
type="primary"
link
- @click="downLoadFile(row)"
+ @click="openEdit(row)"
>
- 闄勪欢
+ 缂栬緫
</el-button>
<el-button
type="primary"
link
- @click="openEdit(row)"
+ @click="downLoadFile(row)"
>
- 缂栬緫
+ 闄勪欢
</el-button>
<el-button
type="primary"
@@ -166,6 +166,11 @@
width: 240,
},
{
+ label: "浜у搧澶х被",
+ prop: "productCategory",
+ width: 150,
+ },
+ {
label: "瑙勬牸鍨嬪彿",
prop: "specificationModel",
width: 150,
@@ -180,7 +185,7 @@
prop: "taxInclusiveTotalPrice",
width: 200,
formatData: (cell) => {
- return cell ? parseFloat(cell).toFixed(2) : 0;
+ return cell ? parseFloat(cell).toFixed(3) : 0;
},
},
{
@@ -193,7 +198,7 @@
prop: "ticketsAmount",
width: 200,
formatData: (cell) => {
- return cell ? parseFloat(cell).toFixed(2) : 0;
+ return cell ? parseFloat(cell).toFixed(3) : 0;
},
},
{
@@ -201,7 +206,7 @@
prop: "unTicketsPrice",
width: 200,
formatData: (cell) => {
- return cell ? parseFloat(cell).toFixed(2) : 0;
+ return cell ? parseFloat(cell).toFixed(3) : 0;
},
},
{
@@ -232,21 +237,35 @@
}
);
-// 涓昏〃鍚堣鏂规硶
const summarizeMainTable = (param) => {
- return proxy.summarizeTable(
+ const sums = proxy.summarizeTable(
param,
- [
- "taxInclusiveTotalPrice",
- "ticketsAmount",
- "unTicketsPrice",
- "invoiceAmount",
- ],
+ ["ticketsAmount", "unTicketsPrice", "invoiceAmount"],
{
- ticketsNum: { noDecimal: true }, // 涓嶄繚鐣欏皬鏁�
- futureTickets: { noDecimal: true }, // 涓嶄繚鐣欏皬鏁�
+ ticketsAmount: { decimalPlaces: 3 },
+ unTicketsPrice: { decimalPlaces: 3 },
+ invoiceAmount: { decimalPlaces: 3 },
+ ticketsNum: { noDecimal: true },
+ futureTickets: { noDecimal: true },
}
);
+
+ const keySet = new Set();
+ let taxInclusiveSum = 0;
+ (param.data || []).forEach((row) => {
+ const key = `${row.purchaseContractNumber ?? ""}\n${row.salesContractNo ?? ""}\n${row.productCategory ?? ""}\n${row.specificationModel ?? ""}`;
+ if (keySet.has(key)) return;
+ keySet.add(key);
+ const val = Number(row.taxInclusiveTotalPrice);
+ if (!isNaN(val)) taxInclusiveSum += val;
+ });
+ const taxInclusiveIndex = (param.columns || []).findIndex(
+ (c) => c.property === "taxInclusiveTotalPrice"
+ );
+ if (taxInclusiveIndex !== -1) {
+ sums[taxInclusiveIndex] = taxInclusiveSum.toFixed(3);
+ }
+ return sums;
};
const handleSelectionChange = (val) => {
--
Gitblit v1.9.3