<template>
  <div>
    <div class="layout-content-padding">
      <div class="layout-content-main">
        <el-tabs v-model="activeName" @tab-click="_changeTabs">
          <el-tab-pane label="试验项目报告审核" name="lab">
            <reportMake ref="labTabs" />
          </el-tab-pane>
          <el-tab-pane label="试验项目报告审核历史" name="his">
            <historyTask ref="hisTabs" />
          </el-tab-pane>
        </el-tabs>
      </div>
    </div>
  </div>
</template>
<script>
import reportMake from './tabs/ExpReportCheck'
import historyTask from './tabs/ExpReportCheckHis'

export default {
  components: { reportMake, historyTask },
  data() {
    return {
      activeName: 'lab'
    }
  },
  mounted() {
    this.activeName = 'lab'
    this._page()
  },
  methods: {
    _changeTabs(tab, event) {
      if (tab.name === 'lab') {
        this._page()
      } else {
        this.$refs.hisTabs._clearPage()
        this.$refs.hisTabs._page()
      }
    },
    _page() {
      this.$refs.labTabs._clearPage()
      this.$refs.labTabs._page()
    }
  }
}
</script>
