Some checks failed
构建并部署前端到测试环境 / deploy (push) Failing after 7m27s
- 新增采集成功/失败记录、卡日流量、套餐日流量详单、冲正流水、退款后处理尝试记录 6 个查询页 - 资产详情新增采集记录、冲正记录与人工冲正,同步后展示本次流量入账结果 - 退款列表与详情展示资产后处理状态,支持按状态筛选、人工重试与查看尝试记录 - 新增前端权限码常量(需在 tb_permission 补数据)
107 lines
3.4 KiB
TypeScript
107 lines
3.4 KiB
TypeScript
/**
|
||
* 退款管理相关 API
|
||
*/
|
||
|
||
import { BaseService } from '../BaseService'
|
||
import type {
|
||
Refund,
|
||
RefundQueryParams,
|
||
RefundListResponse,
|
||
CreateRefundRequest,
|
||
ResubmitRefundRequest,
|
||
ApproveRefundRequest,
|
||
RejectRefundRequest,
|
||
ReturnRefundRequest,
|
||
BaseResponse
|
||
} from '@/types/api'
|
||
|
||
export class RefundService extends BaseService {
|
||
/**
|
||
* 获取退款申请列表
|
||
* @param params 查询参数
|
||
*/
|
||
static getRefunds(params?: RefundQueryParams): Promise<BaseResponse<RefundListResponse>> {
|
||
return this.get<BaseResponse<RefundListResponse>>('/api/admin/refunds', params)
|
||
}
|
||
|
||
/**
|
||
* 获取退款申请详情
|
||
* @param id 退款申请ID
|
||
*/
|
||
static getRefundById(id: number): Promise<BaseResponse<Refund>> {
|
||
return this.getOne<Refund>(`/api/admin/refunds/${id}`)
|
||
}
|
||
|
||
/**
|
||
* 创建退款申请
|
||
* @param data 创建退款申请请求参数
|
||
*/
|
||
static createRefund(data: CreateRefundRequest): Promise<BaseResponse<Refund>> {
|
||
return this.post<BaseResponse<Refund>>('/api/admin/refunds', data)
|
||
}
|
||
|
||
/**
|
||
* 审批通过退款申请(仅存量无企微审批实例的申请可用)
|
||
* @param id 退款申请ID
|
||
* @param data 审批通过请求参数
|
||
*/
|
||
static approveRefund(id: number, data: ApproveRefundRequest): Promise<BaseResponse<Refund>> {
|
||
return this.post<BaseResponse<Refund>>(`/api/admin/refunds/${id}/approve`, data)
|
||
}
|
||
|
||
/**
|
||
* 审批拒绝退款申请(仅存量无企微审批实例的申请可用)
|
||
* @param id 退款申请ID
|
||
* @param data 拒绝请求参数
|
||
*/
|
||
static rejectRefund(id: number, data: RejectRefundRequest): Promise<BaseResponse<Refund>> {
|
||
return this.post<BaseResponse<Refund>>(`/api/admin/refunds/${id}/reject`, data)
|
||
}
|
||
|
||
/**
|
||
* 退回退款申请(仅存量无企微审批实例的申请可用)
|
||
* @param id 退款申请ID
|
||
* @param data 退回请求参数
|
||
*/
|
||
static returnRefund(id: number, data: ReturnRefundRequest): Promise<BaseResponse<Refund>> {
|
||
return this.post<BaseResponse<Refund>>(`/api/admin/refunds/${id}/return`, data)
|
||
}
|
||
|
||
/**
|
||
* 重新提交退款申请
|
||
* @param id 退款申请ID
|
||
* @param data 重新提交请求参数
|
||
*/
|
||
static resubmitRefund(id: number, data: ResubmitRefundRequest): Promise<BaseResponse<void>> {
|
||
return this.post<BaseResponse<void>>(`/api/admin/refunds/${id}/resubmit`, data)
|
||
}
|
||
|
||
/**
|
||
* 补发历史退款审批
|
||
* @param id 退款申请ID
|
||
*/
|
||
static triggerApproval(id: number): Promise<BaseResponse<Refund>> {
|
||
return this.post<BaseResponse<Refund>>(`/api/admin/refunds/${id}/trigger-approval`)
|
||
}
|
||
|
||
/**
|
||
* 恢复退款原审批提交
|
||
*
|
||
* 后端负责同步已有审批单、确认未知提交结果或恢复明确失败的原提交事件。
|
||
* 此操作不接收审批实例 ID、审批材料或企业微信单号,也不会创建新的审批尝试。
|
||
* @param id 退款申请ID
|
||
*/
|
||
static recoverApproval(id: number): Promise<BaseResponse<Refund>> {
|
||
return this.post<BaseResponse<Refund>>(`/api/admin/refunds/${id}/recover-approval`)
|
||
}
|
||
|
||
/**
|
||
* 人工重试退款资产后处理(仅平台账号;仅"需人工处理"的退款单)
|
||
* 成功返回最新退款详情;仍失败时后端返回错误并保留"需人工处理"
|
||
* @param id 退款申请ID
|
||
*/
|
||
static retryAssetPostProcessing(id: number): Promise<BaseResponse<Refund>> {
|
||
return this.post<BaseResponse<Refund>>(`/api/admin/refunds/${id}/asset-post-processing/retry`)
|
||
}
|
||
}
|