 <template>
  <div class="m-container">
    <h2>
      <div class="squrt"></div>
      异常数据查询
      <!-- <filter-search
        v-if="$route.query.tabrouter === 'teamSchedule'"
        :keys="['searchType']"
        :moreKeys="['organId']"
        @reload="reloadItem"
      /> -->
    </h2>
    <div class="m-core">
      <tab-router @change="changeKey">
              <el-tab-pane
          v-if="permission('/indexErrDataRecord/historyError')"
          lazy
          label="异常数据查询汇总"
          name="historyError"
        >
          <historyError v-if="activeKey === 'historyError'"  />
        </el-tab-pane>
        <el-tab-pane
          v-if="permission('/indexErrDataRecord/patrol')"
          lazy
          label="乐团巡查事项异常"
          name="patrol"
        >
          <patrol v-if="activeKey === 'patrol'"  searchType='MUSIC_PATROL_ITEM'/>
        </el-tab-pane>
        <el-tab-pane
          v-if="permission('/indexErrDataRecord/inspection')"
          lazy
          label="乐团巡查任务未提交"
          name="inspection"
        >
        <patrol v-if="activeKey === 'inspection'"  searchType='INSPECTION_ITEM_PLAN'/>
        </el-tab-pane>
        <el-tab-pane
          v-if="permission('/indexErrDataRecord/studentvisit')"
          lazy
          label="回访任务未完成"
          name="studentvisit"
        >
          <visitError v-if="activeKey === 'studentvisit'" searchType='STUDENT_VISIT'/>
        </el-tab-pane>
        <el-tab-pane
          v-if="permission('/indexErrDataRecord/errattendance')"
          lazy
          label="课程考勤异常"
          name="errattendance"
        >
          <errorCourse v-if="activeKey === 'errattendance'"   searchType="ERR_ATTENDANCE"/>
        </el-tab-pane>
        <el-tab-pane
          v-if="permission('/indexErrDataRecord/noattendance')"
          lazy
          label="课程异常"
          name="noattendance"
        >
          <errorCourse v-if="activeKey === 'noattendance'"   searchType="NO_ATTENDANCE" />
        </el-tab-pane>
      </tab-router>
    </div>
  </div>
</template>
<script>
import { permission } from "@/utils/directivePage";
import patrol from './components/patrol'
import visitError from './components/visitError'
import errorCourse from './components/errorCourse'
import historyError from './components/historyError'
export default {
  name: "indexErrDataRecord",
  components:{patrol,visitError,errorCourse,historyError},
  data() {
    return {
      activeKey: "",
    };
  },
  methods: {
    permission,
    changeKey(val) {
      this.activeKey = val;
    },
    reloadItem() {
      if (this.$refs.teamSchedule) {
        this.$refs.teamSchedule.getList();
      }
    },
  },
};
</script>
