<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="entrust">
            <ReceiveByEntrust ref="entrustTabs"></ReceiveByEntrust>
          </el-tab-pane>
          <el-tab-pane label="分配历史" name="sample">
            <ReceiveBySample ref="sampleTabs"></ReceiveBySample>
          </el-tab-pane>
        </el-tabs>
      </div>
    </div>
  </div>
</template>

<script>
import ReceiveBySample from '../test-task-manage-his/AllotByEntrust'
import ReceiveByEntrust from './AllotByEntrust'

export default {
  name: 'MeterSummaryEntrustIndex',
  components: {
    ReceiveByEntrust,
    ReceiveBySample
  },
  data() {
    return {
      activeName: 'entrust'
    }
  },
  mounted() {
    this.activeName = 'entrust'
    this._page()
  },
  methods: {
    _changeTabs(tab, event) {
      if (tab.name === 'entrust') {
        this._page()
      } else {
        this.$refs.sampleTabs._page()
      }
    },
    _page() {
      this.$refs.entrustTabs._page()
    }
  }
}
</script>

<style scoped>
</style>
