钱包余额统计抽屉
This commit is contained in:
1 parent
83a4633699
commit
0951063bf9
1 file changed
+56
-9
@@ -36,7 +36,7 @@
|
||||
</el-row>
|
||||
</el-form>
|
||||
<el-row>
|
||||
<div class="mb8" style="width: 100%">
|
||||
<div class="mb8 flex justify-between" style="width: 100%">
|
||||
<el-button
|
||||
plain
|
||||
:disabled="multiple"
|
||||
@@ -47,14 +47,17 @@
|
||||
>
|
||||
删除
|
||||
</el-button>
|
||||
<right-toolbar
|
||||
v-model:showSearch="showSearch"
|
||||
:export="'wallet_walletRecord_export'"
|
||||
@exportExcel="exportExcel"
|
||||
class="ml10 mr20"
|
||||
style="float: right"
|
||||
@queryTable="getDataList"
|
||||
></right-toolbar>
|
||||
<div class="flex gap-5">
|
||||
<el-button plain type="primary" @click="viewBalanceStatistics">余额统计</el-button>
|
||||
<right-toolbar
|
||||
v-model:showSearch="showSearch"
|
||||
:export="'wallet_walletRecord_export'"
|
||||
@exportExcel="exportExcel"
|
||||
class="ml10 mr20"
|
||||
style="float: right"
|
||||
@queryTable="getDataList"
|
||||
/>
|
||||
</div>
|
||||
</div>
|
||||
</el-row>
|
||||
<el-table
|
||||
@@ -111,6 +114,14 @@
|
||||
</template>
|
||||
</DraggableDepTree>
|
||||
</div>
|
||||
|
||||
<el-drawer v-model="showDrawer" @closed="drawerClose">
|
||||
<el-descriptions v-loading="balanceStatisticsLoading" :column="1" title="钱包余额统计" border>
|
||||
<el-descriptions-item label="总余额:">{{ balanceStatistics.a }}</el-descriptions-item>
|
||||
<el-descriptions-item label="饭卡钱包总余额:">{{ balanceStatistics.b }}</el-descriptions-item>
|
||||
<el-descriptions-item label="消费钱包总余额:">{{ balanceStatistics.c }}</el-descriptions-item>
|
||||
</el-descriptions>
|
||||
</el-drawer>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
@@ -131,6 +142,13 @@ const showSearch = ref(true)
|
||||
// 多选变量
|
||||
const selectObjs = ref([]) as any
|
||||
const multiple = ref(true)
|
||||
const showDrawer = ref(false) // 余额统计抽屉开关
|
||||
const balanceStatisticsLoading = ref(false)
|
||||
const balanceStatistics = reactive<any>({
|
||||
a: 0,
|
||||
b: 0,
|
||||
c: 0,
|
||||
})
|
||||
|
||||
const state: BasicTableProps = reactive<BasicTableProps>({
|
||||
queryForm: {
|
||||
@@ -154,6 +172,35 @@ const resetQuery = () => {
|
||||
getDataList()
|
||||
}
|
||||
|
||||
// 余额统计
|
||||
const viewBalanceStatistics = async () => {
|
||||
showDrawer.value = true
|
||||
balanceStatisticsLoading.value = true
|
||||
try {
|
||||
const { code, data } = await getBalanceStatistics({
|
||||
deptIds: state.queryForm.deptIds,
|
||||
isInclude: state.queryForm.isInclude,
|
||||
userId: state.queryForm.userId,
|
||||
})
|
||||
if (code == 0) {
|
||||
balanceStatistics.a = data.a
|
||||
return
|
||||
}
|
||||
return useMessage().error(data.msg || "获取数据失败")
|
||||
} catch (error: any) {
|
||||
useMessage().error(error.msg)
|
||||
} finally {
|
||||
balanceStatisticsLoading.value = false
|
||||
}
|
||||
}
|
||||
|
||||
// 关闭抽屉
|
||||
const drawerClose = () => {
|
||||
for (const key in balanceStatistics) {
|
||||
balanceStatistics[key] = 0
|
||||
}
|
||||
}
|
||||
|
||||
// 导出excel
|
||||
const exportExcel = () => {
|
||||
postDownBlobFile(
|
||||
|
||||
Reference in new issue
Block a user