<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 './TakeByEntrust'
import ReceiveBySample from './TakeBySample'

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>
