|
@@ -10,6 +10,16 @@
|
|
:name="item.name"
|
|
:name="item.name"
|
|
></el-tab-pane>
|
|
></el-tab-pane>
|
|
</el-tabs>
|
|
</el-tabs>
|
|
|
|
+ <div class="p-1 flex-wrap float-left text-center md:w-56 h-20 w-1/3">
|
|
|
|
+ <div style="margin-bottom: 2px">
|
|
|
|
+ <el-input v-model="data.mealCode" placeholder="请输入取餐号" maxlength="10"/>
|
|
|
|
+ </div>
|
|
|
|
+ <div @click="startOrder" class="rounded w-full h-full pt-3 relative" style="background-color: #4A5DFF;color:rgba(255, 255, 255)">
|
|
|
|
+ <p class="font-semibold text-xl" style="font-size: 35px;">
|
|
|
|
+ 点餐台
|
|
|
|
+ </p>
|
|
|
|
+ </div>
|
|
|
|
+ </div>
|
|
<div
|
|
<div
|
|
v-for="i in deskList"
|
|
v-for="i in deskList"
|
|
:key="i"
|
|
:key="i"
|
|
@@ -136,13 +146,13 @@
|
|
import { Loading } from '@element-plus/icons-vue'
|
|
import { Loading } from '@element-plus/icons-vue'
|
|
import { postAll } from '@/api/org/post'
|
|
import { postAll } from '@/api/org/post'
|
|
import {
|
|
import {
|
|
- orderDeskList,
|
|
|
|
- createOrders,
|
|
|
|
- orderCheckout,
|
|
|
|
- orderPay,
|
|
|
|
- queryPayStatus,
|
|
|
|
- cancelOrder,
|
|
|
|
- rockoverDesk
|
|
|
|
|
|
+ orderDeskList,
|
|
|
|
+ createOrders,
|
|
|
|
+ orderCheckout,
|
|
|
|
+ orderPay,
|
|
|
|
+ queryPayStatus,
|
|
|
|
+ cancelOrder,
|
|
|
|
+ rockoverDesk, toEmptyy
|
|
} from '@/api/order'
|
|
} from '@/api/order'
|
|
import Console from './console.vue'
|
|
import Console from './console.vue'
|
|
import { getOrdersCurrent } from '@/api/orders'
|
|
import { getOrdersCurrent } from '@/api/orders'
|
|
@@ -154,6 +164,7 @@ console.log(userStore.userInfo.id + '开始链接客户端')
|
|
const activeName = ref<any>('all')
|
|
const activeName = ref<any>('all')
|
|
const dialogVisible = ref(false)
|
|
const dialogVisible = ref(false)
|
|
const isLoading = ref(false)
|
|
const isLoading = ref(false)
|
|
|
|
+const mealCode = ref('')
|
|
const currentDeskStatus = ref()
|
|
const currentDeskStatus = ref()
|
|
const currentDeskMaxNum = ref<number>()
|
|
const currentDeskMaxNum = ref<number>()
|
|
const currentDeskAmount = ref<number>()
|
|
const currentDeskAmount = ref<number>()
|
|
@@ -166,9 +177,11 @@ const data = reactive({
|
|
userNum: 1, //当前就餐人数
|
|
userNum: 1, //当前就餐人数
|
|
deskId: null,
|
|
deskId: null,
|
|
type: 0, //后台点餐类型:0
|
|
type: 0, //后台点餐类型:0
|
|
- canScan: false
|
|
|
|
|
|
+ canScan: false,
|
|
|
|
+ mealCode: null
|
|
})
|
|
})
|
|
const order_ = (i: any) => {
|
|
const order_ = (i: any) => {
|
|
|
|
+ console.log('***order_***', i)
|
|
dialogVisible.value = true
|
|
dialogVisible.value = true
|
|
currentDesk = i
|
|
currentDesk = i
|
|
currentDeskStatus.value = i.status
|
|
currentDeskStatus.value = i.status
|
|
@@ -177,6 +190,7 @@ const order_ = (i: any) => {
|
|
}
|
|
}
|
|
const order = () => {
|
|
const order = () => {
|
|
dialogVisible.value = false
|
|
dialogVisible.value = false
|
|
|
|
+ data.mealCode = currentDesk.name
|
|
createOrders(data).then((res) => {
|
|
createOrders(data).then((res) => {
|
|
consoleRef.value?.open(currentDesk, data.userNum, res)
|
|
consoleRef.value?.open(currentDesk, data.userNum, res)
|
|
init()
|
|
init()
|
|
@@ -184,6 +198,20 @@ const order = () => {
|
|
console.warn('***order***', currentDesk)
|
|
console.warn('***order***', currentDesk)
|
|
// router.push({ path: '/order/console', query: { deskID: id } })
|
|
// router.push({ path: '/order/console', query: { deskID: id } })
|
|
}
|
|
}
|
|
|
|
+const startOrder = () => {
|
|
|
|
+ if(data.mealCode == null || data.mealCode == '') {
|
|
|
|
+ feedback.notifyError('请输入取餐号')
|
|
|
|
+ return
|
|
|
|
+ }
|
|
|
|
+ currentDeskStatus.value = 0
|
|
|
|
+ data.deskId = 0
|
|
|
|
+ currentDeskMaxNum.value = null
|
|
|
|
+ currentDesk = {
|
|
|
|
+ id: data.deskId,
|
|
|
|
+ name: data.mealCode,
|
|
|
|
+ }
|
|
|
|
+ order();
|
|
|
|
+}
|
|
const rockover = () => {
|
|
const rockover = () => {
|
|
feedback
|
|
feedback
|
|
.confirm('将重置桌号状态, 确定翻台吗?')
|
|
.confirm('将重置桌号状态, 确定翻台吗?')
|
|
@@ -358,6 +386,7 @@ const tabChange = (name: any) => {
|
|
}
|
|
}
|
|
}
|
|
}
|
|
const init = async () => {
|
|
const init = async () => {
|
|
|
|
+ data.mealCode = ''
|
|
let _list: any[] = []
|
|
let _list: any[] = []
|
|
await orderDeskList().then((res: any) => {
|
|
await orderDeskList().then((res: any) => {
|
|
// deskList.value = res
|
|
// deskList.value = res
|
|
@@ -366,10 +395,12 @@ const init = async () => {
|
|
getOrdersCurrent().then((res) => {
|
|
getOrdersCurrent().then((res) => {
|
|
deskList.value = _list.map((item) => {
|
|
deskList.value = _list.map((item) => {
|
|
res.forEach((element: any) => {
|
|
res.forEach((element: any) => {
|
|
|
|
+ if (element.deskId == 0) {
|
|
|
|
+ data.mealCode = element.mealCode
|
|
|
|
+ }
|
|
if (item.id == element.deskId) {
|
|
if (item.id == element.deskId) {
|
|
item.status = element.status
|
|
item.status = element.status
|
|
item.userNum = element.userNum
|
|
item.userNum = element.userNum
|
|
- // item.amount = element.amount
|
|
|
|
item.ordersId = element.number
|
|
item.ordersId = element.number
|
|
if (item.amount) {
|
|
if (item.amount) {
|
|
item.amount += Number.parseFloat(element.amount)
|
|
item.amount += Number.parseFloat(element.amount)
|