This commit is contained in:
@@ -11,13 +11,6 @@
|
|||||||
<ElRadio value="after_order">先购买后实名</ElRadio>
|
<ElRadio value="after_order">先购买后实名</ElRadio>
|
||||||
</ElRadioGroup>
|
</ElRadioGroup>
|
||||||
</ElFormItem>
|
</ElFormItem>
|
||||||
<ElAlert
|
|
||||||
v-if="devicePolicyHint"
|
|
||||||
title="实际H5流程由设备策略决定"
|
|
||||||
type="info"
|
|
||||||
:closable="false"
|
|
||||||
show-icon
|
|
||||||
/>
|
|
||||||
<ElAlert
|
<ElAlert
|
||||||
v-if="errorMessage"
|
v-if="errorMessage"
|
||||||
:title="errorMessage"
|
:title="errorMessage"
|
||||||
@@ -56,13 +49,11 @@
|
|||||||
assetUnit: string
|
assetUnit: string
|
||||||
loading?: boolean
|
loading?: boolean
|
||||||
errorMessage?: string
|
errorMessage?: string
|
||||||
devicePolicyHint?: boolean
|
|
||||||
}
|
}
|
||||||
|
|
||||||
const props = withDefaults(defineProps<Props>(), {
|
const props = withDefaults(defineProps<Props>(), {
|
||||||
loading: false,
|
loading: false,
|
||||||
errorMessage: '',
|
errorMessage: ''
|
||||||
devicePolicyHint: false
|
|
||||||
})
|
})
|
||||||
|
|
||||||
const emit = defineEmits<{
|
const emit = defineEmits<{
|
||||||
|
|||||||
1
src/template/设备批量任务.csv
Normal file
1
src/template/设备批量任务.csv
Normal file
@@ -0,0 +1 @@
|
|||||||
|
89861590172420377385
|
||||||
|
@@ -155,9 +155,7 @@
|
|||||||
<div class="task-list-toolbar">
|
<div class="task-list-toolbar">
|
||||||
<ElButton
|
<ElButton
|
||||||
v-if="hasAuth(BULK_PURCHASE_PERMISSIONS.template)"
|
v-if="hasAuth(BULK_PURCHASE_PERMISSIONS.template)"
|
||||||
tag="a"
|
@click="downloadTemplate"
|
||||||
href="/templates/bulk-purchase-template.csv"
|
|
||||||
download="批量订购套餐模板.csv"
|
|
||||||
>
|
>
|
||||||
下载模板
|
下载模板
|
||||||
</ElButton>
|
</ElButton>
|
||||||
@@ -306,6 +304,21 @@
|
|||||||
() => submitting.value || voucherUploading.value || orderFileUploading.value
|
() => submitting.value || voucherUploading.value || orderFileUploading.value
|
||||||
)
|
)
|
||||||
|
|
||||||
|
const downloadTemplate = () => {
|
||||||
|
try {
|
||||||
|
const link = document.createElement('a')
|
||||||
|
link.href = new URL('@/template/批量订购套餐模板.csv', import.meta.url).href
|
||||||
|
link.download = '批量订购套餐模板.csv'
|
||||||
|
document.body.appendChild(link)
|
||||||
|
link.click()
|
||||||
|
document.body.removeChild(link)
|
||||||
|
ElMessage.success('模板下载成功')
|
||||||
|
} catch (error) {
|
||||||
|
console.error('下载模板失败:', error)
|
||||||
|
ElMessage.error('模板下载失败')
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
const form = reactive<{
|
const form = reactive<{
|
||||||
series_id?: number
|
series_id?: number
|
||||||
package_id?: number
|
package_id?: number
|
||||||
@@ -526,6 +539,7 @@
|
|||||||
) => {
|
) => {
|
||||||
stopTaskStatusPolling()
|
stopTaskStatusPolling()
|
||||||
const session = taskStatusPollSession
|
const session = taskStatusPollSession
|
||||||
|
let lastStatus = initialStatus
|
||||||
|
|
||||||
const poll = async () => {
|
const poll = async () => {
|
||||||
if (session !== taskStatusPollSession) return
|
if (session !== taskStatusPollSession) return
|
||||||
@@ -537,10 +551,22 @@
|
|||||||
})
|
})
|
||||||
if (response.code === 0) {
|
if (response.code === 0) {
|
||||||
const task = response.data.items.find((item) => (item.task_id ?? item.id) === taskId)
|
const task = response.data.items.find((item) => (item.task_id ?? item.id) === taskId)
|
||||||
if (task && task.status !== initialStatus) {
|
if (task) {
|
||||||
await loadTaskList()
|
if (task.status !== lastStatus) {
|
||||||
stopTaskStatusPolling()
|
lastStatus = task.status
|
||||||
return
|
await loadTaskList()
|
||||||
|
}
|
||||||
|
if (
|
||||||
|
session === taskStatusPollSession &&
|
||||||
|
[
|
||||||
|
BulkPurchaseTaskStatus.COMPLETED,
|
||||||
|
BulkPurchaseTaskStatus.FAILED,
|
||||||
|
BulkPurchaseTaskStatus.CANCELED
|
||||||
|
].includes(task.status)
|
||||||
|
) {
|
||||||
|
stopTaskStatusPolling()
|
||||||
|
return
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
|
|||||||
@@ -391,8 +391,8 @@
|
|||||||
const downloadTemplate = () => {
|
const downloadTemplate = () => {
|
||||||
try {
|
try {
|
||||||
const link = document.createElement('a')
|
const link = document.createElement('a')
|
||||||
link.href = new URL('@/template/批量订购套餐模板.csv', import.meta.url).href
|
link.href = new URL('@/template/设备批量任务.csv', import.meta.url).href
|
||||||
link.download = '批量订购套餐模板.csv'
|
link.download = '设备批量任务.csv'
|
||||||
document.body.appendChild(link)
|
document.body.appendChild(link)
|
||||||
link.click()
|
link.click()
|
||||||
document.body.removeChild(link)
|
document.body.removeChild(link)
|
||||||
@@ -450,6 +450,7 @@
|
|||||||
) => {
|
) => {
|
||||||
stopTaskStatusPolling()
|
stopTaskStatusPolling()
|
||||||
const session = taskStatusPollSession
|
const session = taskStatusPollSession
|
||||||
|
let lastStatus = initialStatus
|
||||||
|
|
||||||
const poll = async () => {
|
const poll = async () => {
|
||||||
if (session !== taskStatusPollSession) return
|
if (session !== taskStatusPollSession) return
|
||||||
@@ -461,10 +462,20 @@
|
|||||||
})
|
})
|
||||||
if (response.code === 0) {
|
if (response.code === 0) {
|
||||||
const task = response.data.items.find((item) => item.id === taskId)
|
const task = response.data.items.find((item) => item.id === taskId)
|
||||||
if (task && task.status !== initialStatus) {
|
if (task) {
|
||||||
await loadTaskList()
|
if (task.status !== lastStatus) {
|
||||||
stopTaskStatusPolling()
|
lastStatus = task.status
|
||||||
return
|
await loadTaskList()
|
||||||
|
}
|
||||||
|
if (
|
||||||
|
session === taskStatusPollSession &&
|
||||||
|
[DeviceImportTaskStatus.COMPLETED, DeviceImportTaskStatus.FAILED].includes(
|
||||||
|
task.status
|
||||||
|
)
|
||||||
|
) {
|
||||||
|
stopTaskStatusPolling()
|
||||||
|
return
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
|
|||||||
@@ -338,13 +338,11 @@
|
|||||||
const isPlatformAccount = computed(() => [1, 2].includes(Number(userStore.info.user_type)))
|
const isPlatformAccount = computed(() => [1, 2].includes(Number(userStore.info.user_type)))
|
||||||
const canViewRecharge = computed(() => [1, 2, 3].includes(Number(userStore.info.user_type)))
|
const canViewRecharge = computed(() => [1, 2, 3].includes(Number(userStore.info.user_type)))
|
||||||
const canCreateRecharge = computed(() => isAgentAccount.value || isPlatformAccount.value)
|
const canCreateRecharge = computed(() => isAgentAccount.value || isPlatformAccount.value)
|
||||||
const createMode = ref<'online' | 'offline'>('offline')
|
const createMode = ref<'online' | 'offline'>(isAgentAccount.value ? 'online' : 'offline')
|
||||||
const createDialogTitle = computed(() =>
|
const createDialogTitle = computed(() =>
|
||||||
createMode.value === 'online' ? '代理钱包在线扫码充值' : '创建平台线下代充'
|
createMode.value === 'online' ? '代理钱包在线扫码充值' : '创建平台线下代充'
|
||||||
)
|
)
|
||||||
const createButtonLabel = computed(() =>
|
const createButtonLabel = computed(() => (isAgentAccount.value ? '立即充值' : '创建充值订单'))
|
||||||
createMode.value === 'online' ? '立即充值' : '创建充值订单'
|
|
||||||
)
|
|
||||||
|
|
||||||
const loading = ref(false)
|
const loading = ref(false)
|
||||||
const createLoading = ref(false)
|
const createLoading = ref(false)
|
||||||
|
|||||||
@@ -324,21 +324,6 @@
|
|||||||
</ElFormItem>
|
</ElFormItem>
|
||||||
</ElCol>
|
</ElCol>
|
||||||
</ElRow>
|
</ElRow>
|
||||||
|
|
||||||
<ElRow :gutter="20">
|
|
||||||
<ElCol :span="24">
|
|
||||||
<ElFormItem label="套餐描述" prop="description">
|
|
||||||
<ElInput
|
|
||||||
v-model="form.description"
|
|
||||||
type="textarea"
|
|
||||||
:rows="3"
|
|
||||||
placeholder="请输入套餐描述(可选)"
|
|
||||||
maxlength="500"
|
|
||||||
show-word-limit
|
|
||||||
/>
|
|
||||||
</ElFormItem>
|
|
||||||
</ElCol>
|
|
||||||
</ElRow>
|
|
||||||
</ElForm>
|
</ElForm>
|
||||||
<template #footer>
|
<template #footer>
|
||||||
<div class="dialog-footer">
|
<div class="dialog-footer">
|
||||||
@@ -737,8 +722,7 @@
|
|||||||
virtual_data_mb: 0,
|
virtual_data_mb: 0,
|
||||||
cost_price: 0,
|
cost_price: 0,
|
||||||
suggested_retail_price: undefined,
|
suggested_retail_price: undefined,
|
||||||
is_gift: false,
|
is_gift: false
|
||||||
description: ''
|
|
||||||
})
|
})
|
||||||
|
|
||||||
// GB 输入值(用于界面显示)
|
// GB 输入值(用于界面显示)
|
||||||
@@ -1369,7 +1353,6 @@
|
|||||||
: undefined
|
: undefined
|
||||||
originalSuggestedRetailPrice.value = data.suggested_retail_price ?? null
|
originalSuggestedRetailPrice.value = data.suggested_retail_price ?? null
|
||||||
form.is_gift = data.is_gift || false
|
form.is_gift = data.is_gift || false
|
||||||
form.description = data.description || ''
|
|
||||||
|
|
||||||
// 数据填充完成后再显示对话框
|
// 数据填充完成后再显示对话框
|
||||||
dialogVisible.value = true
|
dialogVisible.value = true
|
||||||
@@ -1397,7 +1380,6 @@
|
|||||||
virtualRatioPercent.value = null
|
virtualRatioPercent.value = null
|
||||||
form.cost_price = 0
|
form.cost_price = 0
|
||||||
form.suggested_retail_price = undefined
|
form.suggested_retail_price = undefined
|
||||||
form.description = ''
|
|
||||||
|
|
||||||
dialogVisible.value = true
|
dialogVisible.value = true
|
||||||
}
|
}
|
||||||
@@ -1443,7 +1425,6 @@
|
|||||||
form.suggested_retail_price = undefined
|
form.suggested_retail_price = undefined
|
||||||
originalSuggestedRetailPrice.value = null
|
originalSuggestedRetailPrice.value = null
|
||||||
form.is_gift = false
|
form.is_gift = false
|
||||||
form.description = ''
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// 删除套餐
|
// 删除套餐
|
||||||
|
|||||||
@@ -1021,11 +1021,14 @@
|
|||||||
|
|
||||||
// 添加强充配置:元 -> 分(仅累计充值时需要)
|
// 添加强充配置:元 -> 分(仅累计充值时需要)
|
||||||
if (form.one_time_commission_config.trigger_type === 'accumulated_recharge') {
|
if (form.one_time_commission_config.trigger_type === 'accumulated_recharge') {
|
||||||
commissionConfig.enable_force_recharge = true
|
const enableForceRecharge =
|
||||||
commissionConfig.force_amount =
|
form.one_time_commission_config.enable_force_recharge === true
|
||||||
form.one_time_commission_config.force_amount != null
|
commissionConfig.enable_force_recharge = enableForceRecharge
|
||||||
|
commissionConfig.force_amount = enableForceRecharge
|
||||||
|
? form.one_time_commission_config.force_amount != null
|
||||||
? Math.round(form.one_time_commission_config.force_amount * 100)
|
? Math.round(form.one_time_commission_config.force_amount * 100)
|
||||||
: undefined
|
: undefined
|
||||||
|
: 0
|
||||||
commissionConfig.force_calc_type = form.one_time_commission_config.force_calc_type
|
commissionConfig.force_calc_type = form.one_time_commission_config.force_calc_type
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -484,14 +484,14 @@
|
|||||||
<ElFormItem label="启用强制充值">
|
<ElFormItem label="启用强制充值">
|
||||||
<ElSwitch
|
<ElSwitch
|
||||||
v-model="form.enable_force_recharge"
|
v-model="form.enable_force_recharge"
|
||||||
:disabled="form.force_recharge_locked && isAgentAccount"
|
:disabled="isForceRechargeLockedForAgent"
|
||||||
/>
|
/>
|
||||||
|
<ElTag v-if="form.force_recharge_locked" type="danger" size="small">
|
||||||
|
平台已锁定
|
||||||
|
</ElTag>
|
||||||
</ElFormItem>
|
</ElFormItem>
|
||||||
</ElCol>
|
</ElCol>
|
||||||
<ElCol
|
<ElCol :span="12" v-if="form.enable_force_recharge">
|
||||||
:span="12"
|
|
||||||
v-if="form.enable_force_recharge && !(form.force_recharge_locked && isAgentAccount)"
|
|
||||||
>
|
|
||||||
<ElFormItem label="强充金额(元)" prop="force_recharge_amount">
|
<ElFormItem label="强充金额(元)" prop="force_recharge_amount">
|
||||||
<ElInputNumber
|
<ElInputNumber
|
||||||
v-model="form.force_recharge_amount"
|
v-model="form.force_recharge_amount"
|
||||||
@@ -499,6 +499,7 @@
|
|||||||
:precision="2"
|
:precision="2"
|
||||||
:step="0.01"
|
:step="0.01"
|
||||||
:controls="false"
|
:controls="false"
|
||||||
|
:disabled="isForceRechargeLockedForAgent"
|
||||||
style="width: 100%"
|
style="width: 100%"
|
||||||
placeholder="请输入强制充值金额(元)"
|
placeholder="请输入强制充值金额(元)"
|
||||||
/>
|
/>
|
||||||
@@ -516,6 +517,9 @@
|
|||||||
>¥{{ form.series_force_recharge_amount.toFixed(2) }}</span
|
>¥{{ form.series_force_recharge_amount.toFixed(2) }}</span
|
||||||
>
|
>
|
||||||
</span>
|
</span>
|
||||||
|
<span v-if="isForceRechargeLockedForAgent" class="force-recharge-lock-hint">
|
||||||
|
<br />平台已锁定,代理不可修改强充配置
|
||||||
|
</span>
|
||||||
</div>
|
</div>
|
||||||
</ElFormItem>
|
</ElFormItem>
|
||||||
</ElCol>
|
</ElCol>
|
||||||
@@ -797,6 +801,10 @@
|
|||||||
}> // 套餐配置
|
}> // 套餐配置
|
||||||
})
|
})
|
||||||
|
|
||||||
|
const isForceRechargeLockedForAgent = computed(
|
||||||
|
() => form.force_recharge_locked === true && isAgentAccount.value
|
||||||
|
)
|
||||||
|
|
||||||
// 动态验证规则
|
// 动态验证规则
|
||||||
const rules = computed<FormRules>(() => {
|
const rules = computed<FormRules>(() => {
|
||||||
const baseRules: FormRules = {
|
const baseRules: FormRules = {
|
||||||
@@ -1574,11 +1582,10 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
// 设置强制充值配置
|
// 设置强制充值配置
|
||||||
form.enable_force_recharge = detail.force_recharge_enabled
|
form.force_recharge_locked = detail.force_recharge_locked ?? false
|
||||||
form.force_recharge_amount = detail.force_recharge_amount
|
form.enable_force_recharge = detail.force_recharge_enabled ?? false
|
||||||
? detail.force_recharge_amount / 100
|
form.force_recharge_amount =
|
||||||
: undefined
|
detail.force_recharge_amount != null ? detail.force_recharge_amount / 100 : undefined
|
||||||
form.force_recharge_locked = detail.force_recharge_locked || false
|
|
||||||
|
|
||||||
// 设置套餐数据
|
// 设置套餐数据
|
||||||
if (detail.packages && detail.packages.length > 0) {
|
if (detail.packages && detail.packages.length > 0) {
|
||||||
@@ -1910,6 +1917,10 @@
|
|||||||
color: var(--el-color-primary);
|
color: var(--el-color-primary);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.force-recharge-lock-hint {
|
||||||
|
color: var(--el-color-danger);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
.form-section-title {
|
.form-section-title {
|
||||||
|
|||||||
Reference in New Issue
Block a user