diff --git a/src/views/wallet/wallet-qb/index.vue b/src/views/wallet/wallet-qb/index.vue index a1b3f3e..da57ec8 100644 --- a/src/views/wallet/wallet-qb/index.vue +++ b/src/views/wallet/wallet-qb/index.vue @@ -36,7 +36,7 @@ -
+
删除 - +
+ 余额统计 + +
+ + + + {{ balanceStatistics.a }} + {{ balanceStatistics.b }} + {{ balanceStatistics.c }} + + @@ -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({ + a: 0, + b: 0, + c: 0, +}) const state: BasicTableProps = reactive({ 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(