|
|
|
@ -50,7 +50,7 @@
|
|
|
|
|
</el-form-item>
|
|
|
|
|
<el-form-item label="奖励规则">
|
|
|
|
|
<el-select v-model="form.rewardRuleTemplateId" @change="ruleChange">
|
|
|
|
|
<el-option v-for="(item,index) in ruleData" :key="index" :value="item.id" :label="item.title">
|
|
|
|
|
<el-option v-for="(item) in ruleData" :key="item.id" :value="item.id" :label="item.title">
|
|
|
|
|
</el-option>
|
|
|
|
|
</el-select>
|
|
|
|
|
<el-table :data="ruleTable.data" border style="margin-top: 16px">
|
|
|
|
@ -81,7 +81,7 @@ export default defineComponent({
|
|
|
|
|
start: '',
|
|
|
|
|
end: '',
|
|
|
|
|
coverUrl: '',
|
|
|
|
|
rewardRuleTemplateId: undefined,
|
|
|
|
|
rewardRuleTemplateId: null,
|
|
|
|
|
brandList: [],
|
|
|
|
|
tagList: [],
|
|
|
|
|
referenceList: []
|
|
|
|
@ -104,7 +104,6 @@ export default defineComponent({
|
|
|
|
|
},
|
|
|
|
|
mounted() {
|
|
|
|
|
this.getApi();
|
|
|
|
|
this.activeId.value = this.$route.params.id;
|
|
|
|
|
},
|
|
|
|
|
methods: {
|
|
|
|
|
getApi() {
|
|
|
|
@ -115,11 +114,26 @@ export default defineComponent({
|
|
|
|
|
this.brandData = res.data.records;
|
|
|
|
|
}).catch(() => {});
|
|
|
|
|
this.proxy.$post("/rewardRuleTemplate/list", {}).then(res => {
|
|
|
|
|
this.ruleData = res.data;
|
|
|
|
|
this.ruleData = res.data.records;
|
|
|
|
|
}).catch(() => {});
|
|
|
|
|
this.proxy.$post("/reference/list", {}).then(res => {
|
|
|
|
|
this.refData = res.data.records;
|
|
|
|
|
}).catch(() => {});
|
|
|
|
|
if(this.$route.params.id) {
|
|
|
|
|
this.proxy.$post("/task/detail", {id: this.$route.params.id}).then(res => {
|
|
|
|
|
this.form.title = res.data.title;
|
|
|
|
|
this.form.subtitle = res.data.subtitle;
|
|
|
|
|
this.form.start = res.data.start;
|
|
|
|
|
this.form.end = res.data.end;
|
|
|
|
|
this.form.coverUrl = res.data.coverUrl;
|
|
|
|
|
this.selTime = [res.data.start,res.data.end]
|
|
|
|
|
this.form.rewardRuleTemplateId = res.data.rewardRuleTemplateId;
|
|
|
|
|
this.ruleChange(res.data.rewardRuleTemplateId);
|
|
|
|
|
res.data.referenceList.forEach(ele => {this.form.referenceList.push(ele.id)})
|
|
|
|
|
res.data.brandList.forEach(ele => {this.form.brandList.push(ele.id)})
|
|
|
|
|
res.data.tagList.forEach(ele => {this.form.tagList.push(ele.id)})
|
|
|
|
|
}).catch(() => {});
|
|
|
|
|
}
|
|
|
|
|
},
|
|
|
|
|
selectAll(value) {
|
|
|
|
|
if(value == true) {
|
|
|
|
@ -134,10 +148,18 @@ export default defineComponent({
|
|
|
|
|
}).catch(() => {});
|
|
|
|
|
},
|
|
|
|
|
confirm() {
|
|
|
|
|
this.proxy.$post("/task/add", this.form).then(res => {
|
|
|
|
|
this.$message.success(res.data);
|
|
|
|
|
this.$router.go(-1);
|
|
|
|
|
}).catch(() => {});
|
|
|
|
|
if(this.$route.params.id) {
|
|
|
|
|
let obj = Object.assign(this.form, {id: this.$route.params.id})
|
|
|
|
|
this.proxy.$post("/task/upd", obj).then(res => {
|
|
|
|
|
this.$message.success(res.data);
|
|
|
|
|
this.$router.go(-1);
|
|
|
|
|
}).catch(() => {});
|
|
|
|
|
} else {
|
|
|
|
|
this.proxy.$post("/task/add", this.form).then(res => {
|
|
|
|
|
this.$message.success(res.data);
|
|
|
|
|
this.$router.go(-1);
|
|
|
|
|
}).catch(() => {});
|
|
|
|
|
}
|
|
|
|
|
},
|
|
|
|
|
timeChange(val) {
|
|
|
|
|
this.form.start = val[0];
|
|
|
|
|