优化台桌下单问题
This commit is contained in:
@@ -11,7 +11,7 @@
|
||||
<div class="number" @click="takeFoodCodeRef.show()">
|
||||
<el-text class="t">{{ masterId }}</el-text>
|
||||
</div>
|
||||
<div class="select_user" @click="fastCashierRef.show()"
|
||||
<div class="select_user" @click="quickCashHandle"
|
||||
v-if="!global.orderMemberInfo.telephone && !global.tableInfo.id">
|
||||
<div class="left">
|
||||
<el-icon class="icon">
|
||||
@@ -32,7 +32,10 @@
|
||||
<div class="t" v-if="global.orderMemberInfo.telephone">
|
||||
会员:{{ global.orderMemberInfo.telephone }}
|
||||
</div>
|
||||
<div class="t" v-if="global.tableInfo.id">台桌:{{ global.tableInfo.name }}</div>
|
||||
<div class="t" v-if="global.tableInfo.id">
|
||||
台桌:{{ global.tableInfo.name }}
|
||||
<span v-if="global.tableInfo.num">/{{ global.tableInfo.num }}人</span>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<el-icon class="arrow">
|
||||
@@ -107,7 +110,8 @@
|
||||
<el-button icon="Edit" @click="remarkRef.show()"></el-button>
|
||||
<div class="button">
|
||||
<div class="btn" v-if="shopStore.info.registerType == 'restaurant'">
|
||||
<el-button type="primary" style="width: 100%;" :disabled="!cartList.length" @click="createOrderHandle(0)">
|
||||
<el-button type="primary" style="width: 100%;" :disabled="!cartList.length" v-loading="createOrderLoading"
|
||||
@click="createOrderHandle(0)">
|
||||
<template v-if="!createOrderLoading">
|
||||
仅下单</template>
|
||||
<template v-else>下单中...</template>
|
||||
@@ -182,6 +186,8 @@ import {
|
||||
createOrder,
|
||||
} from "@/api/product";
|
||||
|
||||
import { orderChoseCount } from '@/api/table.js'
|
||||
|
||||
import { queryShopInfo, staffPermission } from '@/api/user.js'
|
||||
|
||||
// 商品列表
|
||||
@@ -224,6 +230,16 @@ const masterId = ref("");
|
||||
// 挂单量
|
||||
const pendingCartNum = ref(0);
|
||||
|
||||
// 快捷收银
|
||||
async function quickCashHandle() {
|
||||
try {
|
||||
await staffPermission('yun_xu_shou_kuan')
|
||||
fastCashierRef.value.show()
|
||||
} catch (error) {
|
||||
console.log(error);
|
||||
}
|
||||
}
|
||||
|
||||
// 生成订单
|
||||
async function createOrderHandle(t = 0) {
|
||||
try {
|
||||
@@ -245,6 +261,7 @@ async function createOrderHandle(t = 0) {
|
||||
|
||||
if (shopStore.info.registerType == 'restaurant' && t == 0) {
|
||||
ElMessage.success('下单成功')
|
||||
queryCartAjax()
|
||||
} else {
|
||||
settleAccountRef.value.show();
|
||||
}
|
||||
@@ -335,6 +352,7 @@ async function delCartHandle(params) {
|
||||
cartLoading.value = false;
|
||||
cartListActive.value = 0;
|
||||
} catch (error) {
|
||||
cartLoading.value = false;
|
||||
console.log(error);
|
||||
}
|
||||
}
|
||||
@@ -418,8 +436,7 @@ async function queryCartAjax() {
|
||||
masterId: masterId.value,
|
||||
shopId: store.userInfo.shopId,
|
||||
tableId: global.tableInfo.qrcode || '',
|
||||
vipUserId: global.orderMemberInfo.id || '',
|
||||
num: ''
|
||||
vipUserId: global.orderMemberInfo.id || ''
|
||||
});
|
||||
|
||||
if (!res.list.length) {
|
||||
@@ -465,8 +482,23 @@ async function queryCartAjax() {
|
||||
}
|
||||
}
|
||||
|
||||
// 增加点餐人数
|
||||
async function addTableNum() {
|
||||
try {
|
||||
const res = await orderChoseCount({
|
||||
masterId: masterId.value,
|
||||
shopId: store.userInfo.shopId,
|
||||
tableId: global.tableInfo.qrcode,
|
||||
num: global.tableInfo.num
|
||||
})
|
||||
} catch (error) {
|
||||
console.log(error);
|
||||
}
|
||||
}
|
||||
|
||||
// 获取取餐码
|
||||
async function createCodeAjax(type = "0") {
|
||||
console.log(1111)
|
||||
try {
|
||||
// if (!process.env.VITE_DEV_SERVER_URL) {
|
||||
// masterId.value = '#20'
|
||||
@@ -486,7 +518,11 @@ async function createCodeAjax(type = "0") {
|
||||
});
|
||||
masterId.value = res.code;
|
||||
}
|
||||
queryCartAjax();
|
||||
|
||||
if (global.tableInfo.num) {
|
||||
await addTableNum()
|
||||
}
|
||||
await queryCartAjax();
|
||||
|
||||
if (type == 1) {
|
||||
// 结算订单 清楚商品所有红点
|
||||
|
||||
Reference in New Issue
Block a user