| | |
| | | <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 { |
| | |
| | | }, |
| | | // 删除 |
| | | 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'); |