diff --git a/src/components/business/BatchRealnamePolicyDialog.vue b/src/components/business/BatchRealnamePolicyDialog.vue index d8a6a33..251f1d5 100644 --- a/src/components/business/BatchRealnamePolicyDialog.vue +++ b/src/components/business/BatchRealnamePolicyDialog.vue @@ -11,13 +11,6 @@ 先购买后实名 - (), { loading: false, - errorMessage: '', - devicePolicyHint: false + errorMessage: '' }) const emit = defineEmits<{ diff --git a/src/template/设备批量任务.csv b/src/template/设备批量任务.csv new file mode 100644 index 0000000..2c9ae84 --- /dev/null +++ b/src/template/设备批量任务.csv @@ -0,0 +1 @@ +89861590172420377385 diff --git a/src/views/asset-management/task-management/bulk-purchase/index.vue b/src/views/asset-management/task-management/bulk-purchase/index.vue index 586f746..6c64746 100644 --- a/src/views/asset-management/task-management/bulk-purchase/index.vue +++ b/src/views/asset-management/task-management/bulk-purchase/index.vue @@ -155,9 +155,7 @@
下载模板 @@ -306,6 +304,21 @@ () => 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<{ series_id?: number package_id?: number @@ -526,6 +539,7 @@ ) => { stopTaskStatusPolling() const session = taskStatusPollSession + let lastStatus = initialStatus const poll = async () => { if (session !== taskStatusPollSession) return @@ -537,10 +551,22 @@ }) if (response.code === 0) { const task = response.data.items.find((item) => (item.task_id ?? item.id) === taskId) - if (task && task.status !== initialStatus) { - await loadTaskList() - stopTaskStatusPolling() - return + if (task) { + if (task.status !== lastStatus) { + lastStatus = task.status + await loadTaskList() + } + if ( + session === taskStatusPollSession && + [ + BulkPurchaseTaskStatus.COMPLETED, + BulkPurchaseTaskStatus.FAILED, + BulkPurchaseTaskStatus.CANCELED + ].includes(task.status) + ) { + stopTaskStatusPolling() + return + } } } } catch (error) { diff --git a/src/views/asset-management/task-management/device-batch-allocation/index.vue b/src/views/asset-management/task-management/device-batch-allocation/index.vue index cf85fa5..d58bb73 100644 --- a/src/views/asset-management/task-management/device-batch-allocation/index.vue +++ b/src/views/asset-management/task-management/device-batch-allocation/index.vue @@ -391,8 +391,8 @@ const downloadTemplate = () => { try { const link = document.createElement('a') - link.href = new URL('@/template/批量订购套餐模板.csv', import.meta.url).href - link.download = '批量订购套餐模板.csv' + link.href = new URL('@/template/设备批量任务.csv', import.meta.url).href + link.download = '设备批量任务.csv' document.body.appendChild(link) link.click() document.body.removeChild(link) @@ -450,6 +450,7 @@ ) => { stopTaskStatusPolling() const session = taskStatusPollSession + let lastStatus = initialStatus const poll = async () => { if (session !== taskStatusPollSession) return @@ -461,10 +462,20 @@ }) if (response.code === 0) { const task = response.data.items.find((item) => item.id === taskId) - if (task && task.status !== initialStatus) { - await loadTaskList() - stopTaskStatusPolling() - return + if (task) { + if (task.status !== lastStatus) { + lastStatus = task.status + await loadTaskList() + } + if ( + session === taskStatusPollSession && + [DeviceImportTaskStatus.COMPLETED, DeviceImportTaskStatus.FAILED].includes( + task.status + ) + ) { + stopTaskStatusPolling() + return + } } } } catch (error) { diff --git a/src/views/finance/agent-recharge/index.vue b/src/views/finance/agent-recharge/index.vue index c39b2c9..1a6f83e 100644 --- a/src/views/finance/agent-recharge/index.vue +++ b/src/views/finance/agent-recharge/index.vue @@ -338,13 +338,11 @@ const isPlatformAccount = computed(() => [1, 2].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 createMode = ref<'online' | 'offline'>('offline') + const createMode = ref<'online' | 'offline'>(isAgentAccount.value ? 'online' : 'offline') const createDialogTitle = computed(() => createMode.value === 'online' ? '代理钱包在线扫码充值' : '创建平台线下代充' ) - const createButtonLabel = computed(() => - createMode.value === 'online' ? '立即充值' : '创建充值订单' - ) + const createButtonLabel = computed(() => (isAgentAccount.value ? '立即充值' : '创建充值订单')) const loading = ref(false) const createLoading = ref(false) diff --git a/src/views/package-management/package-list/index.vue b/src/views/package-management/package-list/index.vue index e62093a..2d65466 100644 --- a/src/views/package-management/package-list/index.vue +++ b/src/views/package-management/package-list/index.vue @@ -324,21 +324,6 @@ - - - - - - - -