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')
})