<!--
  @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>
            {{ workExperienceInfo.comName }}
          </td>
        </tr>
        <tr>
          <td>入职时间</td>
          <td>
            {{ workExperienceInfo.startDate }}
          </td>
        </tr>
        <tr>
          <td>职务</td>
          <td>
            {{ workExperienceInfo.postName }}
          </td>
        </tr>
        <tr>
          <td>从事专业</td>
          <td>
            {{ workExperienceInfo.specialty }}
          </td>
        </tr>
        <tr>
          <td>单位电话</td>
          <td>
            {{ workExperienceInfo.telOffice }}
          </td>
        </tr>
        <tr>
          <td>回避单位</td>
          <td>
            {{ filterDictText(isAvoidCompany, workExperienceInfo.isAvoidCompany) }}
          </td>
        </tr>
        <tr>
          <td>证明文件</td>
          <td>
            <downloadFile :data="workPerienceData" />
          </td>
        </tr>
      </table>
    </div>
  </el-dialog>
</template>

<script>
/* api */
import { queryTBExpertCareerById } 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: 'WorkExperienceDetailDialog',
  components: {
    downloadFile
  },
  mixins: [expertWorkPerience],
  props: {
    // 弹框展示状态
    dialogData: {
      type: Object,
      default: function() {
        return {
          dialog: false, // 展示状态
          id: ''// 编辑时才会有财务状况id
        }
      }
    }
  },
  data() {
    return {
      // // 上传附件参数
      workPerienceData: {
        bizId: '', // 业务主键Id
        fileType: 'EXPERT_UPLOAD_CAREER_PROVE'// 文件类型
      },
      workExperienceInfo: {}
    }
  },
  created() {
    // 获取数据
    const data = {
      id: this.dialogData.id
    }
    this.workExperienceDetail(data)
  },
  methods: {
    filterDictText,
    // 获取任职经历详情
    workExperienceDetail(data) {
      queryTBExpertCareerById(data).then(res => {
        this.workExperienceInfo = res.data
        this.workPerienceData.bizId = this.workExperienceInfo.id
      })
    }
  }
}
</script>
