Commit 6ad2a16d by 胡悦

fix: 修复CreateOrder组件中onConfirm方法的商品筛选逻辑

添加flag参数以区分不同场景下的商品筛选,确保正确过滤出单件商品和组合商品
1 parent 7e99eaef
......@@ -297,8 +297,8 @@ export default {
}
},
// 弹窗确认回调
onConfirm(val) {
console.log(val, 'onConfirm')
onConfirm(val, flag) {
console.log(val,flag, 'onConfirm')
this.externalData = []
// const { chooseContent } = val
const chooseContent = utils.deepClone(val.chooseContent)
......@@ -331,7 +331,9 @@ export default {
} else {
// 过滤出已选的goodFlag为2的对象
const selectedGoods = this.orderObj[_typeValue.key].filter(item => item.goodsFlag === 2)
const singleGoods = chooseContent.filter(item => item.goodsFlag === 1)
const singleGoods = flag ?
this.orderObj[_typeValue.key].filter(item => item.goodsFlag === 1) :
chooseContent.filter(item => item.goodsFlag === 1)
const moreGoods = chooseContent
.filter(item => item.goodsFlag === 2)
.filter(item => {
......@@ -358,6 +360,7 @@ export default {
console.log(e, val)
this.orderObj.customer[val.value] = this.orderObj[val.value]
},
// 校验必填等规则
checkRequired() {
const phoneRex = /^[1]([3-9])[0-9]{9}$/
// 把formList中所有required为true的对象放到一个数组中
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!