EquityTop.vue 1.32 KB
<template>
  <div class="pie-box">
    <TotalBill :totalBillData="numProportion" :totalNum="totalNum"></TotalBill>
    <TotalMerchant :totalMerchantData="merProportion" :totalMerchant="totalMerchant"></TotalMerchant>
  </div>
</template>

<script>
import TotalBill from './components/TotalBill.vue'
import TotalMerchant from './components/TotalMerchant.vue'
export default {
  name: 'EquityTop',
  components: {
    TotalBill,
    TotalMerchant
  },
  data() {
    return {
      totalNum: 0,
      totalMerchant: 0,
      merProportion: [],
      numProportion: [],
      month: ''
    }
  },

  created() {
    this.$bus.$on('selectMonthChange', val => {
      if (val === '全部') val = ''
      this.month = val
      this.getWholesaleNum()
    })
    this.getWholesaleNum()
  },

  mounted() {},

  methods: {
    async getWholesaleNum() {
      const params = {
        statMonth: this.month
      }
      const _result = await this.api.equity.getWholesaleNum(params)
      const { merProportion, numProportion, totalNum, totalMerchant } = _result.data.dataList[0]
      this.merProportion = merProportion
      this.numProportion = numProportion
      this.totalNum = totalNum
      this.totalMerchant = totalMerchant
    }
  }
}
</script>

<style lang="scss" scoped>
.pie-box {
  display: flex;
  justify-content: space-between;
}
</style>