1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
<template>
  <!--
          作者:luoyiming
          时间:2019-10-24
          描述:统计-销售统计
      -->
    <div v-loading="loading" style="min-height: 400px;">
      <!--汇总-->
      <Total v-if="!loading"></Total>
      <!--交易统计-->
      <Transaction v-if="!loading"></Transaction>
      <!--商品统计-->
      <Product v-if="!loading"></Product>
    </div>
</template>
 
<script>
  import StatisticsApi from '@/api/statistics.js';
  import Total from './part/Total.vue'
  import Transaction from './part/Transaction.vue'
  import Product from './part/Product.vue'
  export default{
    components:{
      Total,
      Transaction,
      Product
    },
    data(){
      return{
        /*是否正在加载*/
        loading:true,
        /*数据对象*/
        dataModel:{}
      }
    },
    provide: function () {
      return {
        dataModel: this.dataModel
      }
    },
    created() {
 
      this.getData();
    },
    methods:{
 
      /*获取数据*/
      getData() {
        let self = this;
        StatisticsApi.getOrderTotal({}, true)
          .then(res => {
            Object.assign(self.dataModel, res.data);
            self.loading = false;
          })
          .catch(error => {});
      }
 
    }
  }
</script>
 
<style>
</style>