|
|
|
|
@ -61,7 +61,15 @@ type="success" plain @click="handleExport" :loading="exportLoading"
|
|
|
|
|
|
|
|
|
|
<!-- 列表 -->
|
|
|
|
|
<ContentWrap>
|
|
|
|
|
<el-table v-loading="loading" :data="list" :show-overflow-tooltip="true" @expand-change="handleExpandChange">
|
|
|
|
|
<el-table
|
|
|
|
|
v-loading="loading"
|
|
|
|
|
:data="list"
|
|
|
|
|
:show-overflow-tooltip="true"
|
|
|
|
|
row-key="id"
|
|
|
|
|
@expand-change="handleExpandChange"
|
|
|
|
|
@selection-change="handleSelectionChange"
|
|
|
|
|
>
|
|
|
|
|
<el-table-column type="selection" width="55" fixed="left" reserve-selection />
|
|
|
|
|
<el-table-column type="expand">
|
|
|
|
|
<template #default="scope">
|
|
|
|
|
<el-table
|
|
|
|
|
@ -148,6 +156,7 @@ const queryParams = reactive({
|
|
|
|
|
})
|
|
|
|
|
const queryFormRef = ref() // 搜索的表单
|
|
|
|
|
const exportLoading = ref(false) // 导出的加载中
|
|
|
|
|
const selectedIds = ref<number[]>([])
|
|
|
|
|
|
|
|
|
|
const formatValDisplay = (val: any) => {
|
|
|
|
|
if (val === undefined || val === null || val === '') return ''
|
|
|
|
|
@ -205,6 +214,10 @@ const handleDelete = async (id: number) => {
|
|
|
|
|
} catch { }
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
const handleSelectionChange = (rows: any[]) => {
|
|
|
|
|
selectedIds.value = rows?.map((row) => row.id).filter((id) => id !== undefined) ?? []
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/** 导出按钮操作 */
|
|
|
|
|
const handleExport = async () => {
|
|
|
|
|
try {
|
|
|
|
|
@ -212,7 +225,11 @@ const handleExport = async () => {
|
|
|
|
|
await message.exportConfirm()
|
|
|
|
|
// 发起导出
|
|
|
|
|
exportLoading.value = true
|
|
|
|
|
const data = await ZjSchemaApi.exportZjSchema(queryParams)
|
|
|
|
|
const params = {
|
|
|
|
|
...queryParams,
|
|
|
|
|
ids: selectedIds.value.length ? selectedIds.value.join(',') : undefined,
|
|
|
|
|
}
|
|
|
|
|
const data = await ZjSchemaApi.exportZjSchema(params)
|
|
|
|
|
download.excel(data, '检验方案.xls')
|
|
|
|
|
} catch {
|
|
|
|
|
} finally {
|
|
|
|
|
|