feat:导出统计

This commit is contained in:
dzc committed 2025-10-21 10:02:11 +08:00
1 parent ef79fbba05
commit 9d303ffa3a
7 files changed
+400 -202

No files matched your search

+70 -42
View File
@@ -1,16 +1,9 @@
<template>
<div class="layout-padding">
<div class="layout-padding-auto layout-padding-view">
<DraggableDepTree
ref="draggableDepTreeRef"
placeholder="请输入部门名称"
:show-expand="true"
@getSelectNode="handleGetSelectNode"
switch-inactive-text="包含"
switch-active-text="不包含"
:defaultTreeWidth="20"
:nodeClickable="false"
>
<DraggableDepTree ref="draggableDepTreeRef" placeholder="请输入部门名称" :show-expand="true"
@getSelectNode="handleGetSelectNode" switch-inactive-text="包含" switch-active-text="不包含"
:defaultTreeWidth="20" :nodeClickable="false">
<template #default>
<el-form ref="queryRef" :inline="true" :model="state.queryForm" @keyup.enter="getDataList">
<el-row>
@@ -18,7 +11,8 @@
<select-user v-model="state.queryForm.userId" />
</el-form-item>
<el-form-item style="width: 300px" label="退款时间" prop="createTimeList">
<el-date-picker v-model="state.queryForm.createTimeList" value-format="YYYY-MM-DD" type="daterange" />
<el-date-picker v-model="state.queryForm.createTimeList" value-format="YYYY-MM-DD"
type="daterange" />
</el-form-item>
<el-form-item>
<el-button icon="Search" type="primary" @click="getDataList">
@@ -32,28 +26,16 @@
</el-form>
<el-row>
<div class="mb8" style="width: 100%">
<right-toolbar
:search="false"
v-model:showSearch="showSearch"
:export="'wallet_walletTransaction_export'"
@exportExcel="exportExcel"
class="ml10 mr20"
style="float: right"
@queryTable="getDataList"
></right-toolbar>
<right-toolbar :search="false" v-model:showSearch="showSearch"
:export="'wallet_walletTransaction_export'" @exportExcel="exportExcel" class="ml10 mr20"
style="float: right" @queryTable="getDataList">
<el-button icon="DataLine" circle @click="viewBalanceStatistics" />
</right-toolbar>
</div>
</el-row>
<el-table
: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"
@sort-change="sortChangeHandle"
>
<el-table :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" @sort-change="sortChangeHandle">
<el-table-column type="selection" width="40" align="center" />
<el-table-column type="index" label="#" width="40" />
<el-table-column prop="username" label="用户" show-overflow-tooltip />
@@ -87,36 +69,57 @@
<el-table-column label="操作" width="150">
<template #default="{ row }">
<el-button icon="InfoFilled" link type="primary" @click="doRefund(row)"> 详情 </el-button>
<el-button
v-if="false"
icon="edit-pen"
text
type="primary"
<el-button v-if="false" icon="edit-pen" text type="primary"
v-auth="'wallet_walletRecharge_edit'"
@click="formDialogRef.openDialog(row.id)"
>编辑</el-button
>
@click="formDialogRef.openDialog(row.id)">编辑</el-button>
</template>
</el-table-column>
</el-table>
<pagination @size-change="sizeChangeHandle" @current-change="currentChangeHandle" v-bind="state.pagination" />
<pagination @size-change="sizeChangeHandle" @current-change="currentChangeHandle"
v-bind="state.pagination" />
</template>
</DraggableDepTree>
</div>
<!-- 编辑、新增 -->
<form-dialog ref="formDialogRef" @refresh="getDataList(false)" />
<el-drawer v-model="showDrawer" @closed="drawerClose">
<el-table :data="[balanceStatistics]" style="width: 100%">
<el-table-column align="center" label="充值统计">
<el-table-column align="center" prop="total" label="充值金额">
<template #default="{ row }">
{{ displayPrice(row.totalPrice) }}
</template>
</el-table-column>
<el-table-column align="center" prop="eatTotalPrice" label="饭卡钱包充值金额">
<template #default="{ row }">
{{ displayPrice(row.eatTotalPrice) }}
</template>
</el-table-column>
<el-table-column align="center" prop="xfTotalPrice" label="消费钱包充值金额">
<template #default="{ row }">
{{ displayPrice(row.xfTotalPrice) }}
</template>
</el-table-column>
</el-table-column>
</el-table>
</el-drawer>
</div>
</template>
<script setup lang="ts" name="systemWalletRecharge">
import { BasicTableProps, useTable } from "/@/hooks/table"
import { pageTk } from "/@/api/wallet/wallet-transaction"
import { pageTk, tkTotal } from "/@/api/wallet/wallet-transaction"
import { useMessage, useMessageBox } from "/@/hooks/message"
import { useDict } from "/@/hooks/dict"
import * as hardAfterSaleApi from "/@/api/hard/hard-after-sale"
import { displayPrice } from "/@/utils/formatMoney"
const showDrawer = ref(false)
const balanceStatisticsLoading = ref(false)
const balanceStatistics = reactive<any>({
})
// 引入组件
const FormDialog = defineAsyncComponent(() => import("./form.vue"))
// 定义查询字典
@@ -153,6 +156,31 @@ const resetQuery = () => {
getDataList()
}
// 关闭抽屉
const drawerClose = () => {
for (const key in balanceStatistics) {
balanceStatistics[key] = 0
}
}
// 余额统计
const viewBalanceStatistics = async () => {
showDrawer.value = true
balanceStatisticsLoading.value = true
try {
const { code, data } = await tkTotal({ ...state.queryForm })
if (code == 0) {
Object.assign(balanceStatistics, data)
return
}
return useMessage().error(data.msg || "获取数据失败")
} catch (error: any) {
useMessage().error(error.msg)
} finally {
balanceStatisticsLoading.value = false
}
}
const doRefund = async (row: any) => {
const { data } = await hardAfterSaleApi.getObj(row.bizId)
if (!data) {