|
@@ -5,7 +5,7 @@
|
5
|
5
|
<div class="block">
|
6
|
6
|
<!-- <span class="demonstration">時間篩選</span> -->
|
7
|
7
|
<el-date-picker
|
8
|
|
- v-model="date"
|
|
8
|
+ v-model="query.thirdLayer.date"
|
9
|
9
|
type="datetimerange"
|
10
|
10
|
:picker-options="pickerOptions"
|
11
|
11
|
range-separator="至"
|
|
@@ -17,7 +17,7 @@
|
17
|
17
|
</div>
|
18
|
18
|
</div>
|
19
|
19
|
<el-table :data="list" v-loading.body="listLoading" element-loading-text="Loading" border fit highlight-current-row>
|
20
|
|
- <el-table-column :label="member.name" align="center">
|
|
20
|
+ <el-table-column :label="data.thirdLayer.name" align="center">
|
21
|
21
|
<el-table-column label="時間" align="center">
|
22
|
22
|
<template slot-scope="scope">
|
23
|
23
|
<span>{{moment(scope.row.createdAt)}}</span>
|
|
@@ -53,8 +53,8 @@
|
53
|
53
|
</el-table>
|
54
|
54
|
|
55
|
55
|
<div v-show="!listLoading" class="pagination-container">
|
56
|
|
- <el-pagination background @size-change="handleSizeChange" @current-change="handleCurrentChange" :current-page.sync="listQuery.page"
|
57
|
|
- :page-sizes="[10,20,30, 50]" :page-size="listQuery.limit" layout="total, sizes, prev, pager, next, jumper" :total="total">
|
|
56
|
+ <el-pagination background @size-change="handleSizeChange" @current-change="handleCurrentChange" :current-page.sync="query.thirdLayer.page"
|
|
57
|
+ :page-sizes="[10,20,30, 50]" :page-size="query.thirdLayer.limit" layout="total, sizes, prev, pager, next, jumper" :total="total">
|
58
|
58
|
</el-pagination>
|
59
|
59
|
</div>
|
60
|
60
|
|
|
@@ -116,30 +116,24 @@ export default {
|
116
|
116
|
dialogList: null,
|
117
|
117
|
total: null,
|
118
|
118
|
listLoading: true,
|
119
|
|
- listQuery: {
|
120
|
|
- page: 1,
|
121
|
|
- limit: 20,
|
122
|
|
- startAt: null,
|
123
|
|
- endAt: null
|
124
|
|
- },
|
125
|
119
|
pickerOptions: {
|
126
|
120
|
shortcuts: [{
|
127
|
121
|
text: '本週',
|
128
|
122
|
onClick(picker) {
|
129
|
|
- const end = moment().day(7).hour(11).minute(59).second(59)
|
130
|
|
- const start = moment().subtract(1, 'weeks').day(7).hour(16).minute(0).second(0)
|
131
|
|
- picker.$emit('pick', [start, end])
|
|
123
|
+ const endAt = moment().day(7).hour(11).minute(59).second(59)
|
|
124
|
+ const startAt = moment().subtract(1, 'weeks').day(7).hour(16).minute(0).second(0)
|
|
125
|
+ picker.$emit('pick', [startAt, endAt])
|
132
|
126
|
}
|
133
|
127
|
}, {
|
134
|
128
|
text: '上週',
|
135
|
129
|
onClick(picker) {
|
136
|
|
- const end = moment().subtract(1, 'weeks').day(7).hour(11).minute(59).second(59)
|
137
|
|
- const start = moment().subtract(2, 'weeks').day(7).hour(16).minute(0).second(0)
|
138
|
|
- picker.$emit('pick', [start, end])
|
|
130
|
+ const endAt = moment().subtract(1, 'weeks').day(7).hour(11).minute(59).second(59)
|
|
131
|
+ const startAt = moment().subtract(2, 'weeks').day(7).hour(16).minute(0).second(0)
|
|
132
|
+ picker.$emit('pick', [startAt, endAt])
|
139
|
133
|
}
|
140
|
134
|
}]
|
141
|
135
|
},
|
142
|
|
- date: null,
|
|
136
|
+ // date: null,
|
143
|
137
|
dialogFormVisible: false
|
144
|
138
|
|
145
|
139
|
}
|
|
@@ -150,17 +144,21 @@ export default {
|
150
|
144
|
},
|
151
|
145
|
computed: {
|
152
|
146
|
...mapGetters([
|
153
|
|
- 'visible'
|
|
147
|
+ 'visible',
|
|
148
|
+ 'data',
|
|
149
|
+ 'query'
|
154
|
150
|
])
|
155
|
151
|
},
|
156
|
|
- props: ['member'],
|
157
|
152
|
methods: {
|
158
|
153
|
...mapActions([
|
159
|
|
- 'SetVisible'
|
|
154
|
+ 'SetVisible',
|
|
155
|
+ 'SetData',
|
|
156
|
+ 'SetQuery'
|
160
|
157
|
]),
|
161
|
158
|
getList() {
|
162
|
159
|
this.listLoading = true
|
163
|
|
- fetchGameHistory(this.member, this.listQuery).then(response => {
|
|
160
|
+ this.list = []
|
|
161
|
+ fetchGameHistory(this.data.thirdLayer, this.query.thirdLayer).then(response => {
|
164
|
162
|
this.chipLogList = response.data
|
165
|
163
|
this.chipLogList.map((item) => {
|
166
|
164
|
this.list.push({
|
|
@@ -173,7 +171,7 @@ export default {
|
173
|
171
|
})
|
174
|
172
|
this.listLoading = false
|
175
|
173
|
})
|
176
|
|
- fetchChipsHistory(this.member, this.listQuery).then(response => {
|
|
174
|
+ fetchChipsHistory(this.data.thirdLayer, this.query.thirdLayer).then(response => {
|
177
|
175
|
this.gameRecordList = response.data
|
178
|
176
|
this.gameRecordList.map((item) => {
|
179
|
177
|
if(item.type === config.const.GambleMemberChipsLog.type.deposit) item.type = '上 / 下 分';
|
|
@@ -193,7 +191,7 @@ export default {
|
193
|
191
|
const dateB = new Date(b.createdAt);
|
194
|
192
|
return dateB - dateA;
|
195
|
193
|
});
|
196
|
|
-
|
|
194
|
+ this.total = this.list.length
|
197
|
195
|
this.listLoading = false
|
198
|
196
|
})
|
199
|
197
|
|
|
@@ -201,7 +199,7 @@ export default {
|
201
|
199
|
handlePersonDetail(row) {
|
202
|
200
|
this.listLoading = true
|
203
|
201
|
this.dialogFormVisible = true
|
204
|
|
- fetchPersonGameDetail(this.member.id, row.id).then(response => {
|
|
202
|
+ fetchPersonGameDetail(this.data.thirdLayer.id, row.id).then(response => {
|
205
|
203
|
this.dialogList = response.data.rows
|
206
|
204
|
this.listLoading = false
|
207
|
205
|
})
|
|
@@ -210,22 +208,27 @@ export default {
|
210
|
208
|
console.log('Game detail')
|
211
|
209
|
},
|
212
|
210
|
handleFilter() {
|
213
|
|
- this.listQuery.page = 1
|
214
|
|
- if (this.date) {
|
215
|
|
- this.listQuery.startAt = moment.utc(this.date[0]).format()
|
216
|
|
- this.listQuery.endAt = moment.utc(this.date[1]).format()
|
|
211
|
+ if (this.query.thirdLayer.date) {
|
|
212
|
+ this.SetQuery({layer:3, query: {page: 1,startAt: moment.utc(this.query.thirdLayer.date[0]).format(), endAt: moment.utc(this.query.thirdLayer.date[1]).format()}})
|
217
|
213
|
} else {
|
218
|
|
- this.listQuery.startAt = null
|
219
|
|
- this.listQuery.endAt = null
|
|
214
|
+ this.SetQuery({layer:3, query: {page: 1,startAt: null, endAt: null}})
|
220
|
215
|
}
|
221
|
216
|
this.getList()
|
222
|
217
|
},
|
223
|
218
|
handleSizeChange(val) {
|
224
|
|
- this.listQuery.limit = val
|
|
219
|
+ if (this.query.thirdLayer.date) {
|
|
220
|
+ this.SetQuery({layer:3, query: {limit: val, startAt: moment.utc(this.query.thirdLayer.date[0]).format(), endAt: moment.utc(this.query.thirdLayer.date[1]).format()}})
|
|
221
|
+ } else {
|
|
222
|
+ this.SetQuery({layer:3, query: {limit: val,startAt: null, endAt: null}})
|
|
223
|
+ }
|
225
|
224
|
this.getList()
|
226
|
225
|
},
|
227
|
226
|
handleCurrentChange(val) {
|
228
|
|
- this.listQuery.page = val
|
|
227
|
+ if (this.query.thirdLayer.date) {
|
|
228
|
+ this.SetQuery({layer:3, query: {page: val, startAt: moment.utc(this.query.thirdLayer.date[0]).format(), endAt: moment.utc(this.query.thirdLayer.date[1]).format()}})
|
|
229
|
+ } else {
|
|
230
|
+ this.SetQuery({layer:3, query: {page: val,startAt: null, endAt: null}})
|
|
231
|
+ }
|
229
|
232
|
this.getList()
|
230
|
233
|
},
|
231
|
234
|
moment(time) {
|
|
@@ -256,6 +259,14 @@ export default {
|
256
|
259
|
},
|
257
|
260
|
destroyed() {
|
258
|
261
|
this.SetVisible(2)
|
|
262
|
+ },
|
|
263
|
+ // TODO time 持九化
|
|
264
|
+ watch: {
|
|
265
|
+ 'query.thirdLayer.date': function(val) {
|
|
266
|
+ if(this.query.thirdLayer.date) if((val[0] = this.query.thirdLayer.date[0]) && (val[1] = this.query.thirdLayer.date[1])) return
|
|
267
|
+ this.SetQuery({layer:3, query: {date: val}})
|
|
268
|
+ console.log('test', val);
|
|
269
|
+ }
|
259
|
270
|
}
|
260
|
271
|
}
|
261
|
272
|
</script>
|