diff --git a/src/api/hard/hard-total-appt.ts b/src/api/hard/hard-total-appt.ts index 668dd188..fb743c69 100644 --- a/src/api/hard/hard-total-appt.ts +++ b/src/api/hard/hard-total-appt.ts @@ -8,7 +8,7 @@ export interface CanteenUserReservationQuery { current?: number /** 每页用户数量。 */ size?: number - /** 用餐日期闭区间,固定为开始、结束两个 YYYY-MM-DD 日期,最大跨度为两个自然月。 */ + /** 统计日期闭区间;已核销按实际核销日期,其他状态按预约用餐日期,最大跨度为两个自然月。 */ apptUseDateList: [string, string] /** 姓名、登录账号或手机号关键字。 */ nameOrPhone?: string @@ -42,6 +42,8 @@ export interface CanteenUserReservationOrder { id: string | number /** 用餐时间段字典编码。 */ hourType?: string + /** 订单原预约用餐日期;已核销按核销日查询时用于展示跨日预约。 */ + apptUseDate?: string /** 下单时保存的商品描述。 */ productDesc?: string /** 预约所属食堂名称。 */ @@ -115,13 +117,13 @@ export interface CanteenUserReservationDishStatistics { /** 预约统计的通用汇总结构。金额单位为分。 */ export interface CanteenUserReservationStatisticsSummary { - /** 用户-用餐日期记录数。 */ + /** 用户-统计日期记录数。 */ userCount?: number /** 当前范围内去重用户数。 */ uniqueUserCount?: number - /** 已订餐用户-用餐日期记录数。 */ + /** 已订餐用户-统计日期记录数。 */ reservedUserCount?: number - /** 未订餐用户-用餐日期记录数。 */ + /** 未订餐用户-统计日期记录数。 */ unreservedUserCount?: number /** 有效预约订单数。 */ orderCount?: number @@ -137,7 +139,7 @@ export interface CanteenUserReservationStatisticsSummary { /** 预约每日统计结构。 */ export interface CanteenUserReservationDailyStatistics extends CanteenUserReservationStatisticsSummary { - /** 用餐日期,格式为 YYYY-MM-DD。 */ + /** 统计日期,已核销取核销日期,其他状态取预约用餐日期。 */ date?: string } @@ -155,7 +157,7 @@ export interface CanteenUserReservationStatisticsResponse { } /** - * 按用户和用餐日期范围分页查询每日食堂预约,后端会保留每天没有预约日志的权限范围用户。 + * 按用户和统计日期范围分页查询每日食堂预约,后端会保留没有预约日志的权限范围用户日期行。 */ export function canteenUserReservationPage(query: CanteenUserReservationQuery) { return request({ diff --git a/src/api/wallet/wallet-recharge-import.ts b/src/api/wallet/wallet-recharge-import.ts index a2c56c23..b23be45a 100644 --- a/src/api/wallet/wallet-recharge-import.ts +++ b/src/api/wallet/wallet-recharge-import.ts @@ -1,4 +1,13 @@ import request from "/@/utils/request" +import type { AsyncTaskProgress } from "/@/api/asyncTask" + +/** 充值扣款水单异步导出提交接口的统一响应。 */ +export interface WalletRechargeImportExportTaskResponse { + /** 后端创建的初始异步任务进度。 */ + data: AsyncTaskProgress + /** 后端返回的任务提交提示。 */ + msg?: string +} export function pageJoin(query: any) { return request({ @@ -58,3 +67,12 @@ export function recover(params?: Object) { params, }) } + +/** 提交充值扣款水单异步分片导出任务。 */ +export function submitExport(query: Record) { + return request({ + url: "/wallet/wallet-recharge-import/export-async", + method: "post", + data: query, + }) +} diff --git a/src/api/wallet/wallet-transaction.ts b/src/api/wallet/wallet-transaction.ts index 501bc94a..145c15ef 100644 --- a/src/api/wallet/wallet-transaction.ts +++ b/src/api/wallet/wallet-transaction.ts @@ -1,4 +1,13 @@ import request from "/@/utils/request" +import type { AsyncTaskProgress } from "/@/api/asyncTask" + +/** 钱包流水异步导出提交接口的统一响应。 */ +export interface WalletTransactionExportTaskResponse { + /** 后端创建的初始异步任务进度。 */ + data: AsyncTaskProgress + /** 后端返回的任务提交提示。 */ + msg?: string +} /** 流水备注的前后端统一字符上限,与 wallet_transaction.remark 字段长度保持一致。 */ export const WALLET_TRANSACTION_REMARK_MAX_LENGTH = 256 @@ -138,6 +147,40 @@ export function tkTotal(data: any) { }) } +/** 提交充值记录异步分片导出任务。 */ +export function submitCzExport(query: Record) { + return request({ url: "/wallet/wallet-transaction/export-cz-async", method: "post", data: query }) +} + +/** 提交记账扣款异步分片导出任务。 */ +export function submitJzExport(query: Record) { + return request({ url: "/wallet/wallet-transaction/export-jz-async", method: "post", data: query }) +} + +/** 提交消费记录异步分片导出任务。 */ +export function submitXfExport(query: Record) { + return request({ url: "/wallet/wallet-transaction/export-xf-async", method: "post", data: query }) +} + +/** 提交退款记录异步分片导出任务。 */ +export function submitTkExport(query: Record) { + return request({ url: "/wallet/wallet-transaction/export-tk-async", method: "post", data: query }) +} + +/** 提交食堂退还记录异步分片导出任务。 */ +export function submitThExport(query: Record) { + return request({ url: "/wallet/wallet-transaction/export-th-async", method: "post", data: query }) +} + +/** 提交个人充值统计异步分片导出任务。 */ +export function submitCzTotalPersonExport(query: Record) { + return request({ + url: "/wallet/wallet-transaction/export-cz-total-person-async", + method: "post", + data: query, + }) +} + export function updateBalance(obj?: Object) { return request({ url: "/wallet/wallet-transaction/update-balance", diff --git a/src/views/hard/appt/canteen-dept-appt-total/index.vue b/src/views/hard/appt/canteen-dept-appt-total/index.vue index 404e666e..d286b69e 100644 --- a/src/views/hard/appt/canteen-dept-appt-total/index.vue +++ b/src/views/hard/appt/canteen-dept-appt-total/index.vue @@ -1,91 +1,74 @@ - + - + - + - + @@ -187,12 +183,8 @@ - + @@ -204,7 +196,7 @@ import { displayPrice } from "/@/utils/formatMoney" import { useDict } from "/@/hooks/dict" import { useMessage } from "/@/hooks/message" import { parseTime } from "/@/utils/formatTime" -import { Right } from "@element-plus/icons-vue" +import { QuestionFilled, Right } from "@element-plus/icons-vue" import type { AsyncTaskPollingConfig, AsyncTaskProgress } from "/@/api/asyncTask" import AsyncTaskProgressComponent from "/@/components/AsyncTaskProgress.vue" import { downBlobFile } from "/@/utils/other" @@ -260,6 +252,39 @@ const aggregateSourceName = computed(() => activeName.value === "all" ? "线下 + 预约" : sourceTabs.find((tab) => tab.name === activeName.value)?.label || "当前来源" ) +/** 当前是否只查看预约核销来源,用于切换日期与四项指标的业务文案。 */ +const isReservationSource = computed(() => activeName.value === hardTotalApi.SALE_SOURCE.RESERVATION_VERIFIED) + +/** 日期列随销售来源展示真实业务发生时间,全部来源同时包含支付日期和核销日期。 */ +const statisticsDateColumnLabel = computed(() => { + if (isReservationSource.value) return "核销日期" + if (activeName.value === hardTotalApi.SALE_SOURCE.OFFLINE_PURCHASE) return "支付日期" + return "支付/核销日期" +}) + +/** 预约核销页的人数标题,其他来源保留通用交易名称。 */ +const peopleColumnLabel = computed(() => (isReservationSource.value ? "核销人数" : "交易人数")) + +/** 预约核销页的订单标题,其他来源保留通用交易名称。 */ +const orderColumnLabel = computed(() => (isReservationSource.value ? "核销订单" : "交易订单")) + +/** 预约核销页的份数标题,突出页面展示的是扣除退款后的实际结果。 */ +const quantityColumnLabel = computed(() => (isReservationSource.value ? "实际核销份数" : "售出份数")) + +/** 预约核销页的金额标题,突出页面展示的是扣除退款后的实际结果。 */ +const amountColumnLabel = computed(() => (isReservationSource.value ? "实际核销金额" : "交易金额")) + +/** 当前标签页面向业务人员的统计说明,明确日期依据和退款扣减方式。 */ +const statisticsScopeDescription = computed(() => { + if (isReservationSource.value) { + return "这里统计已经完成取餐核销的预约,日期按实际核销当天计算;发生退款时,只扣除实际退款的菜品份数和金额。" + } + if (activeName.value === hardTotalApi.SALE_SOURCE.OFFLINE_PURCHASE) { + return "这里统计现场购买并已付款的订单,日期按付款当天计算。" + } + return "这里合并显示现场购买和预约核销。现场购买按付款日期统计,预约订餐按实际核销日期统计;预约退款只扣除实际退款的菜品份数和金额。" +}) + // table hook const { sortChangeHandle, tableStyle } = useTable(state) @@ -432,8 +457,8 @@ const getSummaries = (param: any) => { const totalData = data.some((row: any) => row.statisticsLevel === hardTotalApi.STATISTICS_LEVEL.DATE_TOTAL) ? data.filter((row: any) => row.statisticsLevel === hardTotalApi.STATISTICS_LEVEL.DATE_TOTAL) : data.some((row: any) => row.statisticsLevel === hardTotalApi.STATISTICS_LEVEL.HOUR_TOTAL) - ? data.filter((row: any) => row.statisticsLevel === hardTotalApi.STATISTICS_LEVEL.HOUR_TOTAL) - : data + ? data.filter((row: any) => row.statisticsLevel === hardTotalApi.STATISTICS_LEVEL.HOUR_TOTAL) + : data columns.forEach((i: any, index: number) => { if (totalColumns.includes(i.property)) { const total = totalData diff --git a/src/views/hard/appt/canteen-product-appt-total/index.vue b/src/views/hard/appt/canteen-product-appt-total/index.vue index 999f2453..eebab82f 100644 --- a/src/views/hard/appt/canteen-product-appt-total/index.vue +++ b/src/views/hard/appt/canteen-product-appt-total/index.vue @@ -8,7 +8,17 @@ - + + @@ -26,9 +36,10 @@ - + + - + - + - + - + @@ -75,7 +86,7 @@ - + @@ -106,22 +117,22 @@ - + - + - + - + @@ -138,15 +149,11 @@ v-bind="state.pagination" /> - - - + + +