diff --git a/src/api/wallet/wallet-recharge-import.ts b/src/api/wallet/wallet-recharge-import.ts index c77ee85..3d59f07 100644 --- a/src/api/wallet/wallet-recharge-import.ts +++ b/src/api/wallet/wallet-recharge-import.ts @@ -49,7 +49,7 @@ export function putObj(obj?: Object) { export function recover(params?: Object) { return request({ - url: "/wallet-recharge-import/recover", + url: "/wallet/wallet-recharge-import/recover", method: "get", params, }) diff --git a/src/views/wallet/wallet-cz/index.vue b/src/views/wallet/wallet-cz/index.vue index 6f89a8b..a999fbf 100644 --- a/src/views/wallet/wallet-cz/index.vue +++ b/src/views/wallet/wallet-cz/index.vue @@ -40,6 +40,8 @@ :data="state.dataList" v-loading="state.loading" border + :summary-method="getSummaries" + show-summary :cell-style="tableStyle.cellStyle" :header-cell-style="tableStyle.headerCellStyle" @selection-change="selectionChangHandle" @@ -64,12 +66,17 @@ - + + + + - + @@ -90,7 +97,6 @@ - @@ -106,7 +112,7 @@ import { displayPrice } from "/@/utils/formatMoney" // 引入组件 const FormDialog = defineAsyncComponent(() => import("./form.vue")) // 定义查询字典 -const { wallet_type } = useDict("wallet_type") +const { wallet_type, wallet_biz } = useDict("wallet_type", "wallet_biz") // 定义变量内容 const formDialogRef = ref() // 搜索变量 @@ -134,6 +140,22 @@ const resetQuery = () => { getDataList() } +const getSummaries = (param: any) => { + const { columns, data } = param + const totalColumns = ["price", "balance"] + 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]) + .reduce((pren: number, next: number) => pren + next, 0) + totalRow[index] = displayPrice(total) + } + }) + return totalRow +} + // 导出excel const exportExcel = () => { downBlobFile( diff --git a/src/views/wallet/wallet-manage/index.vue b/src/views/wallet/wallet-manage/index.vue index a7c8901..912e32a 100644 --- a/src/views/wallet/wallet-manage/index.vue +++ b/src/views/wallet/wallet-manage/index.vue @@ -50,6 +50,8 @@ :data="state.dataList" v-loading="state.loading" border + :summary-method="getSummaries" + show-summary :cell-style="tableStyle.cellStyle" :header-cell-style="tableStyle.headerCellStyle" @selection-change="selectionChangHandle" @@ -76,17 +78,17 @@ - + - + - + @@ -175,6 +177,22 @@ const exportExcel = () => { ) } +const getSummaries = (param: any) => { + const { columns, data } = param + const totalColumns = ["balance", "totalExpense", "totalRecharge"] + 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]) + .reduce((pren: number, next: number) => pren + next, 0) + totalRow[index] = displayPrice(total) + } + }) + return totalRow +} + // 多选事件 const selectionChangHandle = (objs: { id: string }[]) => { selectObjs.value = objs.map(({ id }) => id) diff --git a/src/views/wallet/wallet-recharge-water/index.vue b/src/views/wallet/wallet-recharge-water/index.vue index 94bc071..ff70c7f 100644 --- a/src/views/wallet/wallet-recharge-water/index.vue +++ b/src/views/wallet/wallet-recharge-water/index.vue @@ -109,19 +109,16 @@
{{ displayPrice(row.price) }}
- + @@ -150,6 +147,9 @@ const selectObjs = ref([]) as any const multiple = ref(true) // 表格变量 const state: BasicTableProps = reactive({ + pagination: { + pageSizes: [1, 10, 20, 50, 100, 200, 500, 1000, 2000], + }, queryForm: {}, pageList: walletRechargeImportApi.pageJoin, }) diff --git a/src/views/wallet/wallet-tk/index.vue b/src/views/wallet/wallet-tk/index.vue index 89e7a41..6e285cb 100644 --- a/src/views/wallet/wallet-tk/index.vue +++ b/src/views/wallet/wallet-tk/index.vue @@ -40,6 +40,8 @@ :data="state.dataList" v-loading="state.loading" border + :summary-method="getSummaries" + show-summary :cell-style="tableStyle.cellStyle" :header-cell-style="tableStyle.headerCellStyle" @selection-change="selectionChangHandle" @@ -64,7 +66,12 @@ - + + + + @@ -113,7 +120,7 @@ import { displayPrice } from "/@/utils/formatMoney" // 引入组件 const FormDialog = defineAsyncComponent(() => import("./form.vue")) // 定义查询字典 -const { wallet_type } = useDict("wallet_type") +const { wallet_type, wallet_biz } = useDict("wallet_type", "wallet_biz") // 定义变量内容 const formDialogRef = ref() // 搜索变量 @@ -160,6 +167,22 @@ const exportExcel = () => { ) } +const getSummaries = (param: any) => { + const { columns, data } = param + const totalColumns = ["price"] + 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]) + .reduce((pren: number, next: number) => pren + next, 0) + totalRow[index] = displayPrice(total) + } + }) + return totalRow +} + // 多选事件 const selectionChangHandle = (objs: { id: string }[]) => { selectObjs.value = objs.map(({ id }) => id) diff --git a/src/views/wallet/wallet-xf/index.vue b/src/views/wallet/wallet-xf/index.vue index 56a237f..f0a10ec 100644 --- a/src/views/wallet/wallet-xf/index.vue +++ b/src/views/wallet/wallet-xf/index.vue @@ -40,6 +40,8 @@ :data="state.dataList" v-loading="state.loading" border + :summary-method="getSummaries" + show-summary :cell-style="tableStyle.cellStyle" :header-cell-style="tableStyle.headerCellStyle" @selection-change="selectionChangHandle" @@ -64,7 +66,12 @@ - + + + + @@ -114,7 +121,7 @@ const { push } = useRouter() // 引入组件 const FormDialog = defineAsyncComponent(() => import("./form.vue")) // 定义查询字典 -const { wallet_type } = useDict("wallet_type") +const { wallet_type, wallet_biz } = useDict("wallet_type", "wallet_biz") // 定义变量内容 const formDialogRef = ref() // 搜索变量 @@ -161,6 +168,22 @@ const selectionChangHandle = (objs: { id: string }[]) => { multiple.value = !objs.length } +const getSummaries = (param: any) => { + const { columns, data } = param + const totalColumns = ["price"] + 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]) + .reduce((pren: number, next: number) => pren + next, 0) + totalRow[index] = displayPrice(total) + } + }) + return totalRow +} + // 删除操作 const handleDelete = async (ids: string[]) => { try {