Commit db9ce567 by cen Committed by chenwq1

fix: 商品单价处理

1 parent b9ae7f90
...@@ -164,7 +164,7 @@ export default { ...@@ -164,7 +164,7 @@ export default {
const filterData = positionTypeList.filter(v => v.positionValue == item) const filterData = positionTypeList.filter(v => v.positionValue == item)
return (filterData.length && filterData[0] && filterData[0].positionName) || '' return (filterData.length && filterData[0] && filterData[0].positionName) || ''
}, },
// 验证价格输入 // 验证价格输入(包含最低价校验 + 重置折扣/抵扣策略)
validatePrice(event, item, index, cindex) { validatePrice(event, item, index, cindex) {
let value = event.detail.value let value = event.detail.value
// 如果为空则设置为0 // 如果为空则设置为0
...@@ -228,19 +228,24 @@ export default { ...@@ -228,19 +228,24 @@ export default {
if (!item.multipleSpecificationsGoods) { if (!item.multipleSpecificationsGoods) {
if (item.goodsFlag == 1) { if (item.goodsFlag == 1) {
//如果没有多规格商品,更新普通商品的价格 // 如果没有多规格商品,更新普通商品的价格
this.$set(this.list[index].goods, 'sellPrice', value) this.$set(this.list[index].goods, 'sellPrice', value)
} else { } else {
// 套餐内商品
this.$set(this.list[index].packageGoods.goodsList[cindex], 'sellPrice', value) this.$set(this.list[index].packageGoods.goodsList[cindex], 'sellPrice', value)
} }
} else if (item.multipleSpecificationsGoods && item.multipleSpecificationsGoods.goods) { } else if (item.multipleSpecificationsGoods && item.multipleSpecificationsGoods.goods) {
// 如果有多规格商品,更新多规格商品的价格 // 如果有多规格商品,更新多规格商品的价格
this.$set(this.list[index].multipleSpecificationsGoods.goods, 'sellPrice', value) this.$set(this.list[index].multipleSpecificationsGoods.goods, 'sellPrice', value)
} }
// 商品价格变动时,清空折扣 / 抵扣配置,并重算 finalPrice
this.resetStrategyWhenPriceChange(item, index, cindex)
this.$emit('changeTotalPrice') this.$emit('changeTotalPrice')
}, },
// 验证价格输入 // 原始价格校验逻辑(保留作备用,不再直接使用)
validatePrice(event, item, index, cindex) { validatePriceRaw(event, item, index, cindex) {
let value = event.detail.value let value = event.detail.value
// 如果为空则设置为0 // 如果为空则设置为0
if (!value || value.trim() === '') { if (!value || value.trim() === '') {
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!