|
@@ -17,10 +17,10 @@
|
17
|
17
|
</div>
|
18
|
18
|
</div>
|
19
|
19
|
<el-table :data="allCombine" v-loading.body="listLoading" element-loading-text="Loading" border fit highlight-current-row>
|
20
|
|
- <el-table-column label="代理商名稱" align="center">
|
21
|
|
- <template slot-scope="scope">
|
|
20
|
+ <el-table-column label="代理商名稱" prop="data.secondLayer.GambleMember.name).slice(19)" align="center">
|
|
21
|
+ <!-- <template slot-scope="scope">
|
22
|
22
|
<span>{{scope.row.name}}</span>
|
23
|
|
- </template>
|
|
23
|
+ </template> -->
|
24
|
24
|
</el-table-column>
|
25
|
25
|
<el-table-column label="總上分額" align="center">
|
26
|
26
|
<template slot-scope="scope">
|
|
@@ -106,7 +106,7 @@
|
106
|
106
|
<script>
|
107
|
107
|
|
108
|
108
|
import { mapActions, mapGetters } from 'vuex'
|
109
|
|
-import { fetchMemberList } from '@/api/agnetManagement'
|
|
109
|
+import { fetchMemberList, fetchGroupDetail } from '@/api/agnetManagement'
|
110
|
110
|
import waves from '@/directive/waves' // 水波纹指令
|
111
|
111
|
import moment from 'moment-timezone'
|
112
|
112
|
import config from '../../../../config'
|
|
@@ -152,6 +152,7 @@ export default {
|
152
|
152
|
}]
|
153
|
153
|
},
|
154
|
154
|
date: null,
|
|
155
|
+ sum: [],
|
155
|
156
|
dialogFormVisible: false
|
156
|
157
|
|
157
|
158
|
}
|
|
@@ -176,103 +177,110 @@ export default {
|
176
|
177
|
this.listLoading = true
|
177
|
178
|
this.allCombine = []
|
178
|
179
|
this.combine = []
|
179
|
|
- let combine = []
|
180
|
|
- await fetchMemberList(this.data.secondLayer, this.listQuery).then(response => {
|
181
|
|
- console.log('response', response.data.rows)
|
182
|
|
- response.data.rows.map(member => {
|
183
|
|
- let row = {
|
184
|
|
- id: member.id,
|
185
|
|
- name: member.name,
|
186
|
|
- chips: member.chips,
|
187
|
|
- totalUp: 0,
|
188
|
|
- totalDown: 0,
|
189
|
|
- totalReward: 0,
|
190
|
|
- totalPunishment: 0,
|
191
|
|
- effectiveTotal: 0,
|
192
|
|
- bookieEarned: 0,
|
193
|
|
- memberEarned: 0,
|
194
|
|
- bookieWagerFee: 0,
|
195
|
|
- bookieWagerFeeRatio: 0,
|
196
|
|
- bookieServiceFees: 0,
|
197
|
|
- bookieServiceFeesRatio: 0,
|
198
|
|
- memberServiceFees: 0,
|
199
|
|
- memberServiceFeesRatio: 0,
|
200
|
|
- totalServiceFees: 0,
|
201
|
|
- memberCheckOut: 0,
|
202
|
|
- feeRatio: new Decimal(this.data.secondLayer.feeRatio/100),
|
203
|
|
- }
|
204
|
|
- let bookie = _.groupBy(member['GambleGame-Bucket-MemberRecords'], 'isBookie')
|
205
|
|
- if (bookie.false) {
|
206
|
|
- row.memberEarned = _.sumBy(bookie.false, item => {
|
207
|
|
- return Math.abs(item.earned)
|
208
|
|
- });
|
209
|
|
- // console.log('membeEarned', row.memberEarned)
|
210
|
|
- row.memberServiceFees = _.sumBy(bookie.false, 'serviceFees');
|
211
|
|
- row.memberServiceFeesRatio = row.feeRatio.times(row.memberServiceFees).valueOf()
|
|
180
|
+ // let combine = []
|
|
181
|
+ await fetchGroupDetail(this.data.secondLayer, this.listQuery).then(response => {
|
|
182
|
+
|
|
183
|
+ console.log('combine', response.data)
|
|
184
|
+
|
|
185
|
+ this.combine = response.data
|
|
186
|
+
|
|
187
|
+ });
|
|
188
|
+ // await fetchMemberList(this.data.secondLayer, this.listQuery).then(response => {
|
|
189
|
+ // console.log('response', response.data.rows)
|
|
190
|
+ // response.data.rows.map(member => {
|
|
191
|
+ // let row = {
|
|
192
|
+ // id: member.id,
|
|
193
|
+ // name: member.name,
|
|
194
|
+ // chips: member.chips,
|
|
195
|
+ // totalUp: 0,
|
|
196
|
+ // totalDown: 0,
|
|
197
|
+ // totalReward: 0,
|
|
198
|
+ // totalPunishment: 0,
|
|
199
|
+ // effectiveTotal: 0,
|
|
200
|
+ // bookieEarned: 0,
|
|
201
|
+ // memberEarned: 0,
|
|
202
|
+ // bookieWagerFee: 0,
|
|
203
|
+ // bookieWagerFeeRatio: 0,
|
|
204
|
+ // bookieServiceFees: 0,
|
|
205
|
+ // bookieServiceFeesRatio: 0,
|
|
206
|
+ // memberServiceFees: 0,
|
|
207
|
+ // memberServiceFeesRatio: 0,
|
|
208
|
+ // totalServiceFees: 0,
|
|
209
|
+ // memberCheckOut: 0,
|
|
210
|
+ // feeRatio: new Decimal(this.data.secondLayer.feeRatio/100),
|
|
211
|
+ // }
|
|
212
|
+ // let bookie = _.groupBy(member['GambleGame-Bucket-MemberRecords'], 'isBookie')
|
|
213
|
+ // if (bookie.false) {
|
|
214
|
+ // row.memberEarned = _.sumBy(bookie.false, item => {
|
|
215
|
+ // return Math.abs(item.earned)
|
|
216
|
+ // });
|
|
217
|
+ // // console.log('membeEarned', row.memberEarned)
|
|
218
|
+ // row.memberServiceFees = _.sumBy(bookie.false, 'serviceFees');
|
|
219
|
+ // row.memberServiceFeesRatio = row.feeRatio.times(row.memberServiceFees).valueOf()
|
212
|
220
|
|
213
|
|
- }
|
214
|
|
- if (bookie.true) {
|
215
|
|
- row.bookieWagerFee = _.sumBy(bookie.true, (item) => {
|
216
|
|
- return item.wagerServiceFees
|
217
|
|
- });
|
218
|
|
- row.bookieWagerFeeRatio = row.feeRatio.times(row.bookieWagerFee).valueOf()
|
219
|
|
- // console.log('eeee', bookie.true)
|
220
|
|
- row.bookieEarned = _.sumBy(bookie.true, item => {
|
221
|
|
- return Math.abs(item.earned)
|
222
|
|
- });
|
223
|
|
- // console.log('bookieEarned' , row.bookieEarned)
|
224
|
|
- row.bookieServiceFees = _.sumBy(bookie.true, (item) => { return item.serviceFees});
|
225
|
|
- row.bookieServiceFeesRatio = row.feeRatio.times(row.bookieServiceFees).valueOf()
|
226
|
|
- }
|
|
221
|
+ // }
|
|
222
|
+ // if (bookie.true) {
|
|
223
|
+ // row.bookieWagerFee = _.sumBy(bookie.true, (item) => {
|
|
224
|
+ // return item.wagerServiceFees
|
|
225
|
+ // });
|
|
226
|
+ // row.bookieWagerFeeRatio = row.feeRatio.times(row.bookieWagerFee).valueOf()
|
|
227
|
+ // // console.log('eeee', bookie.true)
|
|
228
|
+ // row.bookieEarned = _.sumBy(bookie.true, item => {
|
|
229
|
+ // return Math.abs(item.earned)
|
|
230
|
+ // });
|
|
231
|
+ // // console.log('bookieEarned' , row.bookieEarned)
|
|
232
|
+ // row.bookieServiceFees = _.sumBy(bookie.true, (item) => { return item.serviceFees});
|
|
233
|
+ // row.bookieServiceFeesRatio = row.feeRatio.times(row.bookieServiceFees).valueOf()
|
|
234
|
+ // }
|
227
|
235
|
|
228
|
|
- row.effectiveTotal = _.sumBy(member['GambleGame-Bucket-RoundRecords'], item => {
|
229
|
|
- return item.used_quota
|
230
|
|
- }) + row.memberEarned
|
|
236
|
+ // row.effectiveTotal = _.sumBy(member['GambleGame-Bucket-RoundRecords'], item => {
|
|
237
|
+ // return item.used_quota
|
|
238
|
+ // }) + row.memberEarned
|
231
|
239
|
|
232
|
|
- row.totalServiceFees = Number(new Decimal(row.bookieServiceFees).plus(row.memberServiceFees).plus(row.bookieWagerFee).times(row.feeRatio).valueOf())
|
233
|
|
- let chipsLog = _.groupBy(member.GambleMemberChipsLogs, 'type')
|
234
|
|
- console.log('type', chipsLog)
|
235
|
|
- if (chipsLog['0'] || chipsLog['2']) {
|
236
|
|
- row.totalUp = _.sumBy(chipsLog['0'], (item) => {
|
237
|
|
- return item.chips > 0 ? item.chips : 0
|
238
|
|
- })
|
239
|
|
- row.totalDown = _.sumBy(chipsLog['0'], (item) => {
|
240
|
|
- return item.chips < 0 ? item.chips : 0
|
241
|
|
- }) + _.sumBy(chipsLog['2'], (item) => {
|
242
|
|
- return item.chips < 0 ? item.chips : 0
|
243
|
|
- })
|
|
240
|
+ // row.totalServiceFees = Number(new Decimal(row.bookieServiceFees).plus(row.memberServiceFees).plus(row.bookieWagerFee).times(row.feeRatio).valueOf())
|
|
241
|
+ // let chipsLog = _.groupBy(member.GambleMemberChipsLogs, 'type')
|
|
242
|
+ // console.log('type', chipsLog)
|
|
243
|
+ // if (chipsLog['0'] || chipsLog['2']) {
|
|
244
|
+ // row.totalUp = _.sumBy(chipsLog['0'], (item) => {
|
|
245
|
+ // return item.chips > 0 ? item.chips : 0
|
|
246
|
+ // })
|
|
247
|
+ // row.totalDown = _.sumBy(chipsLog['0'], (item) => {
|
|
248
|
+ // return item.chips < 0 ? item.chips : 0
|
|
249
|
+ // }) + _.sumBy(chipsLog['2'], (item) => {
|
|
250
|
+ // return item.chips < 0 ? item.chips : 0
|
|
251
|
+ // })
|
244
|
252
|
|
245
|
|
- }
|
246
|
|
- row.memberCheckOut = (row.totalUp + row.totalDown - row.chips)*(-1)
|
247
|
|
- // TODO CHECK 是否需要
|
248
|
|
- let punishment = _.sumBy(member['GambleGame-Bucket-PunishmentRecords'], item => {
|
249
|
|
- return (item.chips)*(-1)
|
250
|
|
- })
|
251
|
|
- if(chipsLog['1']) {
|
252
|
|
- row.totalReward = _.sumBy(chipsLog['1'], (item) => {
|
253
|
|
- return item.chips > 0 ? item.chips : 0
|
254
|
|
- })
|
255
|
|
- row.totalPunishment = _.sumBy(chipsLog['1'], (item) => {
|
256
|
|
- return item.chips < 0 ? item.chips : 0
|
257
|
|
- });
|
258
|
|
- }
|
259
|
|
- row.totalPunishment += punishment
|
260
|
|
- // console.log('www',row)
|
|
253
|
+ // }
|
|
254
|
+ // row.memberCheckOut = (row.totalUp + row.totalDown - row.chips)*(-1)
|
|
255
|
+ // // TODO CHECK 是否需要
|
|
256
|
+ // let punishment = _.sumBy(member['GambleGame-Bucket-PunishmentRecords'], item => {
|
|
257
|
+ // return (item.chips)*(-1)
|
|
258
|
+ // })
|
|
259
|
+ // if(chipsLog['1']) {
|
|
260
|
+ // row.totalReward = _.sumBy(chipsLog['1'], (item) => {
|
|
261
|
+ // return item.chips > 0 ? item.chips : 0
|
|
262
|
+ // })
|
|
263
|
+ // row.totalPunishment = _.sumBy(chipsLog['1'], (item) => {
|
|
264
|
+ // return item.chips < 0 ? item.chips : 0
|
|
265
|
+ // });
|
|
266
|
+ // }
|
|
267
|
+ // row.totalPunishment += punishment
|
|
268
|
+ // // console.log('www',row)
|
261
|
269
|
|
262
|
|
- combine.push(row)
|
263
|
|
- })
|
264
|
|
- // console.log('cimbine' , this.combine)
|
265
|
|
- this.allCombine.push({
|
266
|
|
- name: (this.data.secondLayer.GambleMember.name).slice(19),
|
267
|
|
- allUp: _.sumBy(combine, 'totalUp'),
|
268
|
|
- allDown: _.sumBy(combine, 'totalDown'),
|
269
|
|
- allChips: _.sumBy(combine, 'chips'),
|
270
|
|
- allEarned: _.sumBy(combine, (item) => {return item.bookieEarned + item.memberEarned}),
|
271
|
|
- allServiceFees: _.sumBy(combine, (item) => {return item.totalServiceFees }).toFixed(2),
|
272
|
|
- })
|
273
|
|
- this.combine = combine
|
|
270
|
+ // combine.push(row)
|
|
271
|
+ // })
|
|
272
|
+ // // console.log('cimbine' , this.combine)
|
|
273
|
+ // this.allCombine.push({
|
|
274
|
+ // name: (this.data.secondLayer.GambleMember.name).slice(19),
|
|
275
|
+ // allUp: _.sumBy(combine, 'totalUp'),
|
|
276
|
+ // allDown: _.sumBy(combine, 'totalDown'),
|
|
277
|
+ // allChips: _.sumBy(combine, 'chips'),
|
|
278
|
+ // allEarned: _.sumBy(combine, (item) => {return item.bookieEarned + item.memberEarned}),
|
|
279
|
+ // allServiceFees: _.sumBy(combine, (item) => {return item.totalServiceFees }).toFixed(2),
|
|
280
|
+ // })
|
|
281
|
+ // this.combine = combine
|
274
|
282
|
this.listLoading = false
|
275
|
|
- })
|
|
283
|
+ // })
|
276
|
284
|
|
277
|
285
|
},
|
278
|
286
|
handlePersonDetail(row) {
|
|
@@ -329,7 +337,7 @@ export default {
|
329
|
337
|
},
|
330
|
338
|
getSummaries(param) {
|
331
|
339
|
const { columns, data } = param;
|
332
|
|
- const sums = [];
|
|
340
|
+ let sums = [];
|
333
|
341
|
columns.forEach((column, index) => {
|
334
|
342
|
if (index === 0) {
|
335
|
343
|
sums[index] = '合計';
|
|
@@ -350,7 +358,14 @@ export default {
|
350
|
358
|
sums[index] = 'N/A';
|
351
|
359
|
}
|
352
|
360
|
});
|
353
|
|
-
|
|
361
|
+ // this.allCombine.push({
|
|
362
|
+ // name: (this.data.secondLayer.GambleMember.name).slice(19),
|
|
363
|
+ // allUp: sums[2],
|
|
364
|
+ // allDown: sums[3],
|
|
365
|
+ // allChips: sums[1],
|
|
366
|
+ // allEarned: sums[6],
|
|
367
|
+ // allServiceFees: sums[13],
|
|
368
|
+ // });
|
354
|
369
|
return sums;
|
355
|
370
|
}
|
356
|
371
|
},
|