This commit is contained in:
@@ -51,14 +51,14 @@ test('agent recharge rejection posts the rejection reason to the order rejection
|
|||||||
const { AgentRechargeService } = await import(pathToFileURL(bundlePath).href)
|
const { AgentRechargeService } = await import(pathToFileURL(bundlePath).href)
|
||||||
|
|
||||||
await AgentRechargeService.rejectAgentRecharge(42, {
|
await AgentRechargeService.rejectAgentRecharge(42, {
|
||||||
reject_reason: '支付凭证不符合要求'
|
rejection_reason: '支付凭证不符合要求'
|
||||||
})
|
})
|
||||||
|
|
||||||
assert.deepEqual(calls, [
|
assert.deepEqual(calls, [
|
||||||
{
|
{
|
||||||
url: '/api/admin/agent-recharges/42/reject',
|
url: '/api/admin/agent-recharges/42/reject',
|
||||||
data: {
|
data: {
|
||||||
reject_reason: '支付凭证不符合要求'
|
rejection_reason: '支付凭证不符合要求'
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
])
|
])
|
||||||
|
|||||||
@@ -32,6 +32,7 @@ export interface AgentRecharge {
|
|||||||
payment_config_id: number | null
|
payment_config_id: number | null
|
||||||
payment_transaction_id: string
|
payment_transaction_id: string
|
||||||
payment_voucher_key?: string[] | string // 凭证附件列表;历史数据可能为单字符串或逗号字符串
|
payment_voucher_key?: string[] | string // 凭证附件列表;历史数据可能为单字符串或逗号字符串
|
||||||
|
rejection_reason?: string | null // 拒绝原因
|
||||||
remark?: string // 运营备注
|
remark?: string // 运营备注
|
||||||
created_at: string
|
created_at: string
|
||||||
paid_at: string | null
|
paid_at: string | null
|
||||||
@@ -75,5 +76,5 @@ export interface ConfirmOfflinePaymentRequest {
|
|||||||
|
|
||||||
// 拒绝代理充值订单请求
|
// 拒绝代理充值订单请求
|
||||||
export interface RejectAgentRechargeRequest {
|
export interface RejectAgentRechargeRequest {
|
||||||
reject_reason: string
|
rejection_reason: string
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -41,6 +41,7 @@
|
|||||||
import { formatDateTime } from '@/utils/business/format'
|
import { formatDateTime } from '@/utils/business/format'
|
||||||
import { hasVoucherKeys, toVoucherKeyList } from '@/utils/business'
|
import { hasVoucherKeys, toVoucherKeyList } from '@/utils/business'
|
||||||
import PaymentVoucherDialog from '@/components/business/PaymentVoucherDialog.vue'
|
import PaymentVoucherDialog from '@/components/business/PaymentVoucherDialog.vue'
|
||||||
|
import { formatRejectionReason } from './agentRechargeDisplay'
|
||||||
|
|
||||||
defineOptions({ name: 'AgentRechargeDetail' })
|
defineOptions({ name: 'AgentRechargeDetail' })
|
||||||
|
|
||||||
@@ -111,6 +112,12 @@
|
|||||||
h(ElTag, { type: getStatusType(data.status) }, () =>
|
h(ElTag, { type: getStatusType(data.status) }, () =>
|
||||||
getStatusText(data.status, data.status_name)
|
getStatusText(data.status, data.status_name)
|
||||||
)
|
)
|
||||||
|
},
|
||||||
|
{
|
||||||
|
label: '驳回原因',
|
||||||
|
prop: 'rejection_reason',
|
||||||
|
formatter: (value) => formatRejectionReason(value),
|
||||||
|
fullWidth: true
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
|
|||||||
@@ -178,9 +178,9 @@
|
|||||||
<ElFormItem label="充值单号">
|
<ElFormItem label="充值单号">
|
||||||
<span>{{ currentRecharge?.recharge_no }}</span>
|
<span>{{ currentRecharge?.recharge_no }}</span>
|
||||||
</ElFormItem>
|
</ElFormItem>
|
||||||
<ElFormItem label="拒绝原因" prop="reject_reason">
|
<ElFormItem label="拒绝原因" prop="rejection_reason">
|
||||||
<ElInput
|
<ElInput
|
||||||
v-model="rejectForm.reject_reason"
|
v-model="rejectForm.rejection_reason"
|
||||||
type="textarea"
|
type="textarea"
|
||||||
:rows="3"
|
:rows="3"
|
||||||
maxlength="500"
|
maxlength="500"
|
||||||
@@ -241,6 +241,7 @@
|
|||||||
import PaymentVoucherDialog from '@/components/business/PaymentVoucherDialog.vue'
|
import PaymentVoucherDialog from '@/components/business/PaymentVoucherDialog.vue'
|
||||||
import VoucherUpload from '@/components/business/VoucherUpload.vue'
|
import VoucherUpload from '@/components/business/VoucherUpload.vue'
|
||||||
import { buildAgentRechargeActions } from './agentRechargeActions'
|
import { buildAgentRechargeActions } from './agentRechargeActions'
|
||||||
|
import { formatRejectionReason } from './agentRechargeDisplay'
|
||||||
|
|
||||||
defineOptions({ name: 'AgentRechargeList' })
|
defineOptions({ name: 'AgentRechargeList' })
|
||||||
|
|
||||||
@@ -366,6 +367,7 @@
|
|||||||
{ label: '状态', prop: 'status' },
|
{ label: '状态', prop: 'status' },
|
||||||
{ label: '支付方式', prop: 'payment_method' },
|
{ label: '支付方式', prop: 'payment_method' },
|
||||||
{ label: '支付通道', prop: 'payment_channel' },
|
{ label: '支付通道', prop: 'payment_channel' },
|
||||||
|
{ label: '驳回原因', prop: 'rejection_reason' },
|
||||||
{ label: '创建时间', prop: 'created_at' },
|
{ label: '创建时间', prop: 'created_at' },
|
||||||
{ label: '支付时间', prop: 'paid_at' },
|
{ label: '支付时间', prop: 'paid_at' },
|
||||||
{ label: '完成时间', prop: 'completed_at' }
|
{ label: '完成时间', prop: 'completed_at' }
|
||||||
@@ -412,7 +414,7 @@
|
|||||||
})
|
})
|
||||||
|
|
||||||
const rejectRules = reactive<FormRules>({
|
const rejectRules = reactive<FormRules>({
|
||||||
reject_reason: [{ required: true, message: '请输入拒绝原因', trigger: 'blur' }]
|
rejection_reason: [{ required: true, message: '请输入拒绝原因', trigger: 'blur' }]
|
||||||
})
|
})
|
||||||
|
|
||||||
const createForm = reactive<{
|
const createForm = reactive<{
|
||||||
@@ -434,7 +436,7 @@
|
|||||||
})
|
})
|
||||||
|
|
||||||
const rejectForm = reactive<RejectAgentRechargeRequest>({
|
const rejectForm = reactive<RejectAgentRechargeRequest>({
|
||||||
reject_reason: ''
|
rejection_reason: ''
|
||||||
})
|
})
|
||||||
|
|
||||||
const rechargeList = ref<AgentRecharge[]>([])
|
const rechargeList = ref<AgentRecharge[]>([])
|
||||||
@@ -541,6 +543,13 @@
|
|||||||
showOverflowTooltip: true,
|
showOverflowTooltip: true,
|
||||||
formatter: (row: AgentRecharge) => row.remark || '-'
|
formatter: (row: AgentRecharge) => row.remark || '-'
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
prop: 'rejection_reason',
|
||||||
|
label: '驳回原因',
|
||||||
|
minWidth: 180,
|
||||||
|
showOverflowTooltip: true,
|
||||||
|
formatter: (row: AgentRecharge) => formatRejectionReason(row.rejection_reason)
|
||||||
|
},
|
||||||
{
|
{
|
||||||
prop: 'created_at',
|
prop: 'created_at',
|
||||||
label: '创建时间',
|
label: '创建时间',
|
||||||
@@ -789,7 +798,7 @@
|
|||||||
// 拒绝对话框关闭后的清理
|
// 拒绝对话框关闭后的清理
|
||||||
const handleRejectDialogClosed = () => {
|
const handleRejectDialogClosed = () => {
|
||||||
rejectFormRef.value?.resetFields()
|
rejectFormRef.value?.resetFields()
|
||||||
rejectForm.reject_reason = ''
|
rejectForm.rejection_reason = ''
|
||||||
currentRecharge.value = null
|
currentRecharge.value = null
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -804,7 +813,7 @@
|
|||||||
rejectLoading.value = true
|
rejectLoading.value = true
|
||||||
try {
|
try {
|
||||||
await AgentRechargeService.rejectAgentRecharge(recharge.id, {
|
await AgentRechargeService.rejectAgentRecharge(recharge.id, {
|
||||||
reject_reason: rejectForm.reject_reason
|
rejection_reason: rejectForm.rejection_reason
|
||||||
})
|
})
|
||||||
ElMessage.success('拒绝成功')
|
ElMessage.success('拒绝成功')
|
||||||
rejectDialogVisible.value = false
|
rejectDialogVisible.value = false
|
||||||
|
|||||||
Reference in New Issue
Block a user