Commit 6bea671b by qinjianhui

fix: 对账单统计优化

parent 03f3f495
......@@ -211,9 +211,7 @@
min-width="340"
>
<template #default="scope">
{{ scope.row.start_time }} - {{
scope.row.end_time
}}
{{ scope.row.start_time }} - {{ scope.row.end_time }}
</template>
</el-table-column>
<el-table-column
......@@ -385,7 +383,7 @@
header-align="center"
align="center"
></ElTableColumn> -->
<ElTableColumn
label="创建时间"
show-overflow-tooltip
......@@ -669,7 +667,6 @@ const treeRef = ref<InstanceType<typeof ElTree>>()
const {
currentPage,
pageSize,
totalData,
total,
data: tableData,
refresh: search,
......@@ -759,28 +756,34 @@ const tabsClick = async () => {
const handleSelectionChange = (v: AccountStatementNote[]) => {
selections.value = v
}
const getSummaries = (data: SummaryMethodProps) => {
const columns = data.columns
const getSummaries = (param: SummaryMethodProps) => {
const { columns, data } = param
const sums: string[] = []
columns.forEach((column, index) => {
console.log(column)
if (index === 0) {
sums[index] = '统计'
}
if (index === 5) {
sums[index] = String(totalData.value['sumNotPassNum'])
}
if (index === 6) {
sums[index] = String(totalData.value['sumShipmentNum'])
}
if (index === 7) {
sums[index] = String(totalData.value['sumPassNum'])
}
if (index === 8) {
sums[index] = String(totalData.value['sumTotalPrice'])
}
})
columns.forEach(
(column: TableColumnCtx<AccountStatementNote>, index: number) => {
if (index === 0) {
sums[index] = '合计'
return
}
const values = data.map((item: AccountStatementNote) => {
return Number(item[column.property as keyof AccountStatementNote])
})
if (!values.every((value: number) => !isNaN(value))) {
return
}
sums[index] = values
.reduce((prev: number, curr: number) => {
const value = Number(curr)
if (!isNaN(value)) {
return prev + curr
} else {
return prev
}
}, 0)
.toString()
},
)
return sums
}
const auditOrder = (key: string) => {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment