From 09b194ba3504e4c4c47e428f3c4ee94d015b618f Mon Sep 17 00:00:00 2001 From: chenghuan Date: Wed, 1 Apr 2026 14:38:32 +0800 Subject: [PATCH] =?UTF-8?q?feat(=E7=BB=9F=E8=AE=A1=E6=8A=A5=E8=A1=A8):=20?= =?UTF-8?q?=E6=B7=BB=E5=8A=A0=E5=B9=B4=E5=BA=A6=E7=BB=9F=E8=AE=A1=E6=8A=A5?= =?UTF-8?q?=E8=A1=A8=E5=8A=9F=E8=83=BD=E5=B9=B6=E6=98=BE=E7=A4=BA=E7=8E=B0?= =?UTF-8?q?=E9=87=91=E5=90=88=E8=AE=A1?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - 将下载全部报表改为下载年度统计报表 - 在类型定义和数据处理中添加 cashFee 字段 - 在报表页面显示现金合计金额 - 添加下载年度统计报表和下载不含天医币报表的接口和功能 - 使用年份选择器替代原有下载按钮 --- apps/finance/src/api/statistics/index.ts | 28 ++++++- .../src/router/routes/modules/statistics.ts | 2 +- .../src/views/statistics/download/index.vue | 75 +++++++++++++++---- .../statistics/summary-month/report-utils.ts | 8 ++ .../views/statistics/summary-month/report.vue | 7 ++ .../views/statistics/summary-month/types.d.ts | 2 + 6 files changed, 105 insertions(+), 17 deletions(-) diff --git a/apps/finance/src/api/statistics/index.ts b/apps/finance/src/api/statistics/index.ts index 0270c8a..b3a1c67 100644 --- a/apps/finance/src/api/statistics/index.ts +++ b/apps/finance/src/api/statistics/index.ts @@ -144,9 +144,33 @@ export const statisticsApi = { * 下载全部月份的收入统计报表 * @returns 全部月份的收入统计报表数据 */ - downloadAllMonthIncomeStatistics: () => { + downloadAllMonthIncomeStatistics: (data?: { year: number | string }) => { return defaultRequestClient.download('common/statistics/getMonthStatistics', { - data: {}, + data: data || {}, + }); + }, + + /** + * 下载年度统计报表 + * @param data 请求参数 + * @param data.year 年份 + * @returns 年度统计报表数据 + */ + downloadYearStatistics: (data: { year: number | string }) => { + return defaultRequestClient.download('common/statistics/getYearStatistics', { + data, + }); + }, + + /** + * 下载年度统计报表(不包含天医币) + * @param data 请求参数 + * @param data.year 年份 + * @returns 年度统计报表数据(不包含天医币) + */ + downloadYearStatisticsNoPoint: (data: { year: number | string }) => { + return defaultRequestClient.download('common/statistics/getYearStatisticsNoPoint', { + data, }); }, }; diff --git a/apps/finance/src/router/routes/modules/statistics.ts b/apps/finance/src/router/routes/modules/statistics.ts index ba94855..cef0fa1 100644 --- a/apps/finance/src/router/routes/modules/statistics.ts +++ b/apps/finance/src/router/routes/modules/statistics.ts @@ -67,7 +67,7 @@ const routes: RouteRecordRaw[] = [ }, { meta: { - title: '下载全部报表', + title: '下载年度报表', keepAlive: true, }, name: 'DownloadReports', diff --git a/apps/finance/src/views/statistics/download/index.vue b/apps/finance/src/views/statistics/download/index.vue index 1b69ce2..60fca8c 100644 --- a/apps/finance/src/views/statistics/download/index.vue +++ b/apps/finance/src/views/statistics/download/index.vue @@ -1,39 +1,86 @@ diff --git a/apps/finance/src/views/statistics/summary-month/report-utils.ts b/apps/finance/src/views/statistics/summary-month/report-utils.ts index 7cb5eeb..8d5bf77 100644 --- a/apps/finance/src/views/statistics/summary-month/report-utils.ts +++ b/apps/finance/src/views/statistics/summary-month/report-utils.ts @@ -21,6 +21,7 @@ export function handleSumAndNoNeedAmortizateMonthData( resultData.push({ type, sumFee: resItem.sumFee || 0, + cashFee: resItem.cashFee || 0, children: childDictArr.map((childType) => ({ title: childType.title, fee: resItem[childType.type] || 0, @@ -86,6 +87,13 @@ export async function handleVipAndCourseMonthData( .reduce((acc: number, cur: IncomeItem) => acc + cur.fee, 0) .toFixed(3), ), + // 现金合计需要去掉天医币后合计 + cashFee: Number.parseFloat( + currentMonthData.incomes + .filter((item: IncomeItem) => item.type !== '天医币') + .reduce((acc: number, cur: IncomeItem) => acc + cur.fee, 0) + .toFixed(3), + ), }; } diff --git a/apps/finance/src/views/statistics/summary-month/report.vue b/apps/finance/src/views/statistics/summary-month/report.vue index 07c2a5c..349208d 100644 --- a/apps/finance/src/views/statistics/summary-month/report.vue +++ b/apps/finance/src/views/statistics/summary-month/report.vue @@ -138,6 +138,7 @@ const vipMonthLoading = ref(loadingText); const vipMonthData = ref({ incomes: [] as IncomeItem[], incomesTotal: 0, + cashFee: 0, notyet: 0, already: 0, now: 0, @@ -168,6 +169,7 @@ const courseMonthLoading = ref(loadingText); const courseMonthData = ref({ incomes: [] as IncomeItem[], incomesTotal: 0, + cashFee: 0, notyet: 0, already: 0, now: 0, @@ -403,6 +405,9 @@ async function downloadMonthStatistics() {
{{ `合计:${item.sumFee}元` }}
+
+ {{ `现金合计:${item.cashFee}元` }} +
@@ -427,6 +432,7 @@ async function downloadMonthStatistics() {
上月剩余摊销 {{ vipMonthData.lastNotyet }}元
收入 合计{{ vipMonthData.incomesTotal }}元
+
现金合计{{ vipMonthData.cashFee }}元
上月剩余摊销 {{ courseMonthData.lastNotyet }}元
收入 合计{{ courseMonthData.incomesTotal }}元
+
现金合计{{ courseMonthData.cashFee }}元