让凭证数组与套餐作废任务进入可联调状态
All checks were successful
构建并部署前端到测试环境 / build-and-deploy (push) Successful in 7m52s

Constraint: 后端订单套餐作废接口使用 /api/admin/order-package-invalidate-tasks,上传
  purpose 只能使用 attachment。
  Rejected: 继续提交逗号拼接凭证字符串 | 新提交路径必须使用 string[],历史字符串只做读取归一化。
  Confidence: high
  Scope-risk: broad
  Directive: 新增订单套餐作废权限时需同时配置菜单 URL 与
  order_package_invalidate_task:create/detail 按钮权限。
  Tested: bun run build;development 真实后端联调上传、创建、列表、详情通过;复机接口未触发。
  Not-tested: 未逐一手工覆盖所有历史凭证数据、全部角色权限组合和所有文件扩展名预览
This commit is contained in:
2026-06-23 09:50:12 +08:00
parent ebf9739f06
commit 0c3065f970
71 changed files with 4264 additions and 240 deletions

View File

@@ -22,7 +22,7 @@
</div>
</ElCard>
<PaymentVoucherDialog :file-key="refundVoucherFileKey" @close="refundVoucherFileKey = ''" />
<PaymentVoucherDialog :file-keys="refundVoucherFileKeys" @close="refundVoucherFileKeys = []" />
<!-- 审批通过对话框 -->
<ElDialog
@@ -150,12 +150,26 @@
placeholder="请输入退款原因"
/>
</ElFormItem>
<ElFormItem label="退款凭证" prop="refund_voucher_key">
<VoucherUpload
ref="resubmitUploadRef"
v-model="resubmitForm.refund_voucher_key"
voucher-name="退款凭证"
@uploading-change="resubmitVoucherUploading = $event"
@change="resubmitFormRef?.validateField('refund_voucher_key')"
/>
</ElFormItem>
</ElForm>
<template #footer>
<div class="dialog-footer">
<ElButton @click="resubmitDialogVisible = false">取消</ElButton>
<ElButton type="primary" @click="handleResubmitRefund" :loading="resubmitLoading">
确认提交
<ElButton
type="primary"
@click="handleResubmitRefund"
:loading="resubmitLoading || resubmitVoucherUploading"
:disabled="resubmitVoucherUploading"
>
{{ resubmitVoucherUploading ? '凭证上传中...' : '确认提交' }}
</ElButton>
</div>
</template>
@@ -179,7 +193,9 @@
ResubmitRefundRequest
} from '@/types/api'
import { formatDateTime, yuanToFen } from '@/utils/business/format'
import { hasVoucherKeys, toVoucherKeyList } from '@/utils/business'
import PaymentVoucherDialog from '@/components/business/PaymentVoucherDialog.vue'
import VoucherUpload from '@/components/business/VoucherUpload.vue'
defineOptions({ name: 'RefundDetail' })
@@ -188,7 +204,7 @@
const loading = ref(false)
const refund = ref<Refund | null>(null)
const refundVoucherFileKey = ref('')
const refundVoucherFileKeys = ref<string[]>([])
const pageTitle = computed(() => `退款详情`)
@@ -199,10 +215,12 @@
const approveLoading = ref(false)
const rejectLoading = ref(false)
const resubmitLoading = ref(false)
const resubmitVoucherUploading = ref(false)
const approveFormRef = ref()
const rejectFormRef = ref()
const resubmitFormRef = ref()
const resubmitUploadRef = ref<InstanceType<typeof VoucherUpload>>()
const approveRules = ref()
const rejectRules = ref({
@@ -222,10 +240,12 @@
const resubmitForm = reactive<{
requested_refund_amount?: number
actual_received_amount?: number
refund_voucher_key: string[]
refund_reason?: string
}>({
requested_refund_amount: undefined,
actual_received_amount: undefined,
refund_voucher_key: [],
refund_reason: ''
})
@@ -295,14 +315,14 @@
label: '退款凭证',
fullWidth: true,
render: (data) =>
data.refund_voucher_key
hasVoucherKeys(data.refund_voucher_key)
? h(
ElButton,
{
type: 'primary',
link: true,
onClick: () => {
refundVoucherFileKey.value = data.refund_voucher_key
refundVoucherFileKeys.value = toVoucherKeyList(data.refund_voucher_key)
}
},
() => '查看退款凭证'
@@ -411,7 +431,10 @@
resubmitFormRef.value?.resetFields()
resubmitForm.requested_refund_amount = undefined
resubmitForm.actual_received_amount = undefined
resubmitForm.refund_voucher_key = []
resubmitForm.refund_reason = ''
resubmitVoucherUploading.value = false
resubmitUploadRef.value?.clearFiles(false)
}
const handleApproveRefund = async () => {
@@ -463,6 +486,10 @@
const handleResubmitRefund = async () => {
if (!resubmitFormRef.value || !refund.value) return
if (resubmitVoucherUploading.value) {
ElMessage.warning('退款凭证上传中,请稍候')
return
}
const refundId = refund.value.id
await resubmitFormRef.value.validate(async (valid: boolean) => {
@@ -474,6 +501,9 @@
actual_received_amount: yuanToFen(resubmitForm.actual_received_amount),
refund_reason: resubmitForm.refund_reason || undefined
}
if (hasVoucherKeys(resubmitForm.refund_voucher_key)) {
data.refund_voucher_key = toVoucherKeyList(resubmitForm.refund_voucher_key)
}
await RefundService.resubmitRefund(refundId, data)
ElMessage.success('重新提交成功')