让凭证数组与套餐作废任务进入可联调状态
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

@@ -103,6 +103,16 @@
@change="createFormRef?.validateField('payment_voucher_key')"
/>
</ElFormItem>
<ElFormItem label="运营备注" prop="remark">
<ElInput
v-model="createForm.remark"
type="textarea"
:rows="3"
maxlength="1000"
show-word-limit
placeholder="请输入运营备注(可选)"
/>
</ElFormItem>
</ElForm>
<template #footer>
<div class="dialog-footer">
@@ -159,8 +169,8 @@
<!-- 支付凭证预览 -->
<PaymentVoucherDialog
:file-key="paymentVoucherFileKey"
@close="paymentVoucherFileKey = ''"
:file-keys="paymentVoucherFileKeys"
@close="paymentVoucherFileKeys = []"
/>
</ElCard>
</div>
@@ -176,6 +186,7 @@
ElTag,
ElButton,
ElCascader,
ElInput,
ElInputNumber,
ElSelect,
ElOption
@@ -192,6 +203,7 @@
import type { SearchFormItem } from '@/types'
import { useCheckedColumns } from '@/composables/useCheckedColumns'
import { formatDateTime } from '@/utils/business/format'
import { hasVoucherKeys, toVoucherKeyList } from '@/utils/business'
import { useAuth } from '@/composables/useAuth'
import PaymentVoucherDialog from '@/components/business/PaymentVoucherDialog.vue'
import VoucherUpload from '@/components/business/VoucherUpload.vue'
@@ -209,7 +221,7 @@
const createDialogVisible = ref(false)
const confirmPayDialogVisible = ref(false)
const currentRecharge = ref<AgentRecharge | null>(null)
const paymentVoucherFileKey = ref('')
const paymentVoucherFileKeys = ref<string[]>([])
// 搜索表单初始值
const initialSearchState: AgentRechargeQueryParams = {
@@ -366,12 +378,14 @@
amount: number
payment_method: string
shop_id: number | null
payment_voucher_key?: string
payment_voucher_key: string[]
remark: string
}>({
amount: MIN_RECHARGE_AMOUNT,
payment_method: '',
shop_id: null,
payment_voucher_key: undefined
payment_voucher_key: [],
remark: ''
})
const confirmPayForm = reactive<ConfirmOfflinePaymentRequest>({
@@ -475,6 +489,13 @@
width: 120,
formatter: (row: AgentRecharge) => row.payment_channel || '-'
},
{
prop: 'remark',
label: '运营备注',
minWidth: 180,
showOverflowTooltip: true,
formatter: (row: AgentRecharge) => row.remark || '-'
},
{
prop: 'created_at',
label: '创建时间',
@@ -628,7 +649,8 @@
createForm.amount = MIN_RECHARGE_AMOUNT
createForm.payment_method = ''
createForm.shop_id = null
createForm.payment_voucher_key = undefined
createForm.payment_voucher_key = []
createForm.remark = ''
voucherUploading.value = false
uploadRef.value?.clearFiles(false)
}
@@ -649,11 +671,15 @@
const data: CreateAgentRechargeRequest = {
amount: Math.round(createForm.amount * 100), // 元转分
payment_method: createForm.payment_method as AgentRechargePaymentMethod,
shop_id: createForm.shop_id!
shop_id: createForm.shop_id!,
remark: createForm.remark || undefined
}
if (createForm.payment_method === 'offline' && createForm.payment_voucher_key) {
data.payment_voucher_key = createForm.payment_voucher_key
if (
createForm.payment_method === 'offline' &&
hasVoucherKeys(createForm.payment_voucher_key)
) {
data.payment_voucher_key = toVoucherKeyList(createForm.payment_voucher_key)
}
await AgentRechargeService.createAgentRecharge(data)
@@ -733,7 +759,7 @@
// 线下支付且有凭证可以查看
if (
row.payment_method === 'offline' &&
row.payment_voucher_key &&
hasVoucherKeys(row.payment_voucher_key) &&
hasAuth('agent_recharge:view_payment_voucher')
) {
actions.push({
@@ -761,8 +787,8 @@
// 查看支付凭证
const handleViewPaymentVoucher = (row: AgentRecharge) => {
if (!row.payment_voucher_key) return
paymentVoucherFileKey.value = row.payment_voucher_key
if (!hasVoucherKeys(row.payment_voucher_key)) return
paymentVoucherFileKeys.value = toVoucherKeyList(row.payment_voucher_key)
}
</script>