<!--  -->
<template>
  <div class="tablePint">
    <div class="tablePint-title">
      员工月度绩效计划与评估表员工月度绩效计划与评估表 --部门负责人部门负责人
    </div>
    <div class="tablePint-aboult">
      <div class="tablePint-aboult-item"
           style="width:100px">
        考核月份
      </div>
      <div class="tablePint-aboult-item"
           style="width:130px">
        {{obj.assessCycle}}
      </div>
      <div class="tablePint-aboult-item"
           style="width:50px">
        工号
      </div>
      <div class="tablePint-aboult-item"
           style="width:50px">
        LY81
      </div>
      <div class="tablePint-aboult-item"
           style="width:80px">
        员工姓名
      </div>
      <div class="tablePint-aboult-item"
           style="width:50px">
        {{obj.currentApprovalStaffName}}
      </div>
      <div class="tablePint-aboult-item"
           style="width:80px">
        一级部门
      </div>
      <div class="tablePint-aboult-item"
           style="width:120px">
        {{obj.departmentOne}}
      </div>
      <div class="tablePint-aboult-item"
           style="width:80px">
        二级部门
      </div>
      <div class="tablePint-aboult-item"
           style="width:100px">
        {{obj.departmentTwo}}
      </div>
      <div class="tablePint-aboult-item"
           style="width:100px">
        三级部门
      </div>
      <div class="tablePint-aboult-item"
           style="width:100px">
        {{obj.departmentThree}}
      </div>
      <div class="tablePint-aboult-item"
           style="width:100px">
        职位
      </div>
      <div class="tablePint-aboult-item"
           style="width:100px">
        前端工程师
      </div>
      <div class="tablePint-aboult-item"
           style="width:100px">
        直属上级
      </div>
      <div class="tablePint-aboult-item"
           style="width:140px">
        杨洋
      </div>
    </div>
    <div class="tablePint-top">
      <div class="tablePint-top-weidu" style="width:100px">
        考核维度
      </div>
      <div class="tablePint-top-mubiao" style="width:130px">
        目标/指标
      </div>
      <div class="tablePint-top-guanjian" style="width:430px">
        关键结果
      </div>
      <div class="tablePint-top-quanzhong" style="width:100px">
        考核权重
      </div>
      <div class="tablePint-top-kaohe" style="width:380px">
        考核结果(员工填写)
      </div>
      <div class="tablePint-top-zhishu" style=" width:100px;flex-direction: column;">
        <div>直属上级</div> <div>评分(100%)</div>
      </div>
      <div class="tablePint-top-defen" style="width:100px">
        得分
      </div>
      <div class="tablePint-top-pingfen" style="width:140px">
        评分说明
      </div>
    </div>
    <div v-for="i in obj.recortModelDtos" :key="i.id">
      <div class="tablePint-content">
        <div class="tablePint-content-left item" style="width:100px;">
          {{i.name}}
        </div>
        <div class="tablePint-content-right">
          <div v-for="j in i.detailDtos" class="tablePint-content-right-item" :key="j.id">
            <div class="item" style="width:130px;">{{j.target}}</div>
            <div class="item pre" style="width:430px;"><pre>{{j.keyResult}}</pre></div>
            <div class="item" style="width:100px">几月交易额</div>
            <div class="item" style="width:380px">{{j.checkResult}}</div>
            <div class="item" style="width:100px">{{j.superScore || '/'}}</div>
            <div class="item" style="width:100px">{{j.acquireScore || '/'}}</div>
            <div class="item" style="width:140px">几月交易额</div>
          </div>
        </div>
      </div>
      <div class="flex ">
        <div class="item bg" style="width:660px;">业务考核结果</div>
        <div class="item bg" style="width:100px;">{{Math.round((i.weight * 100) * 1000) / 1000 }}%</div>
        <div class="item bg" style="width:380px;">/</div>
        <div class="item bg" style="width:100px;">/</div>
        <div class="item bg" style="width:100px;">2.512</div>
        <div class="item bg" style="width:140px;">/</div>
      </div>
    </div>
    <div class="flex">
      <div class="items" style="width:1240px;">最终绩效考核评分</div>
      <div class="item" style="width:100px;">3.234</div>
      <div class="item" style="width:140px;">/</div>
    </div>
    <div class="flex">
      <div class="items" style="width:1240px;">最终绩效考核结果等级</div>
      <div class="item" style="width:100px;">3.5+</div>
      <div class="item" style="width:140px;">/</div>
    </div>
    <div class="flex">
      <div class="items" style="width:740px;padding:20px 10px;">直属上级确认绩效考核内容与结果
      签字：</div>
            <div class="items" style="width:740px;padding:20px 10px;">直属上级确认绩效考核内容与结果
      签字：</div>
    </div>
  </div>
</template>

<script>
import { apiResultGetDetail } from '@/api/assessment'

export default {
  data () {
    return {
      obj: {}
    }
  },
  computed: {
  },
  beforeMount () { },
  mounted () {
    this.handleGetTbale()
  },
  methods: {
    async handleGetTbale (id = this.$route.query.id) {
      let res = await apiResultGetDetail({ id })
      if (res.code !== 200) return
      this.obj = res.data
    }
  },
  watch: {}

}

</script>

<style lang="less" scoped>
.tablePint {
  font-size: 10px;
  div{
    box-sizing: border-box;
  }
  .flex{
    display: flex;
  }
  margin: 10px 10px;
  font-size: 12px;

  color: #5c5c5c;

  border-left: 1px solid #666666;
  &-title {
    .center();
    width: 1480px;
    height: 50px;
    border-top: 1px solid #666666;
    border-right: 1px solid #666666;
    border-bottom: 1px solid #666666;
  }
  &-aboult {
    height: 30px;
    display: flex;
    &-item {
      flex-shrink: 0;
      .center();
      border-right: 1px solid #666666;
      border-bottom: 1px solid #666666;
    }
  }
  &-top {
    display: flex;
    > div {
      flex-shrink: 0;
      .center();
      border-right: 1px solid #666666;
      border-bottom: 1px solid #666666;
    }
    &-weidu {
      width: 100px !important;
    }
  }
  &-content{
    display: flex;
    &-left{
      box-sizing: border-box;
      padding:4px 6px;
    }
    &-right{
      flex: 1 0 auto;
      &-item{
        display: flex;
        >div{
          padding:4px 6px;
          box-sizing: border-box;
        }
      }
    }
  }
  .item {
      flex-shrink: 0;
      .center();
      padding: 6px 10px;
      border-right: 1px solid #666666;
      border-bottom: 1px solid #666666;
    }
  .items {
      flex-shrink: 0;
      padding: 6px 10px;
      border-right: 1px solid #666666;
      border-bottom: 1px solid #666666;
    }
  .bg{
    background-color: rgb(245, 187, 120);
  }
}
</style>
