许成详 6 years ago
parent
commit
98f852edee

+ 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://192.168.0.62: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
578
         })
578
         })
579
       }
579
       }
580
     },
580
     },
581
+    checkInfo () { // 校验表单信息
582
+      if (this.couponInfo.CaseId === '') {
583
+        this.$message({
584
+          type: 'error',
585
+          message: '案场不能为空'
586
+        })
587
+        return false
588
+      }
589
+      if (this.couponInfo.Images[0].CouponImageUrl === '') {
590
+        this.$message({
591
+          type: 'error',
592
+          message: '券图片不能为空'
593
+        })
594
+        return false
595
+      }
596
+      if (this.couponInfo.CouponName === '') {
597
+        this.$message({
598
+          type: 'error',
599
+          message: '券名称不能为空'
600
+        })
601
+        return false
602
+      }
603
+      if (this.couponInfo.CouponType === '') {
604
+        this.$message({
605
+          type: 'error',
606
+          message: '券类型不能为空'
607
+        })
608
+        return false
609
+      }
610
+      if (this.couponInfo.Price === '') {
611
+        this.$message({
612
+          type: 'error',
613
+          message: '券价格不能为空'
614
+        })
615
+        return false
616
+      }
617
+      if (this.couponInfo.TotalCount === '') {
618
+        this.$message({
619
+          type: 'error',
620
+          message: '总张数不能为空'
621
+        })
622
+        return false
623
+      }
624
+      if (this.couponInfo.SendType === '') {
625
+        this.$message({
626
+          type: 'error',
627
+          message: '发送类型不能为空'
628
+        })
629
+        return false
630
+      }
631
+      if (this.couponInfo.SendType === 'channel' && this.couponInfo.ChannelId === '') {
632
+        this.$message({
633
+          type: 'error',
634
+          message: '渠道不能为空'
635
+        })
636
+        return false
637
+      }
638
+      if (this.couponInfo.IsAll === 0 && this.couponInfo.Targets[0].TargetId === '') {
639
+        this.$message({
640
+          type: 'error',
641
+          message: '目标商品不能为空'
642
+        })
643
+        return false
644
+      }
645
+      if (this.couponInfo.SendType === 'channel' && this.couponInfo.VideoUrl === '') {
646
+        this.$message({
647
+          type: 'error',
648
+          message: '视频不能为空'
649
+        })
650
+        return false
651
+      }
652
+      if (this.couponInfo.Share.CouponShareInfo === '') {
653
+        this.$message({
654
+          type: 'error',
655
+          message: '分享描述不能为空'
656
+        })
657
+        return false
658
+      }
659
+      if (this.couponInfo.Share.UseRule === '') {
660
+        this.$message({
661
+          type: 'error',
662
+          message: '使用规则不能为空'
663
+        })
664
+        return false
665
+      }
666
+      if (this.couponInfo.Share.UseInstruction === '') {
667
+        this.$message({
668
+          type: 'error',
669
+          message: '使用说明不能为空'
670
+        })
671
+        return false
672
+      }
673
+    },
581
     submit () { // 保存
674
     submit () { // 保存
675
+      if (!this.checkInfo()) {
676
+        return false
677
+      }
582
       if (this.$route.query.id) {
678
       if (this.$route.query.id) {
583
         if (this.couponInfo.ValidDays) {
679
         if (this.couponInfo.ValidDays) {
584
           this.couponInfo.StartDate = undefined
680
           this.couponInfo.StartDate = undefined