fix: pay
All checks were successful
构建并部署前端到测试环境 / build-and-deploy (push) Successful in 5m0s

This commit is contained in:
sexygoat
2026-04-24 11:17:39 +08:00
parent 62851342c3
commit e4ed3784e3
5 changed files with 147 additions and 67 deletions

View File

@@ -104,9 +104,22 @@
refund_reason: ''
})
const validateRefundAmount = (rule: any, value: number, callback: any) => {
if (value === undefined || value === null || value === 0) {
callback(new Error('请输入申请退款金额'))
} else if (value > formData.actual_received_amount) {
callback(new Error('申请退款金额不能大于实收金额'))
} else {
callback()
}
}
const formRules = reactive<FormRules>({
order_id: [{ required: true, message: '请选择订单', trigger: 'change' }],
requested_refund_amount: [{ required: true, message: '请输入申请退款金额', trigger: 'blur' }]
requested_refund_amount: [
{ required: true, message: '请输入申请退款金额', trigger: 'blur' },
{ validator: validateRefundAmount, trigger: 'blur' }
]
})
const hasInitialOrder = computed(() => !!props.initialOrderId || !!props.initialOrderNo)

View File

@@ -82,6 +82,7 @@ export interface OrderQueryParams {
start_time?: string
end_time?: string
is_expired?: boolean // 是否已过期
seller_shop_id?: number // 所属代理商ID销售来源店铺ID
dateRange?: string[] | any // For date range picker in UI
}

View File

@@ -280,7 +280,9 @@
})),
config: {
clearable: true,
filterable: true
filterable: true,
remote: true,
remoteMethod: (query: string) => searchShops(query)
}
},
{
@@ -534,6 +536,25 @@
}
}
// 搜索店铺(用于搜索表单远程搜索)
const searchShops = async (query: string) => {
try {
const params: any = {
page: 1,
page_size: 20
}
if (query) {
params.shop_name = query
}
const res = await ShopService.getShops(params)
if (res.code === 0) {
shopOptions.value = res.data.items || []
}
} catch (error) {
console.error('Search shops failed:', error)
}
}
// 处理店铺选择变化
const handleShopChange = (value: any) => {
if (Array.isArray(value) && value.length > 0) {

View File

@@ -319,7 +319,8 @@
CardService,
DeviceService,
PackageManageService,
StorageService
StorageService,
ShopService
} from '@/api/modules'
import { ElMessage, ElMessageBox, ElTag } from 'element-plus'
import { Plus } from '@element-plus/icons-vue'
@@ -369,6 +370,7 @@
purchase_role: undefined,
identifier: '',
is_expired: undefined,
seller_shop_id: undefined,
start_time: '',
end_time: ''
}
@@ -376,6 +378,28 @@
// 搜索表单
const searchForm = reactive<OrderQueryParams>({ ...initialSearchState })
// 店铺列表(用于代理商搜索)
const shopOptions = ref<any[]>([])
// 搜索代理商
const searchShops = async (query: string) => {
try {
const params: any = {
page: 1,
page_size: 20
}
if (query) {
params.shop_name = query
}
const res = await ShopService.getShops(params)
if (res.code === 0) {
shopOptions.value = res.data.items || []
}
} catch (error) {
console.error('Search shops failed:', error)
}
}
// 获取订单角色文本
const getPurchaseRoleText = (role: string): string => {
const roleMap: Record<string, string> = {
@@ -404,10 +428,10 @@
label: '资产标识符',
prop: 'identifier',
type: 'input',
placeholder: 'ICCID 或 VirtualNo',
config: {
maxlength: 30,
clearable: true
clearable: true,
placeholder: 'ICCID/VirtualNo/IMEI/SN/MSISDN'
},
labelWidth: '100'
},
@@ -478,6 +502,23 @@
clearable: true
}
},
{
label: '所属代理商',
prop: 'seller_shop_id',
type: 'select',
placeholder: '请选择所属代理商',
options: () =>
shopOptions.value.map((shop) => ({
label: shop.shop_name,
value: shop.id
})),
config: {
clearable: true,
filterable: true,
remote: true,
remoteMethod: (query: string) => searchShops(query)
}
},
{
label: '订单渠道',
prop: 'purchase_role',
@@ -970,6 +1011,7 @@
purchase_role: searchForm.purchase_role,
identifier: searchForm.identifier || undefined,
is_expired: searchForm.is_expired,
seller_shop_id: searchForm.seller_shop_id,
start_time: searchForm.start_time || undefined,
end_time: searchForm.end_time || undefined
}

View File

@@ -293,68 +293,70 @@
<ElInput v-model="form.oa_oauth_redirect_url" placeholder="请输入OAuth回调地址" />
</ElFormItem>
<ElDivider content-position="left">
<span class="divider-title">微信配置</span>
</ElDivider>
<ElRow :gutter="20">
<ElCol :span="12">
<ElFormItem label="微信商户号" prop="wx_mch_id">
<ElInput v-model="form.wx_mch_id" placeholder="请输入微信商户号" />
</ElFormItem>
</ElCol>
<ElCol :span="12">
<ElFormItem label="证书序列号" prop="wx_serial_no">
<ElInput v-model="form.wx_serial_no" placeholder="请输入微信证书序列号" />
</ElFormItem>
</ElCol>
</ElRow>
<ElRow :gutter="20">
<ElCol :span="12">
<ElFormItem label="APIv2密钥" prop="wx_api_v2_key">
<ElInput
v-model="form.wx_api_v2_key"
type="password"
show-password
placeholder="请输入微信APIv2密钥"
/>
</ElFormItem>
</ElCol>
<ElCol :span="12">
<ElFormItem label="APIv3密钥" prop="wx_api_v3_key">
<ElInput
v-model="form.wx_api_v3_key"
type="password"
show-password
placeholder="请输入微信APIv3密钥"
/>
</ElFormItem>
</ElCol>
</ElRow>
<ElFormItem label="支付回调地址" prop="wx_notify_url">
<ElInput v-model="form.wx_notify_url" placeholder="请输入微信支付回调地址" />
</ElFormItem>
<ElRow :gutter="20">
<ElCol :span="12">
<ElFormItem label="支付证书" prop="wx_cert_content">
<ElInput
v-model="form.wx_cert_content"
type="textarea"
:rows="3"
placeholder="请粘贴PEM格式证书内容"
/>
</ElFormItem>
</ElCol>
<ElCol :span="12">
<ElFormItem label="支付密钥" prop="wx_key_content">
<ElInput
v-model="form.wx_key_content"
type="textarea"
:rows="3"
placeholder="请粘贴PEM格式密钥内容"
/>
</ElFormItem>
</ElCol>
</ElRow>
<template v-if="form.provider_type !== 'fuiou'">
<ElDivider content-position="left">
<span class="divider-title">微信配置</span>
</ElDivider>
<ElRow :gutter="20">
<ElCol :span="12">
<ElFormItem label="微信商户号" prop="wx_mch_id">
<ElInput v-model="form.wx_mch_id" placeholder="请输入微信商户号" />
</ElFormItem>
</ElCol>
<ElCol :span="12">
<ElFormItem label="证书序列号" prop="wx_serial_no">
<ElInput v-model="form.wx_serial_no" placeholder="请输入微信证书序列号" />
</ElFormItem>
</ElCol>
</ElRow>
<ElRow :gutter="20">
<ElCol :span="12">
<ElFormItem label="APIv2密钥" prop="wx_api_v2_key">
<ElInput
v-model="form.wx_api_v2_key"
type="password"
show-password
placeholder="请输入微信APIv2密钥"
/>
</ElFormItem>
</ElCol>
<ElCol :span="12">
<ElFormItem label="APIv3密钥" prop="wx_api_v3_key">
<ElInput
v-model="form.wx_api_v3_key"
type="password"
show-password
placeholder="请输入微信APIv3密钥"
/>
</ElFormItem>
</ElCol>
</ElRow>
<ElFormItem label="支付回调地址" prop="wx_notify_url">
<ElInput v-model="form.wx_notify_url" placeholder="请输入微信支付回调地址" />
</ElFormItem>
<ElRow :gutter="20">
<ElCol :span="12">
<ElFormItem label="支付证书" prop="wx_cert_content">
<ElInput
v-model="form.wx_cert_content"
type="textarea"
:rows="3"
placeholder="请粘贴PEM格式证书内容"
/>
</ElFormItem>
</ElCol>
<ElCol :span="12">
<ElFormItem label="支付密钥" prop="wx_key_content">
<ElInput
v-model="form.wx_key_content"
type="textarea"
:rows="3"
placeholder="请粘贴PEM格式密钥内容"
/>
</ElFormItem>
</ElCol>
</ElRow>
</template>
<ElDivider content-position="left">
<span class="divider-title">富友支付配置</span>
@@ -900,6 +902,7 @@
} else {
const data: UpdateWechatConfigRequest = {
name: form.name,
provider_type: form.provider_type,
description: form.description || undefined
}
// 只有填写了有效的新值才更新敏感字段(不是空值且不是脱敏数据)