This commit is contained in:
@@ -19,7 +19,12 @@ export const WITHDRAWAL_STATUS_OPTIONS = [
|
||||
{ label: '待审核', value: WithdrawalStatus.PENDING, type: 'warning' as const },
|
||||
{ label: '已通过', value: WithdrawalStatus.APPROVED, type: 'success' as const },
|
||||
{ label: '已拒绝', value: WithdrawalStatus.REJECTED, type: 'danger' as const },
|
||||
{ label: '已到账', value: WithdrawalStatus.COMPLETED, type: 'success' as const }
|
||||
{ label: '已到账', value: WithdrawalStatus.COMPLETED, type: 'success' as const },
|
||||
{
|
||||
label: '审批提交失败',
|
||||
value: WithdrawalStatus.APPROVAL_SUBMISSION_FAILED,
|
||||
type: 'danger' as const
|
||||
}
|
||||
]
|
||||
|
||||
// 支付方式选项
|
||||
@@ -36,9 +41,22 @@ export const WithdrawalStatusMap = {
|
||||
1: { label: '待审核', type: 'warning' as const, color: '#E6A23C' },
|
||||
2: { label: '已通过', type: 'success' as const, color: '#67C23A' },
|
||||
3: { label: '已拒绝', type: 'danger' as const, color: '#F56C6C' },
|
||||
4: { label: '已到账', type: 'success' as const, color: '#67C23A' }
|
||||
4: { label: '已到账', type: 'success' as const, color: '#67C23A' },
|
||||
5: { label: '审批提交失败', type: 'danger' as const, color: '#F56C6C' }
|
||||
}
|
||||
|
||||
export const WITHDRAWAL_QUALIFICATION_APPROVAL_FAILED = 4
|
||||
export const WITHDRAWAL_QUALIFICATION_STATUS_OPTIONS = [
|
||||
{ label: '待审批', value: 0 },
|
||||
{ label: '已通过', value: 1 },
|
||||
{ label: '已驳回', value: 2 },
|
||||
{ label: '已作废', value: 3 },
|
||||
{ label: '审批提交失败', value: WITHDRAWAL_QUALIFICATION_APPROVAL_FAILED }
|
||||
]
|
||||
|
||||
export const canResubmitWithdrawal = (status: number): boolean =>
|
||||
status === WithdrawalStatus.REJECTED || status === WithdrawalStatus.APPROVAL_SUBMISSION_FAILED
|
||||
|
||||
// ========== 佣金状态映射 ==========
|
||||
|
||||
// 佣金状态映射 (1:已冻结, 2:解冻中, 3:已发放, 4:已失效, 99:待人工修正)
|
||||
@@ -134,10 +152,7 @@ export const COMMISSION_RECORD_STATUS_OPTIONS = [
|
||||
]
|
||||
|
||||
// 是否回溯明细行(source 与 status 双判断,兼容未返回 source 的响应)
|
||||
export function isCommissionClawbackRecord(record: {
|
||||
source?: string
|
||||
status?: number
|
||||
}): boolean {
|
||||
export function isCommissionClawbackRecord(record: { source?: string; status?: number }): boolean {
|
||||
return record.source === 'clawback' || record.status === CommissionStatus.CLAWBACK
|
||||
}
|
||||
|
||||
|
||||
@@ -16,7 +16,8 @@ export const RefundStatusNameMap: Record<RefundStatus, string> = {
|
||||
[RefundStatus.REJECTED]: '已拒绝',
|
||||
[RefundStatus.RETURNED]: '已退回',
|
||||
[RefundStatus.REFUNDING]: '原路退款处理中',
|
||||
[RefundStatus.REFUND_FAILED]: '原路退款失败'
|
||||
[RefundStatus.REFUND_FAILED]: '原路退款失败',
|
||||
[RefundStatus.APPROVAL_SUBMISSION_FAILED]: '审批提交失败'
|
||||
}
|
||||
|
||||
/** 退款状态标签类型映射 */
|
||||
@@ -27,7 +28,8 @@ export const RefundStatusTypeMap: Record<RefundStatus, 'warning' | 'success' | '
|
||||
[RefundStatus.REJECTED]: 'danger',
|
||||
[RefundStatus.RETURNED]: 'info',
|
||||
[RefundStatus.REFUNDING]: 'warning',
|
||||
[RefundStatus.REFUND_FAILED]: 'danger'
|
||||
[RefundStatus.REFUND_FAILED]: 'danger',
|
||||
[RefundStatus.APPROVAL_SUBMISSION_FAILED]: 'danger'
|
||||
}
|
||||
|
||||
/** 退款方式名称映射 */
|
||||
@@ -73,7 +75,12 @@ export const canResubmitRefund = (item: {
|
||||
anomaly_flag?: number
|
||||
}): boolean => {
|
||||
if (!item.status) return false
|
||||
if (item.status === RefundStatus.REJECTED || item.status === RefundStatus.RETURNED) return true
|
||||
if (
|
||||
item.status === RefundStatus.REJECTED ||
|
||||
item.status === RefundStatus.RETURNED ||
|
||||
item.status === RefundStatus.APPROVAL_SUBMISSION_FAILED
|
||||
)
|
||||
return true
|
||||
if (item.status === RefundStatus.REFUND_FAILED) return item.anomaly_flag !== 1
|
||||
return false
|
||||
}
|
||||
@@ -85,3 +92,9 @@ export const canManualApproveRefund = (item: {
|
||||
status?: RefundStatus
|
||||
approval_instance_id?: number | null
|
||||
}): boolean => item.status === RefundStatus.PENDING && !item.approval_instance_id
|
||||
|
||||
export const canRecoverRefundApproval = (item: {
|
||||
status?: RefundStatus
|
||||
approval_recoverable?: boolean
|
||||
}): boolean =>
|
||||
item.status !== RefundStatus.APPROVAL_SUBMISSION_FAILED && item.approval_recoverable === true
|
||||
|
||||
Reference in New Issue
Block a user