This commit is contained in:
2026-08-04 11:22:04 +08:00
parent c894f07cbb
commit 3dcc8b30db
4 changed files with 95 additions and 5 deletions
+14 -4
View File
@@ -1,5 +1,6 @@
<script setup lang="ts">
import { computed, nextTick, onBeforeUnmount, onMounted, reactive, ref, watch } from 'vue'
import { useRouter } from 'vue-router'
import { Building2, CheckCircle2, Download, Eye, FileCheck2, FileText, FileUp, Pencil, Plus, Power, ShieldCheck, ShieldX } from '@lucide/vue'
import { ElMessage, ElMessageBox, type FormInstance, type FormRules } from 'element-plus'
import { getApiErrorDetails, getApiErrorMessage, type ApiErrorDetails } from '@/shared/api/http'
@@ -31,6 +32,7 @@ import ApiErrorMeta from '@/shared/components/ApiErrorMeta.vue'
import CopyButton from '@/shared/components/CopyButton.vue'
import DataTable, { type DataTableColumn } from '@/shared/components/DataTable.vue'
import QueryToolbar, { type QueryField, type QueryModel } from '@/shared/components/QueryToolbar.vue'
import { showExportTaskCreatedDialog } from '@/shared/components/exportTaskCreatedDialog'
import { useAccessPreviewStore } from '@/core/access/accessPreview'
type CustomerFilters = QueryModel & { keyword: string; status: PlatformTenantStatus | '' }
@@ -58,6 +60,7 @@ type DetailQualificationPreview = {
}
const access = useAccessPreviewStore()
const router = useRouter()
const page = ref(1)
const pageSize = ref(10)
const loading = ref(false)
@@ -650,8 +653,9 @@ function closeApprovalResult() {
async function exportCustomers() {
exportSubmitting.value = true
let task: Awaited<ReturnType<typeof createPlatformExportTask>>
try {
await createPlatformExportTask({
task = await createPlatformExportTask({
exportType: 'CUSTOMER_LIST',
format: 'XLSX',
taskName: '客户列表',
@@ -660,9 +664,15 @@ async function exportCustomers() {
status: filters.value.status || undefined,
},
})
ElMessage.success('导出任务已创建,可前往下载中心查看')
} catch (error) { ElMessage.error(getApiErrorMessage(error, '客户导出任务创建失败')) }
finally { exportSubmitting.value = false }
} catch (error) {
ElMessage.error(getApiErrorMessage(error, '客户导出任务创建失败'))
return
} finally {
exportSubmitting.value = false
}
const openDownloadCenter = await showExportTaskCreatedDialog({ taskName: task.taskName, taskNo: task.taskNo })
if (openDownloadCenter) await router.push({ name: 'download-center' })
}
watch([page, pageSize], () => { void loadCustomers() })