| | |
| | | <div> |
| | | <el-dialog v-model="filesDialogVisible" title="查看校准证书" width="80%" @closed="closeFilesLook"> |
| | | <div> |
| | | <el-alert v-if="!tableLoading && tableData.length === 0" type="info" :closable="false" |
| | | title="所选设备暂无校准证书"/> |
| | | <limsTable |
| | | ref="yearTable" |
| | | :column="columnData" |
| | |
| | | fullscreen |
| | | title="查看附件" top="5vh" width="800px"> |
| | | <filePreview v-if="lookDialogVisible" :currentFile="{}" |
| | | :fileUrl="javaApi+'/img/'+currentInfo.fileUrl" style="max-height: 90vh;overflow-y: auto;"/> |
| | | :fileUrl="fileUrl(currentInfo)" style="max-height: 90vh;overflow-y: auto;"/> |
| | | </el-dialog> |
| | | </div> |
| | | </template> |
| | |
| | | import filePreview from '@/components/Preview/filePreview.vue'; |
| | | import limsTable from '@/components/Table/lims-table.vue' |
| | | import file from '@/utils/file'; |
| | | import { getCurrentCalibrationFiles } from '@/api/cnas/process/method/methodVerification' |
| | | |
| | | export default { |
| | | name: 'calibrationsFileDia', |
| | |
| | | }, |
| | | // 方法集合 |
| | | methods: { |
| | | openDia(row) { |
| | | fileUrl(row) { |
| | | const image = /\.(png|jpe?g|gif|bmp|webp)$/i.test(row.fileUrl || '') |
| | | return this.javaApi + (image ? '/img/' : '/word/') + row.fileUrl |
| | | }, |
| | | openDia(row = {}) { |
| | | this.filesDialogVisible = true |
| | | this.info = row |
| | | this.tableData = this.info.calibrationsFileList |
| | | this.tableData = row.calibrationsFileList || [] |
| | | if (row.useCurrentDevices) { |
| | | const deviceIds = [...new Set((row.machineAttachmentList || []).map(device => device.deviceId).filter(Boolean))] |
| | | if (!deviceIds.length) return |
| | | this.tableLoading = true |
| | | getCurrentCalibrationFiles({deviceIds: deviceIds.join(',')}).then(res => { |
| | | if (res.code === 200) this.tableData = res.data || [] |
| | | }).finally(() => { |
| | | this.tableLoading = false |
| | | }) |
| | | } |
| | | }, |
| | | closeFilesLook () { |
| | | this.filesDialogVisible = false |
| | |
| | | // 下载 |
| | | upload (row) { |
| | | let url = ''; |
| | | if(row.type==1){ |
| | | if (/\.(png|jpe?g|gif|bmp|webp)$/i.test(row.fileUrl || '')) { |
| | | url = this.javaApi+'/img/'+row.fileUrl |
| | | file.downloadIamge(url,row.fileName) |
| | | }else{ |