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
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
<template>
  <div class="pb50" v-loading="loading">
    <!--订单进度-->
    <!--内容-->
    <div class="common-seach-wrap ww100">
      <el-form size="small" :inline="true" :model="formInline" class="demo-form-inline ww100">
        <div class="date_section d-b-c">
          <div class="flex-1">
            <el-form-item label="选择店铺">
              <el-select size="small" v-model="formInline.shop_supplier_id" placeholder="请选择" @change="handleClick">
                <el-option label="全部" :value="0"></el-option>
                <el-option v-for="(item, index) in supplierList" :key="index" :label="item.name"
                  :value="item.shop_supplier_id"></el-option>
              </el-select>
            </el-form-item>
            <el-form-item label="查询日期">
              <el-radio-group v-model="formInline.type" size="medium" @change="handleClick">
                <el-radio-button :label="1">今天</el-radio-button>
                <el-radio-button :label="2">近七天</el-radio-button>
                <!-- <el-radio-button :label="3">近十五天</el-radio-button> -->
                <el-radio-button :label="5">当月</el-radio-button>
                <el-radio-button :label="4">自定义时间</el-radio-button>
              </el-radio-group>
            </el-form-item>
          </div>
          <div>
            <el-form-item label="起始时间" v-if="formInline.type==4">
              <div class="block">
                <span class="demonstration"></span>
                <el-date-picker @change="handleClick" size="small" v-model="formInline.time" type="daterange"
                  value-format="yyyy-MM-dd" range-separator="至" start-placeholder="开始日期" end-placeholder="结束日期">
                </el-date-picker>
              </div>
            </el-form-item>
          </div>
          <el-form-item><el-button size="small" type="success" @click="onExport">导出</el-button></el-form-item>
        </div>
      </el-form>
    </div>
 
    <div class="common-form">收入统计表</div>
    <el-table size="small" :data="tableData" border style="width: 100%" v-loading="loading">
      <el-table-column header-align="center" align="center" type="day" prop="day" label="日期"></el-table-column>
      <el-table-column header-align="center" align="center" prop="pay_balance" label="余额支付"></el-table-column>
      <el-table-column header-align="center" align="center" prop="pay_wx" label="付呗支付"></el-table-column>
      <el-table-column header-align="center" align="center" prop="pay_cash" label="线下支付"></el-table-column>
      <el-table-column header-align="center" align="center" prop="pay_other" label="其他支付"></el-table-column>
      <el-table-column header-align="center" align="center" prop="coupon" label="优惠券"></el-table-column>
      <el-table-column header-align="center" align="center" prop="fullreduce" label="满减金额"></el-table-column>
      <el-table-column header-align="center" align="center" prop="points" label="积分金额"></el-table-column>
      <el-table-column header-align="center" align="center" prop="refund_money" label="退款金额"></el-table-column>
    </el-table>
 
  </div>
</template>
 
<script>
  import StatisticsApi from '@/api/statistics.js';
  import qs from 'qs';
  export default {
    data() {
      return {
        active: 0,
        /*是否加载完成*/
        loading: true,
        formInline: {
          order_type: 0,
          type: 1,
          shop_supplier_id: 0,
          time: '',
          persona_id:0
        },
        supplierList: [],
        personaList:[],
        tableData: [],
      };
    },
    created() {
      /*获取列表*/
      this.getParams();
    },
    methods: {
      /*获取参数*/
      getParams() {
        let self = this;
        let params = self.formInline;
        params.page = self.curPage;
        params.list_rows = self.pageSize;
        self.loading = true;
        StatisticsApi.getIncomeOrderDate(params,
            true
          )
          .then(data => {
            self.detail = data.data.detail;
            self.supplierList = data.data.supplierList;
            self.personaList = data.data.personaList;
            self.tableData = data.data.list;
            self.loading = false;
          })
          .catch(error => {
            self.loading = false;
          });
      },
 
      /*切换菜单*/
      handleClick() {
        let self = this;
        if (self.formInline.type == 4 && !self.formInline.time) {
          return
        }
        self.curPage = 1;
        self.getParams()
      },
      /*渠道身份*/
      personaClick() {
        let self = this;
        self.curPage = 1;
        self.getParams()
      },
      onExport: function() {
        let baseUrl = window.location.protocol + '//' + window.location.host;
        window.location.href = baseUrl + '/index.php/shop/statistics.Income/export?' + qs.stringify(this.formInline);
      },
      selectId(e) {
        this.formInline.shop_supplier_id = e;
        this.getParams()
      },
    }
  };
</script>
<style lang="scss">
  .el-row {
    margin-bottom: 20px;
 
    &:last-child {
      margin-bottom: 0;
    }
  }
 
  .el-col {
    border-radius: 4px;
  }
 
  .grid-content {
    padding: 20px;
    border-radius: 4px;
    min-height: 36px;
  }
 
  .bg-purple {
    background: #f4f4f4;
  }
 
  .table-wrap {
    padding: 20px;
    padding-top: 0;
  }
 
  .common-form-data {
    margin-left: 15px;
    font-weight: 500;
  }
 
  .tips {
    padding: 15px;
    margin-bottom: 20px;
  }
 
  .tips_tit {
    font-size: 22px;
    margin-bottom: 10px;
  }
 
  .tips_txt {
    line-height: 25px;
    color: #666;
    font-size: 14px;
  }
 
  .detail_prici {
    font-size: 20px;
    color: #000;
    font-weight: bold;
    margin-top: 10px;
    max-width: 250px;
  }
</style>