From 09781b82e19f07aeab46a6064c6d579381df66f8 Mon Sep 17 00:00:00 2001
From: YeMingfei666 <1619116647@qq.com>
Date: Thu, 10 Oct 2024 11:46:00 +0800
Subject: [PATCH] =?UTF-8?q?=E5=8F=B0=E6=A1=8C=E5=88=97=E8=A1=A8=E4=BF=AE?=
=?UTF-8?q?=E6=94=B9=20=E5=BD=93=E5=8F=B0=E6=A1=8C=E7=8A=B6=E6=80=81?=
=?UTF-8?q?=E4=B8=BA=E5=BC=80=E5=8F=B0=E4=B8=AD=E6=97=B6=20=E5=A6=82?=
=?UTF-8?q?=E6=9E=9C=E5=8F=B0=E6=A1=8C=E6=B2=A1=E6=9C=89=E8=BF=94=E5=9B=9E?=
=?UTF-8?q?=E4=B8=8B=E5=8D=95=E7=94=9F=E6=88=90=E8=AE=A2=E5=8D=95id?=
=?UTF-8?q?=EF=BC=8C=20=E5=B0=86=E5=8F=B0=E6=A1=8C=E5=BD=93=E5=81=9A?=
=?UTF-8?q?=E7=A9=BA=E9=97=B2=E5=A4=84=E7=90=86?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
pageTable/index/components/table-item.vue | 42 ++++++++++++++++-------
1 file changed, 30 insertions(+), 12 deletions(-)
diff --git a/pageTable/index/components/table-item.vue b/pageTable/index/components/table-item.vue
index 1d61d8d..0e72eb1 100644
--- a/pageTable/index/components/table-item.vue
+++ b/pageTable/index/components/table-item.vue
@@ -1,5 +1,5 @@
-
+
{{data.name}}
@@ -18,10 +18,11 @@
- {{returnStutasText(data.status)}}~
+ {{returnStutasText(data.status)}}~
+
-
+
已点{{data.productNum||0}}件
@@ -38,7 +39,7 @@
-
+
选择
@@ -78,19 +79,30 @@
} from '@/http/yskApi/table.js'
import infoBox from '@/commons/utils/infoBox.js'
const status = $status
- const emits = defineEmits(['more','update'])
+ const emits = defineEmits(['more', 'update'])
function returnStutasText(key) {
+ key = returnIsUseing(key)
const item = status[key]
return item ? item.label : ''
}
+ const computedClass = computed(() => {
+ const key = returnIsUseing(props.data.status)
+ return key
+ })
+
+ function returnIsUseing(key) {
+ return key = key == 'using' ? (props.data.orderId ? key : 'idle') : key
+ }
+
function returnStutasColor(key) {
// if(key=='using'){
// return 'rgb(250,85,85)'
// }else{
// return ''
// }
+ key = returnIsUseing(key)
const item = status[key]
return item ? item.type : ''
}
@@ -126,10 +138,10 @@
function more() {
emits('more')
}
-
-
+
+
function diancan() {
- const useType=props.status=='using'?props.data.useType:undefined
+ const useType = props.status == 'using' ? props.data.useType : undefined
go.to('PAGES_CREATE_ORDER', {
tableId: props.data.tableId,
name: props.data.name,
@@ -139,7 +151,7 @@
}
function toOrderDetail() {
- if (props.data.status == 'using') {
+ if (props.data.status == 'using' && props.data.orderId) {
const {
tableId,
name,
@@ -148,19 +160,25 @@
areaId,
orderId
} = props.data
+ if (!orderId) {
+ return uni.showToast({
+ icon: 'none',
+ title: '台桌未返回订单id'
+ })
+ }
go.to('PAGES_ORDER_DETAIL', {
tableId,
name,
status,
amount,
areaId,
- id:orderId
+ id: orderId
})
}
}
function qingtai() {
- const item=props.data
+ const item = props.data
uni.showModal({
title: '提示',
content: '确定要清台:' + props.data.name + '?',
@@ -170,7 +188,7 @@
...item,
status: "idle",
qrcode: item.tableId,
- }).then(res=>{
+ }).then(res => {
infoBox.showToast('清台成功')
emits('update')
})