|
@@ -31,12 +31,18 @@
|
31
|
31
|
<span>{{scope.row.chips}}</span>
|
32
|
32
|
</template>
|
33
|
33
|
</el-table-column>
|
34
|
|
- <el-table-column align="center" label="操作" width="350">
|
|
34
|
+ <el-table-column label="代理商" align="center">
|
|
35
|
+ <template slot-scope="scope">
|
|
36
|
+ {{!scope.row.GambleAgent ? 'N/A': scope.row.GambleAgent.name}}
|
|
37
|
+ </template>
|
|
38
|
+ </el-table-column>
|
|
39
|
+ <el-table-column align="center" label="操作" width="450">
|
35
|
40
|
<template slot-scope="scope">
|
36
|
41
|
<el-button type="primary" size="mini" icon="el-icon-edit" @click="handleChipsMangement(scope.row)">分數管理</el-button>
|
37
|
42
|
<router-link to="/room/index/gambleMember/index/chipsHistory">
|
38
|
43
|
<el-button type="primary" size="mini" icon="el-icon-tickets" @click="handleLog(scope.row)">分數紀錄</el-button>
|
39
|
44
|
</router-link>
|
|
45
|
+ <el-button type="primary" size="mini" icon="el-icon-edit" @click="handleAgentUpdate(scope.row)">代理商設定</el-button>
|
40
|
46
|
<router-link to="/room/index/gambleMember/index/gameHistory">
|
41
|
47
|
<el-button type="primary" size="mini" icon="el-icon-tickets" @click="handlePage(scope.row)">歷史查詢</el-button>
|
42
|
48
|
</router-link>
|
|
@@ -92,6 +98,26 @@
|
92
|
98
|
<el-button v-if="dialogStatus=='deposit'" type="primary" @click="depositChips">確 定</el-button>
|
93
|
99
|
</div>
|
94
|
100
|
</el-dialog>
|
|
101
|
+
|
|
102
|
+
|
|
103
|
+ <el-dialog title="所屬代理商" :visible.sync="dialogUpdateFormVisible" :before-close="handleDialogClose" center>
|
|
104
|
+ <el-form :rules="rules" :model="temp" ref="updateForm" label-position="left" label-width="100px" style='width: 400px; margin-left:50px;'>
|
|
105
|
+ <el-form-item label="使用者" prop="id">
|
|
106
|
+ <el-input v-model="temp.name" :disabled="true"></el-input>
|
|
107
|
+ </el-form-item>
|
|
108
|
+ <el-form-item label="代理商" prop="name">
|
|
109
|
+ <multiselect v-model="updateFormData" :options="agentLIstOptions" @search-change="getRemoteAgentList" placeholder="代理商搜尋" selectLabel="選擇"
|
|
110
|
+ deselectLabel="删除" track-by="key" :internalSearch="false" label="key">
|
|
111
|
+ <span slot='noResult'>無結果</span>
|
|
112
|
+ </multiselect>
|
|
113
|
+ </el-form-item>
|
|
114
|
+ </el-form>
|
|
115
|
+ <div slot="footer" class="dialog-footer">
|
|
116
|
+ <el-button @click="handleDialogClose">取 消</el-button>
|
|
117
|
+ <el-button type="primary" @click="updateData">確 定</el-button>
|
|
118
|
+ </div>
|
|
119
|
+ </el-dialog>
|
|
120
|
+
|
95
|
121
|
</div>
|
96
|
122
|
<router-view :member="member"></router-view>
|
97
|
123
|
</div>
|
|
@@ -101,11 +127,14 @@
|
101
|
127
|
|
102
|
128
|
import { mapGetters, mapActions } from 'vuex'
|
103
|
129
|
// TODO 需更改抓取此房間人員
|
104
|
|
-import { fetchList, chipsDeposit, chipsReward, createGambleMember } from '@/api/gambleMember'
|
|
130
|
+import { fetchList, chipsDeposit, chipsReward, createGambleMember, fetchAgentList, updateBelongAgent } from '@/api/gambleMember'
|
105
|
131
|
import waves from '@/directive/waves' // 水波纹指令
|
|
132
|
+import Multiselect from 'vue-multiselect'// 使用的一个多选框组件,element-ui的select不能满足所有需求
|
|
133
|
+import 'vue-multiselect/dist/vue-multiselect.min.css'// 多选框组件css
|
106
|
134
|
|
107
|
135
|
export default {
|
108
|
136
|
name: 'gambleMemberTable',
|
|
137
|
+ components: { Multiselect },
|
109
|
138
|
directives: {
|
110
|
139
|
waves
|
111
|
140
|
},
|
|
@@ -143,6 +172,9 @@ export default {
|
143
|
172
|
// name: [{ type: 'string', required: true, message: '必填', trigger: 'change' }]
|
144
|
173
|
},
|
145
|
174
|
activeName: 'deposit',
|
|
175
|
+ dialogUpdateFormVisible: false,
|
|
176
|
+ updateFormData: {},
|
|
177
|
+ agentLIstOptions: [],
|
146
|
178
|
}
|
147
|
179
|
},
|
148
|
180
|
created() {
|
|
@@ -164,6 +196,7 @@ export default {
|
164
|
196
|
getList() {
|
165
|
197
|
this.listLoading = true
|
166
|
198
|
fetchList(this.listQuery).then(response => {
|
|
199
|
+ console.log('list',response.data.rows)
|
167
|
200
|
this.list = response.data.rows
|
168
|
201
|
this.total = response.data.count
|
169
|
202
|
this.listLoading = false
|
|
@@ -238,6 +271,7 @@ export default {
|
238
|
271
|
handleDialogClose() {
|
239
|
272
|
this.activeName = 'deposit';
|
240
|
273
|
this.dialogFormVisible = false;
|
|
274
|
+ this.dialogUpdateFormVisible = false;
|
241
|
275
|
},
|
242
|
276
|
rewardChips() {
|
243
|
277
|
this.$refs['rewardForm'].validate((valid) => {
|
|
@@ -262,6 +296,48 @@ export default {
|
262
|
296
|
})
|
263
|
297
|
}
|
264
|
298
|
})
|
|
299
|
+ },
|
|
300
|
+ handleAgentUpdate(row) {
|
|
301
|
+ this.temp = Object.assign({}, row) // copy obj
|
|
302
|
+ this.dialogUpdateFormVisible = true;
|
|
303
|
+ this.$nextTick(() => {
|
|
304
|
+ this.$refs['updateForm'].clearValidate()
|
|
305
|
+ })
|
|
306
|
+ },
|
|
307
|
+ updateData() {
|
|
308
|
+ this.$refs['updateForm'].validate((valid) => {
|
|
309
|
+ if (valid) {
|
|
310
|
+ const tempMember = Object.assign({}, this.temp)
|
|
311
|
+ const tempAgent = Object.assign({}, this.updateFormData.value)
|
|
312
|
+ console.log('aaaaa',tempAgent)
|
|
313
|
+ updateBelongAgent(tempMember, tempAgent).then(() => {
|
|
314
|
+ for (const v of this.list) {
|
|
315
|
+ if (v.id === this.temp.id) {
|
|
316
|
+ const index = this.list.indexOf(v)
|
|
317
|
+ this.list.splice(index, 1, this.temp)
|
|
318
|
+ break
|
|
319
|
+ }
|
|
320
|
+ }
|
|
321
|
+ this.dialogUpdateFormVisible = false
|
|
322
|
+ this.$notify({
|
|
323
|
+ title: '成功',
|
|
324
|
+ message: '操作成功',
|
|
325
|
+ type: 'success',
|
|
326
|
+ duration: 2000
|
|
327
|
+ })
|
|
328
|
+ this.getList()
|
|
329
|
+ })
|
|
330
|
+ }
|
|
331
|
+ })
|
|
332
|
+ },
|
|
333
|
+ getRemoteAgentList(query) {
|
|
334
|
+ fetchAgentList(query).then(response => {
|
|
335
|
+ if (!response.data.rows) return
|
|
336
|
+ this.agentLIstOptions = response.data.rows.map(v => ({
|
|
337
|
+ key: v.GambleMember.name,
|
|
338
|
+ value: v.GambleMember
|
|
339
|
+ }))
|
|
340
|
+ })
|
265
|
341
|
}
|
266
|
342
|
},
|
267
|
343
|
// watch: {
|