修改代客下单部分逻辑

1:加菜时用订单传来的masterID不再重新货区,并置空选择商品数量
2:优化代码,去除重复请求
订单管理加菜
1:跳转加菜页面参数增加mastrID
This commit is contained in:
YeMingfei666 2024-10-31 10:22:48 +08:00
parent d48e16d739
commit 9833e137f9
1 changed files with 8 additions and 10 deletions

View File

@ -455,7 +455,13 @@
let $originGoods = []
let $category = []
async function init() {
if(option.type=='add'){
data.masterId = option.masterId
setTabBar($category, $originGoods, [])
}else{
const masterRes = await getMasterId()
data.masterId = masterRes.masterId
}
const shopInfo = await tbShopInfo()
$shop.value = shopInfo
const useType = data.table.status == 'using' ? data.table.useType : $returnUseType(shopInfo)
@ -483,16 +489,11 @@
$originGoods = goods
console.log(option);
if(option.type=='add'){
// await getTableInfo()
const masterRes = await getMasterId()
data.masterId = masterRes.masterId
cars.length = 0
setTabBar(category, goods, [])
return
}
if (!data.table.tableId) {
const masterRes = await getMasterId()
data.masterId = masterRes.masterId
//
const cartRes = await getCart()
cars.length = 0
@ -503,10 +504,7 @@
setTabBar(category, goods, cars)
return
}
const {
masterId
} = await getMasterId()
data.masterId = masterId
const cartRes = await getCart()
cars.length = 0
const cartArr = getNowCart(cartRes.records)