EthnaYeh преди 6 години
родител
ревизия
0fb407bc6c
променени са 3 файла, в които са добавени 70 реда и са изтрити 30 реда
  1. 7 0
      src/api/gambleGameBucket.js
  2. 52 23
      src/views/gambleGameBucket/detail/index.vue
  3. 11 7
      src/views/gambleGameBucket/index.vue

+ 7 - 0
src/api/gambleGameBucket.js

@@ -64,3 +64,10 @@ export function fetchRoundRecord(data, query = { round: 1 }) {
64 64
     method: 'get'
65 65
   })
66 66
 }
67
+
68
+// export function fetchRoundRecord(data) {
69
+//   return request({
70
+//     url: `/gambleGameBuckets/${data.id}/initDoor`,
71
+//     method: 'get'
72
+//   })
73
+// }

+ 52 - 23
src/views/gambleGameBucket/detail/index.vue

@@ -4,7 +4,7 @@
4 4
      <div class="block">
5 5
       <el-row :gutter="20">
6 6
         <el-col :span="6">
7
-          <span class="demonstration">關數選擇</span>
7
+          <span class="demonstration">關數</span>
8 8
           <el-select @change='handleFilter' style="width: 120px" class="filter-item" v-model="query.secondLayer.round" placeholder="關">
9 9
           <el-option v-for="item in roundOptions" :key="item.label" :label="item.label" :value="item.key">
10 10
           </el-option>
@@ -16,40 +16,63 @@
16 16
       </el-row>
17 17
     </div>
18 18
   </div>
19
-    <el-table :data="dealing" v-loading.body="listLoading" :summary-method="getSummaries" show-summary  element-loading-text="Loading" border fit highlight-current-row
19
+    <el-table header-row-class-name="init" :data="bookie" v-loading.body="listLoading" element-loading-text="Loading" border fit highlight-current-row
20
+      style="width: 100%">      
21
+      <el-table-column label="本期開獎" lable-className="title" align="center">   
22
+        <el-table-column label="莊家結果" align="center">            
23
+                  
24
+          <el-table-column label="莊家" prop="MemberRecord.GambleMember.name"></el-table-column>
25
+          <el-table-column label="點數">
26
+            <template slot-scope="scope">
27
+              <span>{{`${scope.row.DealingRecord.point1} | ${scope.row.DealingRecord.point2} / ${point(scope.row.DealingRecord)}`}}</span>
28
+            </template>
29
+          </el-table-column>
30
+          <el-table-column label="上莊分數" prop="bidChips"></el-table-column>      
31
+          <el-table-column label="莊輸贏">
32
+            <template slot-scope="scope">
33
+              <div :style="moneyColor(scope.row.MemberRecord.earned)">{{scope.row.MemberRecord.earned}}</div>
34
+            </template>
35
+          </el-table-column>      
36
+          <el-table-column label="抽水" prop="MemberRecord.serviceFees"></el-table-column>
37
+          <el-table-column prop="ass" label="服務費">
38
+          </el-table-column>     
39
+        </el-table-column>             
40
+      </el-table-column>                   
41
+    </el-table>
42
+    <el-table :header-cell-style="initDoor" :data="dealing" v-loading.body="listLoading" :summary-method="getSummaries" show-summary  element-loading-text="Loading" border fit highlight-current-row
20 43
       style="width: 100%">
21
-      <el-table-column label="本期開獎" align="center"> 
44
+      <el-table-column label="各門結果" align="center"> 
22 45
         <el-table-column label="名稱">
23 46
           <template slot-scope="scope">
24 47
             <span>{{scope.$index === 0 ?"點數":"門主"}}</span>
25 48
           </template>
26 49
         </el-table-column>   
27
-        <el-table-column label="第一門" :label-class-name="initDoor(1)">
50
+        <el-table-column label="第一門">
28 51
           <template slot-scope="scope">
29 52
             <span>{{doorTableSwitch(scope.$index, 0)}}</span>
30 53
           </template>
31 54
         </el-table-column>
32
-        <el-table-column label="第二門" :label-class-name="initDoor(2)">
55
+        <el-table-column label="第二門">
33 56
           <template slot-scope="scope">
34 57
             <span>{{doorTableSwitch(scope.$index, 1)}}</span>
35 58
           </template>
36 59
         </el-table-column>
37
-        <el-table-column label="第三門" :label-class-name="initDoor(3)">
60
+        <el-table-column label="第三門">
38 61
           <template slot-scope="scope">
39 62
             <span>{{doorTableSwitch(scope.$index, 2)}}</span>
40 63
           </template>
41 64
         </el-table-column>
42
-        <el-table-column label="第四門" :label-class-name="initDoor(4)">
65
+        <el-table-column label="第四門">
43 66
           <template slot-scope="scope">
44 67
             <span>{{doorTableSwitch(scope.$index, 3)}}</span>
45 68
           </template>
46 69
         </el-table-column>
47
-        <el-table-column label="第五門" :label-class-name="initDoor(5)">
70
+        <el-table-column label="第五門">
48 71
           <template slot-scope="scope">
49 72
             <span>{{doorTableSwitch(scope.$index, 4)}}</span>
50 73
           </template>
51 74
         </el-table-column>
52
-        <el-table-column label="第六門" :label-class-name="initDoor(6)">
75
+        <el-table-column label="第六門">
53 76
           <template slot-scope="scope">
54 77
             <span>{{doorTableSwitch(scope.$index, 5)}}</span>
55 78
           </template>
@@ -138,7 +161,7 @@
138 161
 <script>
139 162
 
140 163
 import { mapGetters, mapActions } from 'vuex'
141
-import { fetchDetails, fetchRoundCount, fetchDealingRecords, fetchMemberRecords, fetchRoundRecord } from '@/api/gambleGameBucket'
164
+import { fetchDetails, fetchRoundCount, fetchDealingRecords, fetchMemberRecords, fetchRoundRecord, fetchGameBid } from '@/api/gambleGameBucket'
142 165
 import { fetchGambleMemberList } from '@/api/gambleMember'
143 166
 import { ponitTransform } from '@/utils/point'
144 167
 import _ from 'lodash'
@@ -162,10 +185,17 @@ export default {
162 185
       dealing: [],
163 186
       bookie: [],
164 187
       memberRecord: [],
165
-      initialDoor: 0,
188
+      door: 0,
189
+      bidChips: 0,
166 190
     }
167 191
   },
168 192
   created() {
193
+    fetchRoundRecord(this.data.secondLayer, this.query.secondLayer).then(response => {
194
+      this.door = response.data.initialDoor
195
+    })
196
+    fetchGameBid(this.data.secondLayer).then(response => {
197
+      this.bidChips = response.data
198
+    })
169 199
     fetchRoundCount(this.data.secondLayer).then((response) => {
170 200
       for (let i = 1; i <= response.data; i++) {
171 201
         this.roundOptions.push({ label: `第 ${i} 關`, key: i })
@@ -253,7 +283,7 @@ export default {
253 283
             record.MemberRecord.door === -1 &&
254 284
             record.MemberRecord.door === record.DealingRecord.door
255 285
         })
256
-        this.data.secondLayer.bidChips ? this.bookie[0].bidChips = this.data.secondLayer.bidChips : false
286
+        this.bidChips ? this.bookie[0].bidChips = this.bidChips : false        
257 287
         this.group = _.groupBy(detailTemp, record => {
258 288
           return record.MemberRecord.GambleMember.name
259 289
         })
@@ -297,10 +327,6 @@ export default {
297 327
         this.func = eval(`(function() {${this.statement}})`)
298 328
       })
299 329
 
300
-      fetchRoundRecord(this.data.secondLayer, this.query.secondLayer).then(response => {
301
-        this.initialDoor = response.data.initialDoor
302
-      })
303
-
304 330
       this.listLoading = false
305 331
     },
306 332
     objectSpanMethod({ row, column, rowIndex, columnIndex }) {
@@ -329,6 +355,9 @@ export default {
329 355
       return sums
330 356
     },
331 357
     handleFilter() {
358
+      fetchRoundRecord(this.data.secondLayer, this.query.secondLayer).then(response => {
359
+        this.door = response.data.initialDoor
360
+      })
332 361
       this.SetQuery({layer:2, query: {round: this.query.secondLayer.round}})      
333 362
       this.dealing = []
334 363
       this.getList()
@@ -345,7 +374,7 @@ export default {
345 374
         return `${this.dealing[0][`point1_${colIndex}`]} | ${this.dealing[0][`point2_${colIndex}`]} / ${this.point({point1: this.dealing[0][`point1_${colIndex}`] ,point2: this.dealing[0][`point2_${colIndex}`] ,totalPoints: this.dealing[0][`totalPoints_${colIndex}`]})}`
346 375
       }
347 376
       if (rowIndex === 1) {
348
-        return this.dealing[1][`member_${colIndex}`] ? `${this.dealing[1][`member_${colIndex}`]}` : 'N/A'
377
+        return this.dealing[1][`member_${colIndex+1}`] ? `${this.dealing[1][`member_${colIndex+1}`]}` : '從缺'
349 378
       }
350 379
     },
351 380
     _sum(i) {
@@ -358,9 +387,8 @@ export default {
358 387
     point(dealingRecord) {
359 388
       return ponitTransform(dealingRecord)
360 389
     },
361
-    initDoor(index) {
362
-      console.log(index===this.initialDoor)
363
-      return this.initialDoor === index ? `init` : ''
390
+    initDoor({row, column, rowIndex, columnIndex}) {
391
+      return  columnIndex === this.door ? { color: '#F56C6C' } : ``
364 392
     }
365 393
   },
366 394
   destroyed() {
@@ -369,7 +397,8 @@ export default {
369 397
 }
370 398
 </script>
371 399
 <style>
372
-  .el-table-column .init {
373
-    color: #F56C6C;
374
-  }
400
+div{
401
+  font-weight: bold;
402
+  font-size: 25px
403
+}
375 404
 </style>

+ 11 - 7
src/views/gambleGameBucket/index.vue

@@ -54,7 +54,7 @@
54 54
 <script>
55 55
 
56 56
 import { mapGetters, mapActions } from 'vuex'
57
-import { fetchList, fetchGameBid } from '@/api/gambleGameBucket'
57
+import { fetchList, fetchGameBid, fetchRoundRecord } from '@/api/gambleGameBucket'
58 58
 import waves from '@/directive/waves' // 水波纹指令
59 59
 import moment from 'moment-timezone'
60 60
 
@@ -75,7 +75,7 @@ export default {
75 75
       //   endAt: null,
76 76
       //   bookie: null
77 77
       // },
78
-      temp: {},
78
+      // temp: {},
79 79
       pickerOptions: {
80 80
         shortcuts: [{
81 81
           text: '本週',
@@ -125,12 +125,16 @@ export default {
125 125
       })
126 126
     },
127 127
     handlePage(row) {
128
-      this.temp = Object.assign({}, row) // copy obj
129
-      fetchGameBid(row).then(response => {
130
-        this.temp.bidChips = response.data
131
-      })
128
+      let temp = Object.assign({}, row) // copy obj
129
+      // fetchRoundRecord(row).then(response => {
130
+      //   temp.door = response.data
131
+      // })
132
+      // fetchGameBid(row).then(response => {
133
+      //   temp.bidChips = response.data
134
+      // })
135
+      console.log('eeeee', temp)
132 136
       this.SetVisible(2)
133
-      this.SetData({layer:2, data: this.temp})
137
+      this.SetData({layer:2, data: temp})
134 138
     },
135 139
     handleFilter() {
136 140
       if (this.p_date) {