更新代客下单能够购买判断

This commit is contained in:
2024-10-24 15:44:45 +08:00
parent c19eb54d6d
commit a232e77a2d
6 changed files with 57 additions and 436 deletions

View File

@@ -440,6 +440,10 @@
$originGoods = goods
if (!data.table.tableId) {
//无桌台
const {
masterId
} = await getMasterId()
data.masterId = masterId
setTabBar(category, goods, [])
return
}
@@ -587,7 +591,7 @@
return prve;
}, {});
const canBudyGoods = specList
.filter((v) => util.isCanBuy(v))
.filter((v) => util.isCanBuy(v,guigeModelData.chooseGoods.item))
.sort((a, b) => {
const aNumber = a.specSnap.split(",").reduce((prve, cur) => {
return prve + skuMapNumber[cur];
@@ -676,7 +680,7 @@
prve[i] = matchArr
.filter((v) => v.specSnap.match(i))
.every((v) => {
return !util.isCanBuy(v)
return !util.isCanBuy(v,guigeModelData.chooseGoods.item)
});
}
}
@@ -801,7 +805,8 @@
}
function canAddGoods() {
return data.table.tableId
// return data.table.tableId
return true
}
function searchGoodsUpdate(goodsItem,goodsIndex, isAdd) {
@@ -813,11 +818,11 @@
}
}
async function goodsUpdate(foodsindex, index, isAdd,searchGoodsIndex) {
if (!canAddGoods()) {
return infoBox.showToast('请先选择桌台', 0.5).then(res => {
chooseTable()
})
}
// if (!canAddGoods()) {
// return infoBox.showToast('请先选择桌台', 0.5).then(res => {
// chooseTable()
// })
// }
const $goods = data.tabbar[index].foods[foodsindex]
if ($goods.isDan) {
//单规格