吴羡
12 小时以前 a52ac50ffc5f3b369eb689dd734bfb8a4bb988a4
src/views/CNAS/process/method/methodVerification/component/viewWorkPermitDia.vue
@@ -90,9 +90,23 @@
      const image = /\.(png|jpe?g|gif|bmp|webp)$/i.test(row.fileUrl || '')
      return this.javaApi + (image ? '/img/' : '/word/') + row.fileUrl
    },
    openDia(userIds) {
    // 两种用法:数组=检测人员id(实时查询);行对象=优先展示已保存的上岗证,其次按已选检测人员实时查询
    openDia(payload = {}) {
      this.filesDialogVisible = true
      this.tableData = []
      if (Array.isArray(payload)) {
        this.loadCurrentFiles(payload)
        return
      }
      this.info = payload || {}
      if (Array.isArray(payload.workFileList) && payload.workFileList.length) {
        this.tableData = payload.workFileList
        return
      }
      this.loadCurrentFiles(Array.isArray(payload.confirmUser) ? payload.confirmUser : [])
    },
    loadCurrentFiles(userIds) {
      if (!userIds.length) return
      this.tableLoading = true
      getCurrentWorkFiles({userIds: userIds.join(',')}).then(res => {
        if (res.code === 200) this.tableData = res.data || []