让凭证数组与套餐作废任务进入可联调状态
All checks were successful
构建并部署前端到测试环境 / build-and-deploy (push) Successful in 7m52s
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:
@@ -20,7 +20,7 @@
|
||||
style="width: 100%"
|
||||
>
|
||||
<template v-if="!props.seriesId">
|
||||
<ElOption :value="null" disabled>
|
||||
<ElOption value="__NO_PACKAGE__" disabled>
|
||||
<span style="color: var(--el-text-color-warning)">
|
||||
该设备未关联套餐系列,无法购买套餐
|
||||
</span>
|
||||
@@ -125,6 +125,7 @@
|
||||
import type { CreateOrderRequest, PackageResponse } from '@/types/api'
|
||||
import { useUserStore } from '@/store/modules/user'
|
||||
import VoucherUpload from '@/components/business/VoucherUpload.vue'
|
||||
import { hasVoucherKeys, toVoucherKeyList } from '@/utils/business'
|
||||
|
||||
interface Props {
|
||||
modelValue: boolean
|
||||
@@ -154,7 +155,7 @@
|
||||
const form = reactive({
|
||||
package_id: undefined as number | undefined,
|
||||
payment_method: 'wallet' as 'wallet' | 'offline',
|
||||
payment_voucher_key: undefined as string | undefined
|
||||
payment_voucher_key: [] as string[]
|
||||
})
|
||||
|
||||
const rules = computed<FormRules>(() => {
|
||||
@@ -317,7 +318,7 @@
|
||||
return
|
||||
}
|
||||
|
||||
if (form.payment_method === 'offline' && !form.payment_voucher_key) {
|
||||
if (form.payment_method === 'offline' && !hasVoucherKeys(form.payment_voucher_key)) {
|
||||
ElMessage.error('线下支付必须上传支付凭证')
|
||||
return
|
||||
}
|
||||
@@ -331,8 +332,8 @@
|
||||
payment_method: form.payment_method
|
||||
}
|
||||
|
||||
if (form.payment_method === 'offline' && form.payment_voucher_key) {
|
||||
data.payment_voucher_key = form.payment_voucher_key
|
||||
if (form.payment_method === 'offline' && hasVoucherKeys(form.payment_voucher_key)) {
|
||||
data.payment_voucher_key = toVoucherKeyList(form.payment_voucher_key)
|
||||
}
|
||||
|
||||
await OrderService.createOrder(data)
|
||||
@@ -360,7 +361,7 @@
|
||||
formRef.value?.resetFields()
|
||||
form.package_id = undefined
|
||||
form.payment_method = 'wallet'
|
||||
form.payment_voucher_key = undefined
|
||||
form.payment_voucher_key = []
|
||||
voucherUploading.value = false
|
||||
packageOptions.value = []
|
||||
packagesEmptyWithSeriesId.value = false
|
||||
|
||||
Reference in New Issue
Block a user