Selaa lähdekoodia

报告归档-完整记录、报告

xy 1 päivä sitten
vanhempi
commit
7e0a6036a5

+ 29 - 1
yudao-ui-admin-vue3/src/views/pressure2/reportArchivingBoiler/detail.vue

@@ -115,6 +115,26 @@ const fileAttachTypeMap: Record<string, string> = {
   attachment: '文档'
 }
 const detailTableSchema = reactive<TableItem[]>([
+  {
+    title: '完整记录、报告',
+    columns: [
+      { label: '序号', fieldProps: { type: 'index', align: 'center', width: 55 } },
+      { label: '报告编号', prop: 'reportNo', fieldProps: { align: 'center', minWidth: 150 } },
+      { label: '文件名称', prop: 'reportType', fieldProps: { align: 'center', minWidth: 120 },
+        render: (row) => row.reportType === 100 ? '记录' : '报告' },
+      { label: '版本号', prop: 'reportVersion', fieldProps: { align: 'center', minWidth: 100 } },
+      { label: '生效时间', prop: 'createTime', fieldProps: { align: 'center', minWidth: 160 },
+        render: (_row, value) => formatDate(value) || '-' },
+      { label: '操作', prop: 'operation', fieldProps: { align: 'center', minWidth: 150 },
+        render: (row) => (
+          <>
+            <el-button type="primary" link onClick={() => handleViewPdfByUrl(row.issueUrl)}>预览</el-button>
+            <el-button type="primary" link onClick={() => handleAttachmentDownload(row.issueUrl)}>下载</el-button>
+          </>
+        ) }
+    ],
+    dataField: 'issueReportVersionList'
+  },
   {
     title: '任务单相关文件',
     columns: [
@@ -374,7 +394,7 @@ const detailTableSchema = reactive<TableItem[]>([
         ) }
     ],
     dataField: 'fileAttachList'
-  }
+  },
 ])
 
 // 流转记录/历史版本弹窗
@@ -710,6 +730,14 @@ const getPdfSource = async (type: number, data: any,fileName: string) => {
 // PDF预览相关
 const pdfPreviewVisible = ref(false)
 const currentPdfBlob = ref<Blob | null>(null)
+const handleViewPdfByUrl = async (url) => {
+
+  if (url) {
+    docPdfUrls.value = ([url] || []).map((url) => buildFileUrl(url))
+    showDocPdfDialog.value = true
+  }
+
+}
 const handleViewPdf = async (row) => {
 
   if (row.filePdf) {

+ 1 - 0
yudao-ui-admin-vue3/src/views/pressure2/reportArchivingBoiler/index.api.ts

@@ -22,4 +22,5 @@ export interface DetailData {
   imageList?: Recordable[]
   videoList?: Recordable[]
   attachmentList?: Recordable[]
+  issueReportVersionList?: Recordable[]
 }

+ 29 - 35
yudao-ui-admin-vue3/src/views/pressure2/reportArchivingPipe/detail.vue

@@ -115,6 +115,26 @@ const fileAttachTypeMap: Record<string, string> = {
   attachment: '文档'
 }
 const detailTableSchema = reactive<TableItem[]>([
+  {
+    title: '完整记录、报告',
+    columns: [
+      { label: '序号', fieldProps: { type: 'index', align: 'center', width: 55 } },
+      { label: '报告编号', prop: 'reportNo', fieldProps: { align: 'center', minWidth: 150 } },
+      { label: '文件名称', prop: 'reportType', fieldProps: { align: 'center', minWidth: 120 },
+        render: (row) => row.reportType === 100 ? '记录' : '报告' },
+      { label: '版本号', prop: 'reportVersion', fieldProps: { align: 'center', minWidth: 100 } },
+      { label: '生效时间', prop: 'createTime', fieldProps: { align: 'center', minWidth: 160 },
+        render: (_row, value) => formatDate(value) || '-' },
+      { label: '操作', prop: 'operation', fieldProps: { align: 'center', minWidth: 150 },
+        render: (row) => (
+          <>
+            <el-button type="primary" link onClick={() => handleViewPdfByUrl(row.issueUrl)}>预览</el-button>
+            <el-button type="primary" link onClick={() => handleAttachmentDownload(row.issueUrl)}>下载</el-button>
+          </>
+        ) }
+    ],
+    dataField: 'issueReportVersionList'
+  },
   {
     title: '任务单相关文件',
     columns: [
@@ -374,7 +394,7 @@ const detailTableSchema = reactive<TableItem[]>([
         ) }
     ],
     dataField: 'fileAttachList'
-  }
+  },
 ])
 
 // 流转记录/历史版本弹窗
@@ -710,6 +730,14 @@ const getPdfSource = async (type: number, data: any, fileName: string) => {
 // PDF预览相关
 const pdfPreviewVisible = ref(false)
 const currentPdfBlob = ref<Blob | null>(null)
+const handleViewPdfByUrl = async (url) => {
+
+  if (url) {
+    docPdfUrls.value = ([url] || []).map((url) => buildFileUrl(url))
+    showDocPdfDialog.value = true
+  }
+
+}
 const handleViewPdf = async (row) => {
 
   if (row.filePdf) {
@@ -717,40 +745,6 @@ const handleViewPdf = async (row) => {
     showDocPdfDialog.value = true
     return
   }
-  //
-  // let data: any[] = []
-  // data.push({
-  //   taskStatus: row.taskStatus,
-  //   resultTemplateId: '',
-  //   templateId: row.templateId,
-  //   reportTemplateId: row.reportTemplateId,
-  //   reportUrl: '',
-  //   id: row.reportId,
-  // })
-  //
-  // const loadingInstance = ElLoading.service({
-  //   fullscreen: true,
-  //   text: '正在生成...'
-  // })
-  //
-  // try {
-  //   // 调用 API 获取 ZIP blob
-  //   const pdfBlob = await PipeInputApi.handlePrint(data)
-  //
-  //   if (pdfBlob) {
-  //
-  //     currentPdfBlob.value = pdfBlob
-  //     pdfPreviewVisible.value = true
-  //
-  //   } else {
-  //     ElMessage.error('获取文件失败')
-  //   }
-  // } catch (error) {
-  //   console.error('预览失败:', error)
-  //   ElMessage.error('预览失败')
-  // } finally {
-  //   loadingInstance.close()
-  // }
 
 }
 

+ 1 - 0
yudao-ui-admin-vue3/src/views/pressure2/reportArchivingPipe/index.api.ts

@@ -22,4 +22,5 @@ export interface DetailData {
   imageList?: Recordable[]
   videoList?: Recordable[]
   attachmentList?: Recordable[]
+  issueReportVersionList?: Recordable[]
 }