CustomerData.vue 2.97 KB
<template>
  <div class="Dashboard-CustomerMoneyData">
    <div class="Dashboard-SearchBar bothSearch">
      <search-item label="运营商">
        <operator-select
          :accessType="1"
          :value="filters.operateId"
          @input="val => updateFilters({operateId: val,areaId:undefined})"
        />
      </search-item>
      <search-item label="区域">
        <dashboard-area-select
          :operateId="filters.operateId"
          :value="filters.areaId"
          @input="val => updateFilters({areaId: val})"
        />
      </search-item>
      <el-radio-group
        class="Dashboard-Radio"
        :value="filters.timeType"
        @input="val => updateFilters({timeType: val})"
      >
        <el-radio
          class="Dashboard-Radio-item"
          :label="0"
        >本日</el-radio>
        <el-radio
          class="Dashboard-Radio-item"
          :label="1"
        >本月</el-radio>
        <el-radio
          class="Dashboard-Radio-item"
          :label="2"
        >本年</el-radio>
      </el-radio-group>
      <el-button
        :loading="consumptionLoading||rechargeLoading"
        type="primary"
        @click="fetchAllData"
      >搜索</el-button>
    </div>
    <div class="Dashboard-CustomerMoneyData-chart">
      <CustomerRecharge />
      <CustomerConsumption />
    </div>
  </div>

</template>

<script>
import CustomerRecharge from '../CustomerRecharge/CustomerRecharge';
import CustomerConsumption from '../CustomerConsumption/CustomerConsumption';
import { mapGetters, mapActions } from 'vuex';
import { getFilters } from '@/utils/index';

export default {
  name: 'CustomerMoneyData',
  components: {
    CustomerRecharge,
    CustomerConsumption,
  },
  computed: {
    ...mapGetters('Dashboard/customerData', ['filters']),
    ...mapGetters('Dashboard/customerData/customerConsumption', {
      consumptionLoading: 'loading',
    }),
    ...mapGetters('Dashboard/customerData/customerRecharge', {
      rechargeLoading: 'loading',
    }),
  },
  methods: {
    ...mapActions('Dashboard/customerData', ['updateFilters']),
    ...mapActions('Dashboard/customerData/customerConsumption', [
      'getConsumeOrderList',
    ]),
    ...mapActions('Dashboard/customerData/customerRecharge', [
      'getRechargeOrderList',
    ]),
    fetchAllData() {
      this.getConsumeOrderList();
      this.getRechargeOrderList();
    },
  },
};
</script>

<style lang="scss">
.Dashboard-CustomerMoneyData {
  .Dashboard & .Dashboard-SearchBar.bothSearch {
    justify-content: flex-start;
    align-items: center;
    .Dashboard-Radio {
      margin-left: 20px;
    }
  }

  .Dashboard-CustomerMoneyData-chart {
    display: flex;
    width: 100%;
    .CustomerRecharge {
      flex: 1;
      position: relative;
      margin-right: 30px;
    }
    .CustomerRecharge::after {
      content: '';
      position: absolute;
      height: 80%;
      top: 10%;
      right: -25px;
      border-right: 1px dotted #eee;
    }
    .CustomerConsumption {
      flex: 1;
    }
  }
}
</style>