Browse Source

add punishment

bucket 6 years ago
parent
commit
06a83ba683
2 changed files with 34 additions and 13 deletions
  1. 7 0
      src/api/gambleMember.js
  2. 27 13
      src/views/room/gameHistory/index.vue

+ 7 - 0
src/api/gambleMember.js

114
     }
114
     }
115
   })
115
   })
116
 }
116
 }
117
+
118
+export function fetchPunishment(data) {
119
+  return request({
120
+    url: `/gambleMembers/${data.id}/punishment`,
121
+    method: 'get',
122
+  })
123
+}

+ 27 - 13
src/views/room/gameHistory/index.vue

49
         </el-table-column>      
49
         </el-table-column>      
50
       </el-table>
50
       </el-table>
51
 
51
 
52
-      <div v-show="!listLoading" class="pagination-container">
52
+      <!-- <div v-show="!listLoading" class="pagination-container">
53
         <el-pagination background @size-change="handleSizeChange" @current-change="handleCurrentChange" :current-page.sync="listQuery.page"
53
         <el-pagination background @size-change="handleSizeChange" @current-change="handleCurrentChange" :current-page.sync="listQuery.page"
54
           :page-sizes="[10,20,30, 50]" :page-size="listQuery.limit" layout="total, sizes, prev, pager, next, jumper" :total="total">
54
           :page-sizes="[10,20,30, 50]" :page-size="listQuery.limit" layout="total, sizes, prev, pager, next, jumper" :total="total">
55
         </el-pagination>
55
         </el-pagination>
56
-      </div>
56
+      </div> -->
57
 
57
 
58
       <el-dialog title="個人詳細資料" :visible.sync="dialogFormVisible" width="75%" center>
58
       <el-dialog title="個人詳細資料" :visible.sync="dialogFormVisible" width="75%" center>
59
         <el-table :data="dialogList" v-loading.body="listLoading" element-loading-text="Loading" border fit highlight-current-row
59
         <el-table :data="dialogList" v-loading.body="listLoading" element-loading-text="Loading" border fit highlight-current-row
96
 <script>
96
 <script>
97
 
97
 
98
 import { mapActions, mapGetters } from 'vuex'
98
 import { mapActions, mapGetters } from 'vuex'
99
-import { fetchGameHistory, fetchChipsHistory, fetchPersonGameDetail } from '@/api/gambleMember'
99
+import { fetchGameHistory, fetchChipsHistory, fetchPersonGameDetail, fetchPunishment } from '@/api/gambleMember'
100
 import { fetchCurrentChips } from '@/api/gambleGameBucket'
100
 import { fetchCurrentChips } from '@/api/gambleGameBucket'
101
 import waves from '@/directive/waves' // 水波纹指令
101
 import waves from '@/directive/waves' // 水波纹指令
102
 import moment from 'moment-timezone'
102
 import moment from 'moment-timezone'
117
       listLoading: true,
117
       listLoading: true,
118
       listQuery: { 
118
       listQuery: { 
119
         page: 1, 
119
         page: 1, 
120
-        limit: 20, 
120
+        limit: 9999999999, 
121
         startAt: null, 
121
         startAt: null, 
122
         endAt: null 
122
         endAt: null 
123
       }, 
123
       }, 
168
       this.listLoading = true
168
       this.listLoading = true
169
       //this.list = []
169
       //this.list = []
170
       await fetchGameHistory(this.data.thirdLayer, this.listQuery).then(response => {
170
       await fetchGameHistory(this.data.thirdLayer, this.listQuery).then(response => {
171
+        this.list = []
171
         this.chipLogList = response.data
172
         this.chipLogList = response.data
172
         this.tempCurrentChips = []
173
         this.tempCurrentChips = []
173
         this.chipLogList.map((item) => {
174
         this.chipLogList.map((item) => {
204
           })
205
           })
205
         })
206
         })
206
       })
207
       })
208
+      await fetchPunishment(this.data.thirdLayer).then(response => {
209
+          response.data.map(item => {
210
+            this.list.unshift({
211
+              id: item.id,
212
+              createdAt: item.createdAt,
213
+              type: item.rule,
214
+              amount: item.chips,
215
+              wallet: ` `
216
+            })
217
+          })
218
+      })
207
       this.list.sort(function compare(a, b) {
219
       this.list.sort(function compare(a, b) {
208
         const dateA = new Date(a.createdAt);
220
         const dateA = new Date(a.createdAt);
209
         const dateB = new Date(b.createdAt);
221
         const dateB = new Date(b.createdAt);
216
       this.listLoading = true
228
       this.listLoading = true
217
       this.dialogFormVisible = true
229
       this.dialogFormVisible = true
218
       fetchPersonGameDetail(this.data.thirdLayer.id, row.id).then(response => {
230
       fetchPersonGameDetail(this.data.thirdLayer.id, row.id).then(response => {
231
+        console.log('params', this.data.thirdLayer.id, row.id)
232
+        console.log('rows', response.data.rows)
219
         this.dialogList = response.data.rows
233
         this.dialogList = response.data.rows
220
         this.listLoading = false
234
         this.listLoading = false
221
       })
235
       })
227
       this.SetData({layer:4, data: temp})
241
       this.SetData({layer:4, data: temp})
228
     },
242
     },
229
     handleFilter() {
243
     handleFilter() {
230
-      this.listQuery.page = 1 
244
+      // this.listQuery.page = 1 
231
       if (this.date) { 
245
       if (this.date) { 
232
         this.listQuery.startAt = moment.utc(this.date[0]).format() 
246
         this.listQuery.startAt = moment.utc(this.date[0]).format() 
233
         this.listQuery.endAt = moment.utc(this.date[1]).format()  
247
         this.listQuery.endAt = moment.utc(this.date[1]).format()  
237
       }
251
       }
238
       this.getList()
252
       this.getList()
239
     },
253
     },
240
-    handleSizeChange(val) {
241
-      this.listQuery.limit = val
242
-      this.getList()
243
-    },
244
-    handleCurrentChange(val) {
245
-      this.listQuery.page = val
246
-      this.getList()
247
-    },
254
+    // handleSizeChange(val) {
255
+    //   this.listQuery.limit = val
256
+    //   this.getList()
257
+    // },
258
+    // handleCurrentChange(val) {
259
+    //   this.listQuery.page = val
260
+    //   this.getList()
261
+    // },
248
     moment(time) {
262
     moment(time) {
249
       return moment(time).tz('Asia/Taipei').format('YYYY-MM-DD HH:mm:ss')
263
       return moment(time).tz('Asia/Taipei').format('YYYY-MM-DD HH:mm:ss')
250
     },
264
     },