<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 ReceiveByEntrust from './AllotByEntrust'
import ReceiveBySample from './AllotBySample'

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>
