Commit 6bea671b by qinjianhui

fix: 对账单统计优化

parent 03f3f495
...@@ -211,9 +211,7 @@ ...@@ -211,9 +211,7 @@
min-width="340" min-width="340"
> >
<template #default="scope"> <template #default="scope">
{{ scope.row.start_time }} - {{ {{ scope.row.start_time }} - {{ scope.row.end_time }}
scope.row.end_time
}}
</template> </template>
</el-table-column> </el-table-column>
<el-table-column <el-table-column
...@@ -669,7 +667,6 @@ const treeRef = ref<InstanceType<typeof ElTree>>() ...@@ -669,7 +667,6 @@ const treeRef = ref<InstanceType<typeof ElTree>>()
const { const {
currentPage, currentPage,
pageSize, pageSize,
totalData,
total, total,
data: tableData, data: tableData,
refresh: search, refresh: search,
...@@ -759,28 +756,34 @@ const tabsClick = async () => { ...@@ -759,28 +756,34 @@ const tabsClick = async () => {
const handleSelectionChange = (v: AccountStatementNote[]) => { const handleSelectionChange = (v: AccountStatementNote[]) => {
selections.value = v selections.value = v
} }
const getSummaries = (param: SummaryMethodProps) => {
const getSummaries = (data: SummaryMethodProps) => { const { columns, data } = param
const columns = data.columns
const sums: string[] = [] const sums: string[] = []
columns.forEach((column, index) => { columns.forEach(
console.log(column) (column: TableColumnCtx<AccountStatementNote>, index: number) => {
if (index === 0) { if (index === 0) {
sums[index] = '统计' sums[index] = '合计'
} return
if (index === 5) {
sums[index] = String(totalData.value['sumNotPassNum'])
}
if (index === 6) {
sums[index] = String(totalData.value['sumShipmentNum'])
} }
if (index === 7) { const values = data.map((item: AccountStatementNote) => {
sums[index] = String(totalData.value['sumPassNum']) return Number(item[column.property as keyof AccountStatementNote])
})
if (!values.every((value: number) => !isNaN(value))) {
return
} }
if (index === 8) { sums[index] = values
sums[index] = String(totalData.value['sumTotalPrice']) .reduce((prev: number, curr: number) => {
const value = Number(curr)
if (!isNaN(value)) {
return prev + curr
} else {
return prev
} }
}) }, 0)
.toString()
},
)
return sums return sums
} }
const auditOrder = (key: string) => { 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