|
@@ -52,14 +52,18 @@
|
52
|
52
|
</template>
|
53
|
53
|
</el-table-column>
|
54
|
54
|
<el-table-column
|
55
|
|
- label="操作">
|
|
55
|
+ label="操作"
|
|
56
|
+ width="200">
|
56
|
57
|
<template slot-scope="scope">
|
57
|
58
|
<el-button
|
58
|
59
|
size="mini"
|
59
|
60
|
type="success"
|
60
|
61
|
v-if="scope.row.VerifyStatus!=='used'"
|
61
|
62
|
@click="check(scope.row)">核销</el-button>
|
62
|
|
- <span v-else>已完成</span>
|
|
63
|
+ <el-button
|
|
64
|
+ size="mini"
|
|
65
|
+ type="info"
|
|
66
|
+ v-else>已完成</el-button>
|
63
|
67
|
</template>
|
64
|
68
|
</el-table-column>
|
65
|
69
|
</el-table>
|
|
@@ -74,43 +78,119 @@
|
74
|
78
|
<span class="noData" v-else>今日暂无可核销的课程</span>
|
75
|
79
|
</div>
|
76
|
80
|
</div>
|
|
81
|
+ <el-dialog
|
|
82
|
+ title="选择绑定钥匙"
|
|
83
|
+ :visible.sync="centerDialogVisible"
|
|
84
|
+ width="400"
|
|
85
|
+ center>
|
|
86
|
+ <div>
|
|
87
|
+ <el-table
|
|
88
|
+ :data="dialogList"
|
|
89
|
+ stripe
|
|
90
|
+ style="width: 100%">
|
|
91
|
+ <el-table-column
|
|
92
|
+ prop="CustomerName"
|
|
93
|
+ label="当前用户">
|
|
94
|
+ </el-table-column>
|
|
95
|
+ <el-table-column
|
|
96
|
+ prop="LockNo"
|
|
97
|
+ label="锁柜号">
|
|
98
|
+ </el-table-column>
|
|
99
|
+ <el-table-column
|
|
100
|
+ prop="Status"
|
|
101
|
+ label="状态">
|
|
102
|
+ <template slot-scope="scope">
|
|
103
|
+ {{scope.row.Status === 1 ? '有人' : '无人'}}
|
|
104
|
+ </template>
|
|
105
|
+ </el-table-column>
|
|
106
|
+ <el-table-column
|
|
107
|
+ label="操作"
|
|
108
|
+ width="200">
|
|
109
|
+ <template slot-scope="scope">
|
|
110
|
+ <el-button
|
|
111
|
+ v-if="scope.row.Status === 0"
|
|
112
|
+ size="mini"
|
|
113
|
+ type="success"
|
|
114
|
+ @click="toBindKey(scope.row)">绑定</el-button>
|
|
115
|
+ </template>
|
|
116
|
+ </el-table-column>
|
|
117
|
+ </el-table>
|
|
118
|
+ <el-pagination
|
|
119
|
+ @current-change="handleCurrentChangeDialog"
|
|
120
|
+ :current-page.sync="postData.page"
|
|
121
|
+ :page-size="postData.pagesize"
|
|
122
|
+ layout="prev, pager, next, jumper"
|
|
123
|
+ :total="dialogTotal">
|
|
124
|
+ </el-pagination>
|
|
125
|
+ </div>
|
|
126
|
+ <span slot="footer" class="dialog-footer">
|
|
127
|
+ <el-button @click="centerDialogVisible = false">取 消</el-button>
|
|
128
|
+ <el-button type="primary" @click="centerDialogVisible = false">确 定</el-button>
|
|
129
|
+ </span>
|
|
130
|
+ </el-dialog>
|
|
131
|
+ <el-dialog
|
|
132
|
+ title="提示"
|
|
133
|
+ :visible.sync="dialogVisible"
|
|
134
|
+ width="200">
|
|
135
|
+ <span>确认核销此课程</span>
|
|
136
|
+ <span slot="footer" class="dialog-footer">
|
|
137
|
+ <el-button @click="sureVerify">确 定</el-button>
|
|
138
|
+ <el-button type="primary" @click="sureAndBind">确定并绑定钥匙</el-button>
|
|
139
|
+ </span>
|
|
140
|
+ </el-dialog>
|
77
|
141
|
</div>
|
78
|
142
|
</template>
|
79
|
143
|
|
80
|
144
|
<script>
|
81
|
|
-import { createNamespacedHelpers } from 'vuex'
|
|
145
|
+import { mapState, createNamespacedHelpers } from 'vuex'
|
82
|
146
|
|
83
|
147
|
const { mapState: mapVerifState, mapActions: mapVerifActions } = createNamespacedHelpers('verification')
|
|
148
|
+const { mapActions: mapDeviceActions } = createNamespacedHelpers('device')
|
84
|
149
|
|
85
|
150
|
export default {
|
86
|
151
|
name: '',
|
87
|
152
|
data () {
|
88
|
153
|
return {
|
|
154
|
+ dialogVisible: false,
|
|
155
|
+ dialogList: [],
|
|
156
|
+ centerDialogVisible: false,
|
|
157
|
+ customerId: '',
|
89
|
158
|
customerName: '',
|
90
|
159
|
phone: this.$route.query.tel,
|
91
|
160
|
code: '',
|
92
|
161
|
tel: '',
|
93
|
162
|
page: 1,
|
94
|
163
|
pagesize: 10,
|
|
164
|
+ postData: {
|
|
165
|
+ caseid: '',
|
|
166
|
+ page: 1,
|
|
167
|
+ pagesize: 6,
|
|
168
|
+ },
|
|
169
|
+ dialogTotal: 0,
|
95
|
170
|
}
|
96
|
171
|
},
|
97
|
172
|
mounted () {
|
98
|
173
|
this.$nextTick(function () {
|
99
|
|
- this.getCustomerName({
|
100
|
|
- id: this.phone
|
101
|
|
- }).then((res) => {
|
102
|
|
- console.log(res)
|
103
|
|
- const { code, tel } = this.$route.query
|
104
|
|
- this.code = code
|
105
|
|
- this.tel = tel
|
106
|
|
- this.getList()
|
107
|
|
- })
|
|
174
|
+ this.init()
|
108
|
175
|
})
|
109
|
176
|
},
|
110
|
177
|
computed: {
|
|
178
|
+ ...mapState({
|
|
179
|
+ cases: x => x.app.cases.list,
|
|
180
|
+ defaultCaseId: x => x.app.cases.default,
|
|
181
|
+ OrgId: x => x.app.user.OrgId,
|
|
182
|
+ }),
|
|
183
|
+ CaseId: {
|
|
184
|
+ get () {
|
|
185
|
+ return this.postData.caseid || this.defaultCaseId
|
|
186
|
+ },
|
|
187
|
+ set (val) {
|
|
188
|
+ this.postData.caseid = val
|
|
189
|
+ }
|
|
190
|
+ },
|
111
|
191
|
...mapVerifState({
|
112
|
192
|
courses: x => x.courseVerifs
|
113
|
|
- })
|
|
193
|
+ }),
|
114
|
194
|
},
|
115
|
195
|
methods: {
|
116
|
196
|
...mapVerifActions([
|
|
@@ -119,22 +199,55 @@ export default {
|
119
|
199
|
'GetCourseVerListByTel',
|
120
|
200
|
'getCustomerName'
|
121
|
201
|
]),
|
|
202
|
+ ...mapDeviceActions([
|
|
203
|
+ 'getKeyList',
|
|
204
|
+ 'bindKeyer',
|
|
205
|
+ ]),
|
|
206
|
+ init () {
|
|
207
|
+ this.getCustomerName({
|
|
208
|
+ id: this.phone
|
|
209
|
+ }).then((res) => {
|
|
210
|
+ if (res !== null) {
|
|
211
|
+ this.customerId = res.CustomerId
|
|
212
|
+ this.customerName = res.CustomerName
|
|
213
|
+ const { code, tel } = this.$route.query
|
|
214
|
+ this.code = code
|
|
215
|
+ this.tel = tel
|
|
216
|
+ this.getList()
|
|
217
|
+ } else {
|
|
218
|
+ this.$message({
|
|
219
|
+ type: 'error',
|
|
220
|
+ message: '未查询到用户信息'
|
|
221
|
+ })
|
|
222
|
+ }
|
|
223
|
+ })
|
|
224
|
+ },
|
122
|
225
|
check (item) { // 核销
|
123
|
|
- this.$confirm('确认核销此课程?', '提示', {
|
124
|
|
- confirmButtonText: '确定',
|
125
|
|
- cancelButtonText: '取消',
|
126
|
|
- type: 'warning'
|
|
226
|
+ this.currentItem = item
|
|
227
|
+ this.dialogVisible = true
|
|
228
|
+ },
|
|
229
|
+ sureVerify () {
|
|
230
|
+ this.CourseVerifs({ id: this.currentItem.CustomerDetailId, callback: this.afterCheck })
|
|
231
|
+ this.dialogVisible = false
|
|
232
|
+ },
|
|
233
|
+ sureAndBind () {
|
|
234
|
+ this.dialogVisible = false
|
|
235
|
+ this.getKeyList({
|
|
236
|
+ ...this.postData,
|
|
237
|
+ caseid: this.CaseId,
|
|
238
|
+ }).then((res) => {
|
|
239
|
+ // console.log(JSON.stringify(res))
|
|
240
|
+ this.dialogTotal = res.pagenum
|
|
241
|
+ this.dialogList = res.list
|
|
242
|
+ this.centerDialogVisible = true
|
127
|
243
|
})
|
128
|
|
- .then(() => {
|
129
|
|
- this.CourseVerifs({id: item.CustomerDetailId, callback: this.afterCheck})
|
130
|
|
- })
|
131
|
244
|
},
|
132
|
245
|
getList () {
|
133
|
246
|
if (this.code && this.code !== '') {
|
134
|
|
- this.GetCourseVerList({id: this.code, page: this.page, pagesize: this.pagesize})
|
|
247
|
+ this.GetCourseVerList({ id: this.code, page: this.page, pagesize: this.pagesize })
|
135
|
248
|
} else {
|
136
|
249
|
if (this.tel && this.tel !== '') {
|
137
|
|
- this.GetCourseVerListByTel({tel: this.tel, page: this.page, pagesize: this.pagesize})
|
|
250
|
+ this.GetCourseVerListByTel({ tel: this.tel, page: this.page, pagesize: this.pagesize })
|
138
|
251
|
}
|
139
|
252
|
}
|
140
|
253
|
},
|
|
@@ -150,7 +263,35 @@ export default {
|
150
|
263
|
this.getList()
|
151
|
264
|
},
|
152
|
265
|
reback () { // 返回
|
153
|
|
- this.$router.push({name: 'phoneVerification'})
|
|
266
|
+ this.$router.push({ name: 'phoneVerification' })
|
|
267
|
+ },
|
|
268
|
+ bindKey (item) { // 绑定钥匙
|
|
269
|
+ },
|
|
270
|
+ handleCurrentChangeDialog (val) {
|
|
271
|
+ this.postData.page = val
|
|
272
|
+ this.getKeyList({
|
|
273
|
+ ...this.postData,
|
|
274
|
+ caseid: this.CaseId,
|
|
275
|
+ }).then((res) => {
|
|
276
|
+ // console.log(JSON.stringify(res))
|
|
277
|
+ this.dialogTotal = res.pagenum
|
|
278
|
+ this.dialogList = res.list
|
|
279
|
+ this.centerDialogVisible = true
|
|
280
|
+ })
|
|
281
|
+ },
|
|
282
|
+ toBindKey (item) {
|
|
283
|
+ this.bindKeyer({
|
|
284
|
+ keyid: item.KeyId,
|
|
285
|
+ customerid: this.customerId,
|
|
286
|
+ customername: this.customerName
|
|
287
|
+ }).then((res) => {
|
|
288
|
+ // console.log(JSON.stringify(res))
|
|
289
|
+ this.CourseVerifs({ id: this.currentItem.CustomerDetailId, callback: this.afterCheck })
|
|
290
|
+ this.centerDialogVisible = false
|
|
291
|
+ this.postData.page = 1
|
|
292
|
+ this.dialogList = []
|
|
293
|
+ this.init()
|
|
294
|
+ })
|
154
|
295
|
},
|
155
|
296
|
}
|
156
|
297
|
}
|
|
@@ -159,14 +300,14 @@ export default {
|
159
|
300
|
<!-- Add "scoped" attribute to limit CSS to this component only -->
|
160
|
301
|
<style lang="scss" scoped>
|
161
|
302
|
.subPage {
|
162
|
|
- .userInfo{
|
|
303
|
+ .userInfo {
|
163
|
304
|
white-space: nowrap;
|
164
|
305
|
font-size: 0;
|
165
|
|
- >*{
|
|
306
|
+ > * {
|
166
|
307
|
display: inline-block;
|
167
|
308
|
margin-right: 10px;
|
168
|
309
|
}
|
169
|
|
- >b{
|
|
310
|
+ > b {
|
170
|
311
|
font-weight: bolder;
|
171
|
312
|
font-size: 15px;
|
172
|
313
|
margin-right: 30px;
|
|
@@ -186,7 +327,7 @@ export default {
|
186
|
327
|
}
|
187
|
328
|
}
|
188
|
329
|
}
|
189
|
|
- .noData{
|
|
330
|
+ .noData {
|
190
|
331
|
width: 100%;
|
191
|
332
|
display: block;
|
192
|
333
|
line-height: 40px;
|