| | |
| | | </template> |
| | | </el-table-column> |
| | | </el-table> |
| | | <el-pagination :current-page="1" :page-size="pagination1.size" :page-sizes="[10, 20, 30, 50, 100]" |
| | | <el-pagination :current-page="pagination1.current" :page-size="pagination1.size" :page-sizes="[10, 20, 30, 50, 100]" |
| | | :total="pagination1.total" layout="->,total, sizes, prev, pager, next, jumper" background |
| | | @size-change="handleSizeChange1" @current-change="handleCurrentChange1"> |
| | | </el-pagination> |
| | |
| | | </div> |
| | | <div> |
| | | <limsTable ref="yearTable" :column="columnData" :height="'calc(100vh - 30em)'" :highlightCurrentRow="true" |
| | | :table-data="tableData" :table-loading="tableLoading" style="margin-top: 0.5em;" :page="pagination1"> |
| | | :table-data="tableData" :table-loading="tableLoading" style="margin-top: 0.5em;" :page="filePage"> |
| | | </limsTable> |
| | | </div> |
| | | </el-dialog> |
| | |
| | | exportDeviceAcceptance, |
| | | delDeviceAcceptance, |
| | | } from '@/api/cnas/resourceDemand/device.js' |
| | | import { saveBlobOrShowError } from '@/utils/saveBlob' |
| | | export default { |
| | | name: "equipment-acceptance", |
| | | // import 引入的组件需要注入到对象中才能使用 |
| | |
| | | // 这里存放数据 |
| | | return { |
| | | pagination1: { |
| | | size: 10, |
| | | current: 1, |
| | | total: 0, |
| | | }, |
| | | filePage: { |
| | | size: 10, |
| | | current: 1, |
| | | total: 0, |
| | |
| | | record(row) { |
| | | this.filesDialogVisible = true |
| | | this.acceptanceId = row.acceptanceId |
| | | this.filePage.current = 1 |
| | | this.searchTableList() |
| | | }, |
| | | // 查询附件列表 |
| | |
| | | this.tableLoading = true |
| | | getDeviceAcceptanceFileList({ acceptanceId: this.acceptanceId }).then(res => { |
| | | this.tableLoading = false |
| | | this.tableData = res.data |
| | | this.tableData = res.data || [] |
| | | this.filePage.total = this.tableData.length |
| | | }).catch(err => { |
| | | this.tableLoading = false |
| | | console.log('err---', err); |
| | |
| | | }, |
| | | // 下载 |
| | | upload(row) { |
| | | this.$download.saveAs(row.fileUrl, row.fileName) |
| | | if (!row.fileUrl) { |
| | | this.$message.warning('未上传文件!') |
| | | return |
| | | } |
| | | // 图片存 /img/,其他文档存 /word/ |
| | | const isImage = /\.(jpg|jpeg|png|gif|bmp|webp)$/i.test(row.fileUrl) |
| | | const url = this.javaApi + (isImage ? '/img/' : '/word/') + row.fileUrl |
| | | this.$download.saveAs(url, row.fileName || row.fileUrl) |
| | | }, |
| | | // 删除 |
| | | delete(row) { |
| | |
| | | this.$refs.upload.clearFiles() |
| | | }, |
| | | handleSuccessUp(response,) { |
| | | this.upLoading = false; |
| | | if (response.code == 200) { |
| | | this.$message.success('上传成功'); |
| | | this.searchTableList() |
| | | } else { |
| | | this.$message.error(response.message || response.msg || '上传失败') |
| | | } |
| | | }, |
| | | closeFilesLook() { |
| | |
| | | this.outLoading = true |
| | | exportDeviceAcceptance({ acceptanceId: id }).then(res => { |
| | | this.outLoading = false |
| | | const blob = new Blob([res], { type: 'application/octet-stream' }); |
| | | this.$download.saveAs(blob, '设备验收.doc') |
| | | saveBlobOrShowError(res, '设备验收.doc', 'application/msword') |
| | | }).catch(() => { |
| | | this.outLoading = false |
| | | }) |
| | | }, |
| | | // 删除 |