Browse Source

bug修改

wangfei 6 years ago
parent
commit
7b7ccc2591

+ 3
- 3
config/index.js View File

13
       '/api': {
13
       '/api': {
14
         // target: 'https://dp.huiju360.com.cn/hj_operations',
14
         // target: 'https://dp.huiju360.com.cn/hj_operations',
15
         // target: 'http://192.168.0.62:8080', //wf
15
         // target: 'http://192.168.0.62:8080', //wf
16
-        //target: 'http://127.0.0.1:8080', 
17
-        target: 'http://localhost:8080', //wf
16
+        // target: 'http://127.0.0.1:8080', 
17
+        // target: 'http://192.168.0.62:8080', //wf
18
         // target: 'http://192.168.0.11', //ys
18
         // target: 'http://192.168.0.11', //ys
19
-        // target: 'http://192.168.0.125:8080', //hyq
19
+        target: 'http://192.168.0.125:8080', //hyq
20
         // target: 'http://dev.ycjcjy.com/', //frp
20
         // target: 'http://dev.ycjcjy.com/', //frp
21
         changeOrigin: true, // 如果接口跨域,需要进行这个参数配置
21
         changeOrigin: true, // 如果接口跨域,需要进行这个参数配置
22
         // pathRewrite: {
22
         // pathRewrite: {

+ 125
- 31
src/pages/system/cardAndCouponManager/cardManager/edit.vue View File

3
     <form class="mainForm">
3
     <form class="mainForm">
4
       <ul>
4
       <ul>
5
         <li class="flex-h">
5
         <li class="flex-h">
6
-          <span>选择案场:</span>
6
+          <span>选择案场:<em>*</em></span>
7
           <div class="flex-item">
7
           <div class="flex-item">
8
             <div style="width:50%">
8
             <div style="width:50%">
9
               <el-select v-model="cardInfo.CaseId" placeholder="请选择" @change="caseChange">
9
               <el-select v-model="cardInfo.CaseId" placeholder="请选择" @change="caseChange">
18
           </div>
18
           </div>
19
         </li>
19
         </li>
20
         <li class="flex-h">
20
         <li class="flex-h">
21
-          <span>卡图片:</span>
21
+          <span>卡图片:<em>*</em></span>
22
           <div class="flex-item">
22
           <div class="flex-item">
23
             <div>
23
             <div>
24
               <el-upload
24
               <el-upload
34
           </div>
34
           </div>
35
         </li>
35
         </li>
36
         <li class="flex-h">
36
         <li class="flex-h">
37
-          <span>卡名称:</span>
37
+          <span>卡名称:<em>*</em></span>
38
           <div class="flex-item">
38
           <div class="flex-item">
39
             <div style="width:200px;">
39
             <div style="width:200px;">
40
               <el-input
40
               <el-input
46
           </div>
46
           </div>
47
         </li>
47
         </li>
48
         <li class="flex-h">
48
         <li class="flex-h">
49
-          <span>卡价格:</span>
49
+          <span>卡价格:<em>*</em></span>
50
           <div class="flex-item">
50
           <div class="flex-item">
51
             <div style="width:200px;">
51
             <div style="width:200px;">
52
               <el-input
52
               <el-input
58
           </div>
58
           </div>
59
         </li>
59
         </li>
60
         <li class="flex-h">
60
         <li class="flex-h">
61
-          <span>总张数:</span>
61
+          <span>总张数:<em>*</em></span>
62
           <div class="flex-item">
62
           <div class="flex-item">
63
             <div style="width:200px;">
63
             <div style="width:200px;">
64
               <el-input
64
               <el-input
70
           </div>
70
           </div>
71
         </li>
71
         </li>
72
         <li class="flex-h">
72
         <li class="flex-h">
73
-          <span>发送类型:</span>
73
+          <span>发送类型:<em>*</em></span>
74
           <div class="flex-item">
74
           <div class="flex-item">
75
             <div>
75
             <div>
76
               <el-radio v-model="cardInfo.SendType" label="channel">渠道</el-radio>
76
               <el-radio v-model="cardInfo.SendType" label="channel">渠道</el-radio>
80
           </div>
80
           </div>
81
         </li>
81
         </li>
82
         <li class="flex-h" v-if="cardInfo.SendType === 'channel'">
82
         <li class="flex-h" v-if="cardInfo.SendType === 'channel'">
83
-          <span>选择渠道:</span>
83
+          <span>选择渠道:<em>*</em></span>
84
           <div class="flex-item">
84
           <div class="flex-item">
85
             <div style="width:50%">
85
             <div style="width:50%">
86
               <el-select v-model="cardInfo.ChannelId" placeholder="请选择">
86
               <el-select v-model="cardInfo.ChannelId" placeholder="请选择">
95
           </div>
95
           </div>
96
         </li>
96
         </li>
97
         <li class="flex-h">
97
         <li class="flex-h">
98
-          <span>目标课程:</span>
98
+          <span>目标课程:<em>*</em></span>
99
           <div class="flex-item">
99
           <div class="flex-item">
100
             <div>
100
             <div>
101
               <el-select v-model="cardInfo.Targets[0].TargetId" placeholder="请选择">
101
               <el-select v-model="cardInfo.Targets[0].TargetId" placeholder="请选择">
111
           </div>
111
           </div>
112
         </li>
112
         </li>
113
         <li class="flex-h">
113
         <li class="flex-h">
114
-          <span>卡有效时间:</span>
114
+          <span>卡有效时间:<em>*</em></span>
115
           <div class="flex-item">
115
           <div class="flex-item">
116
             <div>
116
             <div>
117
               <div class="addLine flex-h" style="align-item:center;margin-bottom:20px;">
117
               <div class="addLine flex-h" style="align-item:center;margin-bottom:20px;">
118
-                <!-- <el-date-picker
119
-                  v-model="cardInfo.StartDate"
120
-                  type="date"
121
-                  placeholder="选择起始日期">
122
-                </el-date-picker>
123
-                <span style="line-height:40px;">至</span>
124
-                <el-date-picker
125
-                  v-model="cardInfo.EndDate"
126
-                  type="date"
127
-                  placeholder="选择截止日期">
128
-                </el-date-picker> -->
129
                 <el-date-picker
118
                 <el-date-picker
130
                   v-model="date"
119
                   v-model="date"
131
                   type="daterange"
120
                   type="daterange"
139
           </div>
128
           </div>
140
         </li>
129
         </li>
141
         <li class="flex-h" v-if="cardInfo.SendType !== 'case' && cardInfo.SendType !== 'system'">
130
         <li class="flex-h" v-if="cardInfo.SendType !== 'case' && cardInfo.SendType !== 'system'">
142
-          <span>视频:</span>
131
+          <span>视频:<em>*</em></span>
143
           <div class="flex-item">
132
           <div class="flex-item">
144
             <div style="vertical-align: middle;">
133
             <div style="vertical-align: middle;">
145
               <a style="line-height: 40px;" v-if="videoOff" :href="cardInfo.VideoUrl" target="blank">{{cardInfo.VideoUrl}}</a>
134
               <a style="line-height: 40px;" v-if="videoOff" :href="cardInfo.VideoUrl" target="blank">{{cardInfo.VideoUrl}}</a>
156
           </div>
145
           </div>
157
         </li>
146
         </li>
158
         <li class="flex-h">
147
         <li class="flex-h">
159
-          <span>分享描述:</span>
148
+          <span>分享描述:<em>*</em></span>
160
           <div class="flex-item">
149
           <div class="flex-item">
161
             <div>
150
             <div>
162
               <el-input
151
               <el-input
169
           </div>
158
           </div>
170
         </li>
159
         </li>
171
         <li class="flex-h">
160
         <li class="flex-h">
172
-          <span>规则描述:</span>
161
+          <span>规则描述:<em>*</em></span>
173
           <div class="flex-item">
162
           <div class="flex-item">
174
             <div>
163
             <div>
175
               <el-input
164
               <el-input
182
           </div>
171
           </div>
183
         </li>
172
         </li>
184
         <li class="flex-h">
173
         <li class="flex-h">
185
-          <span>使用说明:</span>
174
+          <span>使用说明:<em>*</em></span>
186
           <div class="flex-item">
175
           <div class="flex-item">
187
             <div>
176
             <div>
188
               <el-input
177
               <el-input
236
         TotalCount: '',
225
         TotalCount: '',
237
         CaseId: '',
226
         CaseId: '',
238
         OrgId: '',
227
         OrgId: '',
239
-        Share: {},
228
+        Share: {
229
+          CardShareInfo: '',
230
+          CardUseRule: '',
231
+          CardUseInstruction: '',
232
+        },
240
         Images: null,
233
         Images: null,
241
         Targets: [{}],
234
         Targets: [{}],
242
         ChannelId: ''
235
         ChannelId: ''
355
     addGoods () { // 添加指定商品
348
     addGoods () { // 添加指定商品
356
       this.centerDialogVisible = true
349
       this.centerDialogVisible = true
357
     },
350
     },
351
+    checkInfo () { // 校验表单信息
352
+      if (this.cardInfo.CaseId === '') {
353
+        this.$message({
354
+          type: 'error',
355
+          message: '案场不能为空'
356
+        })
357
+        return false
358
+      }
359
+      if (this.cardInfo.Images === '') {
360
+        this.$message({
361
+          type: 'error',
362
+          message: '卡图片不能为空'
363
+        })
364
+        return false
365
+      }
366
+      if (this.cardInfo.CardName === '') {
367
+        this.$message({
368
+          type: 'error',
369
+          message: '卡名称不能为空'
370
+        })
371
+        return false
372
+      }
373
+      if (this.cardInfo.Price === '') {
374
+        this.$message({
375
+          type: 'error',
376
+          message: '卡价格不能为空'
377
+        })
378
+        return false
379
+      }
380
+      if (this.cardInfo.TotalCount === '') {
381
+        this.$message({
382
+          type: 'error',
383
+          message: '总张数不能为空'
384
+        })
385
+        return false
386
+      }
387
+      if (this.cardInfo.SendType === '') {
388
+        this.$message({
389
+          type: 'error',
390
+          message: '发送类型不能为空'
391
+        })
392
+        return false
393
+      }
394
+      if (this.cardInfo.SendType === 'channel' && this.cardInfo.ChannelId === '') {
395
+        this.$message({
396
+          type: 'error',
397
+          message: '渠道不能为空'
398
+        })
399
+        return false
400
+      }
401
+      if (this.cardInfo.Targets[0].TargetId === '') {
402
+        this.$message({
403
+          type: 'error',
404
+          message: '目标课程不能为空'
405
+        })
406
+        return false
407
+      }
408
+      if (this.cardInfo.StartDate === '') {
409
+        this.$message({
410
+          type: 'error',
411
+          message: '开始时间不能为空'
412
+        })
413
+        return false
414
+      }
415
+      if (this.cardInfo.EndDate === '') {
416
+        this.$message({
417
+          type: 'error',
418
+          message: '截止时间不能为空'
419
+        })
420
+        return false
421
+      }
422
+      if (this.cardInfo.SendType === 'channel' && this.cardInfo.VideoUrl === '') {
423
+        this.$message({
424
+          type: 'error',
425
+          message: '视频不能为空'
426
+        })
427
+        return false
428
+      }
429
+      if (this.cardInfo.Share.CardShareInfo === '') {
430
+        this.$message({
431
+          type: 'error',
432
+          message: '分享描述不能为空'
433
+        })
434
+        return false
435
+      }
436
+      if (this.cardInfo.Share.CardUseRule === '') {
437
+        this.$message({
438
+          type: 'error',
439
+          message: '使用规则不能为空'
440
+        })
441
+        return false
442
+      }
443
+      if (this.cardInfo.Share.CardUseInstruction === '') {
444
+        this.$message({
445
+          type: 'error',
446
+          message: '使用说明不能为空'
447
+        })
448
+        return false
449
+      }
450
+    },
358
     submit () { // 保存
451
     submit () { // 保存
452
+      if (!this.checkInfo()) {
453
+        return false
454
+      }
359
       if (this.$route.query.id) {
455
       if (this.$route.query.id) {
360
         if (this.date !== '') {
456
         if (this.date !== '') {
361
           this.cardInfo.StartDate = this.date[0]
457
           this.cardInfo.StartDate = this.date[0]
368
           }
464
           }
369
         }
465
         }
370
         this.cardInfo.TotalCount = this.cardInfo.TotalCount - 0
466
         this.cardInfo.TotalCount = this.cardInfo.TotalCount - 0
371
-        console.log(JSON.stringify(this.cardInfo))
372
         this.editCard(this.cardInfo).then((res) => {
467
         this.editCard(this.cardInfo).then((res) => {
373
-          this.$alert('操作成功', '提示', {
374
-            confirmButtonText: '确定',
375
-            callback: action => {
376
-              this.$router.push({ name: 'cardList' })
377
-            }
468
+          this.$message({
469
+            type: 'success',
470
+            message: '操作成功'
378
           })
471
           })
472
+          this.$router.push({ name: 'cardList' })
379
         })
473
         })
380
       } else {
474
       } else {
381
         this.cardInfo.OrgId = this.OrgId
475
         this.cardInfo.OrgId = this.OrgId

+ 111
- 15
src/pages/system/cardAndCouponManager/couponManager/edit.vue View File

4
       <!-- <h1 style="font-size:22px;">{{isEdit === 0 ? '新建' : '编辑'}}{{couponInfo.CouponType === 'goods' ? '饮品优惠券' : '课程优惠券'}}</h1> -->
4
       <!-- <h1 style="font-size:22px;">{{isEdit === 0 ? '新建' : '编辑'}}{{couponInfo.CouponType === 'goods' ? '饮品优惠券' : '课程优惠券'}}</h1> -->
5
       <ul>
5
       <ul>
6
         <li class="flex-h">
6
         <li class="flex-h">
7
-          <span>选择案场:</span>
7
+          <span>选择案场:<em>*</em></span>
8
           <div class="flex-item">
8
           <div class="flex-item">
9
             <div style="width:50%">
9
             <div style="width:50%">
10
               <el-select v-model="couponInfo.CaseId" placeholder="请选择" @change="caseChange">
10
               <el-select v-model="couponInfo.CaseId" placeholder="请选择" @change="caseChange">
19
           </div>
19
           </div>
20
         </li>
20
         </li>
21
         <li class="flex-h">
21
         <li class="flex-h">
22
-          <span>券图片:</span>
22
+          <span>券图片:<em>*</em></span>
23
           <div class="flex-item">
23
           <div class="flex-item">
24
             <div>
24
             <div>
25
               <el-upload
25
               <el-upload
35
           </div>
35
           </div>
36
         </li>
36
         </li>
37
         <li class="flex-h">
37
         <li class="flex-h">
38
-          <span>券名称:</span>
38
+          <span>券名称:<em>*</em></span>
39
           <div class="flex-item">
39
           <div class="flex-item">
40
             <div style="width:200px;">
40
             <div style="width:200px;">
41
               <el-input
41
               <el-input
47
           </div>
47
           </div>
48
         </li>
48
         </li>
49
         <li class="flex-h">
49
         <li class="flex-h">
50
-          <span>券类型:</span>
50
+          <span>券类型:<em>*</em></span>
51
           <div class="flex-item">
51
           <div class="flex-item">
52
             <div style="width:50%">
52
             <div style="width:50%">
53
               <el-select v-model="couponInfo.CouponType" placeholder="请选择" @change="couponTypeChange">
53
               <el-select v-model="couponInfo.CouponType" placeholder="请选择" @change="couponTypeChange">
62
           </div>
62
           </div>
63
         </li>
63
         </li>
64
         <li class="flex-h">
64
         <li class="flex-h">
65
-          <span>券价格:</span>
65
+          <span>券价格:<em>*</em></span>
66
           <div class="flex-item">
66
           <div class="flex-item">
67
             <div style="width:200px;">
67
             <div style="width:200px;">
68
               <el-input
68
               <el-input
74
           </div>
74
           </div>
75
         </li>
75
         </li>
76
         <li class="flex-h">
76
         <li class="flex-h">
77
-          <span>总张数:</span>
77
+          <span>总张数:<em>*</em></span>
78
           <div class="flex-item">
78
           <div class="flex-item">
79
             <div style="width:200px;">
79
             <div style="width:200px;">
80
               <el-input
80
               <el-input
86
           </div>
86
           </div>
87
         </li>
87
         </li>
88
         <li class="flex-h">
88
         <li class="flex-h">
89
-          <span>发送类型:</span>
89
+          <span>发送类型:<em>*</em></span>
90
           <div class="flex-item">
90
           <div class="flex-item">
91
             <div>
91
             <div>
92
               <el-radio v-model="couponInfo.SendType" label="channel">渠道</el-radio>
92
               <el-radio v-model="couponInfo.SendType" label="channel">渠道</el-radio>
96
           </div>
96
           </div>
97
         </li>
97
         </li>
98
         <li class="flex-h" v-if="couponInfo.SendType === 'channel'">
98
         <li class="flex-h" v-if="couponInfo.SendType === 'channel'">
99
-          <span>选择渠道:</span>
99
+          <span>选择渠道:<em>*</em></span>
100
           <div class="flex-item">
100
           <div class="flex-item">
101
             <div style="width:50%">
101
             <div style="width:50%">
102
               <el-select v-model="couponInfo.ChannelId" placeholder="请选择">
102
               <el-select v-model="couponInfo.ChannelId" placeholder="请选择">
111
           </div>
111
           </div>
112
         </li>
112
         </li>
113
         <li class="flex-h">
113
         <li class="flex-h">
114
-          <span>目标商品:</span>
114
+          <span>目标商品:<em>*</em></span>
115
           <div class="flex-item">
115
           <div class="flex-item">
116
             <div>
116
             <div>
117
               <el-radio v-model="couponInfo.IsAll" label="1">全部商品</el-radio>
117
               <el-radio v-model="couponInfo.IsAll" label="1">全部商品</el-radio>
153
           </div>
153
           </div>
154
         </li>
154
         </li>
155
         <li class="flex-h" v-if="couponInfo.CouponType === 'goods'">
155
         <li class="flex-h" v-if="couponInfo.CouponType === 'goods'">
156
-          <span>券有效时间:</span>
156
+          <span>券有效时间:<em>*</em></span>
157
           <div class="flex-item">
157
           <div class="flex-item">
158
             <div>
158
             <div>
159
               <div class="addLine flex-h" style="align-item:center;margin-bottom:20px;">
159
               <div class="addLine flex-h" style="align-item:center;margin-bottom:20px;">
185
           </div>
185
           </div>
186
         </li>
186
         </li>
187
         <li class="flex-h" v-if="couponInfo.CouponType === 'course'">
187
         <li class="flex-h" v-if="couponInfo.CouponType === 'course'">
188
-          <span>券有效时间:</span>
188
+          <span>券有效时间:<em>*</em></span>
189
           <div class="flex-item">
189
           <div class="flex-item">
190
             <div>
190
             <div>
191
               <el-date-picker
191
               <el-date-picker
203
           </div>
203
           </div>
204
         </li>
204
         </li>
205
         <li class="flex-h" v-if="couponInfo.SendType !== 'case' && couponInfo.SendType !== 'system'">
205
         <li class="flex-h" v-if="couponInfo.SendType !== 'case' && couponInfo.SendType !== 'system'">
206
-          <span>视频:</span>
206
+          <span>视频:<em>*</em></span>
207
           <div class="flex-item">
207
           <div class="flex-item">
208
             <div style="vertical-align: middle;">
208
             <div style="vertical-align: middle;">
209
               <a style="line-height: 40px;" v-if="videoOff" :href="couponInfo.VideoUrl" target="blank">{{couponInfo.VideoUrl}}</a>
209
               <a style="line-height: 40px;" v-if="videoOff" :href="couponInfo.VideoUrl" target="blank">{{couponInfo.VideoUrl}}</a>
220
           </div>
220
           </div>
221
         </li>
221
         </li>
222
         <li class="flex-h">
222
         <li class="flex-h">
223
-          <span>分享描述:</span>
223
+          <span>分享描述:<em>*</em></span>
224
           <div class="flex-item">
224
           <div class="flex-item">
225
             <div>
225
             <div>
226
               <el-input
226
               <el-input
233
           </div>
233
           </div>
234
         </li>
234
         </li>
235
         <li class="flex-h">
235
         <li class="flex-h">
236
-          <span>规则描述:</span>
236
+          <span>规则描述:<em>*</em></span>
237
           <div class="flex-item">
237
           <div class="flex-item">
238
             <div>
238
             <div>
239
               <el-input
239
               <el-input
246
           </div>
246
           </div>
247
         </li>
247
         </li>
248
         <li class="flex-h">
248
         <li class="flex-h">
249
-          <span>使用说明:</span>
249
+          <span>使用说明:<em>*</em></span>
250
           <div class="flex-item">
250
           <div class="flex-item">
251
             <div>
251
             <div>
252
               <el-input
252
               <el-input
587
         })
587
         })
588
       }
588
       }
589
     },
589
     },
590
+    checkInfo () { // 校验表单信息
591
+      if (this.couponInfo.CaseId === '') {
592
+        this.$message({
593
+          type: 'error',
594
+          message: '案场不能为空'
595
+        })
596
+        return false
597
+      }
598
+      if (this.couponInfo.Images[0].CouponImageUrl === '') {
599
+        this.$message({
600
+          type: 'error',
601
+          message: '券图片不能为空'
602
+        })
603
+        return false
604
+      }
605
+      if (this.couponInfo.CouponName === '') {
606
+        this.$message({
607
+          type: 'error',
608
+          message: '券名称不能为空'
609
+        })
610
+        return false
611
+      }
612
+      if (this.couponInfo.CouponType === '') {
613
+        this.$message({
614
+          type: 'error',
615
+          message: '券类型不能为空'
616
+        })
617
+        return false
618
+      }
619
+      if (this.couponInfo.Price === '') {
620
+        this.$message({
621
+          type: 'error',
622
+          message: '券价格不能为空'
623
+        })
624
+        return false
625
+      }
626
+      if (this.couponInfo.TotalCount === '') {
627
+        this.$message({
628
+          type: 'error',
629
+          message: '总张数不能为空'
630
+        })
631
+        return false
632
+      }
633
+      if (this.couponInfo.SendType === '') {
634
+        this.$message({
635
+          type: 'error',
636
+          message: '发送类型不能为空'
637
+        })
638
+        return false
639
+      }
640
+      if (this.couponInfo.SendType === 'channel' && this.couponInfo.ChannelId === '') {
641
+        this.$message({
642
+          type: 'error',
643
+          message: '渠道不能为空'
644
+        })
645
+        return false
646
+      }
647
+      if (this.couponInfo.IsAll === 0 && this.couponInfo.Targets[0].TargetId === '') {
648
+        this.$message({
649
+          type: 'error',
650
+          message: '目标商品不能为空'
651
+        })
652
+        return false
653
+      }
654
+      if (this.couponInfo.SendType === 'channel' && this.couponInfo.VideoUrl === '') {
655
+        this.$message({
656
+          type: 'error',
657
+          message: '视频不能为空'
658
+        })
659
+        return false
660
+      }
661
+      if (this.couponInfo.Share.CouponShareInfo === '') {
662
+        this.$message({
663
+          type: 'error',
664
+          message: '分享描述不能为空'
665
+        })
666
+        return false
667
+      }
668
+      if (this.couponInfo.Share.UseRule === '') {
669
+        this.$message({
670
+          type: 'error',
671
+          message: '使用规则不能为空'
672
+        })
673
+        return false
674
+      }
675
+      if (this.couponInfo.Share.UseInstruction === '') {
676
+        this.$message({
677
+          type: 'error',
678
+          message: '使用说明不能为空'
679
+        })
680
+        return false
681
+      }
682
+    },
590
     submit () { // 保存
683
     submit () { // 保存
684
+      if (!this.checkInfo()) {
685
+        return false
686
+      }
591
       if (this.$route.query.id) {
687
       if (this.$route.query.id) {
592
         if (this.couponInfo.ValidDays) {
688
         if (this.couponInfo.ValidDays) {
593
           this.couponInfo.StartDate = undefined
689
           this.couponInfo.StartDate = undefined

+ 1
- 1
src/pages/system/caseManager/keyManager/add.vue View File

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,

+ 1
- 1
src/pages/system/verificationManager/drawVerification/verificationList/index.vue View File

65
               </el-table-column>
65
               </el-table-column>
66
             </el-table>
66
             </el-table>
67
         </div>
67
         </div>
68
-        <span class="noData" v-if="!info.length && ajaxOff">今日暂无可核销的课程</span>
68
+        <span class="noData" v-if="!info.length && ajaxOff">查不到当前信息,请核对二维码或详情</span>
69
       </div>
69
       </div>
70
     </div>
70
     </div>
71
   </div>
71
   </div>

+ 169
- 28
src/pages/system/verificationManager/phoneVerification/verificationList/index.vue View File

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>
71
             :total="courses.pagenum">
75
             :total="courses.pagenum">
72
           </el-pagination>
76
           </el-pagination>
73
         </div>
77
         </div>
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;

+ 1
- 1
src/pages/system/verificationManager/qrcodeVerification/verificationList/index.vue View File

56
               </el-table-column>
56
               </el-table-column>
57
             </el-table>
57
             </el-table>
58
         </div>
58
         </div>
59
-        <span class="noData" v-else>今日暂无可核销的课程</span>
59
+        <span class="noData" v-else>查不到当前信息,请核对二维码或详情</span>
60
       </div>
60
       </div>
61
     </div>
61
     </div>
62
   </div>
62
   </div>

+ 20
- 0
src/store/case/device.js View File

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 View File

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`