liding
12 小时以前 8690e8f223d07cc4aedc3f7c1a38316f223b20cc
src/views/CNAS/process/method/methodVerification/component/calibrationsFileDia.vue
@@ -2,6 +2,8 @@
  <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"
@@ -18,7 +20,7 @@
      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>
@@ -27,6 +29,7 @@
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',
@@ -88,10 +91,24 @@
  },
  // 方法集合
  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
@@ -104,7 +121,7 @@
    // 下载
    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{