mirror of
https://gitee.com/myxzgzs/boyue-ui-admin-vue3
synced 2025-08-08 00:12:43 +08:00
fix: 【MALL 商城】商城-满减送管理功能中,已添加的优惠券删除后保存不成功
This commit is contained in:
parent
2e495f1312
commit
a61fe176ce
@ -107,16 +107,15 @@ const initGiveCouponList = async () => {
|
||||
|
||||
/** 设置赠送的优惠券 */
|
||||
const setGiveCouponList = () => {
|
||||
if (isEmpty(rewardRule.value) || isEmpty(list.value)) {
|
||||
if (isEmpty(rewardRule.value)) {
|
||||
return
|
||||
}
|
||||
// 核心:清空 rewardRule.value.giveCouponTemplateCounts,解决删除不生效的问题
|
||||
rewardRule.value.giveCouponTemplateCounts = {}
|
||||
|
||||
// 设置优惠券和其数量的对应
|
||||
list.value.forEach((rule) => {
|
||||
if (!rewardRule.value.giveCouponTemplateCounts) {
|
||||
rewardRule.value.giveCouponTemplateCounts = {}
|
||||
}
|
||||
rewardRule.value.giveCouponTemplateCounts[rule.id] = rule.giveCount!
|
||||
rewardRule.value.giveCouponTemplateCounts![rule.id] = rule.giveCount!
|
||||
})
|
||||
}
|
||||
defineExpose({ setGiveCouponList })
|
||||
|
Loading…
x
Reference in New Issue
Block a user