修改积分商品回显问题

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