<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="check">
            <ReportMakeByEntrust ref="checkTabs"></ReportMakeByEntrust>
          </el-tab-pane>
          <el-tab-pane label="历史报告" name="checkHis">
            <ReportMakeHis ref="checkHisTabs"></ReportMakeHis>
          </el-tab-pane>
        </el-tabs>
      </div>
    </div>
  </div>
</template>

<script>
import ReportMakeByEntrust from './tabs/ReportMakeByEntrust'
import ReportMakeHis from './ReportMakeHis'

export default {
  components: {
    ReportMakeByEntrust,
    ReportMakeHis
  },
  data() {
    return {
      activeName: 'check'
    }
  },
  mounted() {
    this.activeName = 'check'
    this.$refs.checkTabs._page()
  },
  methods: {
    _changeTabs(tab, event) {
      if (tab.name === 'check') {
        this.$refs.checkTabs._open()
      } else if (tab.name === 'applyRecord') {
        // this.$refs.applyRecordTabs._page()
      } else {
        this.$refs.checkHisTabs._page()
      }
    }
  }
}
</script>
