代码更新

This commit is contained in:
GaoHao
2025-02-26 19:46:20 +08:00
parent 7519ffced3
commit b4a0393d2d
413 changed files with 7483 additions and 60762 deletions

View File

@@ -38,7 +38,7 @@
</template>
<template v-else>
<view class="u-flex u-row-center u-m-t-16">
<template v-if="data.tableId">
<template v-if="data.id">
<template v-if="data.status =='unbind' ">
<my-button color="#333" :width="200" :height="56" type="default" @click="bind">
绑定码牌
@@ -68,25 +68,27 @@
</template>
<script setup>
import * as Api from '@/http/yskApi/Instead.js'
import { computed, ref } from 'vue';
import myButton from '@/components/my-components/my-button'
import go from '@/commons/utils/go.js'
import {hasPermission} from '@/commons/utils/hasPermission.js'
import {
$status
} from '@/commons/table-status.js'
import {
computed,
onMounted,
ref
} from 'vue';
import {
$table
} from '@/http/yskApi/table.js'
import { $status } from '@/commons/table-status.js'
import { $table } from '@/http/yskApi/table.js'
import infoBox from '@/commons/utils/infoBox.js'
const status = $status
const emits = defineEmits(['more', 'update', 'bind'])
const props = defineProps({
data: {
type: Object,
default: () => {
return {}
}
},
areaMap: {
type: Object,
default: () => {}
}
})
const status = $status
function returnStutasText(key) {
key = returnIsUseing(key)
const item = status[key]
@@ -104,46 +106,17 @@
}
function returnStutasColor(key) {
// if(key=='using'){
// return 'rgb(250,85,85)'
// }else{
// return ''
// }
key = returnIsUseing(key)
const item = status[key]
return item ? item.type : ''
}
const props = defineProps({
data: {
type: Object,
default: () => {
return {}
}
},
areaMap: {
type: Object,
default: () => {}
}
})
const goodsList = ref([])
const allPrice = computed(() => {
return goodsList.value.reduce((prve, cur) => {
return prve + cur.salePrice * cur.number
}, 0).toFixed(2)
})
const goodsNumber = computed(() => {
let result = 0
result = goodsList.value.reduce((prve, cur) => {
return prve + cur.number
}, 0)
return result
})
onMounted(() => {})
/**
* 更多
*/
function more() {
if(props.data.status=='closed'){
if(props.data.status=='done'){
return uni.showToast({
icon:'none',
title:'桌台关闭中!'
@@ -152,17 +125,23 @@
emits('more')
}
/**
* 绑定码牌
*/
function bind() {
emits('bind',props.data)
}
/**
* 选择下单
*/
async function diancan() {
hasPermission('允许下单').then(res=>{
console.log(res)
if(res){
const useType = props.status == 'using' ? props.data.useType : undefined
go.to('PAGES_CREATE_ORDER', {
tableId: props.data.tableId,
tableId: props.data.id,
name: props.data.name,
maxCapacity: props.data.maxCapacity,
status: props.data.status,
@@ -172,10 +151,13 @@
}
/**
* 查看订单详情
*/
function toOrderDetail() {
if (props.data.status == 'using' && props.data.orderId) {
const {
tableId,
id,
name,
status,
amount,
@@ -189,7 +171,7 @@
})
}
go.to('PAGES_ORDER_DETAIL', {
tableId,
id,
name,
status,
amount,
@@ -198,7 +180,10 @@
})
}
}
/**
* 清台
*/
function qingtai() {
const item = props.data
uni.showModal({
@@ -209,7 +194,7 @@
$table.update({
...item,
status: "idle",
qrcode: item.tableId,
qrcode: item.id,
}).then(res => {
infoBox.showToast('清台成功')
emits('update')
@@ -221,10 +206,6 @@
</script>
<style lang="scss" scoped>
.gap-10 {
gap: 10rpx;
}
.item {
width: 330rpx;
box-sizing: border-box;