diff --git a/scripts/tests/agentRechargeService.test.mjs b/scripts/tests/agentRechargeService.test.mjs
index 8abe6e0..0179c7f 100644
--- a/scripts/tests/agentRechargeService.test.mjs
+++ b/scripts/tests/agentRechargeService.test.mjs
@@ -51,14 +51,14 @@ test('agent recharge rejection posts the rejection reason to the order rejection
const { AgentRechargeService } = await import(pathToFileURL(bundlePath).href)
await AgentRechargeService.rejectAgentRecharge(42, {
- reject_reason: '支付凭证不符合要求'
+ rejection_reason: '支付凭证不符合要求'
})
assert.deepEqual(calls, [
{
url: '/api/admin/agent-recharges/42/reject',
data: {
- reject_reason: '支付凭证不符合要求'
+ rejection_reason: '支付凭证不符合要求'
}
}
])
diff --git a/src/types/api/agentRecharge.ts b/src/types/api/agentRecharge.ts
index 931cb73..eb2d651 100644
--- a/src/types/api/agentRecharge.ts
+++ b/src/types/api/agentRecharge.ts
@@ -32,6 +32,7 @@ export interface AgentRecharge {
payment_config_id: number | null
payment_transaction_id: string
payment_voucher_key?: string[] | string // 凭证附件列表;历史数据可能为单字符串或逗号字符串
+ rejection_reason?: string | null // 拒绝原因
remark?: string // 运营备注
created_at: string
paid_at: string | null
@@ -75,5 +76,5 @@ export interface ConfirmOfflinePaymentRequest {
// 拒绝代理充值订单请求
export interface RejectAgentRechargeRequest {
- reject_reason: string
+ rejection_reason: string
}
diff --git a/src/views/finance/agent-recharge/detail.vue b/src/views/finance/agent-recharge/detail.vue
index 71f3d2b..f79b494 100644
--- a/src/views/finance/agent-recharge/detail.vue
+++ b/src/views/finance/agent-recharge/detail.vue
@@ -41,6 +41,7 @@
import { formatDateTime } from '@/utils/business/format'
import { hasVoucherKeys, toVoucherKeyList } from '@/utils/business'
import PaymentVoucherDialog from '@/components/business/PaymentVoucherDialog.vue'
+ import { formatRejectionReason } from './agentRechargeDisplay'
defineOptions({ name: 'AgentRechargeDetail' })
@@ -111,6 +112,12 @@
h(ElTag, { type: getStatusType(data.status) }, () =>
getStatusText(data.status, data.status_name)
)
+ },
+ {
+ label: '驳回原因',
+ prop: 'rejection_reason',
+ formatter: (value) => formatRejectionReason(value),
+ fullWidth: true
}
]
},
diff --git a/src/views/finance/agent-recharge/index.vue b/src/views/finance/agent-recharge/index.vue
index c39ddee..dd3393d 100644
--- a/src/views/finance/agent-recharge/index.vue
+++ b/src/views/finance/agent-recharge/index.vue
@@ -178,9 +178,9 @@
{{ currentRecharge?.recharge_no }}
-
+
({
- reject_reason: [{ required: true, message: '请输入拒绝原因', trigger: 'blur' }]
+ rejection_reason: [{ required: true, message: '请输入拒绝原因', trigger: 'blur' }]
})
const createForm = reactive<{
@@ -434,7 +436,7 @@
})
const rejectForm = reactive({
- reject_reason: ''
+ rejection_reason: ''
})
const rechargeList = ref([])
@@ -541,6 +543,13 @@
showOverflowTooltip: true,
formatter: (row: AgentRecharge) => row.remark || '-'
},
+ {
+ prop: 'rejection_reason',
+ label: '驳回原因',
+ minWidth: 180,
+ showOverflowTooltip: true,
+ formatter: (row: AgentRecharge) => formatRejectionReason(row.rejection_reason)
+ },
{
prop: 'created_at',
label: '创建时间',
@@ -789,7 +798,7 @@
// 拒绝对话框关闭后的清理
const handleRejectDialogClosed = () => {
rejectFormRef.value?.resetFields()
- rejectForm.reject_reason = ''
+ rejectForm.rejection_reason = ''
currentRecharge.value = null
}
@@ -804,7 +813,7 @@
rejectLoading.value = true
try {
await AgentRechargeService.rejectAgentRecharge(recharge.id, {
- reject_reason: rejectForm.reject_reason
+ rejection_reason: rejectForm.rejection_reason
})
ElMessage.success('拒绝成功')
rejectDialogVisible.value = false