<template>
  <div class="form-wrap">
    <div style="padding: 10px">
      <el-tabs
        v-model="activeName"
        @tab-click="handleTabClick">
        <el-tab-pane
          name="saleStat"
          label="分账销售统计">
          <SaleStat ref="saleStat" />
        </el-tab-pane>
        <el-tab-pane
          name="checkStat"
          label="分账核销统计">
          <CheckStat ref="checkStat" />
        </el-tab-pane>
      </el-tabs>
    </div>
  </div>
</template>

<script>
import SaleStat from './SaleStat'
import CheckStat from './CheckStat'

export default {
  components: {
    SaleStat,
    CheckStat
  },
  data () {
    return {
      activeName: 'saleStat'
    }
  },
  mounted () {
    this.$refs.saleStat.getList()
  },
  methods: {
    handleTabClick (tab, e) {
      console.log(tab.name)
      if (this.$refs[tab.name]) {
        this.$refs[tab.name].getList()
      }
    }
  }
}
</script>

  <style lang="scss" scoped>
  .offSale-btn{
    color: #F56C6C
  }
  .onSale-btn{
    color: #67C23A
  }
  </style>
