EthnaYeh 7 lat temu
rodzic
commit
c169b7232f
1 zmienionych plików z 11 dodań i 16 usunięć
  1. 11 16
      src/views/gambleGameBucket/detail/index.vue

+ 11 - 16
src/views/gambleGameBucket/detail/index.vue

52
         </el-table-column>
52
         </el-table-column>
53
         <el-table-column label="上莊分數" prop="bidChips"></el-table-column>      
53
         <el-table-column label="上莊分數" prop="bidChips"></el-table-column>      
54
         <el-table-column label="莊輸贏" prop="MemberRecord.earned"></el-table-column>      
54
         <el-table-column label="莊輸贏" prop="MemberRecord.earned"></el-table-column>      
55
-        <el-table-column label="總押注" prop="totalWager"></el-table-column>      
56
         <el-table-column label="抽水" prop="MemberRecord.serviceFees"></el-table-column>     
55
         <el-table-column label="抽水" prop="MemberRecord.serviceFees"></el-table-column>     
57
       </el-table-column>                   
56
       </el-table-column>                   
58
     </el-table>
57
     </el-table>
191
         })
190
         })
192
         // TODO refactor
191
         // TODO refactor
193
         let deal = {}
192
         let deal = {}
193
+
194
         dealingTemp.map((record, index) => {
194
         dealingTemp.map((record, index) => {
195
           if (index % 6 === 0) {
195
           if (index % 6 === 0) {
196
             deal.door_0 = record.door
196
             deal.door_0 = record.door
248
         this.detail = this.group.reduce((arr, element) => {
248
         this.detail = this.group.reduce((arr, element) => {
249
           return arr.concat(element)
249
           return arr.concat(element)
250
         }, [])
250
         }, [])
251
-        this.bookie[0].totalWager = 0
252
-        this.detail.map((item) => {
253
-          this.bookie[0].totalWager += item.MemberRecord.wager
254
-        })
255
-        // TODO 抽出去
256
-        const sum = (i) => {
257
-          let count = 0
258
-          for (let j = 0; j < i; j++) {
259
-            count += this.group[j].length
260
-          }
261
-          return count
262
-        }
263
 
251
 
264
         this.group.map((item, itemIndex) => {
252
         this.group.map((item, itemIndex) => {
265
           let totalChips = 0
253
           let totalChips = 0
266
           item.map((person, personIndex) => {
254
           item.map((person, personIndex) => {
267
             totalChips += person.MemberRecord.earned
255
             totalChips += person.MemberRecord.earned
268
-            item.length - 1 === personIndex ? this.detail[sum(itemIndex)].totalChips = totalChips : false
256
+            item.length - 1 === personIndex ? this.detail[this._sum(itemIndex)].totalChips = totalChips : false
269
           })
257
           })
270
         })
258
         })
271
 
259
 
278
             }`
266
             }`
279
           } else if (i === this.group.length - 1) {
267
           } else if (i === this.group.length - 1) {
280
             this.statement +=
268
             this.statement +=
281
-            `else if(this.rowIndex === ${sum(i)}){
269
+            `else if(this.rowIndex === ${this._sum(i)}){
282
               this.rowspan = ${this.group[i].length},
270
               this.rowspan = ${this.group[i].length},
283
               this.colspan = 1
271
               this.colspan = 1
284
             }else {
272
             }else {
287
             }`
275
             }`
288
           } else {
276
           } else {
289
             this.statement +=
277
             this.statement +=
290
-            `else if(this.rowIndex === ${sum(i)}){
278
+            `else if(this.rowIndex === ${this._sum(i)}){
291
               this.rowspan = ${this.group[i].length},
279
               this.rowspan = ${this.group[i].length},
292
               this.colspan = 1 
280
               this.colspan = 1 
293
             }`
281
             }`
315
     handleFilter() {
303
     handleFilter() {
316
       this.dealing = []
304
       this.dealing = []
317
       this.getList()
305
       this.getList()
306
+    },
307
+    _sum(i) {
308
+      let count = 0
309
+      for (let j = 0; j < i; j++) {
310
+          count += this.group[j].length
311
+      }
312
+      return count
318
     }
313
     }
319
   },
314
   },
320
   destroyed() {
315
   destroyed() {