<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/ExpReportIssue'
import historyTask from './tabs/ExpReportIssueHis'

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>
