| | |
| | | :data="checkList" |
| | | height="800" |
| | | style="border: 2px solid #3d7fff" |
| | | v-loading="loading" |
| | | v-loading="listLoading" |
| | | > |
| | | <el-table-column label="检查计划" prop="planName" min-width="150" /> |
| | | <el-table-column label="计划类型" min-width="120"> |
| | |
| | | <CustomTable |
| | | :data="checkMaterialList" |
| | | height="630" |
| | | v-loading="loading" |
| | | v-loading="materialListLoading" |
| | | > |
| | | <el-table-column label="检查标题" prop="title" min-width="150" /> |
| | | <!-- 以下列仅在非项目端(type != 2)时显示 --> |
| | |
| | | width="1420px" |
| | | @close="closeReportDialog" |
| | | > |
| | | <div style="height: 691px;" class="flex flex-column" v-loading="loading"> |
| | | <div style="height: 691px;" class="flex flex-column" v-loading="reportLoading"> |
| | | <!-- PDF预览容器 --> |
| | | <div |
| | | v-if="showPreview && pdfUrl" |
| | |
| | | width="1420px" |
| | | @close="closeDetailDialog" |
| | | > |
| | | <div class="oa" style="height: 700px" v-loading="loading"> |
| | | <div class="oa" style="height: 700px" v-loading="detailLoading"> |
| | | <div class="flex j-between gap--30 mt--30"> |
| | | <div class="flex1"> |
| | | <div class="SHSR fs--16 lh--16 mb--17 color1">计划名称:</div> |
| | |
| | | reportUrl: '', // 已废弃,保留兼容性 |
| | | reportBlobUrl: '', // Blob URL用于下载 |
| | | pdfUrl: '', // PDF预览URL |
| | | loading: false, |
| | | listLoading: false, |
| | | materialListLoading: false, |
| | | detailLoading: false, |
| | | reportLoading: false, |
| | | showPreview: false, // 是否显示预览 |
| | | reportPopoverVisibleId: null, |
| | | |
| | |
| | | |
| | | // 获取检查列表 |
| | | async getCheckList () { |
| | | this.loading = true |
| | | this.listLoading = true |
| | | try { |
| | | const params = { |
| | | pageNum: this.currentPage, |
| | |
| | | console.error('获取检查列表失败:', error) |
| | | this.$message.error('获取检查列表失败') |
| | | } finally { |
| | | this.loading = false |
| | | this.listLoading = false |
| | | } |
| | | }, |
| | | |
| | |
| | | return |
| | | } |
| | | |
| | | this.loading = true |
| | | this.materialListLoading = true |
| | | try { |
| | | const res = await getDeviceDetailCheckPlanList({ |
| | | planId: this.currentPlanId, |
| | |
| | | console.error('获取检查资料列表失败:', error) |
| | | this.$message.error('获取检查资料列表失败') |
| | | } finally { |
| | | this.loading = false |
| | | this.materialListLoading = false |
| | | } |
| | | }, |
| | | |
| | |
| | | return |
| | | } |
| | | |
| | | this.loading = true |
| | | this.detailLoading = true |
| | | try { |
| | | const res = await getDeviceDetailCheckPlanDetail({ |
| | | id: this.currentCheckId |
| | |
| | | console.error('获取检查资料详情失败:', error) |
| | | this.$message.error('获取检查资料详情失败') |
| | | } finally { |
| | | this.loading = false |
| | | this.detailLoading = false |
| | | } |
| | | }, |
| | | |
| | |
| | | this.currentRow = row |
| | | this.reportVisible = true |
| | | this.showPreview = false |
| | | this.loading = true |
| | | this.reportLoading = true |
| | | |
| | | try { |
| | | // 从 sessionStorage 获取模板 ID |
| | |
| | | const checkTaskId = row.id |
| | | if (!checkTaskId) { |
| | | this.$message.error('缺少检查任务ID') |
| | | this.loading = false |
| | | this.reportLoading = false |
| | | this.reportVisible = false |
| | | return |
| | | } |
| | |
| | | if (type === 'safe') { |
| | | if (!safetyId) { |
| | | this.$message.error('缺少安全报告模板ID') |
| | | this.loading = false |
| | | this.reportLoading = false |
| | | this.reportVisible = false |
| | | return |
| | | } |
| | |
| | | } else { |
| | | if (!deviceTemplateId) { |
| | | this.$message.error('缺少设备报告模板ID') |
| | | this.loading = false |
| | | this.reportLoading = false |
| | | this.reportVisible = false |
| | | return |
| | | } |
| | |
| | | } catch (error) { |
| | | console.error('生成Word文档失败:', error) |
| | | this.$message.error(error.message || '生成报告失败') |
| | | this.loading = false |
| | | this.reportLoading = false |
| | | this.reportVisible = false |
| | | return |
| | | } |
| | |
| | | // 检查 Word 文档是否生成成功 |
| | | if (!wordBlob || wordBlob.size === 0) { |
| | | this.$message.error('报告生成失败') |
| | | this.loading = false |
| | | this.reportLoading = false |
| | | this.reportVisible = false |
| | | return |
| | | } |
| | |
| | | } catch (error) { |
| | | console.error('获取PDF链接失败:', error) |
| | | this.$message.error(error.message || '获取PDF链接失败') |
| | | this.loading = false |
| | | this.reportLoading = false |
| | | this.reportVisible = false |
| | | return |
| | | } |
| | |
| | | |
| | | if (!pdfUrl) { |
| | | this.$message.error('获取PDF链接失败') |
| | | this.loading = false |
| | | this.reportLoading = false |
| | | this.reportVisible = false |
| | | return |
| | | } |
| | |
| | | this.showPreview = false |
| | | this.reportVisible = false |
| | | } finally { |
| | | this.loading = false |
| | | this.reportLoading = false |
| | | } |
| | | }, |
| | | |