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
...@@ -385,7 +383,7 @@ ...@@ -385,7 +383,7 @@
header-align="center" header-align="center"
align="center" align="center"
></ElTableColumn> --> ></ElTableColumn> -->
<ElTableColumn <ElTableColumn
label="创建时间" label="创建时间"
show-overflow-tooltip show-overflow-tooltip
...@@ -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']) const values = data.map((item: AccountStatementNote) => {
} return Number(item[column.property as keyof AccountStatementNote])
if (index === 6) { })
sums[index] = String(totalData.value['sumShipmentNum']) if (!values.every((value: number) => !isNaN(value))) {
} return
if (index === 7) { }
sums[index] = String(totalData.value['sumPassNum']) sums[index] = values
} .reduce((prev: number, curr: number) => {
if (index === 8) { const value = Number(curr)
sums[index] = String(totalData.value['sumTotalPrice']) 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