<template>
  <div class="page-body">
    <div class="page-search row items-center">
      <div class="col row wrap q-col-gutter-md">
        <div class="col-3">
          <q-input filled stack-label dense v-model="teacherDate" label="月份" disable maxlength="20" />
        </div>
        <div class="col-3">
          <q-select filled stack-label option-value="Id" option-label="EmployeeName" disable
            v-model="saveObj.TeacherAccountId" ref="Teacher_Id" :options="TeacherList" label="老师" dense
            class="col-3 q-pr-lg q-pb-lg" emit-value map-options />
        </div>
      </div>
    </div>
    <div class="page-content">
      <table class="jobTable" style="border-collapse:collapse;">
        <tbody v-for="(item,index) in saveObj.DetailsList" :key="index">
          <tr>
            <th width="150">类别</th>
            <th width="150">内容</th>
            <th v-for="(sItem,tindex) in item.SubtypeList[0].OptionList" :key="tindex">
              <div>{{sItem.LevelTitle}}</div>
              <div>{{sItem.LevelScore}} 分</div>
            </th>
            <th width="100">教学主管考核</th>
            <th width="100">教务主管考核</th>
          </tr>
          <tr>
            <td :rowspan="item.SubtypeList.length+1">{{item.TypeName}}</td>
          </tr>
          <tr v-for="(sItem,sIndex) in item.SubtypeList" :key="sIndex">
            <td>{{sItem.SubTypeName}}</td>
            <td v-for="(cItem,cIndex) in sItem.OptionList" style="position:relative;" :key="cIndex">
              <template v-if="cItem.LevelDesc!=''&&cItem.LevelScore>0">
                <el-tooltip class="item" effect="dark" :content="cItem.LevelDesc" placement="top-start">
                  <i style="position:absolute;left:3px;top:3px;" class="iconfont icon-bangzhu"></i>
                </el-tooltip>
                <q-checkbox v-model="cItem.IsCheck" disable val="teal" color="green" />
              </template>
            </td>
            <td>{{sItem.S_TeacherScore}}</td>
            <td>{{sItem.S_JiaoWuScore}}</td>
          </tr>
        </tbody>
        <tfoot>
          <tr>
            <td colspan="2">教学主管考核得分</td>
            <td colspan="2">
              {{saveObj.TeacherScore}}
            </td>
            <td colspan="2">
              教务主管考核得分
            </td>
            <td colspan="3">
              {{saveObj.JiaoWuScore}}
            </td>
          </tr>
          <tr>
            <td colspan="2">
              最终考核得分总计
              <br />
              得分=(教学主管考核*30%+教务主管考核*70%)
            </td>
            <td>
              {{saveObj.TotalScore}}
            </td>
            <td>
              教学负责人：
            </td>
            <td>
              {{saveObj.S_JiaoXue_CreateByName}}
            </td>
            <td>
              {{saveObj.S_JiaoXue_Time}}
            </td>
            <td>
              教务负责人：
            </td>
            <td>
              {{saveObj.S_JiaoWu_CreateByName}}
            </td>
            <td>
              {{saveObj.S_JiaoWu_Time}}
            </td>
          </tr>
          <!-- <tr>
            <td colspan="9" style="text-align:left;padding-left:5px;">
              注：以下由部门考核者填写
            </td>
          </tr>
          <tr>
            <td colspan="9" style="text-align:left;padding-left:5px;">
              1、该员工的综合工作表现如何？
            </td>
          </tr>
          <tr>
            <td colspan="9" style="text-align:left;padding-left:5px;">
              {{saveObj.Behavior}}
            </td>
          </tr>
          <tr>
            <td colspan="9" style="text-align:left;padding-left:5px;">
              2、主要缺点：{{saveObj.Advantage}}
            </td>
          </tr>
          <tr>
            <td colspan="9" style="text-align:left;padding-left:5px;">
              &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;主要优点：{{saveObj.ShortComing}}
            </td>
          </tr>
          <tr>
            <td colspan="9" style="text-align:left;padding-left:5px;">
              3、该员工发展潜力如何？
            </td>
          </tr>
          <tr>
            <td colspan="9" style="text-align:left;padding-left:5px;">
              {{saveObj.Potential}}
            </td>
          </tr>
          <tr>
            <td colspan="9" style="text-align:left;padding-left:5px;">
              人力资源部审核：
            </td>
          </tr>
          <tr>
            <td colspan="9" style="text-align:left;padding-left:5px;">
              校长审批：
            </td>
          </tr>
          <tr>
            <td colspan="9" style="text-align:center;padding-left:5px;">
              绩效考核结果沟通
            </td>
          </tr>
          <tr>
            <td colspan="9" style="text-align:left;padding-left:5px;">
              注：以下由被考核者填写
            </td>
          </tr>
          <tr>
            <td colspan="9" style="text-align:left;padding-left:5px;">
              1、您的上级怎样帮助你，将使你未来的工作绩效更高？
            </td>
          </tr>
          <tr>
            <td colspan="9" style="text-align:left;padding-left:5px;">
              {{saveObj.Help}}
            </td>
          </tr>
          <tr>
            <td colspan="9" style="text-align:left;padding-left:5px;">
              2、对公司的发展有什么建议？
            </td>
          </tr>
          <tr>
            <td colspan="9" style="text-align:left;padding-left:5px;">
              {{saveObj.Suggest}}
            </td>
          </tr>
          <tr>
            <td colspan="9" style="text-align:left;padding-left:5px;">
              3、其他意见：
            </td>
          </tr>
          <tr>
            <td colspan="9" style="text-align:left;padding-left:5px;">
              {{saveObj.Other}}
            </td>
          </tr>
          <tr>
            <td colspan="9" style="text-align:left;padding-left:5px;">
              签字/日期：{{saveObj.TeacherSignDate}}
            </td>
          </tr> -->
        </tfoot>
      </table>
    </div>
  </div>
</template>
<script>
  import {
    queryEmployee
  } from "../../api/users/user";
  import {
    getTeacherAssessmentById,
  } from "../../api/teacher/index";
  export default {
    meta: {
      title: "中教每月工作考核详情"
    },
    components: {},
    data() {
      return {
        TeacherList: [], //关联教师下拉数据
        teacherDate: "", //考核月份
        saveObj: {},
        msg: {
          Id: 0
        },
        isAuth: false, //是否有权限
        saveLoading: false,
      }
    },
    created() {
      if (this.$route.query && this.$route.query.Id) {
        this.msg.Id = this.$route.query.Id
      }
      this.GetTeacherList();
    },
    mounted() {
      this.getInfo();
    },
    methods: {
      //获取教师下拉
      GetTeacherList() {
        var qMsg = {
          IsLeave: 1,
          AccountTypeStr: 2,
          QDeptIds: "8,14"
        };
        queryEmployee(qMsg).then(res => {
          if (res.Code == 1) {
            this.TeacherList = res.Data;
          }
        });
      },
      //获取教师考核数据
      getInfo() {
        getTeacherAssessmentById(this.msg).then(res => {
          if (res.Code == 1) {
            var tempData = res.Data;
            this.saveObj = tempData;
            this.teacherDate = this.saveObj.YearStr + "-" + this.saveObj.MonthStr;
          }
        })
      },
    }
  }
</script>
<style lang="sass">
  @import url('~assets/css/table.sass')
</style>
<style scoped>
  .jobTable {
    width: 100%;
    text-align: center;
  }

  .jobTable tr td {
    height: 40px;
    color: #000;
    border: 1px solid #d1d1d1;
  }

  .jobTable tr th {
    height: 40px;
    background-color: rgb(238, 238, 239);
  }
</style>