<!--
  @description: 职业资格查看-弹框
  @Modifier: qrf
  @routerPath:
  @date: 2020/10/18-15:56
-->
<template>
  <el-dialog
    v-dialogDrag
    :visible.sync="dialogData.dialog"
    :close-on-click-modal="false"
    title="查看职业资格"
    width="650px"
    append-to-body
    custom-class="el-dialog__body-p8 el-dialog_table"
  >
    <div class="main mb10">
      <table class="tableData">
        <tr>
          <td>职业资格证书</td>
          <td>
            {{ expertVocationalQualificationsInfo.practiceQualificationName }}
          </td>
        </tr>
        <tr>
          <td>颁发机构</td>
          <td>
            {{ expertVocationalQualificationsInfo.certificateCompany }}
          </td>
        </tr>
        <tr>
          <td>注册证书编号</td>
          <td>
            {{ expertVocationalQualificationsInfo.certificateNo }}
          </td>
        </tr>
        <tr>
          <td>获得时间</td>
          <td>
            {{ expertVocationalQualificationsInfo.acquisitionDate }}
          </td>
        </tr>
        <tr>
          <td>有效期至</td>
          <td>
            {{ expertVocationalQualificationsInfo.invalidDate }}
          </td>
        </tr>
        <tr>
          <td>证明文件</td>
          <td>
            <downloadFile :data="photoIdType" />
          </td>
        </tr>
      </table>
    </div>
  </el-dialog>
</template>

<script>
/* api */
import { queryTBExpertCertificationById } from '@/api/expert/expertscloud'
/* 公共方法 */
import { expertWorkPerience } from '@/views/expert/expertInfo/expertWorkPerience/mixins/expertWorkPerience'
import { filterDictText } from '@/assets/js/utils'
/* 組件 */
import downloadFile from '@comp/common/updownload/downloadFile' // 获取附件信息 下载组件
export default {
  name: 'ExpertVocationalQualificationsDetailDialog',
  components: {
    downloadFile
  },
  mixins: [expertWorkPerience],
  props: {
    // 弹框展示状态
    dialogData: {
      type: Object,
      default: function() {
        return {
          dialog: false, // 展示状态
          id: ''// 编辑时才会有财务状况id
        }
      }
    }
  },
  data() {
    return {
      photoIdType: {
        bizId: '', // 业务主键Id
        fileType: 'EXPERT_UPLOAD_PROFESSIONAL_PROVE' // 文件类型
      },
      acquisitionDate: '',
      expertVocationalQualificationsInfo: {}
    }
  },
  created() {
    // 获取数据
    const data = {
      id: this.dialogData.id
    }
    this.workExperienceDetail(data)
  },
  methods: {
    filterDictText,
    // 打开弹框
    // 获取任职经历详情
    workExperienceDetail(data) {
      queryTBExpertCertificationById(data).then(res => {
        this.expertVocationalQualificationsInfo = res.data
        this.photoIdType.bizId = res.data.id
      })
    }
  }
}
</script>
