Unknown 6 years ago
parent
commit
564a7b6b8c

+ 5 - 5
src/views/agnetManagement/gambleMemberManagement/index.vue

85
               <span :style="moneyColor(scope.row.totalPunishment)">{{scope.row.totalDown}}</span>
85
               <span :style="moneyColor(scope.row.totalPunishment)">{{scope.row.totalDown}}</span>
86
             </template>
86
             </template>
87
           </el-table-column>
87
           </el-table-column>
88
-          <el-table-column label="有效投注量(莊家)" align="center">
88
+          <el-table-column label="莊家贏錢" align="center">
89
             <template slot-scope="scope">
89
             <template slot-scope="scope">
90
               <span :style="moneyColor(scope.row.bookieEarned)">{{scope.row.bookieEarned}}</span>
90
               <span :style="moneyColor(scope.row.bookieEarned)">{{scope.row.bookieEarned}}</span>
91
             </template>
91
             </template>
92
           </el-table-column>
92
           </el-table-column>
93
-          <el-table-column label="有效投注量(閒家)" align="center">
93
+          <el-table-column label="閒家贏錢" align="center">
94
             <template slot-scope="scope">
94
             <template slot-scope="scope">
95
               <span :style="moneyColor(scope.row.memberEarned)">{{scope.row.memberEarned}}</span>
95
               <span :style="moneyColor(scope.row.memberEarned)">{{scope.row.memberEarned}}</span>
96
             </template>
96
             </template>
107
           </el-table-column>
107
           </el-table-column>
108
           <el-table-column label="總退水" align="center">
108
           <el-table-column label="總退水" align="center">
109
             <template slot-scope="scope">
109
             <template slot-scope="scope">
110
-              <span :style="moneyColor(scope.row.wallet)">{{scope.row.totalServiceFees}}</span>
110
+              <span :style="moneyColor(scope.row.totalServiceFees)">{{scope.row.totalServiceFees}}</span>
111
             </template>
111
             </template>
112
           </el-table-column>
112
           </el-table-column>
113
           <el-table-column label="會員結帳" align="center">
113
           <el-table-column label="會員結帳" align="center">
114
             <template slot-scope="scope">
114
             <template slot-scope="scope">
115
-              <span :style="moneyColor(scope.row.memberCheckOut)">{{scope.row.memberCheckOut}}</span>
115
+              <span :style="moneyColor((scope.row.memberCheckOut)*(-1))">{{(scope.row.memberCheckOut)*(-1)}}</span>
116
             </template>
116
             </template>
117
           </el-table-column>
117
           </el-table-column>
118
           <el-table-column align="center" label="操作" width="100">
118
           <el-table-column align="center" label="操作" width="100">
319
       return money >= 0 ? { color: '#67C23A' } : { color: '#FA5555' }
319
       return money >= 0 ? { color: '#67C23A' } : { color: '#FA5555' }
320
     },
320
     },
321
     all(scope) {
321
     all(scope) {
322
-      return scope.row.allUp+scope.row.allDown-scope.row.allChips-scope.row.allServiceFees
322
+      return (scope.row.allUp+scope.row.allDown-scope.row.allChips-scope.row.allServiceFees)*(-1)
323
     }
323
     }
324
   },
324
   },
325
   destroyed() {
325
   destroyed() {

+ 1 - 1
src/views/agnetManagement/index.vue

176
             let allEarned = _.sumBy(combine, (item) => {return item.bookieEarned + item.memberEarned})
176
             let allEarned = _.sumBy(combine, (item) => {return item.bookieEarned + item.memberEarned})
177
             let allServiceFees = _.sumBy(combine, (item) => {return item.bookieServiceFees + item.
177
             let allServiceFees = _.sumBy(combine, (item) => {return item.bookieServiceFees + item.
178
             memberServiceFees})
178
             memberServiceFees})
179
-            agent.all = allUp+allDown-allChips-allServiceFees
179
+            agent.all = (allUp+allDown-allChips-allServiceFees)*(-1)
180
             this.list.push(agent)
180
             this.list.push(agent)
181
             
181
             
182
             this.listLoading = false
182
             this.listLoading = false

+ 43 - 37
src/views/gambleGameBucket/detail/index.vue

27
               <span>{{`${scope.row.DealingRecord.point1} | ${scope.row.DealingRecord.point2} / ${point(scope.row.DealingRecord)}`}}</span>
27
               <span>{{`${scope.row.DealingRecord.point1} | ${scope.row.DealingRecord.point2} / ${point(scope.row.DealingRecord)}`}}</span>
28
             </template>
28
             </template>
29
           </el-table-column>
29
           </el-table-column>
30
-          <el-table-column label="上莊分數" prop="bidChips"></el-table-column>  
30
+          <el-table-column label="上莊分數">
31
+            <template slot-scope="scope">
32
+              <span>{{memberRecord[memberRecord.length-1][0].wager}}</span>
33
+            </template>
34
+          </el-table-column>  
31
           <el-table-column label="有效下注量">
35
           <el-table-column label="有效下注量">
32
             <template slot-scope="scope">
36
             <template slot-scope="scope">
33
               <div :style="moneyColor(scope.row.effectiveWagger)">{{scope.row.effectiveWagger}}</div>
37
               <div :style="moneyColor(scope.row.effectiveWagger)">{{scope.row.effectiveWagger}}</div>
44
               <div :style="moneyColor(scope.row.bookieResult)">{{scope.row.bookieResult}}</div>
48
               <div :style="moneyColor(scope.row.bookieResult)">{{scope.row.bookieResult}}</div>
45
             </template>
49
             </template>
46
           </el-table-column>  
50
           </el-table-column>  
47
-          <el-table-column prop="ass" label="服務費">
51
+          <el-table-column prop="MemberRecord.FixedServiceFees" label="服務費">
48
           </el-table-column>     
52
           </el-table-column>     
49
         </el-table-column>             
53
         </el-table-column>             
50
       </el-table-column>                   
54
       </el-table-column>                   
176
       bookie: [],
180
       bookie: [],
177
       memberRecord: [],
181
       memberRecord: [],
178
       door: 0,
182
       door: 0,
179
-      bidChips: 0,
183
+      // bidChips: 0,
180
       wagerRecord: [],
184
       wagerRecord: [],
181
     }
185
     }
182
   },
186
   },
183
   created() {
187
   created() {
184
-    fetchWagerRecord(this.data.secondLayer, this.query.secondLayer).then(response => {
185
-      this.wagerRecord = response.data
186
-    })
187
     fetchRoundRecord(this.data.secondLayer, this.query.secondLayer).then(response => {
188
     fetchRoundRecord(this.data.secondLayer, this.query.secondLayer).then(response => {
188
       this.door = response.data.initialDoor
189
       this.door = response.data.initialDoor
189
     })
190
     })
190
-    fetchGameBid(this.data.secondLayer).then(response => {
191
-      this.bidChips = response.data
192
-    })
191
+    // fetchGameBid(this.data.secondLayer).then(response => {
192
+    //   this.bidChips = response.data
193
+    // })
193
     fetchRoundCount(this.data.secondLayer).then((response) => {
194
     fetchRoundCount(this.data.secondLayer).then((response) => {
194
       for (let i = 1; i <= response.data; i++) {
195
       for (let i = 1; i <= response.data; i++) {
195
         this.roundOptions.push({ label: `第 ${i} 關`, key: i })
196
         this.roundOptions.push({ label: `第 ${i} 關`, key: i })
197
     })
198
     })
198
     this.SetVisible(2)
199
     this.SetVisible(2)
199
     this.getList()
200
     this.getList()
200
-    fetchGambleMemberList({ page: 1, limit: 9999999999, chipsSort: 'DESC' }).then(response => {
201
-      const { rows } = response.data
202
-      let members = {}
203
-      // TODO refactor
204
-      rows.map((person, index) => {
205
-        if (index % 4 === 0) {
206
-          members.name_0 = person.name
207
-          members.chips_0 = person.chips
208
-          index === response.data.count - 1 ? this.members.push(members) : false
209
-        } else if (index % 4 === 1) {
210
-          members.name_1 = person.name
211
-          members.chips_1 = person.chips
212
-          index === response.data.count - 1 ? this.members.push(members) : false
213
-        } else if (index % 4 === 2) {
214
-          members.name_2 = person.name
215
-          members.chips_2 = person.chips
216
-          index === response.data.count - 1 ? this.members.push(members) : false
217
-        } else if (index % 4 === 3) {
218
-          members.name_3 = person.name
219
-          members.chips_3 = person.chips
220
-          this.members.push(members)
221
-          members = {}
222
-        }
223
-      })
224
-    })
225
   },
201
   },
226
   computed: {
202
   computed: {
227
     ...mapGetters([
203
     ...mapGetters([
240
       this.listLoading = true
216
       this.listLoading = true
241
       let detailTemp, dealingTemp, memberRecordTemp
217
       let detailTemp, dealingTemp, memberRecordTemp
242
       this.detail = []
218
       this.detail = []
219
+      fetchWagerRecord(this.data.secondLayer, this.query.secondLayer).then(response => {
220
+        this.wagerRecord = response.data
221
+      })
243
       fetchDealingRecords(this.data.secondLayer, this.query.secondLayer).then(response => {
222
       fetchDealingRecords(this.data.secondLayer, this.query.secondLayer).then(response => {
244
         dealingTemp = response.data.rows.filter(record => {
223
         dealingTemp = response.data.rows.filter(record => {
245
           return record.door !== -1
224
           return record.door !== -1
277
             record.MemberRecord.door === -1 &&
256
             record.MemberRecord.door === -1 &&
278
             record.MemberRecord.door === record.DealingRecord.door
257
             record.MemberRecord.door === record.DealingRecord.door
279
         })
258
         })
280
-        console.log('this', this.bookie)
281
-        this.bidChips ? this.bookie[0].bidChips = this.bidChips : false        
259
+        // console.log('this', this.memberRecord)
260
+        // this.bidChips ? this.bookie[0].bidChips = this.bidChips : false        
282
         this.group = _.groupBy(detailTemp, record => {
261
         this.group = _.groupBy(detailTemp, record => {
283
           return record.MemberRecord.GambleMember.name
262
           return record.MemberRecord.GambleMember.name
284
         })
263
         })
287
         this.detail = this.group.reduce((arr, element) => {
266
         this.detail = this.group.reduce((arr, element) => {
288
           return arr.concat(element)
267
           return arr.concat(element)
289
         }, [])
268
         }, [])
290
-
291
         this.bookie[0].effectiveWagger = _.sumBy(this.detail, item => {
269
         this.bookie[0].effectiveWagger = _.sumBy(this.detail, item => {
292
           return Math.abs(item.MemberRecord.earned) ;
270
           return Math.abs(item.MemberRecord.earned) ;
293
         })
271
         })
327
         this.func = eval(`(function() {${this.statement}})`)
305
         this.func = eval(`(function() {${this.statement}})`)
328
       })
306
       })
329
 
307
 
308
+      fetchGambleMemberList({ page: 1, limit: 9999999999, chipsSort: 'DESC' }).then(response => {
309
+        const { rows } = response.data
310
+        console.log('sss', this.detail)
311
+
312
+        let members = {}
313
+        // TODO refactor
314
+        rows.map((person, index) => {
315
+          if (index % 4 === 0) {
316
+            members.name_0 = person.name
317
+            members.chips_0 = person.chips
318
+            index === response.data.count - 1 ? this.members.push(members) : false
319
+          } else if (index % 4 === 1) {
320
+            members.name_1 = person.name
321
+            members.chips_1 = person.chips
322
+            index === response.data.count - 1 ? this.members.push(members) : false
323
+          } else if (index % 4 === 2) {
324
+            members.name_2 = person.name
325
+            members.chips_2 = person.chips
326
+            index === response.data.count - 1 ? this.members.push(members) : false
327
+          } else if (index % 4 === 3) {
328
+            members.name_3 = person.name
329
+            members.chips_3 = person.chips
330
+            this.members.push(members)
331
+            members = {}
332
+          }
333
+        })
334
+      })
335
+
330
       this.listLoading = false
336
       this.listLoading = false
331
     },
337
     },
332
     objectSpanMethod({ row, column, rowIndex, columnIndex }) {
338
     objectSpanMethod({ row, column, rowIndex, columnIndex }) {