<template>
  <div class="edit">
    <div class="container normal-panel">
      <p class="normal-title normal-margin">基础信息</p>
      <el-descriptions :column="4">
          <el-descriptions-item label="年度">{{detail.year}}</el-descriptions-item>
          <el-descriptions-item label="部门">{{detail.depname}}</el-descriptions-item>
          <el-descriptions-item label="人员姓名">{{detail.name}}</el-descriptions-item>
          <el-descriptions-item label="职位">{{detail.position}}</el-descriptions-item>
          <el-descriptions-item label="营销区域">{{detail.areaname}}</el-descriptions-item>
          <el-descriptions-item label="状态">
            <span :style="{color:detail.status=='下达' ? '#9BC464' : '#000000'}">{{detail.status}}</span>
          </el-descriptions-item>
      </el-descriptions>
    </div>
    <div class="container normal-panel" style="margin-top:16px">
      <p class="normal-title normal-margin">基本信息</p>
        <el-descriptions :column="4">
          <el-descriptions-item label="创建人">{{detail.createby}}</el-descriptions-item>
          <el-descriptions-item label="创建时间">{{detail.createdate}}</el-descriptions-item>
          <el-descriptions-item label="最近调整人">{{detail.changeby}}</el-descriptions-item>
          <el-descriptions-item label="最近调整时间">{{detail.changedate}}</el-descriptions-item>
          <el-descriptions-item label="下达人">{{detail.checkby}}</el-descriptions-item>
          <el-descriptions-item label="下达时间">{{detail.checkdate}}</el-descriptions-item>
        </el-descriptions>
    </div>
    <div class="container normal-panel" style="margin-top:16px">
      <Table></Table>
    </div>
  </div>
</template>

<script>
import Header from '@/SManagement/archives_upload/components/Header'
import Search from '@/components/search/index'
import Table from '../components/detailTable'
export default {
  name: '',
  data() {
    return {
      detail: ''
    };
  },
  components: { Header , Search ,Table},
  computed:{
  },
  watch:{
  },
  created() {
    this.getPersonalDetail()
    this.getTargetList()
  },
  methods: {
    async getPersonalDetail() {
      let res = await this.$api.requested({
          "id": 20220904190202,
          "content": {
              "year": this.$route.query.year,
              "hrid":this.$route.query.id
          },
      })
      this.detail = res.data
      console.log(this.detail);
    },
    async getTargetList() {
      let res = await this.$api.requested({
        "id": 20220904192002,
        "content": {
            "year": this.$route.query.year,
            "hrid":this.$route.query.id,
            "where":{
                "condition":""//支持部门名称查询
            }
        }
      })
    }
  },
};
</script>

<style scoped>
  .header {
    display: flex;
    justify-content: space-between;
  }
</style>
