<!--
  @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>
            {{ experEducationInfo.graduateSchool }}
          </td>
        </tr>
        <tr>
          <td>所学专业</td>
          <td>
            {{ experEducationInfo.specialty }}
          </td>
        </tr>
        <tr>
          <td>学历</td>
          <td>
            {{ experEducationInfo.educationDvCode }}
          </td>
        </tr>
        <tr>
          <td>入学时间</td>
          <td>
            {{ experEducationInfo.startDate }}
          </td>
        </tr>
        <tr>
          <td>毕业时间</td>
          <td>
            {{ experEducationInfo.endDate }}
          </td>
        </tr>
        <tr>
          <td>证明文件</td>
          <td>
            <downloadFile :data="photoIdType" />
          </td>
        </tr>
      </table>
    </div>
  </el-dialog>
</template>

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