|
@@ -214,7 +214,7 @@ export default {
|
|
|
dynamicPointsId: "",
|
|
dynamicPointsId: "",
|
|
|
dynamicPointsName: "",
|
|
dynamicPointsName: "",
|
|
|
countryCode: settings.defaultCountry,
|
|
countryCode: settings.defaultCountry,
|
|
|
- periods: "",
|
|
|
|
|
|
|
+ periods: ["", ""],
|
|
|
pointsItems: []
|
|
pointsItems: []
|
|
|
},
|
|
},
|
|
|
pointsItem: {
|
|
pointsItem: {
|
|
@@ -277,12 +277,6 @@ export default {
|
|
|
},
|
|
},
|
|
|
methods: {
|
|
methods: {
|
|
|
init() {
|
|
init() {
|
|
|
- if (this.form.periodStart && this.form.periodEnd) {
|
|
|
|
|
- this.form.periods = [
|
|
|
|
|
- this.form.periodStart,
|
|
|
|
|
- this.form.periodEnd
|
|
|
|
|
- ]
|
|
|
|
|
- }
|
|
|
|
|
if (!this.form.pointsItems || this.form.pointsItems.length == 0) {
|
|
if (!this.form.pointsItems || this.form.pointsItems.length == 0) {
|
|
|
this.form.pointsItems = [];
|
|
this.form.pointsItems = [];
|
|
|
this.addConfigItem();
|
|
this.addConfigItem();
|
|
@@ -291,7 +285,6 @@ export default {
|
|
|
this.getGroupOptions(item.userType, item, true)
|
|
this.getGroupOptions(item.userType, item, true)
|
|
|
});
|
|
});
|
|
|
}
|
|
}
|
|
|
- this.changeTimePeriod();
|
|
|
|
|
this.changeCountry();
|
|
this.changeCountry();
|
|
|
},
|
|
},
|
|
|
onBack() {
|
|
onBack() {
|
|
@@ -301,11 +294,6 @@ export default {
|
|
|
})
|
|
})
|
|
|
})
|
|
})
|
|
|
},
|
|
},
|
|
|
- changeTimePeriod() {
|
|
|
|
|
- if (this.form.periods == null || this.form.periods == undefined) {
|
|
|
|
|
- this.form.periods = ["", ""];
|
|
|
|
|
- }
|
|
|
|
|
- },
|
|
|
|
|
changeCountry() {
|
|
changeCountry() {
|
|
|
if (this.options.country && this.options.country.length > 0) {
|
|
if (this.options.country && this.options.country.length > 0) {
|
|
|
for(let country of this.options.country) {
|
|
for(let country of this.options.country) {
|
|
@@ -400,7 +388,17 @@ export default {
|
|
|
getPointsConfigInfo() {
|
|
getPointsConfigInfo() {
|
|
|
points.viewPointsConfig(this.$route.params.id).then(res => {
|
|
points.viewPointsConfig(this.$route.params.id).then(res => {
|
|
|
if (res.data) {
|
|
if (res.data) {
|
|
|
- this.form = res.data;
|
|
|
|
|
|
|
+ for (let k in this.form) {
|
|
|
|
|
+ if (res.data[k]) {
|
|
|
|
|
+ this.form[k] = res.data[k];
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
|
|
+ if (res.data.periodStart && res.data.periodEnd) {
|
|
|
|
|
+ this.form.periods = [
|
|
|
|
|
+ res.data.periodStart,
|
|
|
|
|
+ res.data.periodEnd
|
|
|
|
|
+ ]
|
|
|
|
|
+ }
|
|
|
this.init();
|
|
this.init();
|
|
|
}
|
|
}
|
|
|
}).catch(err => {
|
|
}).catch(err => {
|