quanwei
18 hours ago c441dea81bd86bdfb12dff35821fed51f4cc91c2
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
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
<template>
  <!--
          作者:luoyiming
          时间:2019-10-24
          描述:统计-销售统计-总计
      -->
 
  <div class="ww100 pt16">
    <div class="common-form">订单统计</div>
    <div class="d-b-c">
      <div>
        <el-date-picker
          size="small"
          v-model="datePicker"
          type="daterange"
          align="right"
          unlink-panels
          format="yyyy-MM-dd"
          value-format="yyyy-MM-dd"
          range-separator="至"
          start-placeholder="开始日期"
          end-placeholder="结束日期"
          @change="changeDate"
          :picker-options="pickerOptions"
        ></el-date-picker>
      </div>
    </div>
    <div class="d-a-c lh30 mt30">
      <div class="flex-1 tc">
      <p>成交额</p>
      <p class="f20 fb gray3">{{dataModel.order.order_total_price.total}}</p>
    </div>
    <div class="flex-1 tc">
      <p>客单价</p>
      <p class="f20 fb gray3">{{dataModel.order.order_per_price.total}}</p>
    </div>
    <div class="flex-1 tc">
      <p>付款订单</p>
      <p class="f20 fb gray3">{{dataModel.order.order_total.total}}</p>
    </div>
    <div class="flex-1 tc">
      <p>付款人数</p>
      <p class="f20 fb gray3">{{dataModel.order.order_user_total.total}}</p>
    </div>
    <div class="flex-1 tc">
      <p>成功退款金额</p>
      <p class="f20 fb gray3">{{dataModel.order.order_refund_money.total}}</p>
    </div>
    <div class="flex-1 tc">
      <p>退款订单</p>
      <p class="f20 fb gray3">{{dataModel.order.order_refund_total.total}}</p>
    </div>
    </div>
 
     <!-- <div class="pt30 tc" style="width: 80px;">
      <p class="gray9">今日</p>
      <p class="gray9">昨日</p>
    </div>
    <div class="flex-1 tc">
      <p>成交额</p>
      <p class="f20 fb gray3">{{dataModel.order.order_total_price.today}}</p>
      <p class="gray">{{dataModel.order.order_total_price.yesterday}}</p>
    </div>
    <div class="flex-1 tc">
      <p>客单价</p>
      <p class="f20 fb gray3">{{dataModel.order.order_per_price.today}}</p>
      <p class="gray">{{dataModel.order.order_per_price.yesterday}}</p>
    </div>
    <div class="flex-1 tc">
      <p>付款订单</p>
      <p class="f20 fb gray3">{{dataModel.order.order_total.today}}</p>
      <p class="gray">{{dataModel.order.order_total.yesterday}}</p>
    </div>
    <div class="flex-1 tc">
      <p>付款人数</p>
      <p class="f20 fb gray3">{{dataModel.order.order_user_total.today}}</p>
      <p class="gray">{{dataModel.order.order_user_total.yesterday}}</p>
    </div>
    <div class="flex-1 tc">
      <p>成功退款金额</p>
      <p class="f20 fb gray3">{{dataModel.order.order_refund_money.today}}</p>
      <p class="gray">{{dataModel.order.order_refund_money.yesterday}}</p>
    </div>
    <div class="flex-1 tc">
      <p>退款订单</p>
      <p class="f20 fb gray3">{{dataModel.order.order_refund_total.today}}</p>
      <p class="gray">{{dataModel.order.order_refund_total.yesterday}}</p>
    </div> -->
  </div>
</template>
<script>
 
import StatisticsApi from '@/api/statistics.js';
import { formatDate } from '@/utils/DateTime.js'
export default {
  components:{
  },
  data() {
    let endDate=new Date();
    let startDate=new Date();
    startDate.setTime(startDate.getTime()- 3600 * 1000 * 24 * 7);
    return {
      /*是否正在加载*/
      loading: true,
      /*时间快捷选项*/
      pickerOptions: {
        shortcuts: [
          {
            text: '最近一周',
            onClick(picker) {
              const end = new Date();
              const start = new Date();
              start.setTime(start.getTime() - 3600 * 1000 * 24 * 7);
              picker.$emit('pick', [start, end]);
            }
          },
          {
            text: '最近一个月',
            onClick(picker) {
              const end = new Date();
              const start = new Date();
              start.setTime(start.getTime() - 3600 * 1000 * 24 * 30);
              picker.$emit('pick', [start, end]);
            }
          },
          {
            text: '最近三个月',
            onClick(picker) {
              const end = new Date();
              const start = new Date();
              start.setTime(start.getTime() - 3600 * 1000 * 24 * 90);
              picker.$emit('pick', [start, end]);
            }
          }
        ]
      },
      datePicker: [formatDate(startDate,'yyyy-MM-dd'),formatDate(endDate,'yyyy-MM-dd')],
      dataModel:[],
    };
  },
  inject: ['supplier_id'],
  created() {
     this.getData();
  },
  methods: {
    /*选择时间*/
    changeDate() {
      this.getData();
    },
    /*获取列表*/
    getData() {
      let self = this;
      self.loading = true;
      StatisticsApi.getOrderData({
        search_time: self.datePicker,
        shop_supplier_id:self.supplier_id,
      }, true)
        .then(res => {
          self.dataModel = res.data;
          self.loading = false;
        })
        .catch(error => {});
    },
 
 
  }
};
</script>
 
<style>
</style>