fix: 更新提现审核相关功能 更新账务报表页面功能
This commit is contained in:
@@ -0,0 +1,13 @@
|
||||
/**
|
||||
* 财务报表 API
|
||||
* 对应 OpenAPI: GET /admin/finance/report/list
|
||||
*/
|
||||
import { get } from '@/utils/request';
|
||||
import type { ReportQueryParams, FinanceReportVO, ApiResult } from './types';
|
||||
|
||||
export type { ReportQueryParams, FinanceReportVO, ReportMonthItem, ApiResult } from './types';
|
||||
|
||||
/** GET /admin/finance/report/list — 财务报表 */
|
||||
export function getFinanceReport(params: ReportQueryParams): Promise<ApiResult<FinanceReportVO>> {
|
||||
return get('/admin/finance/report/list', params as Record<string, any>);
|
||||
}
|
||||
@@ -0,0 +1,46 @@
|
||||
/**
|
||||
* 财务报表 — 类型定义
|
||||
* 对应 OpenAPI: GET /admin/finance/report/list
|
||||
*/
|
||||
|
||||
/** 月度明细项(对应 InnerMonthVO) */
|
||||
export interface ReportMonthItem {
|
||||
/** 月份 yyyy-MM */
|
||||
month: string;
|
||||
/** 订单金额,0.00 格式 */
|
||||
orderAmount: string;
|
||||
/** 退款金额,0.00 格式 */
|
||||
refundAmount: string;
|
||||
/** 净收入 = orderAmount - refundAmount,0.00 格式 */
|
||||
netIncome: string;
|
||||
/** 提现金额,0.00 格式 */
|
||||
withdrawAmount: string;
|
||||
}
|
||||
|
||||
/** 财务报表汇总(对应 TournamentFinanceReportVO) */
|
||||
export interface FinanceReportVO {
|
||||
/** 总收入(扣除退款后),0.00 格式 */
|
||||
totalIncome: string;
|
||||
/** 总收入较上月增长率 */
|
||||
totalIncomeTendency: string;
|
||||
/** 总提现金额,0.00 格式 */
|
||||
totalWithdrawIncome: string;
|
||||
/** 总提现金额较上月增长率 */
|
||||
totalWithdrawIncomeTendency: string;
|
||||
/** 平台余额 = totalIncome - totalWithdrawIncome,0.00 格式 */
|
||||
totalBalanceAmount: string;
|
||||
/** 月度收支明细 */
|
||||
monthList: ReportMonthItem[];
|
||||
}
|
||||
|
||||
/** 财务报表查询参数 */
|
||||
export interface ReportQueryParams {
|
||||
/** 查询日期 yyyy-MM */
|
||||
date: string;
|
||||
}
|
||||
|
||||
export interface ApiResult<T> {
|
||||
code: number;
|
||||
msg: string;
|
||||
data: T;
|
||||
}
|
||||
@@ -12,7 +12,7 @@ export type { WithdrawVO, WithdrawInfoVO, WithdrawQueryParams, PageData, ApiResu
|
||||
|
||||
const delay = (ms: number) => new Promise<void>((r) => setTimeout(r, ms));
|
||||
|
||||
/** GET /finance/withdraw/page — 提现列表分页 */
|
||||
/** GET /admin/finance/withdraw/page — 提现列表分页 */
|
||||
export async function getWithdrawList(
|
||||
params: WithdrawQueryParams,
|
||||
): Promise<ApiResult<PageData<WithdrawVO>>> {
|
||||
@@ -26,16 +26,16 @@ export async function getWithdrawList(
|
||||
data: buildMockWithdrawPage(page, limit, params),
|
||||
};
|
||||
}
|
||||
return get('/finance/withdraw/page', params as Record<string, any>);
|
||||
return get('/admin/finance/withdraw/page', params as Record<string, any>);
|
||||
}
|
||||
|
||||
/** GET /finance/withdraw/info?id=xxx — 提现详情 */
|
||||
/** GET /admin/finance/withdraw/info?id=xxx — 提现详情 */
|
||||
export async function getWithdrawInfo(id: number): Promise<ApiResult<WithdrawInfoVO>> {
|
||||
if (USE_MOCK) {
|
||||
await delay(MOCK_DELAY);
|
||||
return { code: 200, msg: 'success', data: buildMockWithdrawInfo(id) };
|
||||
}
|
||||
return get('/finance/withdraw/info', { id: String(id) });
|
||||
return get('/admin/finance/withdraw/info', { id: String(id) });
|
||||
}
|
||||
|
||||
/** 提现审核请求参数 */
|
||||
@@ -50,7 +50,7 @@ export interface WithdrawAuditParams {
|
||||
checkImg: string;
|
||||
}
|
||||
|
||||
/** POST /finance/withdraw/audit — 审核提现 */
|
||||
/** POST /admin/finance/withdraw/audit — 审核提现 */
|
||||
export async function postWithdrawAudit(params: WithdrawAuditParams): Promise<ApiResult<null>> {
|
||||
return post('/finance/withdraw/audit', params);
|
||||
return post('/admin/finance/withdraw/audit', params);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user