| | |
| | | <el-button :loading="submitListLoad" type="primary" @click="submitList">确 定</el-button> |
| | | </span></template> |
| | | </el-dialog> |
| | | <report-preview ref="reportPreview" /> |
| | | </div> |
| | | </template> |
| | | |
| | | <script> |
| | | import ReportPreview from '@/components/ReportPreview/index.vue' |
| | | import { loadReportFile, reportFilename, reportPdfPath } from '@/utils/reportPreview' |
| | | // vue-qr 只支持 Vue2,换成同 props 的本地组件(内部用 Vue3 的 qrcode.vue) |
| | | import vueQr from '@/components/QrCode' |
| | | import PrintJS from 'print-js' |
| | |
| | | components: { |
| | | limsTable, |
| | | PrintDialog, |
| | | ReportPreview, |
| | | vueQr |
| | | }, |
| | | data() { |
| | |
| | | showHide: (row) => { |
| | | return this.tabIndex === 1 || this.tabIndex === 2 || this.tabIndex === 3 || this.tabIndex === 6 || this.tabIndex === 7 |
| | | } |
| | | }, |
| | | { |
| | | name: '报告预览', |
| | | type: 'text', |
| | | clickFun: (row) => this.previewReport(row), |
| | | disabled: (row) => !this.canDownloadReport(row), |
| | | showHide: () => [2, 3, 7].includes(this.tabIndex) |
| | | }, |
| | | { |
| | | name: '报告下载', |
| | |
| | | canDownloadReport(row) { |
| | | return !!(row && row.reportId && (row.urlS || row.url)) |
| | | }, |
| | | previewReport(row) { |
| | | if (!this.canDownloadReport(row)) return |
| | | const path = reportPdfPath(row.urlS || row.url) |
| | | this.$refs.reportPreview.open([{ |
| | | key: 'approved', label: '有章报告', format: 'pdf', |
| | | filename: reportFilename(row.reportCode || row.entrustCode || row.code, 'pdf'), |
| | | load: signal => loadReportFile(path, signal) |
| | | }]) |
| | | }, |
| | | download(row) { |
| | | if (!this.canDownloadReport(row)) { |
| | | return |
| | | } |
| | | let url = row.urlS ? row.urlS : row.url; |
| | | url = url.split('.')[0] + '.pdf' |
| | | url = reportPdfPath(url) |
| | | const link = document.createElement('a'); |
| | | link.href = this.javaApi + url; |
| | | link.target = '_blank'; |