吴羡
13 小时以前 a1faa94fbf85553f22da934a1abc745d89dd8667
src/views/CNAS/resourceDemand/device/component/equipmentAcceptance.vue
@@ -26,7 +26,7 @@
            </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>
@@ -45,7 +45,7 @@
      </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>
@@ -67,6 +67,7 @@
  exportDeviceAcceptance,
  delDeviceAcceptance,
} from '@/api/cnas/resourceDemand/device.js'
import { saveBlobOrShowError } from '@/utils/saveBlob'
export default {
  name: "equipment-acceptance",
  // import 引入的组件需要注入到对象中才能使用
@@ -82,6 +83,11 @@
    // 这里存放数据
    return {
      pagination1: {
        size: 10,
        current: 1,
        total: 0,
      },
      filePage: {
        size: 10,
        current: 1,
        total: 0,
@@ -171,6 +177,7 @@
    record(row) {
      this.filesDialogVisible = true
      this.acceptanceId = row.acceptanceId
      this.filePage.current = 1
      this.searchTableList()
    },
    // 查询附件列表
@@ -178,7 +185,8 @@
      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);
@@ -197,7 +205,14 @@
    },
    // 下载
    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) {
@@ -239,10 +254,11 @@
      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() {
@@ -263,8 +279,9 @@
      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
      })
    },
    // 删除