|
@@ -378,6 +378,7 @@
|
378
|
378
|
<div class="flex-item">
|
379
|
379
|
<el-select :disabled="!editAll || isread" v-if="addPrizeInfo.CouponCardType === 'card'" @change="cardChange" v-model="addPrizeInfo.CouponCardId" placeholder="请选择">
|
380
|
380
|
<el-option
|
|
381
|
+ :disabled="!item.select"
|
381
|
382
|
v-for="item in cardList"
|
382
|
383
|
:key="item.CardId"
|
383
|
384
|
:label="item.CardName"
|
|
@@ -386,6 +387,7 @@
|
386
|
387
|
</el-select>
|
387
|
388
|
<el-select :disabled="!editAll || isread" v-if="addPrizeInfo.CouponCardType === 'coupon'" @change="couponChange" v-model="addPrizeInfo.CouponCardId" placeholder="请选择">
|
388
|
389
|
<el-option
|
|
390
|
+ :disabled="!item.select"
|
389
|
391
|
v-for="item in couponList"
|
390
|
392
|
:key="item.CouponId"
|
391
|
393
|
:label="item.CouponName"
|
|
@@ -718,6 +720,7 @@ export default {
|
718
|
720
|
if (this.postData.Prizes[a].ValidDays === 0) {
|
719
|
721
|
this.postData.Prizes[a].ValidDays = ''
|
720
|
722
|
}
|
|
723
|
+ this.postData.Prizes[a].Defaults = this.postData.Prizes[a].Defaults || []
|
721
|
724
|
}
|
722
|
725
|
})
|
723
|
726
|
}
|
|
@@ -745,6 +748,10 @@ export default {
|
745
|
748
|
usedid: this.$route.query.id || '',
|
746
|
749
|
caseid: this.CaseId,
|
747
|
750
|
}).then((res) => {
|
|
751
|
+ res.list = res.list || []
|
|
752
|
+ for (var n = 0; n < res.list.length; n++) {
|
|
753
|
+ res.list[n].select = true
|
|
754
|
+ }
|
748
|
755
|
this.cardList = res.list
|
749
|
756
|
})
|
750
|
757
|
this.GetCouponList({ // 获取券列表
|
|
@@ -755,6 +762,10 @@ export default {
|
755
|
762
|
usedid: this.$route.query.id || '',
|
756
|
763
|
caseid: this.CaseId,
|
757
|
764
|
}).then((res) => {
|
|
765
|
+ res.list = res.list || []
|
|
766
|
+ for (var n = 0; n < res.list.length; n++) {
|
|
767
|
+ res.list[n].select = true
|
|
768
|
+ }
|
758
|
769
|
this.couponList = res.list
|
759
|
770
|
})
|
760
|
771
|
},
|
|
@@ -787,7 +798,6 @@ export default {
|
787
|
798
|
}
|
788
|
799
|
},
|
789
|
800
|
checkData () { // 校验活动信息
|
790
|
|
- // this.postData.CaseId === '' ? this.postData.CaseId = this.defaultCaseId : this.postData.CaseId = ''
|
791
|
801
|
if (this.postData.CaseId === '') {
|
792
|
802
|
this.$message({
|
793
|
803
|
type: 'error',
|
|
@@ -885,10 +895,6 @@ export default {
|
885
|
895
|
this.$router.push({ name: 'listOfLotteryActivities' })
|
886
|
896
|
},
|
887
|
897
|
submitLuckdrawData () { // 提交活动信息
|
888
|
|
- // document.getElementById('hiddenRule').innerHTML = this.postData.LuckdrawRule
|
889
|
|
- // var imgArr = document.getElementById('hiddenRule').getElementsByTagName('img')
|
890
|
|
- // console.log(imgArr)
|
891
|
|
- // console.log(this.postData.CaseId, this.defaultCaseId)
|
892
|
898
|
if (this.postData.CaseId === '' && this.defaultCaseId !== '') {
|
893
|
899
|
this.postData.CaseId = this.defaultCaseId
|
894
|
900
|
}
|
|
@@ -972,6 +978,11 @@ export default {
|
972
|
978
|
Tel: this.addPhoneNum,
|
973
|
979
|
})
|
974
|
980
|
this.addPhoneNum = ''
|
|
981
|
+ } else if (!this.findSamePhone(this.addPhoneNum)) {
|
|
982
|
+ this.$message({
|
|
983
|
+ type: 'error',
|
|
984
|
+ message: '请勿填写重复手机号'
|
|
985
|
+ })
|
975
|
986
|
} else {
|
976
|
987
|
this.$message({
|
977
|
988
|
type: 'error',
|
|
@@ -996,6 +1007,19 @@ export default {
|
996
|
1007
|
cancelButtonText: '取消',
|
997
|
1008
|
type: 'warning'
|
998
|
1009
|
}).then(() => {
|
|
1010
|
+ if (this.postData.Prizes[index].CouponCardType === 'card') {
|
|
1011
|
+ for (var n = 0; n < this.cardList.length; n++) {
|
|
1012
|
+ if (this.cardList[n].CardId === this.postData.Prizes[index].CouponCardId) {
|
|
1013
|
+ this.cardList[n].select = true
|
|
1014
|
+ }
|
|
1015
|
+ }
|
|
1016
|
+ } else {
|
|
1017
|
+ for (var a = 0; a < this.couponList.length; a++) {
|
|
1018
|
+ if (this.couponList[a].CouponId === this.postData.Prizes[index].CouponCardId) {
|
|
1019
|
+ this.couponList[a].select = true
|
|
1020
|
+ }
|
|
1021
|
+ }
|
|
1022
|
+ }
|
999
|
1023
|
this.postData.Prizes.splice(index, 1)
|
1000
|
1024
|
this.$message({
|
1001
|
1025
|
type: 'success',
|
|
@@ -1057,12 +1081,14 @@ export default {
|
1057
|
1081
|
for (var n = 0; n < this.cardList.length; n++) {
|
1058
|
1082
|
if (this.cardList[n].CardId === this.addPrizeInfo.CouponCardId) {
|
1059
|
1083
|
this.addPrizeInfo.PrizeName = this.cardList[n].CardName
|
|
1084
|
+ this.cardList[n].select = false
|
1060
|
1085
|
}
|
1061
|
1086
|
}
|
1062
|
1087
|
} else {
|
1063
|
1088
|
for (var a = 0; a < this.couponList.length; a++) {
|
1064
|
1089
|
if (this.couponList[a].CouponId === this.addPrizeInfo.CouponCardId) {
|
1065
|
1090
|
this.addPrizeInfo.PrizeName = this.couponList[a].CouponName
|
|
1091
|
+ this.couponList[a].select = false
|
1066
|
1092
|
}
|
1067
|
1093
|
}
|
1068
|
1094
|
}
|