驳回
This commit is contained in:
@@ -167,6 +167,38 @@
|
||||
</template>
|
||||
</ElDialog>
|
||||
|
||||
<!-- 拒绝充值订单对话框 -->
|
||||
<ElDialog
|
||||
v-model="rejectDialogVisible"
|
||||
title="拒绝充值订单"
|
||||
width="500px"
|
||||
@closed="handleRejectDialogClosed"
|
||||
>
|
||||
<ElForm ref="rejectFormRef" :model="rejectForm" :rules="rejectRules" label-width="100px">
|
||||
<ElFormItem label="充值单号">
|
||||
<span>{{ currentRecharge?.recharge_no }}</span>
|
||||
</ElFormItem>
|
||||
<ElFormItem label="拒绝原因" prop="reject_reason">
|
||||
<ElInput
|
||||
v-model="rejectForm.reject_reason"
|
||||
type="textarea"
|
||||
:rows="3"
|
||||
maxlength="500"
|
||||
show-word-limit
|
||||
placeholder="请输入拒绝原因"
|
||||
/>
|
||||
</ElFormItem>
|
||||
</ElForm>
|
||||
<template #footer>
|
||||
<div class="dialog-footer">
|
||||
<ElButton @click="rejectDialogVisible = false">取消</ElButton>
|
||||
<ElButton type="danger" @click="handleRejectRecharge" :loading="rejectLoading">
|
||||
确认拒绝
|
||||
</ElButton>
|
||||
</div>
|
||||
</template>
|
||||
</ElDialog>
|
||||
|
||||
<!-- 支付凭证预览 -->
|
||||
<PaymentVoucherDialog
|
||||
:file-keys="paymentVoucherFileKeys"
|
||||
@@ -198,7 +230,8 @@
|
||||
AgentRechargeStatus,
|
||||
AgentRechargePaymentMethod,
|
||||
CreateAgentRechargeRequest,
|
||||
ConfirmOfflinePaymentRequest
|
||||
ConfirmOfflinePaymentRequest,
|
||||
RejectAgentRechargeRequest
|
||||
} from '@/types/api'
|
||||
import type { SearchFormItem } from '@/types'
|
||||
import { useCheckedColumns } from '@/composables/useCheckedColumns'
|
||||
@@ -207,6 +240,7 @@
|
||||
import { useAuth } from '@/composables/useAuth'
|
||||
import PaymentVoucherDialog from '@/components/business/PaymentVoucherDialog.vue'
|
||||
import VoucherUpload from '@/components/business/VoucherUpload.vue'
|
||||
import { buildAgentRechargeActions } from './agentRechargeActions'
|
||||
|
||||
defineOptions({ name: 'AgentRechargeList' })
|
||||
|
||||
@@ -217,9 +251,11 @@
|
||||
const createLoading = ref(false)
|
||||
const voucherUploading = ref(false)
|
||||
const confirmPayLoading = ref(false)
|
||||
const rejectLoading = ref(false)
|
||||
const tableRef = ref()
|
||||
const createDialogVisible = ref(false)
|
||||
const confirmPayDialogVisible = ref(false)
|
||||
const rejectDialogVisible = ref(false)
|
||||
const currentRecharge = ref<AgentRecharge | null>(null)
|
||||
const paymentVoucherFileKeys = ref<string[]>([])
|
||||
|
||||
@@ -337,6 +373,7 @@
|
||||
|
||||
const createFormRef = ref<FormInstance>()
|
||||
const confirmPayFormRef = ref<FormInstance>()
|
||||
const rejectFormRef = ref<FormInstance>()
|
||||
const uploadRef = ref<InstanceType<typeof VoucherUpload>>()
|
||||
const MIN_RECHARGE_AMOUNT = 0.01
|
||||
|
||||
@@ -374,6 +411,10 @@
|
||||
]
|
||||
})
|
||||
|
||||
const rejectRules = reactive<FormRules>({
|
||||
reject_reason: [{ required: true, message: '请输入拒绝原因', trigger: 'blur' }]
|
||||
})
|
||||
|
||||
const createForm = reactive<{
|
||||
amount: number
|
||||
payment_method: string
|
||||
@@ -392,6 +433,10 @@
|
||||
operation_password: ''
|
||||
})
|
||||
|
||||
const rejectForm = reactive<RejectAgentRechargeRequest>({
|
||||
reject_reason: ''
|
||||
})
|
||||
|
||||
const rechargeList = ref<AgentRecharge[]>([])
|
||||
|
||||
// 格式化货币 - 将分转换为元
|
||||
@@ -735,6 +780,44 @@
|
||||
})
|
||||
}
|
||||
|
||||
// 显示拒绝对话框
|
||||
const handleShowReject = (row: AgentRecharge) => {
|
||||
currentRecharge.value = row
|
||||
rejectDialogVisible.value = true
|
||||
}
|
||||
|
||||
// 拒绝对话框关闭后的清理
|
||||
const handleRejectDialogClosed = () => {
|
||||
rejectFormRef.value?.resetFields()
|
||||
rejectForm.reject_reason = ''
|
||||
currentRecharge.value = null
|
||||
}
|
||||
|
||||
// 拒绝代理充值订单
|
||||
const handleRejectRecharge = async () => {
|
||||
const formRef = rejectFormRef.value
|
||||
const recharge = currentRecharge.value
|
||||
if (!formRef || !recharge) return
|
||||
|
||||
await formRef.validate(async (valid) => {
|
||||
if (valid) {
|
||||
rejectLoading.value = true
|
||||
try {
|
||||
await AgentRechargeService.rejectAgentRecharge(recharge.id, {
|
||||
reject_reason: rejectForm.reject_reason
|
||||
})
|
||||
ElMessage.success('拒绝成功')
|
||||
rejectDialogVisible.value = false
|
||||
await getTableData()
|
||||
} catch (error) {
|
||||
console.error(error)
|
||||
} finally {
|
||||
rejectLoading.value = false
|
||||
}
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
// 处理名称点击
|
||||
const handleNameClick = (row: AgentRecharge) => {
|
||||
if (hasAuth('agent_recharge:detail_page')) {
|
||||
@@ -754,35 +837,12 @@
|
||||
|
||||
// 获取操作按钮
|
||||
const getActions = (row: AgentRecharge) => {
|
||||
const actions: any[] = []
|
||||
|
||||
// 线下支付且有凭证可以查看
|
||||
if (
|
||||
row.payment_method === 'offline' &&
|
||||
hasVoucherKeys(row.payment_voucher_key) &&
|
||||
hasAuth('agent_recharge:view_payment_voucher')
|
||||
) {
|
||||
actions.push({
|
||||
label: '查看支付凭证',
|
||||
handler: () => handleViewPaymentVoucher(row),
|
||||
type: 'primary'
|
||||
})
|
||||
}
|
||||
|
||||
// 待支付且线下转账的订单可以确认支付
|
||||
if (
|
||||
row.status === 1 &&
|
||||
row.payment_method === 'offline' &&
|
||||
hasAuth('agent_recharge:confirm_payment')
|
||||
) {
|
||||
actions.push({
|
||||
label: '确认支付',
|
||||
handler: () => handleShowConfirmPay(row),
|
||||
type: 'primary'
|
||||
})
|
||||
}
|
||||
|
||||
return actions
|
||||
return buildAgentRechargeActions(row, {
|
||||
hasAuth,
|
||||
onViewPaymentVoucher: handleViewPaymentVoucher,
|
||||
onConfirmPayment: handleShowConfirmPay,
|
||||
onReject: handleShowReject
|
||||
})
|
||||
}
|
||||
|
||||
// 查看支付凭证
|
||||
|
||||
Reference in New Issue
Block a user