Browse Source

新增pv&商户分润统计

xialei 1 year ago
parent
commit
85e6a5b975

+ 14 - 0
src/api/accounts.js

@@ -190,6 +190,20 @@ export function getVrCountApi(data) {
190
 }
190
 }
191
 
191
 
192
 /**
192
 /**
193
+ * @description PV统计
194
+ */
195
+export function getPvCountApi(data) {
196
+  return request.get('finance/pv_list', data)
197
+} 
198
+
199
+/**
200
+ * @description 商户分润统计
201
+ */
202
+export function getFenrunApi(data) {
203
+  return request.get('finance/fenrun_list', data)
204
+}
205
+
206
+/**
193
  * @description 佣金统计
207
  * @description 佣金统计
194
  */
208
  */
195
 export function getYongJinCountApi(data) {
209
 export function getYongJinCountApi(data) {

+ 21 - 3
src/router/modules/accounts.js

@@ -173,10 +173,10 @@ const accountsRouter =
173
         meta: {
173
         meta: {
174
           title: '红包统计',
174
           title: '红包统计',
175
           noCache: true
175
           noCache: true
176
-        },
176
+        },  
177
         component: () => import('@/views/accounts/caiwutongji/hongbao/index')
177
         component: () => import('@/views/accounts/caiwutongji/hongbao/index')
178
       },
178
       },
179
-      {
179
+      {  
180
         path: 'count/fugou',
180
         path: 'count/fugou',
181
         name: 'fugou',
181
         name: 'fugou',
182
         meta: {
182
         meta: {
@@ -190,10 +190,28 @@ const accountsRouter =
190
         name: 'vr',
190
         name: 'vr',
191
         meta: {
191
         meta: {
192
           title: 'vr统计',
192
           title: 'vr统计',
193
-          noCache: true
193
+          noCache: true 
194
         },
194
         },
195
         component: () => import('@/views/accounts/caiwutongji/vr/index')
195
         component: () => import('@/views/accounts/caiwutongji/vr/index')
196
       },
196
       },
197
+      {  
198
+        path: 'count/pv',
199
+        name: 'pv',
200
+        meta: {
201
+          title: 'PV统计',
202
+          noCache: true
203
+        },
204
+        component: () => import('@/views/accounts/caiwutongji/pv/index')
205
+      },
206
+      { 
207
+        path: 'count/fenrun',
208
+        name: 'fenrun',
209
+        meta: {
210
+          title: '商户分润统计',
211
+          noCache: true
212
+        },
213
+        component: () => import('@/views/accounts/caiwutongji/fenrun/index')
214
+      },
197
       {
215
       {
198
         path: 'record/bill',
216
         path: 'record/bill',
199
         name: 'billRecord',
217
         name: 'billRecord',

+ 47 - 0
src/views/accounts/caiwutongji/commission/index.vue

@@ -55,8 +55,35 @@
55
                                 <el-option :value="-1" label="已失效"/>
55
                                 <el-option :value="-1" label="已失效"/>
56
                             </el-select>
56
                             </el-select>
57
                         </el-form-item>
57
                         </el-form-item>
58
+
59
+                        <!-- 佣金类型 1代理费 2 消费佣金 3直推奖√ 4辖区佣金\\r\\n5 养老金√ 6 广告费 7 锁客收益 √ 8平台奖励 9渠道商\\r\\n10 推广店铺收益 √ 11.合伙人分红 12联创分红,13 股权分红 -->
60
+                        <el-form-item class="selected-kuang" label="名称:">
61
+                            <el-select
62
+                                v-model="tableFrom.commission_type"
63
+                                class="filter-item"
64
+                                placeholder="全部"
65
+                                @change="getList(1)"
66
+                            >
67
+                                <el-option value="" label="全部"/> 
68
+                                <!-- <el-option :value="1" label="代理费"/>
69
+                                <el-option :value="2" label="消费佣金"/> -->
70
+                                <el-option :value="3" label="直推佣金"/>
71
+                                <!-- <el-option :value="4" label="辖区佣金"/>
72
+                                <el-option :value="5" label="养老金"/>
73
+                                <el-option :value="6" label="广告费"/> -->
74
+                                <el-option :value="7" label="锁客收益"/>
75
+                                <!-- <el-option :value="8" label="平台奖励"/>
76
+                                <el-option :value="9" label="渠道商"/> -->
77
+                                <el-option :value="10" label="推广店铺收益"/>
78
+                                <el-option :value="11" label="合伙人分红"/>
79
+                                <el-option :value="12" label="联创分红"/>
80
+                                <el-option :value="13" label="股权分红"/>
81
+                            </el-select>
82
+                        </el-form-item>
58
                     </el-form>
83
                     </el-form>
59
 
84
 
85
+                    
86
+
60
                     <div class="bottom-button">
87
                     <div class="bottom-button">
61
                         <el-button size="small" style="width: 100px; margin-top: 20px; border: 1px solid #999;"
88
                         <el-button size="small" style="width: 100px; margin-top: 20px; border: 1px solid #999;"
62
                                    @click="reset">重置
89
                                    @click="reset">重置
@@ -116,6 +143,26 @@
116
                       <span v-if="scope.row.user_group == 7"> 董事 </span>
143
                       <span v-if="scope.row.user_group == 7"> 董事 </span>
117
                   </template>
144
                   </template>
118
                 </el-table-column>
145
                 </el-table-column>
146
+
147
+                 <!-- 佣金类型 1代理费 2 消费佣金 3直推奖√ 4辖区佣金\\r\\n5 养老金√ 6 广告费 7 锁客收益 √ 8平台奖励 9渠道商\\r\\n10 推广店铺收益 √ 11.合伙人分红 12联创分红,13 股权分红 -->  
148
+                <el-table-column label="名称" min-width="130" >
149
+                  <template slot-scope="scope">
150
+                      <span v-if="scope.row.commission_type == 1"> 代理费 </span>   
151
+                      <span v-if="scope.row.commission_type == 2"> 消费佣金 </span>
152
+                      <span v-if="scope.row.commission_type == 3"> 直推佣金 </span>
153
+                        <span v-if="scope.row.commission_type == 4"> 辖区佣金 </span>
154
+                        <span v-if="scope.row.commission_type == 5"> 养老金 </span>
155
+                        <span v-if="scope.row.commission_type == 6"> 广告费 </span>
156
+                        <span v-if="scope.row.commission_type == 7"> 锁客收益 </span>
157
+                        <span v-if="scope.row.commission_type == 8"> 平台奖励 </span>
158
+                        <span v-if="scope.row.commission_type == 9"> 渠道商 </span>
159
+                        <span v-if="scope.row.commission_type == 10"> 推广店铺收益 </span>
160
+                        <span v-if="scope.row.commission_type == 11"> 合伙人分红 </span>
161
+                        <span v-if="scope.row.commission_type == 12"> 联创分红 </span>
162
+                        <span v-if="scope.row.commission_type == 13"> 股权分红 </span>
163
+                  </template>
164
+                </el-table-column>
165
+
119
                 <!-- <el-table-column label="隶属团队" min-width="130" prop="team_account"/> -->
166
                 <!-- <el-table-column label="隶属团队" min-width="130" prop="team_account"/> -->
120
                 <el-table-column label="说明" min-width="130" prop="title"/>
167
                 <el-table-column label="说明" min-width="130" prop="title"/>
121
                 <el-table-column label="关联订单" prop="order_sn"  min-width="130">
168
                 <el-table-column label="关联订单" prop="order_sn"  min-width="130">

+ 448 - 0
src/views/accounts/caiwutongji/fenrun/index.vue

@@ -0,0 +1,448 @@
1
+<template>
2
+<div class="divBox">
3
+    <el-card class="box-card">
4
+        <div slot="header" class="clearfix">
5
+            <div class="container">
6
+                <el-form size="small" label-width="100px">
7
+                    <el-form-item label="时间选择:" class="width100">
8
+                        <el-radio-group v-model="tableFrom.date" type="button" class="mr20" size="small" @change="selectChange(tableFrom.date)">
9
+                            <el-radio-button v-for="(item,i) in fromList.fromTxt" :key="i" :label="item.val">{{ item.text }}</el-radio-button>
10
+                        </el-radio-group>
11
+                        <el-date-picker v-model="timeVal" value-format="yyyy/MM/dd" format="yyyy/MM/dd" size="small" type="daterange" placement="bottom-end" placeholder="自定义时间" style="width: 250px;" @change="onchangeTime" />
12
+                    </el-form-item>
13
+                    <el-form-item label="用户手机号:" class="width100">
14
+                        <el-input v-model="tableFrom.phone" placeholder="请输入" class="selWidth" size="small">
15
+                        </el-input>
16
+                    </el-form-item>
17
+                    <!-- <el-form-item label="商户分润变动:" class="selected-kuang">
18
+                      <el-select
19
+                        v-model="tableFrom.pm"
20
+                        placeholder="全部"
21
+                        class="filter-item"
22
+                        @change="getList(1)"
23
+                      >
24
+                        <el-option label="全部" value="" />
25
+                        <el-option label="增加" value="1" />
26
+                        <el-option label="扣减" value="2" />
27
+                      </el-select>
28
+                    </el-form-item> --> 
29
+                    <el-form-item label="分润状态:" class="selected-kuang"> 
30
+                      <el-select 
31
+                        v-model="tableFrom.status"
32
+                        placeholder="全部"
33
+                        class="filter-item"
34
+                        @change="getList(1)"
35
+                      >
36
+                        <el-option label="全部" value="" />
37
+                        <el-option label="已结算" value="1" />
38
+                        <el-option label="未结算" value="-1" />
39
+                        <el-option label="已失效" value="0" />
40
+                      </el-select>
41
+                    </el-form-item>
42
+
43
+                </el-form>
44
+
45
+                <div class="bottom-button">
46
+                  <el-button size="small" @click="reset" style="width: 100px; margin-top: 20px; border: 1px solid; " >重置</el-button>
47
+                  <!-- <el-button type="primary" size="small" @click="exportSearchResult" style="width: 100px; margin-top: 20px;">导出</el-button> -->
48
+
49
+                  <el-button type="primary" size="small" @click="getList(1)" style="width: 100px; margin-top: 20px;">查询</el-button>
50
+                </div>
51
+            </div>
52
+
53
+
54
+
55
+        </div>
56
+
57
+        <div style="display: flex">
58
+          <div class="jiangjintotal" v-for="(v,k) in cardLists" >
59
+            <span class="jiangjintotal-title">{{ v.name }}</span>
60
+            <span class="money">{{ v.count }}</span>
61
+          </div>
62
+        </div>
63
+
64
+        <el-table :data="tableData.data" style="width: 100%" size="mini" class="table" highlight-current-row >
65
+
66
+
67
+            <el-table-column label="ID" prop="id" min-width="100" />
68
+            <el-table-column label="时间" prop="addtime" min-width="150" />
69
+            <!-- <el-table-column label="用户昵称" prop="nickname"  min-width="130" />
70
+            <el-table-column label="用户账号(手机号)" prop="phone"  min-width="130" /> -->
71
+
72
+            <el-table-column label="商户分润金额" prop="number"  min-width="130" />
73
+            <el-table-column label="订单金额" prop="total_price"  min-width="130" />
74
+            <el-table-column label="状态" prop="status"  min-width="130">
75
+              <template slot-scope="scope">
76
+                <span v-if="scope.row.status == 1">有效</span>  
77
+                <span v-if="scope.row.status == -1">待确认</span>
78
+                <span v-if="scope.row.status == 0">已失效</span>
79
+              </template>
80
+            </el-table-column>
81
+            <el-table-column label="店铺名称" prop="mer_name"  min-width="130" />
82
+            <!-- <el-table-column label="商户分润变动" prop="status"  min-width="130">
83
+              <template slot-scope="scope">
84
+                <span v-if="scope.row.pm == 1">增加</span>
85
+                <span v-if="scope.row.pm == 2">扣减</span>
86
+              </template>
87
+            </el-table-column> -->
88
+            <el-table-column label="关联订单" prop="order_sn"  min-width="130">
89
+              <template slot-scope="scope">
90
+                <span style="color: blue; cursor: pointer;" @click="pushToOrderList(scope.row.order_sn)">{{ scope.row.order_sn }}</span>
91
+              </template>
92
+            </el-table-column>
93
+        </el-table>
94
+        <div class="block">
95
+          <el-pagination :page-sizes="[20, 40, 60, 80]" :page-size="tableFrom.limit" :current-page="tableFrom.page"
96
+            layout="total, sizes, prev, pager, next, jumper" :total="tableData.total" @size-change="handleSizeChange"
97
+            @current-change="pageChange" />
98
+        </div>
99
+    </el-card>
100
+
101
+
102
+</div>
103
+</template>
104
+
105
+<script>
106
+import {
107
+    redPointListApi,
108
+    exportOrderApi,
109
+} from "@/api/order";
110
+
111
+import { performanceDivvyLstApi } from '@/api/protocol'
112
+
113
+import fileList from "@/components/exportFile/fileList";
114
+import cardsData from "@/components/cards/index";
115
+import {getZeroPointApi, getFenrunApi} from "@/api/accounts";
116
+import {roterPre} from "@/settings";
117
+export default {
118
+    components: {
119
+        cardsData,
120
+        fileList
121
+    },
122
+    data() {
123
+        return {
124
+            performanceList:[],
125
+            merSelect: [],
126
+            timeVal: '',
127
+            tableData: {
128
+                data: [],
129
+                total: 0,
130
+            },
131
+            listLoading: true,
132
+            tableFrom: {
133
+                uid: "",
134
+                date: "",
135
+                page: 1,
136
+                limit: 20,
137
+                type: "",
138
+                pm: ""
139
+            },
140
+            fromList: {
141
+                title: "选择时间",
142
+                custom: true,
143
+                fromTxt: [{
144
+                        text: "全部",
145
+                        val: ""
146
+                    },
147
+                    {
148
+                        text: "今天",
149
+                        val: "today"
150
+                    },
151
+                    {
152
+                        text: "昨天",
153
+                        val: "yesterday"
154
+                    },
155
+                    {
156
+                        text: "最近7天",
157
+                        val: "lately7"
158
+                    },
159
+                    {
160
+                        text: "最近30天",
161
+                        val: "lately30"
162
+                    },
163
+                    {
164
+                        text: "本月",
165
+                        val: "month"
166
+                    },
167
+                    {
168
+                        text: "本年",
169
+                        val: "year"
170
+                    },
171
+                ],
172
+            },
173
+            fileVisible: false,
174
+            cardLists: [],
175
+            teamList: [],
176
+
177
+        };
178
+    },
179
+    mounted() {
180
+        this.getList(1);
181
+
182
+        performanceDivvyLstApi({'page':1,'limit':100,'state':1}).then(res => {
183
+          this.performanceList = res.data.list
184
+        }).catch(res => {
185
+          this.$message.error(res.message)
186
+        })
187
+        // 获取隶属团队
188
+        getZeroPointApi().then(res => {
189
+            this.teamList = res.data
190
+            console.log('隶属团队')
191
+            console.log(this.teamList)
192
+        }).catch((res) => {
193
+            this.$message.error(res.message);
194
+        });
195
+
196
+    },
197
+    methods: {
198
+
199
+      pushToOrderList(orderIds) {
200
+
201
+
202
+        // accounts/extract
203
+
204
+        this.$router.push({
205
+          path: roterPre + "/order/list/",
206
+          query: { order_sn: orderIds },
207
+        });
208
+      },
209
+
210
+      tanchuang() {
211
+        this.dialogVisible = true
212
+      },
213
+
214
+      selectData(name) {
215
+        if (name == '系统奖励红商户分润数') {
216
+          this.tableFrom.pm = '1'
217
+        } else if (name == '系统销毁红商户分润数') {
218
+          this.tableFrom.pm = '2'
219
+        } else if (name == '人工奖励红商户分润数') {
220
+          this.tableFrom.pm = '3'
221
+        } else if (name == '人工销毁红商户分润数') {
222
+          this.tableFrom.pm = '4'
223
+        }
224
+
225
+        this.getList(1)
226
+      },
227
+
228
+      // 重置
229
+      reset() {
230
+        this.tableFrom ={
231
+            uid: "",
232
+            date: "",
233
+            page: 1,
234
+            limit: 20,
235
+            type: "",
236
+            pm: ""
237
+          }
238
+        this.getList();
239
+      },
240
+      exportSearchResult() {
241
+        RewardExcelApi(this.paramsData).then(res => {
242
+          console.log( res.data)
243
+          console.log( res.data.path)
244
+          window.open( res.data.path)
245
+          // window.open(SettingMer.https + `/excel/download/0?token=` + getToken()+`&path=` + res.data.path)
246
+        }).catch((res) => {
247
+
248
+        })
249
+      },
250
+
251
+
252
+
253
+        // 表格某一行添加特定的样式
254
+        addTdClass(val) {
255
+            if (val.row.status > 0 && val.row.paid == 1) {
256
+                for (let i = 0; i < val.row.orderProduct.length; i++) {
257
+                    if (val.row.orderProduct[i].refund_num > 0 && val.row.orderProduct[i].refund_num < val.row.orderProduct[i].product_num) {
258
+                        return "row-bg";
259
+                    }
260
+                }
261
+            } else {
262
+                return " ";
263
+            }
264
+        },
265
+
266
+        // 导出
267
+        exportOrder() {
268
+            exportOrderApi(this.tableFrom)
269
+                .then((res) => {
270
+                    // this.$message.success(res.message);
271
+                    // this.fileVisible = true;
272
+                    // this.$refs.exportList.exportFileList();
273
+                  const h = this.$createElement;
274
+                  this.$msgbox({
275
+                    title: '提示',
276
+                    message: h('p', null, [
277
+                      h('span', null, '文件正在生成中,请稍后点击"'),
278
+                      h('span', { style: 'color: teal' }, '导出已生成列表'),
279
+                      h('span', null, '"查看~ '),
280
+                    ]),
281
+                    confirmButtonText: '我知道了',
282
+                  }).then(action => {
283
+
284
+                  });                })
285
+                .catch((res) => {
286
+                    this.$message.error(res.message);
287
+                });
288
+        },
289
+        getExportFileList() {
290
+            this.fileVisible = true;
291
+            this.$refs.exportList.exportFileList('order');
292
+        },
293
+
294
+        handleSelectionChange(val) {
295
+            this.selectionList = val;
296
+            const data = [];
297
+            this.selectionList.map((item) => {
298
+                data.push(item.order_id);
299
+            });
300
+            this.ids = data.join(",");
301
+        },
302
+        // 选择时间
303
+        selectChange(tab) {
304
+            this.timeVal = [];
305
+            this.tableFrom.date = tab;
306
+            this.getList(1);
307
+        },
308
+        // 具体日期
309
+        onchangeTime(e) {
310
+            this.timeVal = e;
311
+            this.tableFrom.date = e ? this.timeVal.join("-") : "";
312
+            this.getList(1);
313
+        },
314
+
315
+        // 列表
316
+        getList(num) {
317
+            this.tableFrom.page = num ? num : this.tableFrom.page;
318
+            getFenrunApi(this.tableFrom).then((res) => {
319
+                console.log(res,'aaaaa');
320
+                this.tableData.data = res.data.list;
321
+                this.tableData.total = res.data.count;
322
+
323
+                this.cardLists = [
324
+                  { info: '', name: '商户分润总数', count: res.data.statistics.all },
325
+                  { info: '', name: '已结算', count: res.data.statistics.clear },
326
+                  { info: '', name: '未结算', count: res.data.statistics.nclear },
327
+                  { info: '', name: '已失效', count: res.data.statistics.lost },
328
+                  // {info: '', name: '商户分润扣减总数', count: res.data.statistics.deduct},
329
+                  // {info: '', name: '剩余商户分润总数', count: res.data.statistics.all_mp1}
330
+                ]
331
+            }).catch((res) => {
332
+                this.$message.error(res.message);
333
+            });
334
+        },
335
+        pageChange(page) {
336
+            this.tableFrom.page = page;
337
+            this.getList('');
338
+        },
339
+        handleSizeChange(val) {
340
+            this.tableFrom.limit = val;
341
+            this.getList('');
342
+        },
343
+    }
344
+};
345
+</script>
346
+
347
+<style lang="scss" scoped>
348
+.selWidth {
349
+    width: 300px;
350
+}
351
+
352
+.el-dropdown-link {
353
+    cursor: pointer;
354
+    color: #409eff;
355
+    font-size: 12px;
356
+}
357
+
358
+.el-icon-arrow-down {
359
+    font-size: 12px;
360
+}
361
+
362
+.tabBox_tit {
363
+    width: 53%;
364
+    font-size: 12px !important;
365
+    margin: 0 2px 0 10px;
366
+    letter-spacing: 1px;
367
+    padding: 5px 0;
368
+    box-sizing: border-box;
369
+}
370
+
371
+/deep/.row-bg {
372
+    .cell {
373
+        color: red !important;
374
+    }
375
+}
376
+
377
+.filter-item {
378
+  width:50%;
379
+}
380
+
381
+
382
+.cancel-order-mark {
383
+    margin-top: 30px;
384
+
385
+    .cancel-order-select-reason {
386
+        height: 30px;
387
+    }
388
+
389
+    .canel-order-remark-input {
390
+        width: 75%;
391
+        margin-left: 35px;
392
+    }
393
+
394
+
395
+}
396
+
397
+.bottom-button {
398
+    margin-top: 30px;
399
+    margin-left: 300px;
400
+    width: 250px;
401
+    display: flex;
402
+    justify-content: space-between;
403
+  }
404
+
405
+.cancel-button {
406
+        display: flex;
407
+        justify-content: center;
408
+        margin-top: 20px;
409
+        gap:50px;
410
+        height: 30px;
411
+        // background-color: rebeccapurple;
412
+
413
+        .confirm {
414
+          width: 70px;
415
+          // height: 30px;
416
+        }
417
+        .cacnel-item {
418
+          width: 70px;
419
+          // height: 30px;
420
+        }
421
+    }
422
+
423
+.selected-kuang {
424
+  width: 500px;
425
+}
426
+
427
+
428
+.jiangjintotal {
429
+
430
+  display: flex;
431
+  flex-direction: column;
432
+  justify-content: center;
433
+  align-items: center;
434
+  margin-bottom: 10px;
435
+  border: 1px solid #999;
436
+  border-radius: 5px;
437
+  width: 150px;
438
+  height: 60px;
439
+  line-height: 25px;
440
+  margin-right: 10px;
441
+}
442
+
443
+.jiangjintotal .money {
444
+  font-size: 20px;
445
+}
446
+
447
+
448
+</style>

+ 46 - 0
src/views/accounts/caiwutongji/fugou/index.vue

@@ -41,6 +41,31 @@
41
                       </el-select>
41
                       </el-select>
42
                     </el-form-item>
42
                     </el-form-item>
43
 
43
 
44
+                    <!-- 佣金类型 1代理费 2 消费佣金 3直推奖√ 4辖区佣金\\r\\n5 养老金√ 6 广告费 7 锁客收益 √ 8平台奖励 9渠道商\\r\\n10 推广店铺收益 √ 11.合伙人分红 12联创分红,13 股权分红 -->
45
+                    <el-form-item class="selected-kuang" label="名称:">
46
+                            <el-select
47
+                                v-model="tableFrom.commission_type"
48
+                                class="filter-item"
49
+                                placeholder="全部"
50
+                                @change="getList(1)"
51
+                            >
52
+                                <el-option value="" label="全部"/> 
53
+                                <!-- <el-option :value="1" label="代理费"/>
54
+                                <el-option :value="2" label="消费佣金"/> -->
55
+                                <el-option :value="3" label="直推佣金"/>
56
+                                <!-- <el-option :value="4" label="辖区佣金"/>
57
+                                <el-option :value="5" label="养老金"/>
58
+                                <el-option :value="6" label="广告费"/> -->
59
+                                <el-option :value="7" label="锁客收益"/>
60
+                                <!-- <el-option :value="8" label="平台奖励"/>
61
+                                <el-option :value="9" label="渠道商"/> -->
62
+                                <el-option :value="10" label="推广店铺收益"/>
63
+                                <el-option :value="11" label="合伙人分红"/>
64
+                                <el-option :value="12" label="联创分红"/>
65
+                                <el-option :value="13" label="股权分红"/>
66
+                            </el-select>
67
+                        </el-form-item>
68
+
44
                 </el-form>
69
                 </el-form>
45
 
70
 
46
                 <div class="bottom-button">
71
                 <div class="bottom-button">
@@ -71,6 +96,26 @@
71
             <el-table-column label="用户账号(手机号)" prop="phone"  min-width="130" />
96
             <el-table-column label="用户账号(手机号)" prop="phone"  min-width="130" />
72
 
97
 
73
             <el-table-column label="复购金数" prop="number"  min-width="130" />
98
             <el-table-column label="复购金数" prop="number"  min-width="130" />
99
+
100
+            <!-- 佣金类型 1代理费 2 消费佣金 3直推奖√ 4辖区佣金\\r\\n5 养老金√ 6 广告费 7 锁客收益 √ 8平台奖励 9渠道商\\r\\n10 推广店铺收益 √ 11.合伙人分红 12联创分红,13 股权分红 -->  
101
+            <el-table-column label="名称" min-width="130" >
102
+                <template slot-scope="scope">
103
+                    <span v-if="scope.row.commission_type == 1"> 代理费 </span>   
104
+                    <span v-if="scope.row.commission_type == 2"> 消费佣金 </span>
105
+                    <span v-if="scope.row.commission_type == 3"> 直推佣金 </span>
106
+                      <span v-if="scope.row.commission_type == 4"> 辖区佣金 </span>
107
+                      <span v-if="scope.row.commission_type == 5"> 养老金 </span>
108
+                      <span v-if="scope.row.commission_type == 6"> 广告费 </span>
109
+                      <span v-if="scope.row.commission_type == 7"> 锁客收益 </span>
110
+                      <span v-if="scope.row.commission_type == 8"> 平台奖励 </span>
111
+                      <span v-if="scope.row.commission_type == 9"> 渠道商 </span>
112
+                      <span v-if="scope.row.commission_type == 10"> 推广店铺收益 </span>
113
+                      <span v-if="scope.row.commission_type == 11"> 合伙人分红 </span>
114
+                      <span v-if="scope.row.commission_type == 12"> 联创分红 </span>
115
+                      <span v-if="scope.row.commission_type == 13"> 股权分红 </span>
116
+                </template>
117
+              </el-table-column>
118
+
74
             <el-table-column label="复购金状态" prop="status"  min-width="130">
119
             <el-table-column label="复购金状态" prop="status"  min-width="130">
75
               <template slot-scope="scope">
120
               <template slot-scope="scope">
76
                 <span v-if="scope.row.status == 1">有效</span>  
121
                 <span v-if="scope.row.status == 1">有效</span>  
@@ -135,6 +180,7 @@ export default {
135
                 page: 1,
180
                 page: 1,
136
                 limit: 20,
181
                 limit: 20,
137
                 type: "",
182
                 type: "",
183
+                commission_type: "",
138
                 pm: ""
184
                 pm: ""
139
             },
185
             },
140
             fromList: {
186
             fromList: {

+ 447 - 0
src/views/accounts/caiwutongji/pv/index.vue

@@ -0,0 +1,447 @@
1
+<template>
2
+<div class="divBox">
3
+    <el-card class="box-card">
4
+        <div slot="header" class="clearfix">
5
+            <div class="container">
6
+                <el-form size="small" label-width="100px">
7
+                    <el-form-item label="时间选择:" class="width100">
8
+                        <el-radio-group v-model="tableFrom.date" type="button" class="mr20" size="small" @change="selectChange(tableFrom.date)">
9
+                            <el-radio-button v-for="(item,i) in fromList.fromTxt" :key="i" :label="item.val">{{ item.text }}</el-radio-button>
10
+                        </el-radio-group>
11
+                        <el-date-picker v-model="timeVal" value-format="yyyy/MM/dd" format="yyyy/MM/dd" size="small" type="daterange" placement="bottom-end" placeholder="自定义时间" style="width: 250px;" @change="onchangeTime" />
12
+                    </el-form-item>
13
+                    <el-form-item label="用户手机号:" class="width100">
14
+                        <el-input v-model="tableFrom.phone" placeholder="请输入" class="selWidth" size="small">
15
+                        </el-input>
16
+                    </el-form-item>
17
+                    <!-- <el-form-item label="PV变动:" class="selected-kuang">
18
+                      <el-select
19
+                        v-model="tableFrom.pm"
20
+                        placeholder="全部"
21
+                        class="filter-item"
22
+                        @change="getList(1)"
23
+                      >
24
+                        <el-option label="全部" value="" />
25
+                        <el-option label="增加" value="1" />
26
+                        <el-option label="扣减" value="2" />
27
+                      </el-select>
28
+                    </el-form-item> -->
29
+                    <el-form-item label="PV状态:" class="selected-kuang">
30
+                      <el-select
31
+                        v-model="tableFrom.status"
32
+                        placeholder="全部"
33
+                        class="filter-item"
34
+                        @change="getList(1)"
35
+                      >
36
+                        <el-option label="全部" value="" />
37
+                        <el-option label="已结算" value="1" />
38
+                        <el-option label="未结算" value="-1" />
39
+                        <el-option label="已失效" value="0" />
40
+                      </el-select>
41
+                    </el-form-item>
42
+
43
+                </el-form>
44
+
45
+                <div class="bottom-button">
46
+                  <el-button size="small" @click="reset" style="width: 100px; margin-top: 20px; border: 1px solid; " >重置</el-button>
47
+                  <!-- <el-button type="primary" size="small" @click="exportSearchResult" style="width: 100px; margin-top: 20px;">导出</el-button> -->
48
+
49
+                  <el-button type="primary" size="small" @click="getList(1)" style="width: 100px; margin-top: 20px;">查询</el-button>
50
+                </div>
51
+            </div>
52
+
53
+
54
+
55
+        </div>
56
+
57
+        <div style="display: flex">
58
+          <div class="jiangjintotal" v-for="(v,k) in cardLists" >
59
+            <span class="jiangjintotal-title">{{ v.name }}</span>
60
+            <span class="money">{{ v.count }}</span>
61
+          </div>
62
+        </div>
63
+
64
+        <el-table :data="tableData.data" style="width: 100%" size="mini" class="table" highlight-current-row >
65
+
66
+
67
+            <el-table-column label="ID" prop="id" min-width="100" />
68
+            <el-table-column label="时间" prop="addtime" min-width="150" />
69
+            <!-- <el-table-column label="用户昵称" prop="nickname"  min-width="130" />
70
+            <el-table-column label="用户账号(手机号)" prop="phone"  min-width="130" /> --> 
71
+
72
+            <el-table-column label="PV数" prop="pv"  min-width="130" />
73
+            <el-table-column label="状态" prop="status"  min-width="130">
74
+              <template slot-scope="scope">
75
+                <span v-if="scope.row.status == 1">有效</span>  
76
+                <span v-if="scope.row.status == -1">待确认</span>
77
+                <span v-if="scope.row.status == 0">已失效</span>
78
+              </template>
79
+            </el-table-column>
80
+            <!-- <el-table-column label="PV变动" prop="status"  min-width="130">
81
+              <template slot-scope="scope">
82
+                <span v-if="scope.row.pm == 1">增加</span>
83
+                <span v-if="scope.row.pm == 2">扣减</span>
84
+              </template>
85
+            </el-table-column> -->
86
+            <el-table-column label="关联订单" prop="order_sn"  min-width="130">  
87
+              <template slot-scope="scope">
88
+                <span style="color: blue; cursor: pointer;" @click="pushToOrderList(scope.row.order_sn)">{{ scope.row.order_sn }}</span>
89
+              </template>
90
+            </el-table-column>
91
+            <el-table-column label="说明" prop="mark"  min-width="130" />
92
+        </el-table>
93
+        <div class="block">
94
+          <el-pagination :page-sizes="[20, 40, 60, 80]" :page-size="tableFrom.limit" :current-page="tableFrom.page"
95
+            layout="total, sizes, prev, pager, next, jumper" :total="tableData.total" @size-change="handleSizeChange"
96
+            @current-change="pageChange" />
97
+        </div>
98
+    </el-card>
99
+
100
+
101
+</div>
102
+</template>
103
+
104
+<script>
105
+import {
106
+    redPointListApi,
107
+    exportOrderApi,
108
+} from "@/api/order";
109
+
110
+import { performanceDivvyLstApi } from '@/api/protocol'
111
+
112
+import fileList from "@/components/exportFile/fileList";
113
+import cardsData from "@/components/cards/index";
114
+import {getZeroPointApi, getPvCountApi} from "@/api/accounts";
115
+import {roterPre} from "@/settings";
116
+export default {
117
+    components: {
118
+        cardsData,
119
+        fileList
120
+    },
121
+    data() {
122
+        return {
123
+            performanceList:[],
124
+            merSelect: [],
125
+            timeVal: '',
126
+            tableData: {
127
+                data: [],
128
+                total: 0,
129
+            },
130
+            listLoading: true,
131
+            tableFrom: {
132
+                uid: "",
133
+                date: "",
134
+                page: 1,
135
+                limit: 20,
136
+                type: "",
137
+                pm: ""
138
+            },
139
+            fromList: {
140
+                title: "选择时间",
141
+                custom: true,
142
+                fromTxt: [{
143
+                        text: "全部",
144
+                        val: ""
145
+                    },
146
+                    {
147
+                        text: "今天",
148
+                        val: "today"
149
+                    },
150
+                    {
151
+                        text: "昨天",
152
+                        val: "yesterday"
153
+                    },
154
+                    {
155
+                        text: "最近7天",
156
+                        val: "lately7"
157
+                    },
158
+                    {
159
+                        text: "最近30天",
160
+                        val: "lately30"
161
+                    },
162
+                    {
163
+                        text: "本月",
164
+                        val: "month"
165
+                    },
166
+                    {
167
+                        text: "本年",
168
+                        val: "year"
169
+                    },
170
+                ],
171
+            },
172
+            fileVisible: false,
173
+            cardLists: [],
174
+            teamList: [],
175
+
176
+        };
177
+    },
178
+    mounted() {
179
+        this.getList(1);
180
+
181
+        performanceDivvyLstApi({'page':1,'limit':100,'state':1}).then(res => {
182
+          this.performanceList = res.data.list
183
+        }).catch(res => {
184
+          this.$message.error(res.message)
185
+        })
186
+        // 获取隶属团队
187
+        getZeroPointApi().then(res => {
188
+            this.teamList = res.data
189
+            console.log('隶属团队')
190
+            console.log(this.teamList)
191
+        }).catch((res) => {
192
+            this.$message.error(res.message);
193
+        });
194
+
195
+    },
196
+    methods: {
197
+
198
+      pushToOrderList(orderIds) {
199
+
200
+
201
+        // accounts/extract
202
+
203
+        this.$router.push({
204
+          path: roterPre + "/order/list/",
205
+          query: { order_sn: orderIds },
206
+        });
207
+      },
208
+
209
+      tanchuang() {
210
+        this.dialogVisible = true
211
+      },
212
+
213
+      selectData(name) {
214
+        if (name == '系统奖励红PV数') {
215
+          this.tableFrom.pm = '1'
216
+        } else if (name == '系统销毁红PV数') {
217
+          this.tableFrom.pm = '2'
218
+        } else if (name == '人工奖励红PV数') {
219
+          this.tableFrom.pm = '3'
220
+        } else if (name == '人工销毁红PV数') {
221
+          this.tableFrom.pm = '4'
222
+        }
223
+
224
+        this.getList(1)
225
+      },
226
+
227
+      // 重置
228
+      reset() {
229
+        this.tableFrom ={
230
+            uid: "",
231
+            date: "",
232
+            page: 1,
233
+            limit: 20,
234
+            type: "",
235
+            pm: ""
236
+          }
237
+        this.getList();
238
+      },
239
+      exportSearchResult() {
240
+        RewardExcelApi(this.paramsData).then(res => {
241
+          console.log( res.data)
242
+          console.log( res.data.path)
243
+          window.open( res.data.path)
244
+          // window.open(SettingMer.https + `/excel/download/0?token=` + getToken()+`&path=` + res.data.path)
245
+        }).catch((res) => {
246
+
247
+        })
248
+      },
249
+
250
+
251
+
252
+        // 表格某一行添加特定的样式
253
+        addTdClass(val) {
254
+            if (val.row.status > 0 && val.row.paid == 1) {
255
+                for (let i = 0; i < val.row.orderProduct.length; i++) {
256
+                    if (val.row.orderProduct[i].refund_num > 0 && val.row.orderProduct[i].refund_num < val.row.orderProduct[i].product_num) {
257
+                        return "row-bg";
258
+                    }
259
+                }
260
+            } else {
261
+                return " ";
262
+            }
263
+        },
264
+
265
+        // 导出
266
+        exportOrder() {
267
+            exportOrderApi(this.tableFrom)
268
+                .then((res) => {
269
+                    // this.$message.success(res.message);
270
+                    // this.fileVisible = true;
271
+                    // this.$refs.exportList.exportFileList();
272
+                  const h = this.$createElement;
273
+                  this.$msgbox({
274
+                    title: '提示',
275
+                    message: h('p', null, [
276
+                      h('span', null, '文件正在生成中,请稍后点击"'),
277
+                      h('span', { style: 'color: teal' }, '导出已生成列表'),
278
+                      h('span', null, '"查看~ '),
279
+                    ]),
280
+                    confirmButtonText: '我知道了',
281
+                  }).then(action => {
282
+
283
+                  });                })
284
+                .catch((res) => {
285
+                    this.$message.error(res.message);
286
+                });
287
+        },
288
+        getExportFileList() {
289
+            this.fileVisible = true;
290
+            this.$refs.exportList.exportFileList('order');
291
+        },
292
+
293
+        handleSelectionChange(val) {
294
+            this.selectionList = val;
295
+            const data = [];
296
+            this.selectionList.map((item) => {
297
+                data.push(item.order_id);
298
+            });
299
+            this.ids = data.join(",");
300
+        },
301
+        // 选择时间
302
+        selectChange(tab) {
303
+            this.timeVal = [];
304
+            this.tableFrom.date = tab;
305
+            this.getList(1);
306
+        },
307
+        // 具体日期
308
+        onchangeTime(e) {
309
+            this.timeVal = e;
310
+            this.tableFrom.date = e ? this.timeVal.join("-") : "";
311
+            this.getList(1);
312
+        },
313
+
314
+        // 列表
315
+        getList(num) {
316
+            this.tableFrom.page = num ? num : this.tableFrom.page;
317
+            getPvCountApi(this.tableFrom).then((res) => {
318
+                console.log(res,'aaaaa');
319
+                this.tableData.data = res.data.list;
320
+                this.tableData.total = res.data.count;
321
+
322
+                this.cardLists = [
323
+                  { info: '', name: '平台PV总数', count: res.data.statistics.all },
324
+                  { info: '', name: '已结算PV总数', count: res.data.statistics.clear },
325
+                  { info: '', name: '未结算PV总数', count: res.data.statistics.nclear },
326
+                  { info: '', name: '已失效PV总数', count: res.data.statistics.lost },
327
+                  { info: '', name: '已结算红包总额', count: res.data.statistics.deduct},
328
+                  { info: '', name: '可分红PV数', count: res.data.statistics.all_mp1}
329
+                ]
330
+            }).catch((res) => { 
331
+                this.$message.error(res.message);
332
+            });
333
+        },
334
+        pageChange(page) {
335
+            this.tableFrom.page = page;
336
+            this.getList('');
337
+        },
338
+        handleSizeChange(val) {
339
+            this.tableFrom.limit = val;
340
+            this.getList('');
341
+        },
342
+    }
343
+};
344
+</script>
345
+
346
+<style lang="scss" scoped>
347
+.selWidth {
348
+    width: 300px;
349
+}
350
+
351
+.el-dropdown-link {
352
+    cursor: pointer;
353
+    color: #409eff;
354
+    font-size: 12px;
355
+}
356
+
357
+.el-icon-arrow-down {
358
+    font-size: 12px;
359
+}
360
+
361
+.tabBox_tit {
362
+    width: 53%;
363
+    font-size: 12px !important;
364
+    margin: 0 2px 0 10px;
365
+    letter-spacing: 1px;
366
+    padding: 5px 0;
367
+    box-sizing: border-box;
368
+}
369
+
370
+/deep/.row-bg {
371
+    .cell {
372
+        color: red !important;
373
+    }
374
+}
375
+
376
+.filter-item {
377
+  width:50%;
378
+}
379
+
380
+
381
+.cancel-order-mark {
382
+    margin-top: 30px;
383
+
384
+    .cancel-order-select-reason {
385
+        height: 30px;
386
+    }
387
+
388
+    .canel-order-remark-input {
389
+        width: 75%;
390
+        margin-left: 35px;
391
+    }
392
+
393
+
394
+}
395
+
396
+.bottom-button {
397
+    margin-top: 30px;
398
+    margin-left: 300px;
399
+    width: 250px;
400
+    display: flex;
401
+    justify-content: space-between;
402
+  }
403
+
404
+.cancel-button {
405
+        display: flex;
406
+        justify-content: center;
407
+        margin-top: 20px;
408
+        gap:50px;
409
+        height: 30px;
410
+        // background-color: rebeccapurple;
411
+
412
+        .confirm {
413
+          width: 70px;
414
+          // height: 30px;
415
+        }
416
+        .cacnel-item {
417
+          width: 70px;
418
+          // height: 30px;
419
+        }
420
+    }
421
+
422
+.selected-kuang {
423
+  width: 500px;
424
+}
425
+
426
+
427
+.jiangjintotal {
428
+
429
+  display: flex;
430
+  flex-direction: column;
431
+  justify-content: center;
432
+  align-items: center;
433
+  margin-bottom: 10px;
434
+  border: 1px solid #999;
435
+  border-radius: 5px;
436
+  width: 150px;
437
+  height: 60px;
438
+  line-height: 25px;
439
+  margin-right: 10px;
440
+}
441
+
442
+.jiangjintotal .money {
443
+  font-size: 20px;
444
+}
445
+
446
+
447
+</style>