|
@@ -1,9 +1,6 @@
|
1
|
1
|
<template>
|
2
|
2
|
<div class="subPage flex-h">
|
3
|
|
- <div class="img">
|
4
|
|
- <img v-if="templateList.length" :src="templateList[templateActiveIndex].TplImg" width="100%" alt="">
|
5
|
|
- </div>
|
6
|
|
- <div class="flex-item">
|
|
3
|
+ <div class="flex-item" style="margin:20px;">
|
7
|
4
|
<nav class="flex-h">
|
8
|
5
|
<a class="flex-item" :class="{'active': activeIndex === 0}" @click="activeIndex = 0">基础信息</a>
|
9
|
6
|
<a class="flex-item" :class="{'active': activeIndex === 1}" @click="activeIndex = 1">奖品信息</a>
|
|
@@ -72,13 +69,13 @@
|
72
|
69
|
<input type="file" :ref="'templateImg' + index" hidden @change="templateImgChange(item, $event)">
|
73
|
70
|
<img :src="item.MiniPic" style="width:100%;height:100%;object-fit: contain;">
|
74
|
71
|
</a>
|
|
72
|
+ <span style="width:100%;display:block;text-align:center;font-size:11px;color:#ccc;">(双击更换背景图)</span>
|
75
|
73
|
<el-button
|
76
|
74
|
v-if="item.currentImg !== ''"
|
77
|
75
|
size="mini"
|
78
|
76
|
@click="resetCurrentImg(item, index)"
|
79
|
77
|
type="success">重置</el-button>
|
80
|
78
|
</div>
|
81
|
|
- <div class="drawTemplateItem"><span style="width:100%;display:block;text-align:left;font-size:11px;color:#ccc;">(双击更换背景图)</span></div>
|
82
|
79
|
</div>
|
83
|
80
|
</div>
|
84
|
81
|
</li>
|
|
@@ -312,8 +309,11 @@
|
312
|
309
|
@click="rebackList">取消</el-button>
|
313
|
310
|
</div>
|
314
|
311
|
</div>
|
|
312
|
+ <div class="img" style="margin-left:0px;margin-right:20px;">
|
|
313
|
+ <img v-if="templateList.length" :src="templateList[templateActiveIndex].TplImg" width="100%" alt="">
|
|
314
|
+ </div>
|
315
|
315
|
<el-dialog
|
316
|
|
- title="新增奖品"
|
|
316
|
+ :title="editPrizeOff ? '编辑奖品' : '新增奖品'"
|
317
|
317
|
:visible.sync="centerDialogVisible"
|
318
|
318
|
width="800px"
|
319
|
319
|
@closed="prizeTypeChange();editPrizeOff = false"
|
|
@@ -337,13 +337,14 @@
|
337
|
337
|
<span>是否实物:<em>*</em></span>
|
338
|
338
|
<div class="flex-item">
|
339
|
339
|
<el-switch
|
340
|
|
- :disabled="isread"
|
|
340
|
+ :disabled="!editAll || isread"
|
341
|
341
|
v-model="addPrizeInfo.IsReality"
|
342
|
342
|
:active-value="1"
|
343
|
343
|
:inactive-value="0"
|
344
|
344
|
@change="checkIsReality"
|
345
|
345
|
:active-text="addPrizeInfo.IsReality ? '是' : '否'">
|
346
|
346
|
</el-switch>
|
|
347
|
+ <span style="line-height:40px;font-size:11px;color:#ccc;">(选择“否”即为“谢谢参与”奖项)</span>
|
347
|
348
|
</div>
|
348
|
349
|
</li>
|
349
|
350
|
<li class="flex-h" style="width:50%;float:left;" v-if="addPrizeInfo.PrizeType === 'third' && addPrizeInfo.IsReality === 1">
|
|
@@ -559,6 +560,8 @@ const { mapActions: mapCouponActions } = createNamespacedHelpers('coupon')
|
559
|
560
|
export default {
|
560
|
561
|
data () {
|
561
|
562
|
return {
|
|
563
|
+ submitOff: true,
|
|
564
|
+ editPrizeOff: false,
|
562
|
565
|
isread: false, // 是否预览模式
|
563
|
566
|
editAll: true, // 是否全部能编辑
|
564
|
567
|
editPrizePhoneIndex: '', // 编辑奖品内定手机号索引值
|
|
@@ -773,6 +776,13 @@ export default {
|
773
|
776
|
})
|
774
|
777
|
return false
|
775
|
778
|
}
|
|
779
|
+ if (new Date(this.postData.BeginDate).getTime() > new Date(this.postData.EndDate).getTime()) {
|
|
780
|
+ this.$message({
|
|
781
|
+ type: 'error',
|
|
782
|
+ message: '活动截止时间不能小于开始时间'
|
|
783
|
+ })
|
|
784
|
+ return false
|
|
785
|
+ }
|
776
|
786
|
if (this.postData.LuckdrawRule === '') {
|
777
|
787
|
this.$message({
|
778
|
788
|
type: 'error',
|
|
@@ -835,49 +845,54 @@ export default {
|
835
|
845
|
this.$router.push({ name: 'listOfLotteryActivities' })
|
836
|
846
|
},
|
837
|
847
|
submitLuckdrawData () { // 提交活动信息
|
838
|
|
- if (!this.checkData()) {
|
839
|
|
- return false
|
840
|
|
- }
|
841
|
|
- this.postData.ShareAddNum = this.postData.ShareAddNum - 0
|
842
|
|
- this.postData.LuckdrawNum = this.postData.LuckdrawNum - 0
|
843
|
|
- if (!this.postData.IsInternalDefault) {
|
844
|
|
- for (var n = 0; n < this.postData.Prizes.length; n++) {
|
845
|
|
- this.postData.Prizes[n].Defaults = []
|
|
848
|
+ if (this.submitOff) {
|
|
849
|
+ this.submitOff = false
|
|
850
|
+ if (!this.checkData()) {
|
|
851
|
+ return false
|
846
|
852
|
}
|
847
|
|
- }
|
848
|
|
- for (var a = 0; a < this.postData.Prizes.length; a++) {
|
849
|
|
- if (this.postData.Prizes[a].IsReality) {
|
850
|
|
- if (this.postData.Prizes[a].VerificationStart === '') {
|
|
853
|
+ this.postData.ShareAddNum = this.postData.ShareAddNum - 0
|
|
854
|
+ this.postData.LuckdrawNum = this.postData.LuckdrawNum - 0
|
|
855
|
+ if (!this.postData.IsInternalDefault) {
|
|
856
|
+ for (var n = 0; n < this.postData.Prizes.length; n++) {
|
|
857
|
+ this.postData.Prizes[n].Defaults = []
|
|
858
|
+ }
|
|
859
|
+ }
|
|
860
|
+ for (var a = 0; a < this.postData.Prizes.length; a++) {
|
|
861
|
+ if (this.postData.Prizes[a].IsReality) {
|
|
862
|
+ if (this.postData.Prizes[a].VerificationStart === '') {
|
|
863
|
+ delete this.postData.Prizes[a].VerificationStart
|
|
864
|
+ delete this.postData.Prizes[a].VerificationEnd
|
|
865
|
+ } else {
|
|
866
|
+ delete this.postData.Prizes[a].ValidDays
|
|
867
|
+ }
|
|
868
|
+ } else {
|
851
|
869
|
delete this.postData.Prizes[a].VerificationStart
|
852
|
870
|
delete this.postData.Prizes[a].VerificationEnd
|
853
|
|
- } else {
|
854
|
871
|
delete this.postData.Prizes[a].ValidDays
|
855
|
872
|
}
|
856
|
|
- } else {
|
857
|
|
- delete this.postData.Prizes[a].VerificationStart
|
858
|
|
- delete this.postData.Prizes[a].VerificationEnd
|
859
|
|
- delete this.postData.Prizes[a].ValidDays
|
860
|
873
|
}
|
861
|
|
- }
|
862
|
|
- // console.log(JSON.stringify(this.postData))
|
863
|
|
- if (this.$route.query.id) { // 编辑模式
|
864
|
|
- this.editLuckdraw(this.postData).then((res) => {
|
865
|
|
- // console.log(JSON.stringify(this.postData))
|
866
|
|
- this.$message({
|
867
|
|
- message: '操作成功',
|
868
|
|
- type: 'success'
|
|
874
|
+ // console.log(JSON.stringify(this.postData))
|
|
875
|
+ if (this.$route.query.id) { // 编辑模式
|
|
876
|
+ this.editLuckdraw(this.postData).then((res) => {
|
|
877
|
+ // console.log(JSON.stringify(this.postData))
|
|
878
|
+ this.submitOff = true
|
|
879
|
+ this.$message({
|
|
880
|
+ message: '操作成功',
|
|
881
|
+ type: 'success'
|
|
882
|
+ })
|
|
883
|
+ this.$router.push({ name: 'listOfLotteryActivities' })
|
869
|
884
|
})
|
870
|
|
- this.$router.push({ name: 'listOfLotteryActivities' })
|
871
|
|
- })
|
872
|
|
- } else { // 新增模式
|
873
|
|
- this.addLuckdraw(this.postData).then((res) => {
|
874
|
|
- // console.log(JSON.stringify(this.postData))
|
875
|
|
- this.$message({
|
876
|
|
- message: '操作成功',
|
877
|
|
- type: 'success'
|
|
885
|
+ } else { // 新增模式
|
|
886
|
+ this.addLuckdraw(this.postData).then((res) => {
|
|
887
|
+ // console.log(JSON.stringify(this.postData))
|
|
888
|
+ this.submitOff = true
|
|
889
|
+ this.$message({
|
|
890
|
+ message: '操作成功',
|
|
891
|
+ type: 'success'
|
|
892
|
+ })
|
|
893
|
+ this.$router.push({ name: 'listOfLotteryActivities' })
|
878
|
894
|
})
|
879
|
|
- this.$router.push({ name: 'listOfLotteryActivities' })
|
880
|
|
- })
|
|
895
|
+ }
|
881
|
896
|
}
|
882
|
897
|
},
|
883
|
898
|
addPrizeItemPhone (index) { // 编辑奖品内定号码
|