| | |
| | | <template> |
| | | <div> |
| | | <el-dialog v-model="filesDialogVisible" title="附件上传" width="80%" @closed="closeFilesLook"> |
| | | <div style="display: flex;justify-content: space-between;"> |
| | | <el-dialog v-model="filesDialogVisible" :title="readOnly ? '查看附件' : '附件上传'" width="80%" @closed="closeFilesLook"> |
| | | <div v-if="!readOnly" style="display: flex;justify-content: space-between;"> |
| | | <el-upload ref='upload' |
| | | :action="fileAction" |
| | | :auto-upload="true" |
| | |
| | | <div> |
| | | <lims-table |
| | | ref="yearTable" |
| | | :column="columnData" |
| | | :column="readOnly ? readonlyColumnData : columnData" |
| | | :height="'calc(100vh - 47em)'" |
| | | :highlightCurrentRow="true" |
| | | :table-data="tableData" |
| | |
| | | |
| | | export default { |
| | | name: 'ViewTestRecord', |
| | | props: { readOnly: { type: Boolean, default: false } }, |
| | | // import 引入的组件需要注入到对象中才能使用 |
| | | components: { limsTable }, |
| | | computed: { |
| | | readonlyColumnData() { |
| | | return this.columnData.map(column => column.dataType === 'action' |
| | | ? { ...column, operation: column.operation.filter(item => item.name !== '删除') } |
| | | : column) |
| | | } |
| | | }, |
| | | data() { |
| | | // 这里存放数据 |
| | | return { |
| | |
| | | }, |
| | | // 下载 |
| | | upload (row) { |
| | | let url = ''; |
| | | if(row.type==1){ |
| | | url = this.javaApi+'/img/'+row.fileUrl |
| | | file.downloadIamge(url,row.fileName) |
| | | }else{ |
| | | url = this.javaApi+'/word/'+row.fileUrl |
| | | const link = document.createElement('a'); |
| | | link.href = url; |
| | | link.download = row.fileName; |
| | | link.click(); |
| | | } |
| | | return this.$download.attachment(row, row.fileName) |
| | | }, |
| | | // 删除 |
| | | delete (row) { |
| | | if (this.readOnly) return |
| | | this.tableLoading = true |
| | | delVerifyMethodFileList({methodFileId:row.methodFileId}).then(res => { |
| | | this.tableLoading = false |
| | |
| | | }, |
| | | // 上传验证 |
| | | fileBeforeUpload(file) { |
| | | if (this.readOnly) return false |
| | | let flag = true |
| | | if (file.size > 1024 * 1024 * 10) { |
| | | this.$message.error('上传文件不超过10M'); |