Browse Source

detail modify

EthnaYeh 6 years ago
parent
commit
0fb407bc6c

+ 7 - 0
src/api/gambleGameBucket.js

64
     method: 'get'
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
      <div class="block">
4
      <div class="block">
5
       <el-row :gutter="20">
5
       <el-row :gutter="20">
6
         <el-col :span="6">
6
         <el-col :span="6">
7
-          <span class="demonstration">關數選擇</span>
7
+          <span class="demonstration">關數</span>
8
           <el-select @change='handleFilter' style="width: 120px" class="filter-item" v-model="query.secondLayer.round" placeholder="關">
8
           <el-select @change='handleFilter' style="width: 120px" class="filter-item" v-model="query.secondLayer.round" placeholder="關">
9
           <el-option v-for="item in roundOptions" :key="item.label" :label="item.label" :value="item.key">
9
           <el-option v-for="item in roundOptions" :key="item.label" :label="item.label" :value="item.key">
10
           </el-option>
10
           </el-option>
16
       </el-row>
16
       </el-row>
17
     </div>
17
     </div>
18
   </div>
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
       style="width: 100%">
43
       style="width: 100%">
21
-      <el-table-column label="本期開獎" align="center"> 
44
+      <el-table-column label="各門結果" align="center"> 
22
         <el-table-column label="名稱">
45
         <el-table-column label="名稱">
23
           <template slot-scope="scope">
46
           <template slot-scope="scope">
24
             <span>{{scope.$index === 0 ?"點數":"門主"}}</span>
47
             <span>{{scope.$index === 0 ?"點數":"門主"}}</span>
25
           </template>
48
           </template>
26
         </el-table-column>   
49
         </el-table-column>   
27
-        <el-table-column label="第一門" :label-class-name="initDoor(1)">
50
+        <el-table-column label="第一門">
28
           <template slot-scope="scope">
51
           <template slot-scope="scope">
29
             <span>{{doorTableSwitch(scope.$index, 0)}}</span>
52
             <span>{{doorTableSwitch(scope.$index, 0)}}</span>
30
           </template>
53
           </template>
31
         </el-table-column>
54
         </el-table-column>
32
-        <el-table-column label="第二門" :label-class-name="initDoor(2)">
55
+        <el-table-column label="第二門">
33
           <template slot-scope="scope">
56
           <template slot-scope="scope">
34
             <span>{{doorTableSwitch(scope.$index, 1)}}</span>
57
             <span>{{doorTableSwitch(scope.$index, 1)}}</span>
35
           </template>
58
           </template>
36
         </el-table-column>
59
         </el-table-column>
37
-        <el-table-column label="第三門" :label-class-name="initDoor(3)">
60
+        <el-table-column label="第三門">
38
           <template slot-scope="scope">
61
           <template slot-scope="scope">
39
             <span>{{doorTableSwitch(scope.$index, 2)}}</span>
62
             <span>{{doorTableSwitch(scope.$index, 2)}}</span>
40
           </template>
63
           </template>
41
         </el-table-column>
64
         </el-table-column>
42
-        <el-table-column label="第四門" :label-class-name="initDoor(4)">
65
+        <el-table-column label="第四門">
43
           <template slot-scope="scope">
66
           <template slot-scope="scope">
44
             <span>{{doorTableSwitch(scope.$index, 3)}}</span>
67
             <span>{{doorTableSwitch(scope.$index, 3)}}</span>
45
           </template>
68
           </template>
46
         </el-table-column>
69
         </el-table-column>
47
-        <el-table-column label="第五門" :label-class-name="initDoor(5)">
70
+        <el-table-column label="第五門">
48
           <template slot-scope="scope">
71
           <template slot-scope="scope">
49
             <span>{{doorTableSwitch(scope.$index, 4)}}</span>
72
             <span>{{doorTableSwitch(scope.$index, 4)}}</span>
50
           </template>
73
           </template>
51
         </el-table-column>
74
         </el-table-column>
52
-        <el-table-column label="第六門" :label-class-name="initDoor(6)">
75
+        <el-table-column label="第六門">
53
           <template slot-scope="scope">
76
           <template slot-scope="scope">
54
             <span>{{doorTableSwitch(scope.$index, 5)}}</span>
77
             <span>{{doorTableSwitch(scope.$index, 5)}}</span>
55
           </template>
78
           </template>
138
 <script>
161
 <script>
139
 
162
 
140
 import { mapGetters, mapActions } from 'vuex'
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
 import { fetchGambleMemberList } from '@/api/gambleMember'
165
 import { fetchGambleMemberList } from '@/api/gambleMember'
143
 import { ponitTransform } from '@/utils/point'
166
 import { ponitTransform } from '@/utils/point'
144
 import _ from 'lodash'
167
 import _ from 'lodash'
162
       dealing: [],
185
       dealing: [],
163
       bookie: [],
186
       bookie: [],
164
       memberRecord: [],
187
       memberRecord: [],
165
-      initialDoor: 0,
188
+      door: 0,
189
+      bidChips: 0,
166
     }
190
     }
167
   },
191
   },
168
   created() {
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
     fetchRoundCount(this.data.secondLayer).then((response) => {
199
     fetchRoundCount(this.data.secondLayer).then((response) => {
170
       for (let i = 1; i <= response.data; i++) {
200
       for (let i = 1; i <= response.data; i++) {
171
         this.roundOptions.push({ label: `第 ${i} 關`, key: i })
201
         this.roundOptions.push({ label: `第 ${i} 關`, key: i })
253
             record.MemberRecord.door === -1 &&
283
             record.MemberRecord.door === -1 &&
254
             record.MemberRecord.door === record.DealingRecord.door
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
         this.group = _.groupBy(detailTemp, record => {
287
         this.group = _.groupBy(detailTemp, record => {
258
           return record.MemberRecord.GambleMember.name
288
           return record.MemberRecord.GambleMember.name
259
         })
289
         })
297
         this.func = eval(`(function() {${this.statement}})`)
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
       this.listLoading = false
330
       this.listLoading = false
305
     },
331
     },
306
     objectSpanMethod({ row, column, rowIndex, columnIndex }) {
332
     objectSpanMethod({ row, column, rowIndex, columnIndex }) {
329
       return sums
355
       return sums
330
     },
356
     },
331
     handleFilter() {
357
     handleFilter() {
358
+      fetchRoundRecord(this.data.secondLayer, this.query.secondLayer).then(response => {
359
+        this.door = response.data.initialDoor
360
+      })
332
       this.SetQuery({layer:2, query: {round: this.query.secondLayer.round}})      
361
       this.SetQuery({layer:2, query: {round: this.query.secondLayer.round}})      
333
       this.dealing = []
362
       this.dealing = []
334
       this.getList()
363
       this.getList()
345
         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}`]})}`
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
       if (rowIndex === 1) {
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
     _sum(i) {
380
     _sum(i) {
358
     point(dealingRecord) {
387
     point(dealingRecord) {
359
       return ponitTransform(dealingRecord)
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
   destroyed() {
394
   destroyed() {
369
 }
397
 }
370
 </script>
398
 </script>
371
 <style>
399
 <style>
372
-  .el-table-column .init {
373
-    color: #F56C6C;
374
-  }
400
+div{
401
+  font-weight: bold;
402
+  font-size: 25px
403
+}
375
 </style>
404
 </style>

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

54
 <script>
54
 <script>
55
 
55
 
56
 import { mapGetters, mapActions } from 'vuex'
56
 import { mapGetters, mapActions } from 'vuex'
57
-import { fetchList, fetchGameBid } from '@/api/gambleGameBucket'
57
+import { fetchList, fetchGameBid, fetchRoundRecord } from '@/api/gambleGameBucket'
58
 import waves from '@/directive/waves' // 水波纹指令
58
 import waves from '@/directive/waves' // 水波纹指令
59
 import moment from 'moment-timezone'
59
 import moment from 'moment-timezone'
60
 
60
 
75
       //   endAt: null,
75
       //   endAt: null,
76
       //   bookie: null
76
       //   bookie: null
77
       // },
77
       // },
78
-      temp: {},
78
+      // temp: {},
79
       pickerOptions: {
79
       pickerOptions: {
80
         shortcuts: [{
80
         shortcuts: [{
81
           text: '本週',
81
           text: '本週',
125
       })
125
       })
126
     },
126
     },
127
     handlePage(row) {
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
       this.SetVisible(2)
136
       this.SetVisible(2)
133
-      this.SetData({layer:2, data: this.temp})
137
+      this.SetData({layer:2, data: temp})
134
     },
138
     },
135
     handleFilter() {
139
     handleFilter() {
136
       if (this.p_date) {
140
       if (this.p_date) {