许成详 6 vuotta sitten
vanhempi
commit
57f6702eed

+ 1
- 1
dist/index.html Näytä tiedosto

@@ -1 +1 @@
1
-<!DOCTYPE html><html><head><meta charset=utf-8><meta name=viewport content="width=device-width,initial-scale=1"><link rel=stylesheet href=//at.alicdn.com/t/font_775069_dwqa9wy3lkh.css><link rel="shortcut icon" href=favorite.ico><title>城的空间后台管理系统</title><link href=./static/css/app.83d0c0e7bdb025819eec501edcf8f187.css rel=stylesheet></head><body><div id=app></div><script type=text/javascript src=./static/js/manifest.3ad1d5771e9b13dbdad2.js></script><script type=text/javascript src=./static/js/vendor.3c9a16350e1e47228e4f.js></script><script type=text/javascript src=./static/js/app.33d0b8b0542e24dfdb3d.js></script></body></html>
1
+<!DOCTYPE html><html><head><meta charset=utf-8><meta name=viewport content="width=device-width,initial-scale=1"><link rel=stylesheet href=//at.alicdn.com/t/font_775069_dwqa9wy3lkh.css><link rel="shortcut icon" href=favorite.ico><title>城的空间后台管理系统</title><link href=./static/css/app.35b4ceb8c9fe8cd21897d028cc0c21e2.css rel=stylesheet></head><body><div id=app></div><script type=text/javascript src=./static/js/manifest.3ad1d5771e9b13dbdad2.js></script><script type=text/javascript src=./static/js/vendor.3c9a16350e1e47228e4f.js></script><script type=text/javascript src=./static/js/app.2b5745f7ebb70dc3b669.js></script></body></html>

+ 127
- 65
src/pages/system/marketingActivities/listOfLotteryActivities/edit.vue Näytä tiedosto

@@ -17,7 +17,7 @@
17 17
                 <span>案场:<em>*</em></span>
18 18
                 <div class="flex-item">
19 19
                   <div style="width:50%">
20
-                    <el-select :disabled="!editAll" v-model="CaseId" placeholder="请选择案场">
20
+                    <el-select :disabled="!editAll || isread" v-model="CaseId" placeholder="请选择案场">
21 21
                       <el-option
22 22
                         v-for="item in cases"
23 23
                         :key="item.CaseId"
@@ -33,6 +33,7 @@
33 33
                 <div class="flex-item">
34 34
                   <div style="width:50%">
35 35
                     <el-input
36
+                      :disabled="isread"
36 37
                       placeholder="请输入活动标题"
37 38
                       v-model="postData.Name"
38 39
                       clearable>
@@ -45,7 +46,7 @@
45 46
                 <div class="flex-item">
46 47
                   <div>
47 48
                     <el-date-picker
48
-                      :disabled="!editAll"
49
+                      :disabled="!editAll || isread"
49 50
                       value-format="yyyy-MM-ddT00:00:00+08:00"
50 51
                       v-model="postData.BeginDate"
51 52
                       type="date"
@@ -53,7 +54,7 @@
53 54
                     </el-date-picker>
54 55
                     <span>至</span>
55 56
                     <el-date-picker
56
-                      :disabled="!editAll"
57
+                      :disabled="!editAll || isread"
57 58
                       value-format="yyyy-MM-ddT00:00:00+08:00"
58 59
                       v-model="postData.EndDate"
59 60
                       type="date"
@@ -94,7 +95,9 @@
94 95
                 <span>活动规则说明:<em>*</em></span>
95 96
                 <div class="flex-item">
96 97
                   <div>
97
-                    <quill-editor v-model="postData.LuckdrawRule"
98
+                    <quill-editor
99
+                      :disabled="isread"
100
+                      v-model="postData.LuckdrawRule"
98 101
                       ref="myQuillEditor"
99 102
                       :options="editorOption">
100 103
                     </quill-editor>
@@ -136,11 +139,12 @@
136 139
                 width="200">
137 140
                 <template slot-scope="scope">
138 141
                   <el-button
142
+                    :disabled="isread"
139 143
                     size="mini"
140 144
                     type="success"
141 145
                     @click="editPrizeItem(scope.row, scope.$index)">编辑</el-button>
142 146
                   <el-button
143
-                    :disabled="!editAll"
147
+                    :disabled="!editAll || isread"
144 148
                     size="mini"
145 149
                     type="warning"
146 150
                     @click="deletePrizeItem(scope.$index)">删除</el-button>
@@ -149,7 +153,7 @@
149 153
             </el-table>
150 154
             <div style="text-align:center;margin-top:20px;">
151 155
               <el-button
152
-                :disabled="!editAll"
156
+                :disabled="!editAll || isread"
153 157
                 size="mini"
154 158
                 type="primary"
155 159
                 @click="addPrize">新增奖品</el-button>
@@ -161,7 +165,7 @@
161 165
                 <span>参与类型:</span>
162 166
                 <div class="flex-item flex-h">
163 167
                   <el-switch
164
-                    :disabled="!editAll"
168
+                    :disabled="!editAll || isread"
165 169
                     v-model="postData.JoinType"
166 170
                     active-value="newuser"
167 171
                     inactive-value="no"
@@ -173,7 +177,7 @@
173 177
                 <span>抽奖次数:</span>
174 178
                 <div class="flex-item flex-h">
175 179
                   <el-switch
176
-                    :disabled="!editAll"
180
+                    :disabled="!editAll || isread"
177 181
                     v-model="postData.NumType"
178 182
                     active-value="repeat"
179 183
                     inactive-value="noRepeat"
@@ -183,7 +187,7 @@
183 187
                     <span>每个账号</span>
184 188
                     <div style="width:100px;">
185 189
                       <el-input
186
-                        :disabled="!editAll"
190
+                        :disabled="!editAll || isread"
187 191
                         placeholder=""
188 192
                         v-model="postData.LuckdrawNum"
189 193
                         clearable>
@@ -194,7 +198,7 @@
194 198
                   <div :hidden="postData.NumType !== 'repeat'">
195 199
                     <span>每</span>
196 200
                     <div style="width:100px;">
197
-                      <el-select :disabled="!editAll" v-model="postData.NumInterval" placeholder="请选择">
201
+                      <el-select :disabled="!editAll || isread" v-model="postData.NumInterval" placeholder="请选择">
198 202
                         <el-option
199 203
                           v-for="item in lotteryTimeUnitOptions"
200 204
                           :key="item.id"
@@ -205,7 +209,7 @@
205 209
                     </div>
206 210
                     <div style="width:100px;">
207 211
                       <el-input
208
-                        :disabled="!editAll"
212
+                        :disabled="!editAll || isread"
209 213
                         placeholder=""
210 214
                         v-model="postData.LuckdrawNum"
211 215
                         clearable>
@@ -219,7 +223,7 @@
219 223
                 <span>分享设置:</span>
220 224
                 <div class="flex-item flex-h">
221 225
                   <el-switch
222
-                    :disabled="!editAll"
226
+                    :disabled="!editAll || isread"
223 227
                     v-model="postData.ShareType"
224 228
                     active-value="newuser"
225 229
                     inactive-value="no"
@@ -229,7 +233,7 @@
229 233
                     <span>新增</span>
230 234
                     <div style="width:100px;">
231 235
                       <el-input
232
-                        :disabled="!editAll"
236
+                        :disabled="!editAll || isread"
233 237
                         placeholder=""
234 238
                         v-model="postData.ShareAddNum"
235 239
                         clearable>
@@ -243,7 +247,7 @@
243 247
                 <span>系统用户抽奖:</span>
244 248
                 <div class="flex-item flex-h">
245 249
                   <el-switch
246
-                    :disabled="!editAll"
250
+                    :disabled="!editAll || isread"
247 251
                     v-model="postData.IsSysLuckdraw"
248 252
                     :active-value="1"
249 253
                     :inactive-value="0"
@@ -255,7 +259,7 @@
255 259
                 <span>奖品内定设置:</span>
256 260
                 <div class="flex-item flex-h">
257 261
                   <el-switch
258
-                    :disabled="!editAll"
262
+                    :disabled="!editAll || isread"
259 263
                     v-model="postData.IsInternalDefault"
260 264
                     :active-value="1"
261 265
                     :inactive-value="0"
@@ -286,7 +290,7 @@
286 290
                 width="200">
287 291
                 <template slot-scope="scope">
288 292
                   <el-button
289
-                    :disabled="!editAll"
293
+                    :disabled="!editAll || isread"
290 294
                     size="mini"
291 295
                     type="success"
292 296
                     @click="addPrizeItemPhone(scope.$index)">编辑</el-button>
@@ -298,6 +302,7 @@
298 302
       </div>
299 303
       <div style="text-align:center">
300 304
         <el-button
305
+          :disabled="isread"
301 306
           size="mini"
302 307
           type="success"
303 308
           @click="submitLuckdrawData">保存</el-button>
@@ -318,7 +323,7 @@
318 323
           <li class="flex-h" style="width:50%;float:left;">
319 324
             <span>奖品类型:<em>*</em></span>
320 325
             <div class="flex-item">
321
-              <el-select :disabled="!editAll" v-model="addPrizeInfo.PrizeType" @change="prizeTypeChange" placeholder="请选择">
326
+              <el-select :disabled="!editAll || isread" v-model="addPrizeInfo.PrizeType" @change="prizeTypeChange" placeholder="请选择">
322 327
                 <el-option
323 328
                   v-for="item in prizeOptions"
324 329
                   :key="item.id"
@@ -329,11 +334,24 @@
329 334
             </div>
330 335
           </li>
331 336
           <li class="flex-h" style="width:50%;float:left;" v-if="addPrizeInfo.PrizeType === 'third'">
337
+            <span>是否实物:<em>*</em></span>
338
+            <div class="flex-item">
339
+              <el-switch
340
+                :disabled="isread"
341
+                v-model="addPrizeInfo.IsReality"
342
+                :active-value="1"
343
+                :inactive-value="0"
344
+                @change="checkIsReality"
345
+                :active-text="addPrizeInfo.IsReality ? '是' : '否'">
346
+              </el-switch>
347
+            </div>
348
+          </li>
349
+          <li class="flex-h" style="width:50%;float:left;" v-if="addPrizeInfo.PrizeType === 'third' && addPrizeInfo.IsReality === 1">
332 350
             <span>奖品名称:<em>*</em></span>
333 351
             <div class="flex-item">
334 352
               <div style="width: 200px;">
335 353
                 <el-input
336
-                  :disabled="!editAll"
354
+                  :disabled="!editAll || isread"
337 355
                   placeholder=""
338 356
                   v-model="addPrizeInfo.PrizeName"
339 357
                   clearable>
@@ -344,7 +362,7 @@
344 362
           <li class="flex-h" style="width:50%;float:left;" v-if="addPrizeInfo.PrizeType === 'couponcard'">
345 363
             <span>卡券类型:<em>*</em></span>
346 364
             <div class="flex-item">
347
-              <el-select :disabled="!editAll" v-model="addPrizeInfo.CouponCardType" @change="cardCouponChange" placeholder="请选择">
365
+              <el-select :disabled="!editAll || isread" v-model="addPrizeInfo.CouponCardType" @change="cardCouponChange" placeholder="请选择">
348 366
                 <el-option
349 367
                   v-for="item in cardOrCouponOptions"
350 368
                   :key="item.id"
@@ -357,7 +375,7 @@
357 375
           <li class="flex-h" v-if="addPrizeInfo.PrizeType === 'couponcard'">
358 376
             <span>选择卡券:<em>*</em></span>
359 377
             <div class="flex-item">
360
-              <el-select :disabled="!editAll" v-if="addPrizeInfo.CouponCardType === 'card'" v-model="addPrizeInfo.CouponCardId" placeholder="请选择">
378
+              <el-select :disabled="!editAll || isread" v-if="addPrizeInfo.CouponCardType === 'card'" @change="cardChange" v-model="addPrizeInfo.CouponCardId" placeholder="请选择">
361 379
                 <el-option
362 380
                   v-for="item in cardList"
363 381
                   :key="item.CardId"
@@ -365,7 +383,7 @@
365 383
                   :value="item.CardId">
366 384
                 </el-option>
367 385
               </el-select>
368
-              <el-select :disabled="!editAll" v-if="addPrizeInfo.CouponCardType === 'coupon'" v-model="addPrizeInfo.CouponCardId" placeholder="请选择">
386
+              <el-select :disabled="!editAll || isread" v-if="addPrizeInfo.CouponCardType === 'coupon'" @change="couponChange" v-model="addPrizeInfo.CouponCardId" placeholder="请选择">
369 387
                 <el-option
370 388
                   v-for="item in couponList"
371 389
                   :key="item.CouponId"
@@ -375,27 +393,12 @@
375 393
               </el-select>
376 394
             </div>
377 395
           </li>
378
-          <li class="flex-h">
379
-            <span>奖品图片:<em>*</em></span>
380
-            <div class="flex-item">
381
-              <el-upload
382
-                :disabled="!editAll"
383
-                class="avatar-uploader"
384
-                action='string'
385
-                :http-request="toolClass.upload"
386
-                :show-file-list="false"
387
-                :on-success="handleAvatarSuccess">
388
-                <img v-if="addPrizeInfo.PrizeImg" :src="addPrizeInfo.PrizeImg" class="avatar">
389
-                <i v-else class="el-icon-plus avatar-uploader-icon"></i>
390
-              </el-upload>
391
-            </div>
392
-          </li>
393 396
           <li class="flex-h" style="width:50%;float:left;">
394 397
             <span>中奖概率:<em>*</em></span>
395 398
             <div class="flex-item">
396 399
               <div style="width: 200px;display:inline-block;">
397 400
                 <el-input
398
-                  :disabled="!editAll"
401
+                  :disabled="!editAll || isread"
399 402
                   placeholder=""
400 403
                   v-model="addPrizeInfo.Probability"
401 404
                   clearable>
@@ -404,12 +407,12 @@
404 407
               <span style="line-height:40px;">%</span>
405 408
             </div>
406 409
           </li>
407
-          <li class="flex-h" style="width:50%;float:left;">
410
+          <li class="flex-h" style="width:50%;float:left;" v-if="!(addPrizeInfo.PrizeType === 'third' && addPrizeInfo.IsReality !== 1)">
408 411
             <span>奖品数量:<em>*</em></span>
409 412
             <div class="flex-item">
410 413
               <div style="width: 200px;">
411 414
                 <el-input
412
-                  :disabled="!editAll"
415
+                  :disabled="!editAll || isread || addPrizeInfo.PrizeType === 'couponcard'"
413 416
                   placeholder=""
414 417
                   v-model="addPrizeInfo.Stock"
415 418
                   clearable>
@@ -417,15 +420,15 @@
417 420
               </div>
418 421
             </div>
419 422
           </li>
420
-          <li class="flex-h" v-if="addPrizeInfo.PrizeType === 'third'">
423
+          <li class="flex-h" v-if="addPrizeInfo.PrizeType === 'third' && addPrizeInfo.IsReality === 1">
421 424
             <span>核销时间:<em>*</em></span>
422 425
             <div class="flex-item">
423 426
               <div class="flex-h" style="width: 100%;align-item: center;">
424
-                <el-radio :disabled="!editAll" v-model="verificationType" :label="1" style="margin-right: 5px;"><em style="color: transparent;display:none;">1</em></el-radio>
427
+                <el-radio :disabled="!editAll || isread" v-model="verificationType" :label="1" style="margin-right: 5px;"><em style="color: transparent;display:none;">1</em></el-radio>
425 428
                 <span>领取后</span>
426 429
                 <div style="width: 100px;display: inline-block;">
427 430
                   <el-input
428
-                    :disabled="!editAll"
431
+                    :disabled="!editAll || isread"
429 432
                     placeholder=""
430 433
                     v-model="addPrizeInfo.ValidDays"
431 434
                     clearable>
@@ -434,11 +437,11 @@
434 437
                 <span>天内有效</span>
435 438
               </div>
436 439
               <div class="flex-h" style="width: 100%;align-item: center;margin-top: 10px;">
437
-                <el-radio :disabled="!editAll" v-model="verificationType" :label="2" style="margin-right: 5px;"><em style="color: transparent;display:none;">2</em></el-radio>
440
+                <el-radio :disabled="!editAll || isread" v-model="verificationType" :label="2" style="margin-right: 5px;"><em style="color: transparent;display:none;">2</em></el-radio>
438 441
                 <span>有效期</span>
439 442
                 <div style="display: inline-block;">
440 443
                   <el-date-picker
441
-                    :disabled="!editAll"
444
+                    :disabled="!editAll || isread"
442 445
                     value-format="yyyy-MM-ddT00:00:00+08:00"
443 446
                     v-model="addPrizeInfo.VerificationStart"
444 447
                     type="date"
@@ -448,7 +451,7 @@
448 451
                 <span>至</span>
449 452
                 <div style="display: inline-block;">
450 453
                   <el-date-picker
451
-                    :disabled="!editAll"
454
+                    :disabled="!editAll || isread"
452 455
                     value-format="yyyy-MM-ddT00:00:00+08:00"
453 456
                     v-model="addPrizeInfo.VerificationEnd"
454 457
                     type="date"
@@ -458,11 +461,28 @@
458 461
               </div>
459 462
             </div>
460 463
           </li>
464
+          <li class="flex-h" style="width:50%;float:left;">
465
+            <span>奖品图片:<em>*</em></span>
466
+            <div class="flex-item">
467
+              <el-upload
468
+                :disabled="!editAll || isread"
469
+                class="avatar-uploader"
470
+                action='string'
471
+                :http-request="toolClass.upload"
472
+                :show-file-list="false"
473
+                :on-success="handleAvatarSuccess">
474
+                <img v-if="addPrizeInfo.PrizeImg" :src="addPrizeInfo.PrizeImg" class="avatar">
475
+                <i v-else class="el-icon-plus avatar-uploader-icon"></i>
476
+              </el-upload>
477
+            </div>
478
+          </li>
461 479
           <li class="flex-h" v-if="addPrizeInfo.PrizeType === 'third'">
462 480
             <span>兑换说明:</span>
463 481
             <div class="flex-item">
464 482
               <div>
465
-                <quill-editor v-model="addPrizeInfo.PrizeDesc"
483
+                <quill-editor
484
+                  :disabled="isread"
485
+                  v-model="addPrizeInfo.PrizeDesc"
466 486
                   ref="myQuillEditor"
467 487
                   :options="editorOption">
468 488
                 </quill-editor>
@@ -473,8 +493,10 @@
473 493
       </form>
474 494
       <div style="text-align:center;margin:20px 0 0;padding-bottom:20px;">
475 495
         <el-button
496
+          :disabled="isread"
476 497
           size="mini"
477
-          type="primary" @click="savePrizeItem">保存</el-button>
498
+          type="primary"
499
+          @click="savePrizeItem">保存</el-button>
478 500
         <el-button
479 501
           size="mini"
480 502
           type="danger"
@@ -490,12 +512,14 @@
490 512
       <div style="text-align:center;font-size:0;">
491 513
         <div style="width:300px;display:inline-block;margin-right:20px;">
492 514
           <el-input
515
+            :disabled="isread"
493 516
             placeholder="请输入正确手机号"
494 517
             v-model="addPhoneNum"
495 518
             clearable>
496 519
           </el-input>
497 520
         </div>
498 521
         <el-button
522
+          :disabled="isread"
499 523
           type="primary"
500 524
           @click="addPhoneInPrize">确定</el-button>
501 525
       </div>
@@ -512,6 +536,7 @@
512 536
             label="操作">
513 537
             <template slot-scope="scope">
514 538
               <el-button
539
+                :disabled="isread"
515 540
                 size="mini"
516 541
                 type="warning"
517 542
                 @click="deletePrizeItemPhone(scope.$index)">删除</el-button>
@@ -534,6 +559,7 @@ const { mapActions: mapCouponActions } = createNamespacedHelpers('coupon')
534 559
 export default {
535 560
   data () {
536 561
     return {
562
+      isread: false, // 是否预览模式
537 563
       editAll: true, // 是否全部能编辑
538 564
       editPrizePhoneIndex: '', // 编辑奖品内定手机号索引值
539 565
       addPhoneTableData: [], // 添加手机号数据
@@ -566,6 +592,7 @@ export default {
566 592
         VerificationEnd: '', // 有效期截止时间
567 593
         PrizeDesc: '', // 兑换说明
568 594
         Probability: '', // 中奖概率
595
+        IsReality: 1, // 是否实物
569 596
       },
570 597
       verificationType: 1, // 核销类型
571 598
       centerDialogVisible: false,
@@ -587,7 +614,7 @@ export default {
587 614
         BeginDate: '', // 开始日期
588 615
         EndDate: '', // 截止日期
589 616
         LuckdrawRule: '', // 编辑内容
590
-        JoinType: 'newuser', // 参与类型
617
+        JoinType: 'no', // 参与类型
591 618
         NumType: 'repeat', // 抽奖次数类型
592 619
         NumInterval: 'day', // 抽奖周期单位
593 620
         LuckdrawNum: '', // 抽奖次数
@@ -626,6 +653,9 @@ export default {
626 653
     quillEditor,
627 654
   },
628 655
   created () {
656
+    if (this.$route.query.isread) {
657
+      this.isread = true
658
+    }
629 659
     this.GetCardList({ // 获取卡列表
630 660
       page: 1,
631 661
       pagesize: 100000,
@@ -689,6 +719,31 @@ export default {
689 719
     ...mapCouponActions([
690 720
       'GetCouponList',
691 721
     ]),
722
+    cardChange () {
723
+      for (var n = 0; n < this.cardList.length; n++) {
724
+        if (this.cardList[n].CardId === this.addPrizeInfo.CouponCardId) {
725
+          this.addPrizeInfo.Stock = this.cardList[n].TotalCount - this.cardList[n].UsedCount
726
+          break
727
+        }
728
+      }
729
+    },
730
+    couponChange () {
731
+      for (var n = 0; n < this.couponList.length; n++) {
732
+        if (this.couponList[n].CouponId === this.addPrizeInfo.CouponCardId) {
733
+          this.addPrizeInfo.Stock = this.couponList[n].TotalCount - this.couponList[n].UsedCount
734
+          break
735
+        }
736
+      }
737
+    },
738
+    checkIsReality () {
739
+      if (!this.addPrizeInfo.IsReality) {
740
+        for (var n in this.addPrizeInfo) {
741
+          if (n !== 'PrizeType' && n !== 'PrizeImg' && n !== 'PrizeDesc' && n !== 'IsReality' && n !== 'Probability') {
742
+            this.addPrizeInfo[n] = ''
743
+          }
744
+        }
745
+      }
746
+    },
692 747
     checkData () { // 校验活动信息
693 748
       if (this.postData.CaseId === '') {
694 749
         this.$message({
@@ -868,10 +923,11 @@ export default {
868 923
     },
869 924
     prizeTypeChange () { // 新增奖品类型切换
870 925
       for (var n in this.addPrizeInfo) {
871
-        if (n !== 'PrizeType') {
926
+        if (n !== 'PrizeType' && n !== 'IsReality') {
872 927
           this.addPrizeInfo[n] = ''
873 928
         }
874 929
       }
930
+      this.addPrizeInfo.IsReality = 1
875 931
     },
876 932
     savePrizeItem () { // 保存新增奖品信息
877 933
       if (this.addPrizeInfo.PrizeType === 'couponcard') { // 卡券
@@ -924,20 +980,13 @@ export default {
924 980
           }
925 981
         }
926 982
       } else if (this.addPrizeInfo.PrizeType === 'third') { // 第三方
927
-        if (this.addPrizeInfo.PrizeName === '') {
983
+        if (this.addPrizeInfo.PrizeName === '' && this.addPrizeInfo.IsReality) {
928 984
           this.$message({
929 985
             type: 'error',
930 986
             message: '奖品名称不能为空'
931 987
           })
932 988
           return false
933 989
         }
934
-        if (this.addPrizeInfo.PrizeImg === '') {
935
-          this.$message({
936
-            type: 'error',
937
-            message: '奖品图片不能为空'
938
-          })
939
-          return false
940
-        }
941 990
         if (this.addPrizeInfo.Probability === '' || (this.addPrizeInfo.Probability - 0) <= 0 || (this.addPrizeInfo.Probability - 0) > 100) {
942 991
           this.$message({
943 992
             type: 'error',
@@ -945,14 +994,14 @@ export default {
945 994
           })
946 995
           return false
947 996
         }
948
-        if (this.addPrizeInfo.Stock === '' || (this.addPrizeInfo.Stock - 0) % 1 !== 0 || (this.addPrizeInfo.Stock - 0) <= 0) {
997
+        if ((this.addPrizeInfo.Stock === '' || (this.addPrizeInfo.Stock - 0) % 1 !== 0 || (this.addPrizeInfo.Stock - 0) <= 0) && this.addPrizeInfo.IsReality) {
949 998
           this.$message({
950 999
             type: 'error',
951 1000
             message: '奖品数量须为大于0正整数'
952 1001
           })
953 1002
           return false
954 1003
         }
955
-        if (this.verificationType === 1) {
1004
+        if (this.verificationType === 1 && this.addPrizeInfo.IsReality) {
956 1005
           if (this.addPrizeInfo.ValidDays === '' || (this.addPrizeInfo.ValidDays - 0) % 1 !== 0 || (this.addPrizeInfo.ValidDays - 0) <= 0) {
957 1006
             this.$message({
958 1007
               type: 'error',
@@ -962,7 +1011,7 @@ export default {
962 1011
           }
963 1012
           this.addPrizeInfo.VerificationStart = ''
964 1013
           this.addPrizeInfo.VerificationEnd = ''
965
-        } else {
1014
+        } else if (this.addPrizeInfo.IsReality) {
966 1015
           if (this.addPrizeInfo.VerificationStart === '') {
967 1016
             this.$message({
968 1017
               type: 'error',
@@ -979,6 +1028,13 @@ export default {
979 1028
           }
980 1029
           this.addPrizeInfo.ValidDays = ''
981 1030
         }
1031
+        if (this.addPrizeInfo.PrizeImg === '') {
1032
+          this.$message({
1033
+            type: 'error',
1034
+            message: '奖品图片不能为空'
1035
+          })
1036
+          return false
1037
+        }
982 1038
       }
983 1039
       this.addPrizeInfo.Stock = this.addPrizeInfo.Stock - 0
984 1040
       this.addPrizeInfo.Probability = this.addPrizeInfo.Probability - 0
@@ -1007,11 +1063,15 @@ export default {
1007 1063
       this.addPrizeInfo.CouponCardId = ''
1008 1064
     },
1009 1065
     cutTemplate (index) { // 切换模板
1010
-      this.templateActiveIndex = index
1011
-      this.postData.TplId = this.templateList[index].TplId
1066
+      if (!this.isread) {
1067
+        this.templateActiveIndex = index
1068
+        this.postData.TplId = this.templateList[index].TplId
1069
+      }
1012 1070
     },
1013 1071
     dbTemplateClick (index) { // 更换背景图
1014
-      this.$refs['templateImg' + index][0].click()
1072
+      if (!this.isread) {
1073
+        this.$refs['templateImg' + index][0].click()
1074
+      }
1015 1075
     },
1016 1076
     templateImgChange (item, e) { // 图片更换
1017 1077
       if (e.target.files[0]) {
@@ -1026,8 +1086,10 @@ export default {
1026 1086
       }
1027 1087
     },
1028 1088
     resetCurrentImg (item, index) { // 重置背景图
1029
-      item.currentImg = ''
1030
-      if (this.templateActiveIndex === index) this.postData.Imgs = []
1089
+      if (!this.isread) {
1090
+        item.currentImg = ''
1091
+        if (this.templateActiveIndex === index) this.postData.Imgs = []
1092
+      }
1031 1093
     },
1032 1094
     addPrize () { // 新增奖品
1033 1095
       this.centerDialogVisible = true

+ 3
- 0
src/pages/system/marketingActivities/listOfLotteryActivities/index.vue Näytä tiedosto

@@ -61,6 +61,9 @@
61 61
           <el-table-column
62 62
             prop="Name"
63 63
             label="活动名称">
64
+            <template slot-scope="scope">
65
+              <router-link style="color:#333;" :to="{name: 'editLotteryActivities', query: {id: scope.row.Id, isread: 1}}">{{scope.row.Name}}</router-link>
66
+            </template>
64 67
           </el-table-column>
65 68
           <el-table-column
66 69
             prop="BeginDate"

+ 22
- 13
src/pages/system/marketingActivities/snapUpList/edit.vue Näytä tiedosto

@@ -12,7 +12,7 @@
12 12
                 <span>案场:<em>*</em></span>
13 13
                 <div class="flex-item">
14 14
                   <div style="width:50%">
15
-                    <el-select :disabled="editOff" v-model="CaseId" placeholder="请选择案场">
15
+                    <el-select :disabled="editOff || isread" v-model="CaseId" placeholder="请选择案场">
16 16
                       <el-option
17 17
                         v-for="item in cases"
18 18
                         :key="item.CaseId"
@@ -28,6 +28,7 @@
28 28
                 <div class="flex-item">
29 29
                   <div style="width:50%">
30 30
                     <el-input
31
+                      :disabled="isread"
31 32
                       placeholder="请输入活动名称"
32 33
                       v-model="postData.FlashBuyName"
33 34
                       clearable>
@@ -40,7 +41,7 @@
40 41
                 <div class="flex-item">
41 42
                   <div style="width:50%">
42 43
                     <el-input
43
-                      :disabled="editOff"
44
+                      :disabled="editOff || isread"
44 45
                       placeholder="请输入活动名额"
45 46
                       v-model="postData.FlashBuyMaxAttendant"
46 47
                       clearable>
@@ -65,7 +66,7 @@
65 66
                 <div class="flex-item">
66 67
                   <div>
67 68
                     <el-date-picker
68
-                      :disabled="editOff"
69
+                      :disabled="editOff || isread"
69 70
                       value-format="yyyy-MM-ddT00:00:00+08:00"
70 71
                       v-model="postData.StartDate"
71 72
                       type="date"
@@ -73,7 +74,7 @@
73 74
                     </el-date-picker>
74 75
                     <span>至</span>
75 76
                     <el-date-picker
76
-                      :disabled="editOff"
77
+                      :disabled="editOff || isread"
77 78
                       value-format="yyyy-MM-ddT00:00:00+08:00"
78 79
                       v-model="postData.EndDate"
79 80
                       type="date"
@@ -86,7 +87,9 @@
86 87
                 <span>活动说明:</span>
87 88
                 <div class="flex-item">
88 89
                   <div>
89
-                    <quill-editor v-model="postData.FlashBuyInfo"
90
+                    <quill-editor
91
+                      :disabled="isread"
92
+                      v-model="postData.FlashBuyInfo"
90 93
                       ref="myQuillEditor"
91 94
                       :options="editorOption">
92 95
                     </quill-editor>
@@ -97,8 +100,8 @@
97 100
                 <span>参与类型:<em>*</em></span>
98 101
                 <div class="flex-item">
99 102
                   <div>
100
-                    <el-radio :disabled="editOff" v-model="postData.AttendantType" label="no">不限</el-radio>
101
-                    <el-radio :disabled="editOff" v-model="postData.AttendantType" label="newuser">新用户</el-radio>
103
+                    <el-radio :disabled="editOff || isread" v-model="postData.AttendantType" label="no">不限</el-radio>
104
+                    <el-radio :disabled="editOff || isread" v-model="postData.AttendantType" label="newuser">新用户</el-radio>
102 105
                   </div>
103 106
                 </div>
104 107
               </li>
@@ -106,11 +109,11 @@
106 109
                 <span>核销时间:<em>*</em></span>
107 110
                 <div class="flex-item">
108 111
                   <div class="flex-h" style="width: 100%;align-item: center;">
109
-                    <el-radio :disabled="editOff" v-model="postData.ValidateType" label="days" style="margin-right: 5px;"><em style="color: transparent;display:none;">1</em></el-radio>
112
+                    <el-radio :disabled="editOff || isread" v-model="postData.ValidateType" label="days" style="margin-right: 5px;"><em style="color: transparent;display:none;">1</em></el-radio>
110 113
                     <span>领取后</span>
111 114
                     <div style="width: 100px;display: inline-block;">
112 115
                       <el-input
113
-                        :disabled="editOff"
116
+                        :disabled="editOff || isread"
114 117
                         placeholder=""
115 118
                         v-model="postData.ValidateDays"
116 119
                         clearable>
@@ -119,11 +122,11 @@
119 122
                     <span>天内有效</span>
120 123
                   </div>
121 124
                   <div class="flex-h" style="width: 100%;align-item: center;margin-top: 10px;">
122
-                    <el-radio :disabled="editOff" v-model="postData.ValidateType" label="date" style="margin-right: 5px;"><em style="color: transparent;display:none;">2</em></el-radio>
125
+                    <el-radio :disabled="editOff || isread" v-model="postData.ValidateType" label="date" style="margin-right: 5px;"><em style="color: transparent;display:none;">2</em></el-radio>
123 126
                     <span>有效期</span>
124 127
                     <div style="display: inline-block;">
125 128
                       <el-date-picker
126
-                        :disabled="editOff"
129
+                        :disabled="editOff || isread"
127 130
                         value-format="yyyy-MM-ddT00:00:00+08:00"
128 131
                         v-model="postData.ValidateStart"
129 132
                         type="date"
@@ -131,7 +134,7 @@
131 134
                       </el-date-picker>
132 135
                       <span>至</span>
133 136
                       <el-date-picker
134
-                        :disabled="editOff"
137
+                        :disabled="editOff || isread"
135 138
                         value-format="yyyy-MM-ddT00:00:00+08:00"
136 139
                         v-model="postData.ValidateEnd"
137 140
                         type="date"
@@ -143,6 +146,7 @@
143 146
               </li>
144 147
               <li>
145 148
                 <el-button
149
+                  :disabled="isread"
146 150
                   size="mini"
147 151
                   type="primary"
148 152
                   @click="submitFlashbuy">保存</el-button>
@@ -163,6 +167,7 @@ const { mapActions: mapActivityFlashbuyActions } = createNamespacedHelpers('acti
163 167
 export default {
164 168
   data () {
165 169
     return {
170
+      isread: false,
166 171
       editOff: false,
167 172
       templateActiveIndex: 0, // 当前选择模板索引值
168 173
       templateList: [], // 模板列表
@@ -203,11 +208,15 @@ export default {
203 208
     }
204 209
   },
205 210
   created () {
211
+    if (this.$route.query.isread) {
212
+      this.isread = true
213
+    }
206 214
     if (this.$route.query.id) {
207 215
       this.editOff = true
208 216
     }
209 217
     this.getFlashbuyTemplateList().then((res) => {
210 218
       // console.log(JSON.stringify(res))
219
+      res = res || []
211 220
       for (var n = 0; n < res.length; n++) {
212 221
         res[n].currentImg = ''
213 222
       }
@@ -329,7 +338,7 @@ export default {
329 338
       return true
330 339
     },
331 340
     cutTemplate (index) { // 切换模板
332
-      if (!this.editOff) {
341
+      if (!this.editOff && !this.isread) {
333 342
         this.templateActiveIndex = index
334 343
         this.postData.ModelId = this.templateList[index].ModelId
335 344
       }

+ 3
- 0
src/pages/system/marketingActivities/snapUpList/index.vue Näytä tiedosto

@@ -58,6 +58,9 @@
58 58
           <el-table-column
59 59
             prop="FlashBuyName"
60 60
             label="活动名称">
61
+            <template slot-scope="scope">
62
+              <router-link style="color:#333;" :to="{name: 'editSnapUpList', query: {id: scope.row.FlashBuyId, isread: 1}}">{{scope.row.FlashBuyName}}</router-link>
63
+            </template>
61 64
           </el-table-column>
62 65
           <el-table-column
63 66
             prop="FlashBuyStatus"