修改积分商品回显问题

master
15386982806 2023-01-18 11:28:46 +08:00
parent 83f145767e
commit c86d863f1d
1 changed files with 17 additions and 6 deletions

View File

@ -33,11 +33,7 @@
<Select <Select
v-model="form.pointsGoodsCategoryId" v-model="form.pointsGoodsCategoryId"
:label-in-value="true" :label-in-value="true"
@on-change=" @on-change="changeCategory"
(val) => {
changeCategory(val, index);
}
"
> >
<Option v-for="item in categoryList" :value="item.id" :key="item.id">{{ <Option v-for="item in categoryList" :value="item.id" :key="item.id">{{
item.name item.name
@ -97,7 +93,10 @@ export default {
name: "editPointsGoods", name: "editPointsGoods",
data() { data() {
return { return {
pointsGoodsCategoryId:'',
pointsGoodsCategoryName:'',
form: { form: {
/** 活动名称 */ /** 活动名称 */
promotionName: "", promotionName: "",
/** 报名截止时间 */ /** 报名截止时间 */
@ -110,6 +109,7 @@ export default {
seckillRule: "", seckillRule: "",
goodsSku: {}, goodsSku: {},
promotionStatus: "NEW", promotionStatus: "NEW",
}, },
categoryList: [], // categoryList: [], //
id: this.$route.query.id, // id id: this.$route.query.id, // id
@ -134,6 +134,12 @@ export default {
} }
}, },
methods: { methods: {
//
changeCategory(v){
console.log(v);
this.pointsGoodsCategoryId=v.value
this.pointsGoodsCategoryName=v.label
},
// //
closeCurrentPage() { closeCurrentPage() {
this.$store.commit("removeTag", "edit-points-goods"); this.$store.commit("removeTag", "edit-points-goods");
@ -167,7 +173,12 @@ export default {
this.form.startTime = start; this.form.startTime = start;
this.form.endTime = end; this.form.endTime = end;
this.submitLoading = true; this.submitLoading = true;
updatePointsGoods(this.form).then((res) => { let params={
...this.form,
pointsGoodsCategoryId: this.pointsGoodsCategoryId,
pointsGoodsCategoryName:this.pointsGoodsCategoryName
}
updatePointsGoods(params).then((res) => {
this.submitLoading = false; this.submitLoading = false;
if (res.success) { if (res.success) {
this.$Message.success("积分商品修改成功"); this.$Message.success("积分商品修改成功");