员工管理添加员工列表优惠券完善
This commit is contained in:
@@ -44,8 +44,16 @@
|
||||
};
|
||||
},
|
||||
created() {
|
||||
couponsGoods(this.$Route.query.couponId).then(res => {
|
||||
this.goods = res
|
||||
couponsGoods({
|
||||
type: this.$Route.query.type
|
||||
}).then(res => {
|
||||
let coupongoodsIds = this.$store.getters.getCoupongoods,
|
||||
goodsArr = res
|
||||
for(let id of coupongoodsIds){
|
||||
let selectIndex = goodsArr.findIndex(val => val.goods_sku_id === id)
|
||||
goodsArr[selectIndex].isSelect = true
|
||||
}
|
||||
this.goods = goodsArr
|
||||
this.selectNumber()
|
||||
}).catch(err => {
|
||||
uni.showToast({
|
||||
@@ -88,23 +96,8 @@
|
||||
})
|
||||
return
|
||||
}
|
||||
couponsAddgoods(this.$Route.query.couponId, {
|
||||
goodsable_ids: this.selectGoods
|
||||
}).then(res => {
|
||||
uni.showModal({
|
||||
title : '提示',
|
||||
content : res,
|
||||
showCancel : false,
|
||||
success : modalRes => {
|
||||
if(modalRes.confirm) this.$Router.back()
|
||||
}
|
||||
})
|
||||
}).catch(err => {
|
||||
uni.showToast({
|
||||
title: err.message,
|
||||
icon : 'none'
|
||||
})
|
||||
})
|
||||
this.$store.commit('setCoupongoods', this.selectGoods)
|
||||
this.$Router.back()
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user