fix: 代客下单修改未找到的商品不再删除

This commit is contained in:
YeMingfei666 2025-03-26 13:42:20 +08:00
parent 3b4d140134
commit 26c10de00b
1 changed files with 8 additions and 5 deletions

View File

@ -606,7 +606,7 @@ export const useCartsStore = defineStore("carts", () => {
v[key] = skuData[key];
});
} else {
del({ id: v.id })
// del({ id: v.id })
return false
}
return !v.is_gift
@ -636,10 +636,13 @@ export const useCartsStore = defineStore("carts", () => {
return ElMessage.warning(msg.message || '该商品已存在')
}
const skuData = getProductDetails({ product_id: msg.data.product_id, sku_id: msg.data.sku_id })
if (skuData) {
const newGoods = { ...skuData, ...msg.data }
console.log('newGoods', newGoods)
list.value.push(newGoods)
return ElMessage.success(msg.message || '添加成功')
}
}
if (msg.operate_type === "manage_edit") {