This commit is contained in:
@@ -104,9 +104,22 @@
|
|||||||
refund_reason: ''
|
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>({
|
const formRules = reactive<FormRules>({
|
||||||
order_id: [{ required: true, message: '请选择订单', trigger: 'change' }],
|
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)
|
const hasInitialOrder = computed(() => !!props.initialOrderId || !!props.initialOrderNo)
|
||||||
|
|||||||
@@ -82,6 +82,7 @@ export interface OrderQueryParams {
|
|||||||
start_time?: string
|
start_time?: string
|
||||||
end_time?: string
|
end_time?: string
|
||||||
is_expired?: boolean // 是否已过期
|
is_expired?: boolean // 是否已过期
|
||||||
|
seller_shop_id?: number // 所属代理商ID(销售来源店铺ID)
|
||||||
dateRange?: string[] | any // For date range picker in UI
|
dateRange?: string[] | any // For date range picker in UI
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -280,7 +280,9 @@
|
|||||||
})),
|
})),
|
||||||
config: {
|
config: {
|
||||||
clearable: true,
|
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) => {
|
const handleShopChange = (value: any) => {
|
||||||
if (Array.isArray(value) && value.length > 0) {
|
if (Array.isArray(value) && value.length > 0) {
|
||||||
|
|||||||
@@ -319,7 +319,8 @@
|
|||||||
CardService,
|
CardService,
|
||||||
DeviceService,
|
DeviceService,
|
||||||
PackageManageService,
|
PackageManageService,
|
||||||
StorageService
|
StorageService,
|
||||||
|
ShopService
|
||||||
} from '@/api/modules'
|
} from '@/api/modules'
|
||||||
import { ElMessage, ElMessageBox, ElTag } from 'element-plus'
|
import { ElMessage, ElMessageBox, ElTag } from 'element-plus'
|
||||||
import { Plus } from '@element-plus/icons-vue'
|
import { Plus } from '@element-plus/icons-vue'
|
||||||
@@ -369,6 +370,7 @@
|
|||||||
purchase_role: undefined,
|
purchase_role: undefined,
|
||||||
identifier: '',
|
identifier: '',
|
||||||
is_expired: undefined,
|
is_expired: undefined,
|
||||||
|
seller_shop_id: undefined,
|
||||||
start_time: '',
|
start_time: '',
|
||||||
end_time: ''
|
end_time: ''
|
||||||
}
|
}
|
||||||
@@ -376,6 +378,28 @@
|
|||||||
// 搜索表单
|
// 搜索表单
|
||||||
const searchForm = reactive<OrderQueryParams>({ ...initialSearchState })
|
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 getPurchaseRoleText = (role: string): string => {
|
||||||
const roleMap: Record<string, string> = {
|
const roleMap: Record<string, string> = {
|
||||||
@@ -404,10 +428,10 @@
|
|||||||
label: '资产标识符',
|
label: '资产标识符',
|
||||||
prop: 'identifier',
|
prop: 'identifier',
|
||||||
type: 'input',
|
type: 'input',
|
||||||
placeholder: 'ICCID 或 VirtualNo',
|
|
||||||
config: {
|
config: {
|
||||||
maxlength: 30,
|
maxlength: 30,
|
||||||
clearable: true
|
clearable: true,
|
||||||
|
placeholder: 'ICCID/VirtualNo/IMEI/SN/MSISDN'
|
||||||
},
|
},
|
||||||
labelWidth: '100'
|
labelWidth: '100'
|
||||||
},
|
},
|
||||||
@@ -478,6 +502,23 @@
|
|||||||
clearable: true
|
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: '订单渠道',
|
label: '订单渠道',
|
||||||
prop: 'purchase_role',
|
prop: 'purchase_role',
|
||||||
@@ -970,6 +1011,7 @@
|
|||||||
purchase_role: searchForm.purchase_role,
|
purchase_role: searchForm.purchase_role,
|
||||||
identifier: searchForm.identifier || undefined,
|
identifier: searchForm.identifier || undefined,
|
||||||
is_expired: searchForm.is_expired,
|
is_expired: searchForm.is_expired,
|
||||||
|
seller_shop_id: searchForm.seller_shop_id,
|
||||||
start_time: searchForm.start_time || undefined,
|
start_time: searchForm.start_time || undefined,
|
||||||
end_time: searchForm.end_time || undefined
|
end_time: searchForm.end_time || undefined
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -293,68 +293,70 @@
|
|||||||
<ElInput v-model="form.oa_oauth_redirect_url" placeholder="请输入OAuth回调地址" />
|
<ElInput v-model="form.oa_oauth_redirect_url" placeholder="请输入OAuth回调地址" />
|
||||||
</ElFormItem>
|
</ElFormItem>
|
||||||
|
|
||||||
<ElDivider content-position="left">
|
<template v-if="form.provider_type !== 'fuiou'">
|
||||||
<span class="divider-title">微信配置</span>
|
<ElDivider content-position="left">
|
||||||
</ElDivider>
|
<span class="divider-title">微信配置</span>
|
||||||
<ElRow :gutter="20">
|
</ElDivider>
|
||||||
<ElCol :span="12">
|
<ElRow :gutter="20">
|
||||||
<ElFormItem label="微信商户号" prop="wx_mch_id">
|
<ElCol :span="12">
|
||||||
<ElInput v-model="form.wx_mch_id" placeholder="请输入微信商户号" />
|
<ElFormItem label="微信商户号" prop="wx_mch_id">
|
||||||
</ElFormItem>
|
<ElInput v-model="form.wx_mch_id" placeholder="请输入微信商户号" />
|
||||||
</ElCol>
|
</ElFormItem>
|
||||||
<ElCol :span="12">
|
</ElCol>
|
||||||
<ElFormItem label="证书序列号" prop="wx_serial_no">
|
<ElCol :span="12">
|
||||||
<ElInput v-model="form.wx_serial_no" placeholder="请输入微信证书序列号" />
|
<ElFormItem label="证书序列号" prop="wx_serial_no">
|
||||||
</ElFormItem>
|
<ElInput v-model="form.wx_serial_no" placeholder="请输入微信证书序列号" />
|
||||||
</ElCol>
|
</ElFormItem>
|
||||||
</ElRow>
|
</ElCol>
|
||||||
<ElRow :gutter="20">
|
</ElRow>
|
||||||
<ElCol :span="12">
|
<ElRow :gutter="20">
|
||||||
<ElFormItem label="APIv2密钥" prop="wx_api_v2_key">
|
<ElCol :span="12">
|
||||||
<ElInput
|
<ElFormItem label="APIv2密钥" prop="wx_api_v2_key">
|
||||||
v-model="form.wx_api_v2_key"
|
<ElInput
|
||||||
type="password"
|
v-model="form.wx_api_v2_key"
|
||||||
show-password
|
type="password"
|
||||||
placeholder="请输入微信APIv2密钥"
|
show-password
|
||||||
/>
|
placeholder="请输入微信APIv2密钥"
|
||||||
</ElFormItem>
|
/>
|
||||||
</ElCol>
|
</ElFormItem>
|
||||||
<ElCol :span="12">
|
</ElCol>
|
||||||
<ElFormItem label="APIv3密钥" prop="wx_api_v3_key">
|
<ElCol :span="12">
|
||||||
<ElInput
|
<ElFormItem label="APIv3密钥" prop="wx_api_v3_key">
|
||||||
v-model="form.wx_api_v3_key"
|
<ElInput
|
||||||
type="password"
|
v-model="form.wx_api_v3_key"
|
||||||
show-password
|
type="password"
|
||||||
placeholder="请输入微信APIv3密钥"
|
show-password
|
||||||
/>
|
placeholder="请输入微信APIv3密钥"
|
||||||
</ElFormItem>
|
/>
|
||||||
</ElCol>
|
</ElFormItem>
|
||||||
</ElRow>
|
</ElCol>
|
||||||
<ElFormItem label="支付回调地址" prop="wx_notify_url">
|
</ElRow>
|
||||||
<ElInput v-model="form.wx_notify_url" placeholder="请输入微信支付回调地址" />
|
<ElFormItem label="支付回调地址" prop="wx_notify_url">
|
||||||
</ElFormItem>
|
<ElInput v-model="form.wx_notify_url" placeholder="请输入微信支付回调地址" />
|
||||||
<ElRow :gutter="20">
|
</ElFormItem>
|
||||||
<ElCol :span="12">
|
<ElRow :gutter="20">
|
||||||
<ElFormItem label="支付证书" prop="wx_cert_content">
|
<ElCol :span="12">
|
||||||
<ElInput
|
<ElFormItem label="支付证书" prop="wx_cert_content">
|
||||||
v-model="form.wx_cert_content"
|
<ElInput
|
||||||
type="textarea"
|
v-model="form.wx_cert_content"
|
||||||
:rows="3"
|
type="textarea"
|
||||||
placeholder="请粘贴PEM格式证书内容"
|
:rows="3"
|
||||||
/>
|
placeholder="请粘贴PEM格式证书内容"
|
||||||
</ElFormItem>
|
/>
|
||||||
</ElCol>
|
</ElFormItem>
|
||||||
<ElCol :span="12">
|
</ElCol>
|
||||||
<ElFormItem label="支付密钥" prop="wx_key_content">
|
<ElCol :span="12">
|
||||||
<ElInput
|
<ElFormItem label="支付密钥" prop="wx_key_content">
|
||||||
v-model="form.wx_key_content"
|
<ElInput
|
||||||
type="textarea"
|
v-model="form.wx_key_content"
|
||||||
:rows="3"
|
type="textarea"
|
||||||
placeholder="请粘贴PEM格式密钥内容"
|
:rows="3"
|
||||||
/>
|
placeholder="请粘贴PEM格式密钥内容"
|
||||||
</ElFormItem>
|
/>
|
||||||
</ElCol>
|
</ElFormItem>
|
||||||
</ElRow>
|
</ElCol>
|
||||||
|
</ElRow>
|
||||||
|
</template>
|
||||||
|
|
||||||
<ElDivider content-position="left">
|
<ElDivider content-position="left">
|
||||||
<span class="divider-title">富友支付配置</span>
|
<span class="divider-title">富友支付配置</span>
|
||||||
@@ -900,6 +902,7 @@
|
|||||||
} else {
|
} else {
|
||||||
const data: UpdateWechatConfigRequest = {
|
const data: UpdateWechatConfigRequest = {
|
||||||
name: form.name,
|
name: form.name,
|
||||||
|
provider_type: form.provider_type,
|
||||||
description: form.description || undefined
|
description: form.description || undefined
|
||||||
}
|
}
|
||||||
// 只有填写了有效的新值才更新敏感字段(不是空值且不是脱敏数据)
|
// 只有填写了有效的新值才更新敏感字段(不是空值且不是脱敏数据)
|
||||||
|
|||||||
Reference in New Issue
Block a user