代客下单更新
This commit is contained in:
parent
efa346ade6
commit
0632e395ce
|
|
@ -45,6 +45,9 @@
|
|||
</view>
|
||||
</view>
|
||||
</view>
|
||||
<template v-if="tables.list.length<=0">
|
||||
<my-img-empty tips="未找到相关的桌台"></my-img-empty>
|
||||
</template>
|
||||
</view>
|
||||
|
||||
|
||||
|
|
@ -142,7 +145,7 @@
|
|||
content
|
||||
} = await $table.get(query)
|
||||
tables.hasAjax = true
|
||||
content = content.filter(v => v.status != 'closed')
|
||||
content = content.filter(v => v.status == 'idle')
|
||||
tables.list = content
|
||||
tables.selIndex = content.findIndex(v => v.tableId == option.tableId)
|
||||
console.log(tables.selIndex );
|
||||
|
|
@ -166,6 +169,10 @@
|
|||
}
|
||||
|
||||
watch(() => area.sel, (newval) => {
|
||||
if(!newval){
|
||||
tables.list = tables.originList
|
||||
return
|
||||
}
|
||||
tables.list = tables.originList.filter(v => v.areaId == newval.id)
|
||||
})
|
||||
let option = {}
|
||||
|
|
|
|||
|
|
@ -48,6 +48,7 @@
|
|||
function changeCauses(item) {
|
||||
let prve=form.remark?',':''
|
||||
form.remark +=prve+item.name
|
||||
console.log(form.remark);
|
||||
}
|
||||
|
||||
const causes = reactive([{
|
||||
|
|
|
|||
|
|
@ -221,7 +221,7 @@
|
|||
|
||||
<model-discount title="菜品打折/减免" :ref="setModel" name="discount" :price="allPrice"></model-discount>
|
||||
<give-food title="赠菜" :ref="setModel" name="giveFood"></give-food>
|
||||
<my-remark @confirm="goodsOneRemarkConfirm" title="单品备注" :ref="setModel" name="remark"></my-remark>
|
||||
<one-remark @confirm="goodsOneRemarkConfirm" title="单品备注" :ref="setModel" name="remark"></one-remark>
|
||||
<edit-discount title="优惠金额" :ref="setModel" name="editMoney" :price="allPrice"></edit-discount>
|
||||
</view>
|
||||
|
||||
|
|
@ -240,10 +240,9 @@
|
|||
computed,
|
||||
watch
|
||||
} from 'vue';
|
||||
import myButton from '@/components/my-components/my-button'
|
||||
import modelDiscount from './components/discount'
|
||||
import giveFood from './components/give-food'
|
||||
import myRemark from './components/remark'
|
||||
import oneRemark from './components/remark'
|
||||
import editDiscount from '@/pagesCreateOrder/components/edit-discount.vue'
|
||||
import go from '@/commons/utils/go.js';
|
||||
import {
|
||||
|
|
@ -273,10 +272,12 @@
|
|||
}
|
||||
|
||||
function showModel(key, index) {
|
||||
modelData.data =goods.list[index]
|
||||
modelData.selIndex =index
|
||||
modelData.data = goods.list[index]
|
||||
modelData.selIndex = index
|
||||
const model = models.get(key)
|
||||
model && model.open({remark:modelData.data.note})
|
||||
model && model.open({
|
||||
remark: modelData.data.note||''
|
||||
})
|
||||
}
|
||||
|
||||
function formatPrice(n) {
|
||||
|
|
@ -398,11 +399,11 @@
|
|||
//监听桌台改变
|
||||
watch(() => table.value, (newval, oldval) => {
|
||||
if (newval && oldval) {
|
||||
Api.$choseTable({
|
||||
orderId: 4462,
|
||||
oldTableId: oldval.tableId,
|
||||
newTableId: newval.tableId,
|
||||
})
|
||||
// Api.$choseTable({
|
||||
// orderId: 4462,
|
||||
// oldTableId: oldval.tableId,
|
||||
// newTableId: newval.tableId,
|
||||
// })
|
||||
}
|
||||
})
|
||||
|
||||
|
|
@ -510,9 +511,16 @@
|
|||
})
|
||||
} else {
|
||||
//后付
|
||||
uni.navigateBack({
|
||||
delta: 2
|
||||
})
|
||||
if (option.isCreateOrderToDetail) {
|
||||
go.to('PAGES_ORDER_DETAIL', {
|
||||
id: res.id
|
||||
})
|
||||
} else {
|
||||
uni.navigateBack({
|
||||
delta: 2
|
||||
})
|
||||
}
|
||||
|
||||
// return go.to('PAGES_ORDER_DETAIL', {
|
||||
// id: res.id
|
||||
// })
|
||||
|
|
@ -531,7 +539,7 @@
|
|||
|
||||
//单品备注确认
|
||||
async function goodsOneRemarkConfirm(e) {
|
||||
const cart=goods.list[modelData.selIndex]
|
||||
const cart = goods.list[modelData.selIndex]
|
||||
await Api.$updateCart({
|
||||
cartId: cart.id,
|
||||
productId: cart.productId,
|
||||
|
|
@ -540,11 +548,16 @@
|
|||
note: e.remark,
|
||||
num: cart.number // 0会删除此商品
|
||||
})
|
||||
cart.note= e.remark
|
||||
cart.note = e.remark
|
||||
}
|
||||
|
||||
function init() {
|
||||
|
||||
async function init() {
|
||||
await getTbShopInfo()
|
||||
await getCart()
|
||||
console.log($seatFee);
|
||||
if (!$seatFee.totalNumber) {
|
||||
updateChoseCount()
|
||||
}
|
||||
}
|
||||
|
||||
onLoad((opt) => {
|
||||
|
|
@ -558,8 +571,7 @@
|
|||
}
|
||||
}
|
||||
init()
|
||||
getCart()
|
||||
getTbShopInfo()
|
||||
|
||||
// updateChoseCount()
|
||||
})
|
||||
|
||||
|
|
|
|||
|
|
@ -76,6 +76,9 @@
|
|||
return []
|
||||
}
|
||||
},
|
||||
isCreateOrderToDetail:{
|
||||
type:Boolean,default:false
|
||||
},
|
||||
user:{
|
||||
type: Object,
|
||||
default: () => {
|
||||
|
|
@ -123,7 +126,7 @@
|
|||
const {tableId,name,maxCapacity,status,type}=props.table
|
||||
go.to('PAGES_CONFIRM_ORDER',{
|
||||
masterId:props.masterId,type,
|
||||
tableId,name,maxCapacity,status
|
||||
tableId,name,maxCapacity,status,isCreateOrderToDetail:props.isCreateOrderToDetail
|
||||
})
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -97,7 +97,7 @@
|
|||
</template>
|
||||
|
||||
<view class="bottom w-full">
|
||||
<my-car @updateNumber="carsNumberChange" :user="data.vipUser" :masterId="data.masterId" :table="data.table"
|
||||
<my-car :isCreateOrderToDetail="isCreateOrderToDetail" @updateNumber="carsNumberChange" :user="data.vipUser" :masterId="data.masterId" :table="data.table"
|
||||
:data="cars" @clear="onClearCart"></my-car>
|
||||
</view>
|
||||
|
||||
|
|
@ -913,16 +913,29 @@
|
|||
init()
|
||||
})
|
||||
onBeforeUnmount(() => {})
|
||||
|
||||
function watchUpdate() {
|
||||
uni.$off('update:createOrderIndex')
|
||||
uni.$on('update:createOrderIndex', (data) => {
|
||||
console.log('update:createOrderIndex');
|
||||
init()
|
||||
})
|
||||
}
|
||||
onShow(() => {
|
||||
// watchChooseuser()
|
||||
watchChooseTable()
|
||||
watchUpdate()
|
||||
})
|
||||
let isCreateOrderToDetail=ref(false)
|
||||
onLoad((opt) => {
|
||||
console.log(opt)
|
||||
Object.assign(data.table, opt)
|
||||
if(opt.useType){
|
||||
uni.setStorageSync('useType',opt.useType)
|
||||
}
|
||||
if(JSON.stringify(opt)=='{}'){
|
||||
isCreateOrderToDetail.value=true
|
||||
}
|
||||
// if (!opt.tableId) {
|
||||
// infoBox.showErrorToast('暂不支持不选择桌台下载,请从桌台点餐')
|
||||
// return setTimeout(() => {
|
||||
|
|
|
|||
|
|
@ -122,6 +122,8 @@
|
|||
infoBox.showToast('支付成功')
|
||||
setTimeout(() => {
|
||||
// uni.$emit('orderDetail:update')
|
||||
uni.$emit('update:createOrderIndex')
|
||||
console.log('update:createOrderIndex');
|
||||
uni.navigateBack({
|
||||
delta: 2
|
||||
})
|
||||
|
|
|
|||
Loading…
Reference in New Issue