许成详 6 年之前
父節點
當前提交
bfca288586

+ 1
- 1
src/pages/system/caseManager/keyManager/add.vue 查看文件

101
       this.postData.AreaIcon = res.result.url
101
       this.postData.AreaIcon = res.result.url
102
     },
102
     },
103
     submit () { // 提交数据
103
     submit () { // 提交数据
104
+      console.log('柜子编号:' + this.postData.beginnum + ' ' + this.postData.endnum)
104
       if (this.postData.beginnum === '') {
105
       if (this.postData.beginnum === '') {
105
         this.$message({
106
         this.$message({
106
           type: 'error',
107
           type: 'error',
115
         })
116
         })
116
         return false
117
         return false
117
       }
118
       }
118
-      console.log('柜子编号:' + this.postData.beginnum + ' ' + this.postData.endnum)
119
       this.postData.orgid = this.OrgId
119
       this.postData.orgid = this.OrgId
120
       this.$ajax(this.$api.caseManager.addKey.url, {
120
       this.$ajax(this.$api.caseManager.addKey.url, {
121
         method: this.$api.caseManager.addKey.method,
121
         method: this.$api.caseManager.addKey.method,

+ 168
- 27
src/pages/system/verificationManager/phoneVerification/verificationList/index.vue 查看文件

52
                 </template>
52
                 </template>
53
               </el-table-column>
53
               </el-table-column>
54
               <el-table-column
54
               <el-table-column
55
-                label="操作">
55
+                label="操作"
56
+                width="200">
56
                 <template slot-scope="scope">
57
                 <template slot-scope="scope">
57
                   <el-button
58
                   <el-button
58
                     size="mini"
59
                     size="mini"
59
                     type="success"
60
                     type="success"
60
                     v-if="scope.row.VerifyStatus!=='used'"
61
                     v-if="scope.row.VerifyStatus!=='used'"
61
                     @click="check(scope.row)">核销</el-button>
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
                 </template>
67
                 </template>
64
               </el-table-column>
68
               </el-table-column>
65
             </el-table>
69
             </el-table>
74
         <span class="noData" v-else>今日暂无可核销的课程</span>
78
         <span class="noData" v-else>今日暂无可核销的课程</span>
75
       </div>
79
       </div>
76
     </div>
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
   </div>
141
   </div>
78
 </template>
142
 </template>
79
 
143
 
80
 <script>
144
 <script>
81
-import { createNamespacedHelpers } from 'vuex'
145
+import { mapState, createNamespacedHelpers } from 'vuex'
82
 
146
 
83
 const { mapState: mapVerifState, mapActions: mapVerifActions } = createNamespacedHelpers('verification')
147
 const { mapState: mapVerifState, mapActions: mapVerifActions } = createNamespacedHelpers('verification')
148
+const { mapActions: mapDeviceActions } = createNamespacedHelpers('device')
84
 
149
 
85
 export default {
150
 export default {
86
   name: '',
151
   name: '',
87
   data () {
152
   data () {
88
     return {
153
     return {
154
+      dialogVisible: false,
155
+      dialogList: [],
156
+      centerDialogVisible: false,
157
+      customerId: '',
89
       customerName: '',
158
       customerName: '',
90
       phone: this.$route.query.tel,
159
       phone: this.$route.query.tel,
91
       code: '',
160
       code: '',
92
       tel: '',
161
       tel: '',
93
       page: 1,
162
       page: 1,
94
       pagesize: 10,
163
       pagesize: 10,
164
+      postData: {
165
+        caseid: '',
166
+        page: 1,
167
+        pagesize: 6,
168
+      },
169
+      dialogTotal: 0,
95
     }
170
     }
96
   },
171
   },
97
   mounted () {
172
   mounted () {
98
     this.$nextTick(function () {
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
   computed: {
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
     ...mapVerifState({
191
     ...mapVerifState({
112
       courses: x => x.courseVerifs
192
       courses: x => x.courseVerifs
113
-    })
193
+    }),
114
   },
194
   },
115
   methods: {
195
   methods: {
116
     ...mapVerifActions([
196
     ...mapVerifActions([
119
       'GetCourseVerListByTel',
199
       'GetCourseVerListByTel',
120
       'getCustomerName'
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
     check (item) { // 核销
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
     getList () {
245
     getList () {
133
       if (this.code && this.code !== '') {
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
       } else {
248
       } else {
136
         if (this.tel && this.tel !== '') {
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
       this.getList()
263
       this.getList()
151
     },
264
     },
152
     reback () { // 返回
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
 <!-- Add "scoped" attribute to limit CSS to this component only -->
300
 <!-- Add "scoped" attribute to limit CSS to this component only -->
160
 <style lang="scss" scoped>
301
 <style lang="scss" scoped>
161
 .subPage {
302
 .subPage {
162
-  .userInfo{
303
+  .userInfo {
163
     white-space: nowrap;
304
     white-space: nowrap;
164
     font-size: 0;
305
     font-size: 0;
165
-    >*{
306
+    > * {
166
       display: inline-block;
307
       display: inline-block;
167
       margin-right: 10px;
308
       margin-right: 10px;
168
     }
309
     }
169
-    >b{
310
+    > b {
170
       font-weight: bolder;
311
       font-weight: bolder;
171
       font-size: 15px;
312
       font-size: 15px;
172
       margin-right: 30px;
313
       margin-right: 30px;
186
       }
327
       }
187
     }
328
     }
188
   }
329
   }
189
-  .noData{
330
+  .noData {
190
     width: 100%;
331
     width: 100%;
191
     display: block;
332
     display: block;
192
     line-height: 40px;
333
     line-height: 40px;

+ 20
- 0
src/store/case/device.js 查看文件

16
     },
16
     },
17
   },
17
   },
18
   actions: {
18
   actions: {
19
+    bindKeyer ({ commit }, payload) {
20
+      return new Promise((resolve, reject) => {
21
+        ajax(api.caseManager.bindKey.url, {
22
+          method: api.caseManager.bindKey.method,
23
+          urlData: { ...payload },
24
+        }).then(res => {
25
+          resolve(res)
26
+        }).catch(reject)
27
+      })
28
+    },
29
+    getKeyList ({ commit }, payload) {
30
+      return new Promise((resolve, reject) => {
31
+        ajax(api.caseManager.getKeyListById.url, {
32
+          method: api.caseManager.getKeyListById.method,
33
+          queryData: { ...payload },
34
+        }).then(res => {
35
+          resolve(res)
36
+        }).catch(reject)
37
+      })
38
+    },
19
     GetDeviceList ({ commit }, payload) {
39
     GetDeviceList ({ commit }, payload) {
20
       return new Promise((resolve, reject) => {
40
       return new Promise((resolve, reject) => {
21
         ajax(api.device.list.url, {
41
         ajax(api.device.list.url, {

+ 8
- 0
src/util/api.js 查看文件

85
     },
85
     },
86
   },
86
   },
87
   caseManager: {
87
   caseManager: {
88
+    getKeyListById: {
89
+      method: 'get',
90
+      url: `${baseUrl}${common}/case/key`
91
+    },
92
+    bindKey: {
93
+      method: 'post',
94
+      url: `${baseUrl}${common}/case/key/:keyid/:customerid/:customername`
95
+    },
88
     getRolesList: { // 获取角色列表
96
     getRolesList: { // 获取角色列表
89
       method: 'get',
97
       method: 'get',
90
       url: `${baseUrl}${common}/role`
98
       url: `${baseUrl}${common}/role`