From ec29b18fca04e86e328cff28a8ba39afdfc53b6b Mon Sep 17 00:00:00 2001 From: dzc <2388224167@qq.com> Date: Thu, 23 Jan 2025 14:22:16 +0800 Subject: [PATCH] =?UTF-8?q?feat:=E9=83=A8=E9=97=A8=E4=BA=A4=E6=98=93?= =?UTF-8?q?=E9=87=91=E9=A2=9D=E5=AF=BC=E5=87=BA?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/views/hard/hard-dept-total/index.vue | 98 +++++++++++++++--------- 1 file changed, 62 insertions(+), 36 deletions(-) diff --git a/src/views/hard/hard-dept-total/index.vue b/src/views/hard/hard-dept-total/index.vue index 02544fe..2f7b54c 100644 --- a/src/views/hard/hard-dept-total/index.vue +++ b/src/views/hard/hard-dept-total/index.vue @@ -3,20 +3,10 @@
- - - - - - - - - - - + @@ -30,6 +20,19 @@ + +
+ +
+
- + + + + + + + + + + + + + + - - - + - - - - - - + -
@@ -90,6 +99,7 @@ const selectObjs = ref([]) as any const multiple = ref(true) // 表格变量 const state: BasicTableProps = reactive({ + isPage: false, queryForm: {}, pageList: hardTotalApi.pageListDept, }) @@ -98,17 +108,33 @@ const state: BasicTableProps = reactive({ const { getDataList, currentChangeHandle, sizeChangeHandle, sortChangeHandle, downBlobFile, tableStyle } = useTable(state) +// 导出excel +const exportExcel = () => { + downBlobFile("/hard/hard-total/export-dept", Object.assign(state.queryForm), "部门交易记录导出.xlsx") +} + const getSummaries = (param: any) => { const { columns, data } = param - const totalColumns = ["beforePrice", "price"] + const totalColumns = [ + "walletPrice", + "walletCount", + "orderPayPrice", + "orderPayCount", + "orderRefundPrice", + "orderRefundCont", + ] const totalRow = Array.from({ length: columns.length }) columns.forEach((i: any, index: number) => { if (totalColumns.includes(i.property)) { const total = data .filter((v: any) => v[i.property] != null) - .map((v: any) => v[i.property]) + .map((v: any) => Number(v[i.property])) .reduce((pren: number, next: number) => pren + next, 0) - totalRow[index] = displayPrice(total) + if (i.property.includes("Price")) { + totalRow[index] = displayPrice(total) + } else { + totalRow[index] = total + "次" + } } }) return totalRow