| | |
| | | } |
| | | ); |
| | | |
| | | // 主表合计方法 |
| | | const summarizeMainTable = (param) => { |
| | | return proxy.summarizeTable( |
| | | const sums = proxy.summarizeTable( |
| | | param, |
| | | [ |
| | | "taxInclusiveTotalPrice", |
| | | "ticketsAmount", |
| | | "unTicketsPrice", |
| | | "invoiceAmount", |
| | | ], |
| | | ["ticketsAmount", "unTicketsPrice", "invoiceAmount"], |
| | | { |
| | | ticketsNum: { noDecimal: true }, // 不保留小数 |
| | | futureTickets: { noDecimal: true }, // 不保留小数 |
| | | 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(2); |
| | | } |
| | | return sums; |
| | | }; |
| | | |
| | | const handleSelectionChange = (val) => { |