修改代客下单部分逻辑
1:加菜时用订单传来的masterID不再重新货区,并置空选择商品数量 2:优化代码,去除重复请求 订单管理加菜 1:跳转加菜页面参数增加mastrID
This commit is contained in:
parent
d48e16d739
commit
9833e137f9
|
|
@ -455,7 +455,13 @@
|
||||||
let $originGoods = []
|
let $originGoods = []
|
||||||
let $category = []
|
let $category = []
|
||||||
async function init() {
|
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()
|
const shopInfo = await tbShopInfo()
|
||||||
$shop.value = shopInfo
|
$shop.value = shopInfo
|
||||||
const useType = data.table.status == 'using' ? data.table.useType : $returnUseType(shopInfo)
|
const useType = data.table.status == 'using' ? data.table.useType : $returnUseType(shopInfo)
|
||||||
|
|
@ -483,16 +489,11 @@
|
||||||
$originGoods = goods
|
$originGoods = goods
|
||||||
console.log(option);
|
console.log(option);
|
||||||
if(option.type=='add'){
|
if(option.type=='add'){
|
||||||
// await getTableInfo()
|
|
||||||
const masterRes = await getMasterId()
|
|
||||||
data.masterId = masterRes.masterId
|
|
||||||
cars.length = 0
|
cars.length = 0
|
||||||
setTabBar(category, goods, [])
|
setTabBar(category, goods, [])
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
if (!data.table.tableId) {
|
if (!data.table.tableId) {
|
||||||
const masterRes = await getMasterId()
|
|
||||||
data.masterId = masterRes.masterId
|
|
||||||
//无桌台
|
//无桌台
|
||||||
const cartRes = await getCart()
|
const cartRes = await getCart()
|
||||||
cars.length = 0
|
cars.length = 0
|
||||||
|
|
@ -503,10 +504,7 @@
|
||||||
setTabBar(category, goods, cars)
|
setTabBar(category, goods, cars)
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
const {
|
|
||||||
masterId
|
|
||||||
} = await getMasterId()
|
|
||||||
data.masterId = masterId
|
|
||||||
const cartRes = await getCart()
|
const cartRes = await getCart()
|
||||||
cars.length = 0
|
cars.length = 0
|
||||||
const cartArr = getNowCart(cartRes.records)
|
const cartArr = getNowCart(cartRes.records)
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue