<template>
  <div class="EmployeeDetails">
    <div>
      基础信息<br />
      姓名:{{empData.EmployeeName}}
      性别:{{empData.SexStr}}
      生日:{{empData.BirthDateStr}}
      学历:{{empData.EducationStr}}
      <br />
      电话:{{empData.EmployeeTel}}
      身份证:{{empData.IDCard}}

      <br />
      邮箱:
      <br />
      住址:{{empData.Address}}
    </div>
    <div>
      职务信息<br />

      职位:{{empData.PostName}}
      入职时间:{{empData.EntryTime}}
      状态:{{empData.LeaveStatusStr}}

      <br />
      公司:{{empData.SchoolName}}
      部门:{{empData.DeptName}}
    </div>
  </div>
</template>

<script>
  import {
    queryEmployeeInfo,
  } from '../../../api/school/index'
  export default {
    props: {
      saveObj: {
        type: Object,
        default: null
      }
    },
    name: "EmployeeDetails",
    data() {
      return {
        qMsg: {
          Id: 0, //账号表中的Id
          AccountId: 0, //账号表中的AccountId
          AccountType: 0, //账号表中的AccountType
        },
        empData: {}, //员工信息
      }
    },
    created() {
      if (this.saveObj) {
        this.qMsg.Id = this.saveObj.Id;
        this.qMsg.AccountId = this.saveObj.AccountId;
        this.qMsg.AccountType = this.saveObj.AccountType;
      }
    },
    mounted() {
      this.getEmpInfo();
    },
    methods: {
      getEmpInfo() {
        queryEmployeeInfo(this.qMsg).then(res => {
          if (res.Code == 1) {
            this.empData = res.Data;
            console.log("this.empData", this.empData);
          }
        })
      }
    },
  }

</script>
