员工管理添加员工列表优惠券完善

This commit is contained in:
唐明明
2021-09-14 17:22:04 +08:00
parent f5e99ca292
commit 291ce57704
22 changed files with 7141 additions and 3586 deletions

View File

@@ -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()
}
}
}