优化台桌状态以及颜色
This commit is contained in:
@@ -1,87 +1,260 @@
|
|||||||
|
|
||||||
export default {
|
export default {
|
||||||
orderStatus: [
|
orderStatus: [{
|
||||||
{ label: "待支付", type: "unpaid" },
|
label: "待支付",
|
||||||
{ label: "制作中", type: "in_production" },
|
type: "unpaid"
|
||||||
{ label: "待取餐", type: "wait_out" },
|
},
|
||||||
{ label: "订单完成", type: "done" },
|
{
|
||||||
{ label: "申请退单", type: "refunding" },
|
label: "制作中",
|
||||||
{ label: "退单", type: "refund" },
|
type: "in_production"
|
||||||
{ label: "部分退单", type: "part_refund" },
|
},
|
||||||
{ label: "取消订单", type: "cancelled" },
|
{
|
||||||
|
label: "待取餐",
|
||||||
|
type: "wait_out"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
label: "订单完成",
|
||||||
|
type: "done"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
label: "申请退单",
|
||||||
|
type: "refunding"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
label: "退单",
|
||||||
|
type: "refund"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
label: "部分退单",
|
||||||
|
type: "part_refund"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
label: "取消订单",
|
||||||
|
type: "cancelled"
|
||||||
|
},
|
||||||
],
|
],
|
||||||
orderType: [
|
orderType: [{
|
||||||
{ label: "收银", type: "cash" },
|
label: "收银",
|
||||||
{ label: "小程序", type: "miniapp" },
|
type: "cash"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
label: "小程序",
|
||||||
|
type: "miniapp"
|
||||||
|
},
|
||||||
],
|
],
|
||||||
dineMode: [
|
dineMode: [{
|
||||||
{ label: "堂食", type: "dine-in" },
|
label: "堂食",
|
||||||
{ label: "外带", type: "take-out" },
|
type: "dine-in"
|
||||||
{ label: "外卖", type: "take-away" },
|
},
|
||||||
],
|
{
|
||||||
payType: [
|
label: "外带",
|
||||||
{ label: "主扫", type: "main_scan" },
|
type: "take-out"
|
||||||
{ label: "被扫", type: "back_scan" },
|
},
|
||||||
{ label: "微信小程序", type: "wechat_mini" },
|
{
|
||||||
{ label: "支付宝小程序", type: "alipay_mini" },
|
label: "外卖",
|
||||||
{ label: "会员支付", type: "vip_pay" },
|
type: "take-away"
|
||||||
{ label: "现金支付", type: "cash_pay" },
|
},
|
||||||
{ label: "挂账支付", type: "credit_pay" },
|
],
|
||||||
],
|
payType: [{
|
||||||
bizCodes: [
|
label: "主扫",
|
||||||
{ label: "现金充值", type: "cashIn" },
|
type: "main_scan"
|
||||||
{ label: "微信小程序充值", type: "wechatIn" },
|
},
|
||||||
{ label: "支付宝小程序充值", type: "alipayIn" },
|
{
|
||||||
{ label: "充值奖励", type: "awardIn" },
|
label: "被扫",
|
||||||
{ label: "充值退款", type: "rechargeRefund" },
|
type: "back_scan"
|
||||||
{ label: "订单消费", type: "orderPay" },
|
},
|
||||||
{ label: "订单退款", type: "orderRefund" },
|
{
|
||||||
{ label: "管理员充值", type: "adminIn" },
|
label: "微信小程序",
|
||||||
{ label: "管理员消费", type: "adminOut" },
|
type: "wechat_mini"
|
||||||
],
|
},
|
||||||
platformType: [
|
{
|
||||||
{ label: '微信小程序', type: 'WX' },
|
label: "支付宝小程序",
|
||||||
{ label: '支付宝小程序', type: 'ALI' },
|
type: "alipay_mini"
|
||||||
{ label: '收银机客户端', type: 'PC' },
|
},
|
||||||
{ label: 'PC管理端', type: 'WEB' },
|
{
|
||||||
{ label: 'APP管理端', type: 'APP' },
|
label: "会员支付",
|
||||||
{ label: '收款码', type: 'H5' },
|
type: "vip_pay"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
label: "现金支付",
|
||||||
|
type: "cash_pay"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
label: "挂账支付",
|
||||||
|
type: "credit_pay"
|
||||||
|
},
|
||||||
|
],
|
||||||
|
bizCodes: [{
|
||||||
|
label: "现金充值",
|
||||||
|
type: "cashIn"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
label: "微信小程序充值",
|
||||||
|
type: "wechatIn"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
label: "支付宝小程序充值",
|
||||||
|
type: "alipayIn"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
label: "充值奖励",
|
||||||
|
type: "awardIn"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
label: "充值退款",
|
||||||
|
type: "rechargeRefund"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
label: "订单消费",
|
||||||
|
type: "orderPay"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
label: "订单退款",
|
||||||
|
type: "orderRefund"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
label: "管理员充值",
|
||||||
|
type: "adminIn"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
label: "管理员消费",
|
||||||
|
type: "adminOut"
|
||||||
|
},
|
||||||
|
],
|
||||||
|
platformType: [{
|
||||||
|
label: '微信小程序',
|
||||||
|
type: 'WX'
|
||||||
|
},
|
||||||
|
{
|
||||||
|
label: '支付宝小程序',
|
||||||
|
type: 'ALI'
|
||||||
|
},
|
||||||
|
{
|
||||||
|
label: '收银机客户端',
|
||||||
|
type: 'PC'
|
||||||
|
},
|
||||||
|
{
|
||||||
|
label: 'PC管理端',
|
||||||
|
type: 'WEB'
|
||||||
|
},
|
||||||
|
{
|
||||||
|
label: 'APP管理端',
|
||||||
|
type: 'APP'
|
||||||
|
},
|
||||||
|
{
|
||||||
|
label: '收款码',
|
||||||
|
type: 'H5'
|
||||||
|
},
|
||||||
],
|
],
|
||||||
tableStatus: {
|
tableStatus: {
|
||||||
idle: { label: "空闲", type: "#3F9EFF" },
|
unbound: {
|
||||||
using: { label: "使用中", type: "#fa5555" },
|
label: "未绑定",
|
||||||
subscribe: { label: "预定", type: "rgb(34, 191, 100)" },
|
type: "#909090"
|
||||||
closed: { label: "关台", type: "rgb(221,221,221)" },
|
},
|
||||||
opening: { label: "开台中", type: "#E6A23C" },
|
idle: {
|
||||||
cleaning: { label: "待清台", type: "#FAAD14" },
|
label: "空闲",
|
||||||
paying: { label: "结算中", type: "#E6A23C" },
|
type: "#3F9EFF"
|
||||||
unbind: { label: "未绑定", type: "rgb(221,221,221)" }
|
},
|
||||||
|
ordering: {
|
||||||
|
label: "点餐中",
|
||||||
|
type: "#46AEA4"
|
||||||
|
},
|
||||||
|
unsettled: {
|
||||||
|
label: "未结账",
|
||||||
|
type: "#DD3F41"
|
||||||
|
},
|
||||||
|
paying: {
|
||||||
|
label: "支付中",
|
||||||
|
type: "#909090"
|
||||||
|
},
|
||||||
|
settled: {
|
||||||
|
label: "待清台",
|
||||||
|
type: "#FF9500"
|
||||||
|
},
|
||||||
|
closed: {
|
||||||
|
label: "关台",
|
||||||
|
type: "#DDDDDD"
|
||||||
|
},
|
||||||
|
subscribe: {
|
||||||
|
label: "预定",
|
||||||
|
type: "#58B22C"
|
||||||
|
},
|
||||||
},
|
},
|
||||||
invoicingType: [
|
invoicingType: [{
|
||||||
{ label: '全部', type: '' },
|
label: '全部',
|
||||||
{ label: '手动入库', type: 'manual-in' },
|
type: ''
|
||||||
{ label: '手动出库', type: 'manual-out' },
|
},
|
||||||
{ label: '盘盈入库', type: 'win-in' },
|
{
|
||||||
{ label: '盘亏出库', type: 'loss-out' },
|
label: '手动入库',
|
||||||
{ label: '订单退款入库', type: 'other-out' },
|
type: 'manual-in'
|
||||||
{ label: '订单消费出库', type: 'order-out' },
|
},
|
||||||
{ label: '损耗出库', type: 'damage-out' },
|
{
|
||||||
|
label: '手动出库',
|
||||||
|
type: 'manual-out'
|
||||||
|
},
|
||||||
|
{
|
||||||
|
label: '盘盈入库',
|
||||||
|
type: 'win-in'
|
||||||
|
},
|
||||||
|
{
|
||||||
|
label: '盘亏出库',
|
||||||
|
type: 'loss-out'
|
||||||
|
},
|
||||||
|
{
|
||||||
|
label: '订单退款入库',
|
||||||
|
type: 'other-out'
|
||||||
|
},
|
||||||
|
{
|
||||||
|
label: '订单消费出库',
|
||||||
|
type: 'order-out'
|
||||||
|
},
|
||||||
|
{
|
||||||
|
label: '损耗出库',
|
||||||
|
type: 'damage-out'
|
||||||
|
},
|
||||||
],
|
],
|
||||||
invoicingType: [
|
invoicingType: [{
|
||||||
{ label: '全部', type: '' },
|
label: '全部',
|
||||||
{ label: '手动入库', type: 'manual-in' },
|
type: ''
|
||||||
{ label: '手动出库', type: 'manual-out' },
|
},
|
||||||
{ label: '盘盈入库', type: 'win-in' },
|
{
|
||||||
{ label: '盘亏出库', type: 'loss-out' },
|
label: '手动入库',
|
||||||
{ label: '订单退款入库', type: 'other-out' },
|
type: 'manual-in'
|
||||||
{ label: '订单消费出库', type: 'order-out' },
|
},
|
||||||
{ label: '损耗出库', type: 'damage-out' },
|
{
|
||||||
|
label: '手动出库',
|
||||||
|
type: 'manual-out'
|
||||||
|
},
|
||||||
|
{
|
||||||
|
label: '盘盈入库',
|
||||||
|
type: 'win-in'
|
||||||
|
},
|
||||||
|
{
|
||||||
|
label: '盘亏出库',
|
||||||
|
type: 'loss-out'
|
||||||
|
},
|
||||||
|
{
|
||||||
|
label: '订单退款入库',
|
||||||
|
type: 'other-out'
|
||||||
|
},
|
||||||
|
{
|
||||||
|
label: '订单消费出库',
|
||||||
|
type: 'order-out'
|
||||||
|
},
|
||||||
|
{
|
||||||
|
label: '损耗出库',
|
||||||
|
type: 'damage-out'
|
||||||
|
},
|
||||||
],
|
],
|
||||||
refundType: [
|
refundType: [{
|
||||||
{ label: '现金退款', type: 'cash' },
|
label: '现金退款',
|
||||||
{ label: '原路退回', type: 'payBack' },
|
type: 'cash'
|
||||||
|
},
|
||||||
|
{
|
||||||
|
label: '原路退回',
|
||||||
|
type: 'payBack'
|
||||||
|
},
|
||||||
],
|
],
|
||||||
getDiceName(val,key){
|
getDiceName(val, key) {
|
||||||
let item = this[key].find(v => v.type == val)
|
let item = this[key].find(v => v.type == val)
|
||||||
return item ? item.label : ''
|
return item ? item.label : ''
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,194 +1,184 @@
|
|||||||
<template>
|
<template>
|
||||||
<view class="item color-fff border-r-12" :class="[computedClass]">
|
<view class="item color-fff border-r-12" :class="[computedClass]">
|
||||||
<view class="my-bg-main" :style="{'background-color':returnStutasColor(data.status)}">
|
<view class="my-bg-main" :style="{ 'background-color': returnStutasColor(data.status) }">
|
||||||
<view class="u-flex u-row-between">
|
<view class="u-flex u-row-between">
|
||||||
<view class="u-font-32">{{data.name}}</view>
|
<view class="u-font-32">{{ data.name }}</view>
|
||||||
<view class="u-flex" @tap.stop="more">
|
<view class="u-flex" @tap.stop="more">
|
||||||
<uni-icons type="more-filled" color="#fff" size="16"></uni-icons>
|
<uni-icons type="more-filled" color="#fff" size="16"></uni-icons>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
<view class="u-flex u-m-t-10 u-row-between">
|
<view class="u-flex u-m-t-10 u-row-between">
|
||||||
<view>{{areaMap[data.areaId]||'' }}</view>
|
<view>{{ areaMap[data.areaId] || '' }}</view>
|
||||||
<view class="tag" :style="{color:returnStutasColor(data.status)}">
|
<view class="tag" :style="{ color: returnStutasColor(data.status) }">
|
||||||
{{returnStutasText(data.status)}}
|
{{ returnStutasText(data.status) }}
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
|
|
||||||
</view>
|
</view>
|
||||||
<view class="u-flex u-flex-col u-row-center u-col-center bg-fff bottom">
|
<view class="u-flex u-flex-col u-row-center u-col-center bg-fff bottom">
|
||||||
<template v-if="data.status!='using'">
|
<template v-if="data.status != 'using'">
|
||||||
<view class=" u-font-32" :style="{color:returnStutasColor(data.status)}">
|
<view class="u-font-32" :style="{ color: returnStutasColor(data.status) }">{{ returnStutasText(data.status) }}~</view>
|
||||||
{{returnStutasText(data.status)}}~
|
|
||||||
</view>
|
|
||||||
</template>
|
</template>
|
||||||
<view class=" w-full u-p-l-16 u-p-r-16 u-p-t-16 u-font-24">
|
<view class="w-full u-p-l-16 u-p-r-16 u-p-t-16 u-font-24">
|
||||||
<template v-if="data.status=='using'&& data.orderId">
|
<template v-if="data.status == 'using' && data.orderId">
|
||||||
<view class="color-666 u-text-left u-p-b-20 border-bottom">
|
<view class="color-666 u-text-left u-p-b-20 border-bottom">
|
||||||
<view class=""><text>已点</text><text class="u-m-l-20 color-333">{{data.productNum||0}}件</text>
|
<view class="">
|
||||||
|
<text>已点</text>
|
||||||
|
<text class="u-m-l-20 color-333">{{ data.productNum || 0 }}件</text>
|
||||||
|
</view>
|
||||||
|
<view class="u-m-t-10">
|
||||||
|
<text>金额</text>
|
||||||
|
<text class="u-m-l-20 color-333">{{ data.totalAmount || 0 }} 元</text>
|
||||||
|
</view>
|
||||||
|
<view class="u-m-t-10">
|
||||||
|
<text>待结</text>
|
||||||
|
<text class="u-m-l-20 color-333">{{ data.totalAmount || 0 }} 元</text>
|
||||||
</view>
|
</view>
|
||||||
<view class="u-m-t-10"><text>金额</text><text class="u-m-l-20 color-333">{{data.totalAmount||0}}
|
|
||||||
元</text> </view>
|
|
||||||
<view class="u-m-t-10"><text>待结</text><text class="u-m-l-20 color-333">{{data.totalAmount||0}}
|
|
||||||
元</text> </view>
|
|
||||||
</view>
|
</view>
|
||||||
<view class="u-flex u-row-between u-font-20 u-p-b-20 u-p-t-20">
|
<view class="u-flex u-row-between u-font-20 u-p-b-20 u-p-t-20">
|
||||||
<text class="color-333">开台时间</text>
|
<text class="color-333">开台时间</text>
|
||||||
<text class="color-666"> {{data.useTime}}</text>
|
<text class="color-666">{{ data.useTime }}</text>
|
||||||
</view>
|
</view>
|
||||||
</template>
|
</template>
|
||||||
<template v-else>
|
<template v-else>
|
||||||
<view class="u-flex u-row-center u-m-t-16">
|
<view class="u-flex u-row-center u-m-t-16">
|
||||||
<template v-if="data.id">
|
<template v-if="data.id">
|
||||||
<template v-if="data.status =='unbind' ">
|
<template v-if="data.status == 'unbind'">
|
||||||
<my-button color="#333" :width="200" :height="56" type="default" @click="bind">
|
<my-button color="#333" :width="200" :height="56" type="default" @click="bind">绑定码牌</my-button>
|
||||||
绑定码牌
|
|
||||||
</my-button>
|
|
||||||
</template>
|
</template>
|
||||||
<template v-if="data.status=='idle'||(data.status=='using'&&!data.orderId) ">
|
<template v-if="data.status == 'idle' || (data.status == 'using' && !data.orderId)">
|
||||||
<my-button color="#333" :width="150" :height="56" type="default" @click="diancan">
|
<my-button color="#333" :width="150" :height="56" type="default" @click="diancan">选择</my-button>
|
||||||
选择
|
|
||||||
</my-button>
|
|
||||||
</template>
|
</template>
|
||||||
<template v-if="data.status=='cleaning' ">
|
<template v-if="data.status == 'cleaning'">
|
||||||
<my-button color="#333" :width="150" :height="56" type="default" @click="qingtai">
|
<my-button color="#333" :width="150" :height="56" type="default" @click="qingtai">清台</my-button>
|
||||||
清台
|
|
||||||
</my-button>
|
|
||||||
</template>
|
</template>
|
||||||
</template>
|
</template>
|
||||||
<my-button v-else :width="150" :height="56" type="default" disabled>
|
<my-button v-else :width="150" :height="56" type="default" disabled>选择</my-button>
|
||||||
选择
|
|
||||||
</my-button>
|
|
||||||
</view>
|
</view>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
|
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script setup>
|
<script setup>
|
||||||
import { computed, ref } from 'vue';
|
import { computed, ref } from 'vue';
|
||||||
import myButton from '@/components/my-components/my-button'
|
import myButton from '@/components/my-components/my-button';
|
||||||
import go from '@/commons/utils/go.js'
|
import go from '@/commons/utils/go.js';
|
||||||
import { hasPermission } from '@/commons/utils/hasPermission.js'
|
import { hasPermission } from '@/commons/utils/hasPermission.js';
|
||||||
import { shopTableClear } from '@/http/api/table.js'
|
import { shopTableClear } from '@/http/api/table.js';
|
||||||
|
|
||||||
const emits = defineEmits(['more', 'update', 'bind'])
|
const emits = defineEmits(['more', 'update', 'bind']);
|
||||||
const props = defineProps({
|
const props = defineProps({
|
||||||
data: {
|
data: {
|
||||||
type: Object,
|
type: Object,
|
||||||
default: () => {
|
default: () => {
|
||||||
return {}
|
return {};
|
||||||
}
|
|
||||||
},
|
|
||||||
areaMap: {
|
|
||||||
type: Object,
|
|
||||||
default: () => {}
|
|
||||||
}
|
}
|
||||||
})
|
},
|
||||||
|
areaMap: {
|
||||||
const computedClass = computed(() => {
|
type: Object,
|
||||||
return props.data.status
|
default: () => {}
|
||||||
})
|
|
||||||
|
|
||||||
function returnStutasText(key) {
|
|
||||||
const item = uni.$dict.tableStatus[key]
|
|
||||||
return item ? item.label : ''
|
|
||||||
}
|
}
|
||||||
|
});
|
||||||
function returnStutasColor(key) {
|
|
||||||
const item = uni.$dict.tableStatus[key]
|
const computedClass = computed(() => {
|
||||||
return item ? item.type : ''
|
return props.data.status;
|
||||||
|
});
|
||||||
|
|
||||||
|
function returnStutasText(key) {
|
||||||
|
const item = uni.$dict.tableStatus[key];
|
||||||
|
return item ? item.label : '';
|
||||||
|
}
|
||||||
|
|
||||||
|
function returnStutasColor(key) {
|
||||||
|
const item = uni.$dict.tableStatus[key];
|
||||||
|
return item ? item.type : '';
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 更多
|
||||||
|
*/
|
||||||
|
function more() {
|
||||||
|
if (props.data.status == 'done') {
|
||||||
|
return uni.showToast({
|
||||||
|
icon: 'none',
|
||||||
|
title: '桌台关闭中!'
|
||||||
|
});
|
||||||
}
|
}
|
||||||
|
emits('more');
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 绑定码牌
|
||||||
|
*/
|
||||||
|
function bind() {
|
||||||
|
emits('bind', props.data);
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 更多
|
* 选择下单
|
||||||
*/
|
*/
|
||||||
function more() {
|
async function diancan() {
|
||||||
if(props.data.status=='done'){
|
hasPermission('允许下单').then((res) => {
|
||||||
return uni.showToast({
|
console.log(res);
|
||||||
icon:'none',
|
if (res) {
|
||||||
title:'桌台关闭中!'
|
const useType = props.status == 'using' ? props.data.useType : undefined;
|
||||||
})
|
console.log(props.data);
|
||||||
|
go.to('PAGES_CREATE_ORDER', props.data);
|
||||||
}
|
}
|
||||||
emits('more')
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 绑定码牌
|
* 清台
|
||||||
*/
|
*/
|
||||||
function bind() {
|
function qingtai() {
|
||||||
emits('bind',props.data)
|
let item = props.data;
|
||||||
}
|
uni.showModal({
|
||||||
|
title: '提示',
|
||||||
/**
|
content: '确定要清台:' + item.name + '?',
|
||||||
* 选择下单
|
success(res) {
|
||||||
*/
|
if (res.confirm) {
|
||||||
async function diancan() {
|
shopTableClear({
|
||||||
hasPermission('允许下单').then(res=>{
|
id: item.id
|
||||||
console.log(res)
|
}).then((res) => {
|
||||||
if(res){
|
uni.$utils.showToast('清台成功');
|
||||||
const useType = props.status == 'using' ? props.data.useType : undefined
|
emits('update');
|
||||||
console.log(props.data)
|
});
|
||||||
go.to('PAGES_CREATE_ORDER', props.data)
|
|
||||||
}
|
}
|
||||||
})
|
}
|
||||||
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* 清台
|
|
||||||
*/
|
|
||||||
function qingtai() {
|
|
||||||
let item = props.data
|
|
||||||
uni.showModal({
|
|
||||||
title: '提示',
|
|
||||||
content: '确定要清台:' + item.name + '?',
|
|
||||||
success(res) {
|
|
||||||
if (res.confirm) {
|
|
||||||
shopTableClear({
|
|
||||||
id: item.id,
|
|
||||||
}).then(res => {
|
|
||||||
uni.$utils.showToast('清台成功')
|
|
||||||
emits('update')
|
|
||||||
})
|
|
||||||
}
|
|
||||||
}
|
|
||||||
})
|
|
||||||
}
|
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<style lang="scss" scoped>
|
<style lang="scss" scoped>
|
||||||
.item {
|
.item {
|
||||||
width: 330rpx;
|
width: 330rpx;
|
||||||
box-sizing: border-box;
|
box-sizing: border-box;
|
||||||
overflow: hidden;
|
overflow: hidden;
|
||||||
box-shadow: 1px 1px 0 #eee;
|
box-shadow: 1px 1px 0 #eee;
|
||||||
border-color: #eee;
|
border-color: #eee;
|
||||||
|
|
||||||
.bottom {
|
|
||||||
min-height: 224rpx;
|
|
||||||
}
|
|
||||||
|
|
||||||
.my-bg-main {
|
|
||||||
padding: 32rpx 28rpx;
|
|
||||||
|
|
||||||
.tag {
|
|
||||||
background-color: rgba(255, 255, 255, .7);
|
|
||||||
font-size: 24rpx;
|
|
||||||
color: $my-main-color;
|
|
||||||
border-radius: 8rpx;
|
|
||||||
padding: 2rpx 10rpx;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
&.using {
|
|
||||||
.tag {
|
|
||||||
color: rgb(250, 85, 85);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
|
.bottom {
|
||||||
|
min-height: 224rpx;
|
||||||
}
|
}
|
||||||
</style>
|
|
||||||
|
.my-bg-main {
|
||||||
|
padding: 24rpx 28rpx;
|
||||||
|
|
||||||
|
.tag {
|
||||||
|
background-color: rgba(255, 255, 255, 0.7);
|
||||||
|
font-size: 24rpx;
|
||||||
|
color: $my-main-color;
|
||||||
|
border-radius: 8rpx;
|
||||||
|
padding: 2rpx 10rpx;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
&.using {
|
||||||
|
.tag {
|
||||||
|
color: rgb(250, 85, 85);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
</style>
|
||||||
|
|||||||
@@ -1,28 +1,29 @@
|
|||||||
<template>
|
<template>
|
||||||
<view class="color-333 u-font-28 min-page bg-gray ">
|
<view class="color-333 u-font-28 min-page bg-gray">
|
||||||
|
|
||||||
<up-sticky>
|
<up-sticky>
|
||||||
<view class="bg-fff u-p-l-30 u-p-b-30 u-relative">
|
<view class="bg-fff u-p-l-30 u-p-b-30 u-relative">
|
||||||
|
|
||||||
<view class="input-wrapper">
|
<view class="input-wrapper">
|
||||||
<view class="input-main">
|
<view class="input-main">
|
||||||
<view class="u-flex u-p-r-30 u-font-28" @click="pageData.statusShow = !pageData.statusShow">
|
<view class="u-flex u-p-r-30 u-font-28" @click="pageData.statusShow = !pageData.statusShow">
|
||||||
<text class="u-m-r-10 u-line-1 " :class="{'color-main':pageData.query.status!=''}"
|
<text class="u-m-r-10 u-line-1" :class="{ 'color-main': pageData.query.status != '' }" style="max-width: 100rpx">{{ pageData.statusName }}</text>
|
||||||
style="max-width: 100rpx;">{{pageData.statusName }}</text>
|
|
||||||
<up-icon name="arrow-down" size="16"></up-icon>
|
<up-icon name="arrow-down" size="16"></up-icon>
|
||||||
</view>
|
</view>
|
||||||
<uni-easyinput clearable class='jeepay-search' :inputBorder="false"
|
<uni-easyinput
|
||||||
|
clearable
|
||||||
|
class="jeepay-search"
|
||||||
|
:inputBorder="false"
|
||||||
trim="all"
|
trim="all"
|
||||||
placeholder="搜索"
|
placeholder="搜索"
|
||||||
v-model="pageData.query.name"
|
v-model="pageData.query.name"
|
||||||
@clear="searchConfirm"
|
@clear="searchConfirm"
|
||||||
@confirm="searchConfirm">
|
@confirm="searchConfirm"
|
||||||
|
>
|
||||||
<template #prefixIcon>
|
<template #prefixIcon>
|
||||||
<image src="@/static/iconImg/icon-search.svg" class="input-icon" />
|
<image src="@/static/iconImg/icon-search.svg" class="input-icon" />
|
||||||
</template>
|
</template>
|
||||||
</uni-easyinput>
|
</uni-easyinput>
|
||||||
<view class="u-m-l-4">
|
<view class="u-m-l-4">
|
||||||
<button class="" type="text" @click="searchConfirm"> <text class="color-333">搜索</text></button>
|
<button class="" type="text" @click="searchConfirm"><text class="color-333">搜索</text></button>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
@@ -30,423 +31,427 @@
|
|||||||
</up-sticky>
|
</up-sticky>
|
||||||
|
|
||||||
<view class="list u-p-30">
|
<view class="list u-p-30">
|
||||||
<view class="my-bg-main table-type u-flex border-r-12 color-fff ">
|
<view class="my-bg-main table-type u-flex border-r-12 color-fff">
|
||||||
<view class="item u-p-20" :class="{sel:pageData.area.sel===item.id}" @tap="changeAreaSel(item)"
|
<view class="item u-p-20" :class="{ sel: pageData.area.sel == '' }" @tap="changeAreaSel({ id: '' })">
|
||||||
v-for="(item,index) in pageData.area.list" :key="index">
|
|
||||||
<view class="box">
|
<view class="box">
|
||||||
<view class='up-line-1'>{{item.name}}</view>
|
<view class="up-line-1">全部</view>
|
||||||
<view class="u-m-t-10">0/12</view>
|
<!-- <view class="u-m-t-10">0/12</view> -->
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
<view class="item u-p-20" :class="{ sel: pageData.area.sel === item.id }" @tap="changeAreaSel(item)" v-for="(item, index) in pageData.area.list" :key="index">
|
||||||
|
<view class="box">
|
||||||
|
<view class="up-line-1">{{ item.name }}</view>
|
||||||
|
<!-- <view class="u-m-t-10">0/12</view> -->
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
|
|
||||||
<view class="u-m-t-30 ">
|
<view class="u-m-t-30">
|
||||||
<template v-if="pageData.tabList.length">
|
<template v-if="pageData.tabList.length">
|
||||||
<view class="u-flex u-flex-wrap u-row-between">
|
<view class="u-flex u-flex-wrap u-row-between">
|
||||||
<view class="u-m-b-30" v-for="(item,index) in pageData.tabList" :key="index">
|
<view class="u-m-b-30" v-for="(item, index) in pageData.tabList" :key="index">
|
||||||
<table-item @bind="scanCode" @update="getTable" :areaMap="pageData.areaMap" @more="moreShow(item)" :data="item"></table-item>
|
<table-item @bind="scanCode" @update="getTable" :areaMap="pageData.areaMap" @more="moreShow(item)" :data="item"></table-item>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
<my-pagination :page="pageData.query.page" :totalElements="pageData.totalElements" :size="pageData.query.size"
|
<my-pagination :page="pageData.query.page" :totalElements="pageData.totalElements" :size="pageData.query.size" @change="pageChange"></my-pagination>
|
||||||
@change="pageChange"></my-pagination>
|
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<my-img-empty v-if="pageData.hasAjax&&!pageData.tabList.length" tips="未找到相关桌台"></my-img-empty>
|
<my-img-empty v-if="pageData.hasAjax && !pageData.tabList.length" tips="未找到相关桌台"></my-img-empty>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
|
|
||||||
</view>
|
</view>
|
||||||
<my-action-sheet :active="4" @itemClick="actionSheetClick" ref="refMoreSheet" :list="actionSheet.list"
|
<my-action-sheet :active="4" @itemClick="actionSheetClick" ref="refMoreSheet" :list="actionSheet.list" :title="actionSheet.title">
|
||||||
:title="actionSheet.title">
|
|
||||||
<template #title>
|
<template #title>
|
||||||
<view class="color-999 u-p-30 u-text-center border-bottom">桌号:{{actionSheet.title}}</view>
|
<view class="color-999 u-p-30 u-text-center border-bottom">桌号:{{ actionSheet.title }}</view>
|
||||||
</template>
|
</template>
|
||||||
</my-action-sheet>
|
</my-action-sheet>
|
||||||
<up-picker :show="pageData.statusShow" :columns="pageData.statusList" keyName="label" @cancel="pageData.statusShow=false" @confirm="confirmStatus" ></up-picker>
|
<up-picker :show="pageData.statusShow" :columns="pageData.statusList" keyName="label" @cancel="pageData.statusShow = false" @confirm="confirmStatus"></up-picker>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script setup>
|
<script setup>
|
||||||
import { onLoad, onReady, onShow, } from '@dcloudio/uni-app';
|
import { onLoad, onReady, onShow } from '@dcloudio/uni-app';
|
||||||
import { ref, reactive, computed, watch } from 'vue';
|
import { ref, reactive, computed, watch } from 'vue';
|
||||||
|
|
||||||
import tableItem from './components/table-item'
|
|
||||||
|
|
||||||
import go from '@/commons/utils/go.js';
|
|
||||||
import myActionSheet from '@/components/my-components/my-action-sheet';
|
|
||||||
import { hasPermission } from '@/commons/utils/hasPermission.js'
|
|
||||||
|
|
||||||
import { getShopTable, shopTableBind, shopTableClear } from '@/http/api/table.js'
|
|
||||||
import { getShopArea } from '@/http/api/area.js'
|
|
||||||
import { printOrder } from '@/http/api/order.js'
|
|
||||||
import { getHistoryOrder } from '@/http/api/order.js'
|
|
||||||
|
|
||||||
const pageData = reactive({
|
|
||||||
statusShow: false,
|
|
||||||
hasAjax: false,
|
|
||||||
areaMap: {},
|
|
||||||
query: {
|
|
||||||
page: 1,
|
|
||||||
size: 10,
|
|
||||||
status: '',
|
|
||||||
areaId: '',
|
|
||||||
name: '',
|
|
||||||
},
|
|
||||||
totalElements:0,
|
|
||||||
statusList: [[{
|
|
||||||
key: '',
|
|
||||||
label: '全部'
|
|
||||||
},...uni.$utils.objToArrary(uni.$dict.tableStatus)]],
|
|
||||||
statusName: '全部',
|
|
||||||
tabList: [],
|
|
||||||
area: {
|
|
||||||
list: [],
|
|
||||||
sel: ''
|
|
||||||
},
|
|
||||||
orderInfo: null,
|
|
||||||
})
|
|
||||||
|
|
||||||
const refMoreSheet = ref(null)
|
import tableItem from './components/table-item';
|
||||||
const actionSheet = reactive({
|
|
||||||
list: ['结账', '清台', '增减菜', '换台', '打印订单', '历史订单','绑定码牌'],
|
|
||||||
title: '',
|
|
||||||
selTable: ''
|
|
||||||
})
|
|
||||||
|
|
||||||
watch(() => pageData.area.sel, (newval) => {
|
import go from '@/commons/utils/go.js';
|
||||||
pageData.query.page = 1
|
import myActionSheet from '@/components/my-components/my-action-sheet';
|
||||||
getTable()
|
import { hasPermission } from '@/commons/utils/hasPermission.js';
|
||||||
})
|
|
||||||
|
|
||||||
onShow(opt => {
|
import { getShopTable, shopTableBind, shopTableClear } from '@/http/api/table.js';
|
||||||
getData()
|
import { getShopArea } from '@/http/api/area.js';
|
||||||
})
|
import { printOrder } from '@/http/api/order.js';
|
||||||
function getData() {
|
import { getHistoryOrder } from '@/http/api/order.js';
|
||||||
getTable()
|
|
||||||
getArea()
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
const pageData = reactive({
|
||||||
* 获取桌台列表
|
statusShow: false,
|
||||||
*/
|
hasAjax: false,
|
||||||
async function getTable() {
|
areaMap: {},
|
||||||
const res = await getShopTable(pageData.query)
|
query: {
|
||||||
pageData.hasAjax = true
|
page: 1,
|
||||||
pageData.tabList = res.records
|
size: 10,
|
||||||
pageData.totalElements = res.totalRow
|
status: '',
|
||||||
}
|
areaId: '',
|
||||||
|
name: ''
|
||||||
/**
|
},
|
||||||
* 获取区域
|
totalElements: 0,
|
||||||
*/
|
statusList: [
|
||||||
async function getArea() {
|
[
|
||||||
const res = await getShopArea({ name: '', page: 1, size: 300 })
|
{
|
||||||
pageData.area.list = res.records
|
key: '',
|
||||||
pageData.areaMap = res.records.reduce((prve, cur) => {
|
label: '全部'
|
||||||
prve[cur.id] = cur.name
|
},
|
||||||
return prve
|
...uni.$utils.objToArrary(uni.$dict.tableStatus)
|
||||||
}, {})
|
]
|
||||||
}
|
],
|
||||||
|
statusName: '全部',
|
||||||
/**
|
tabList: [],
|
||||||
* 类型选择
|
area: {
|
||||||
* @param {Object} e
|
list: [],
|
||||||
*/
|
sel: ''
|
||||||
function confirmStatus(e){
|
},
|
||||||
pageData.statusShow = false
|
orderInfo: null
|
||||||
pageData.query.status = e.value[0].key
|
});
|
||||||
pageData.statusName = e.value[0].label
|
|
||||||
getTable()
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
const refMoreSheet = ref(null);
|
||||||
* 区域选择确定
|
const actionSheet = reactive({
|
||||||
* @param {Object} item
|
list: ['结账', '清台', '增减菜', '换台', '打印订单', '历史订单', '绑定码牌'],
|
||||||
*/
|
title: '',
|
||||||
function changeAreaSel(item) {
|
selTable: ''
|
||||||
pageData.area.sel = item.id
|
});
|
||||||
pageData.query.areaId = item.id
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 更多操作打开
|
|
||||||
* @param {Object} table
|
|
||||||
*/
|
|
||||||
function moreShow(table) {
|
|
||||||
actionSheet.title = table.name
|
|
||||||
actionSheet.selTable = table
|
|
||||||
refMoreSheet.value.open()
|
|
||||||
if( actionSheet.selTable.orderId ){
|
|
||||||
getHistoryOrder({orderId: actionSheet.selTable.orderId}).then(res=>{
|
|
||||||
pageData.orderInfo = res
|
|
||||||
})
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 更多操作选择
|
|
||||||
* @param {Object} index
|
|
||||||
*/
|
|
||||||
async function actionSheetClick(index) {
|
|
||||||
console.log(index);
|
|
||||||
const item = actionSheet.selTable
|
|
||||||
if (index == 0) {
|
|
||||||
if (!item.orderId) {
|
|
||||||
return uni.$utils.showToast('该桌台暂无要结账的订单!')
|
|
||||||
}
|
|
||||||
const canJieZhang = await hasPermission('允许收款')
|
|
||||||
if(!canJieZhang){
|
|
||||||
return
|
|
||||||
}
|
|
||||||
return toPay(item)
|
|
||||||
}
|
|
||||||
if (index == 1) {
|
|
||||||
//清台
|
|
||||||
return uni.showModal({
|
|
||||||
title: '提示',
|
|
||||||
content: '确定要清台:' + item.name + '?',
|
|
||||||
success(res) {
|
|
||||||
if (res.confirm) {
|
|
||||||
shopTableClear({
|
|
||||||
id: item.id,
|
|
||||||
}).then(res => {
|
|
||||||
uni.$utils.showToast('清台成功')
|
|
||||||
pageData.query.page = 1
|
|
||||||
getTable()
|
|
||||||
})
|
|
||||||
}
|
|
||||||
}
|
|
||||||
})
|
|
||||||
}
|
|
||||||
if (index == 2) {
|
|
||||||
return uni.$utils.showToast('待开放,请敬请期待!')
|
|
||||||
}
|
|
||||||
if (index == 3) {
|
|
||||||
return uni.$utils.showToast('待开放,请敬请期待!')
|
|
||||||
}
|
|
||||||
if (index == 4) {
|
|
||||||
//打印订单
|
|
||||||
if (!item.orderId) {
|
|
||||||
return uni.$utils.showToast('该桌台暂无要打印的订单!')
|
|
||||||
}
|
|
||||||
|
|
||||||
let res = await printOrder( {id: actionSheet.selTable.orderId, type: pageData.orderInfo.status == 'unpaid' ? 1 : 0 } )
|
|
||||||
return
|
|
||||||
}
|
|
||||||
if (index == 6) {
|
|
||||||
//绑定码牌
|
|
||||||
scanCode(item)
|
|
||||||
return
|
|
||||||
}
|
|
||||||
uni.$utils.showToast('待开放,请敬请期待!')
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 去结账
|
|
||||||
* @param {Object} item
|
|
||||||
*/
|
|
||||||
function toPay(item) {
|
|
||||||
go.to('PAGES_ORDER_PAY', {
|
|
||||||
tableId: item.id,
|
|
||||||
tableName: item.name,
|
|
||||||
orderId: item.orderId,
|
|
||||||
discount: 1,
|
|
||||||
userId: item.userId
|
|
||||||
})
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 绑定码牌
|
|
||||||
* @param {Object} item
|
|
||||||
*/
|
|
||||||
function scanCode(item) {
|
|
||||||
|
|
||||||
uni.scanCode({
|
|
||||||
onlyFromCamera: true,
|
|
||||||
success: function(res) {
|
|
||||||
console.log('条码类型:' + res.scanType);
|
|
||||||
console.log('条码内容:' + res.result);
|
|
||||||
let params = getQueryString(res.result);
|
|
||||||
shopTableBind({
|
|
||||||
"tableCode": params.code,
|
|
||||||
"id": item.id,
|
|
||||||
}).then(res => {
|
|
||||||
uni.$utils.showToast('桌台绑定成功')
|
|
||||||
setTimeout(()=>{
|
|
||||||
getTable()
|
|
||||||
},1500)
|
|
||||||
})
|
|
||||||
}
|
|
||||||
});
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 解码
|
|
||||||
* @param {Object} url
|
|
||||||
*/
|
|
||||||
function getQueryString(url) {
|
|
||||||
let params = {};
|
|
||||||
// 正则表达式来匹配URL中的查询字符串
|
|
||||||
let reg = /(?:\?|#|&){1}([^=]*)=([^&]*)/g;
|
|
||||||
url.replace(reg, (match, key, value) => {
|
|
||||||
params[key] = value;
|
|
||||||
});
|
|
||||||
return params;
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
watch(
|
||||||
* 搜索
|
() => pageData.area.sel,
|
||||||
*/
|
(newval) => {
|
||||||
function searchConfirm() {
|
|
||||||
pageData.query.page = 1;
|
pageData.query.page = 1;
|
||||||
getTable()
|
getTable();
|
||||||
}
|
}
|
||||||
|
);
|
||||||
|
|
||||||
/**
|
onShow((opt) => {
|
||||||
* 页数改变事件
|
getData();
|
||||||
* @param {Object} page
|
});
|
||||||
*/
|
function getData() {
|
||||||
function pageChange(page) {
|
getTable();
|
||||||
pageData.query.page = page
|
getArea();
|
||||||
getTable()
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 获取桌台列表
|
||||||
|
*/
|
||||||
|
async function getTable() {
|
||||||
|
const res = await getShopTable(pageData.query);
|
||||||
|
pageData.hasAjax = true;
|
||||||
|
pageData.tabList = res.records;
|
||||||
|
pageData.totalElements = res.totalRow;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 获取区域
|
||||||
|
*/
|
||||||
|
async function getArea() {
|
||||||
|
const res = await getShopArea({ name: '', page: 1, size: 300 });
|
||||||
|
pageData.area.list = res.records;
|
||||||
|
pageData.areaMap = res.records.reduce((prve, cur) => {
|
||||||
|
prve[cur.id] = cur.name;
|
||||||
|
return prve;
|
||||||
|
}, {});
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 类型选择
|
||||||
|
* @param {Object} e
|
||||||
|
*/
|
||||||
|
function confirmStatus(e) {
|
||||||
|
pageData.statusShow = false;
|
||||||
|
pageData.query.status = e.value[0].key;
|
||||||
|
pageData.statusName = e.value[0].label;
|
||||||
|
getTable();
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 区域选择确定
|
||||||
|
* @param {Object} item
|
||||||
|
*/
|
||||||
|
function changeAreaSel(item) {
|
||||||
|
pageData.area.sel = item.id;
|
||||||
|
pageData.query.areaId = item.id;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 更多操作打开
|
||||||
|
* @param {Object} table
|
||||||
|
*/
|
||||||
|
function moreShow(table) {
|
||||||
|
actionSheet.title = table.name;
|
||||||
|
actionSheet.selTable = table;
|
||||||
|
refMoreSheet.value.open();
|
||||||
|
if (actionSheet.selTable.orderId) {
|
||||||
|
getHistoryOrder({ orderId: actionSheet.selTable.orderId }).then((res) => {
|
||||||
|
pageData.orderInfo = res;
|
||||||
|
});
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 更多操作选择
|
||||||
|
* @param {Object} index
|
||||||
|
*/
|
||||||
|
async function actionSheetClick(index) {
|
||||||
|
console.log(index);
|
||||||
|
const item = actionSheet.selTable;
|
||||||
|
if (index == 0) {
|
||||||
|
if (!item.orderId) {
|
||||||
|
return uni.$utils.showToast('该桌台暂无要结账的订单!');
|
||||||
|
}
|
||||||
|
const canJieZhang = await hasPermission('允许收款');
|
||||||
|
if (!canJieZhang) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
return toPay(item);
|
||||||
|
}
|
||||||
|
if (index == 1) {
|
||||||
|
//清台
|
||||||
|
return uni.showModal({
|
||||||
|
title: '提示',
|
||||||
|
content: '确定要清台:' + item.name + '?',
|
||||||
|
success(res) {
|
||||||
|
if (res.confirm) {
|
||||||
|
shopTableClear({
|
||||||
|
id: item.id
|
||||||
|
}).then((res) => {
|
||||||
|
uni.$utils.showToast('清台成功');
|
||||||
|
pageData.query.page = 1;
|
||||||
|
getTable();
|
||||||
|
});
|
||||||
|
}
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
if (index == 2) {
|
||||||
|
return uni.$utils.showToast('待开放,请敬请期待!');
|
||||||
|
}
|
||||||
|
if (index == 3) {
|
||||||
|
return uni.$utils.showToast('待开放,请敬请期待!');
|
||||||
|
}
|
||||||
|
if (index == 4) {
|
||||||
|
//打印订单
|
||||||
|
if (!item.orderId) {
|
||||||
|
return uni.$utils.showToast('该桌台暂无要打印的订单!');
|
||||||
|
}
|
||||||
|
|
||||||
|
let res = await printOrder({ id: actionSheet.selTable.orderId, type: pageData.orderInfo.status == 'unpaid' ? 1 : 0 });
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
if (index == 6) {
|
||||||
|
//绑定码牌
|
||||||
|
scanCode(item);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
uni.$utils.showToast('待开放,请敬请期待!');
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 去结账
|
||||||
|
* @param {Object} item
|
||||||
|
*/
|
||||||
|
function toPay(item) {
|
||||||
|
go.to('PAGES_ORDER_PAY', {
|
||||||
|
tableId: item.id,
|
||||||
|
tableName: item.name,
|
||||||
|
orderId: item.orderId,
|
||||||
|
discount: 1,
|
||||||
|
userId: item.userId
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 绑定码牌
|
||||||
|
* @param {Object} item
|
||||||
|
*/
|
||||||
|
function scanCode(item) {
|
||||||
|
uni.scanCode({
|
||||||
|
onlyFromCamera: true,
|
||||||
|
success: function (res) {
|
||||||
|
console.log('条码类型:' + res.scanType);
|
||||||
|
console.log('条码内容:' + res.result);
|
||||||
|
let params = getQueryString(res.result);
|
||||||
|
shopTableBind({
|
||||||
|
tableCode: params.code,
|
||||||
|
id: item.id
|
||||||
|
}).then((res) => {
|
||||||
|
uni.$utils.showToast('桌台绑定成功');
|
||||||
|
setTimeout(() => {
|
||||||
|
getTable();
|
||||||
|
}, 1500);
|
||||||
|
});
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 解码
|
||||||
|
* @param {Object} url
|
||||||
|
*/
|
||||||
|
function getQueryString(url) {
|
||||||
|
let params = {};
|
||||||
|
// 正则表达式来匹配URL中的查询字符串
|
||||||
|
let reg = /(?:\?|#|&){1}([^=]*)=([^&]*)/g;
|
||||||
|
url.replace(reg, (match, key, value) => {
|
||||||
|
params[key] = value;
|
||||||
|
});
|
||||||
|
return params;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 搜索
|
||||||
|
*/
|
||||||
|
function searchConfirm() {
|
||||||
|
pageData.query.page = 1;
|
||||||
|
getTable();
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 页数改变事件
|
||||||
|
* @param {Object} page
|
||||||
|
*/
|
||||||
|
function pageChange(page) {
|
||||||
|
pageData.query.page = page;
|
||||||
|
getTable();
|
||||||
|
}
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<style lang="scss" scoped>
|
<style lang="scss" scoped>
|
||||||
.fixed-top {
|
.fixed-top {
|
||||||
z-index: 10;
|
z-index: 10;
|
||||||
}
|
}
|
||||||
.input-wrapper {
|
.input-wrapper {
|
||||||
|
display: flex;
|
||||||
|
justify-content: space-between;
|
||||||
|
align-items: center;
|
||||||
|
padding-top: 26rpx;
|
||||||
|
background-color: $J-bg-ff;
|
||||||
|
|
||||||
|
.input-main {
|
||||||
|
flex: 1;
|
||||||
display: flex;
|
display: flex;
|
||||||
justify-content: space-between;
|
|
||||||
align-items: center;
|
align-items: center;
|
||||||
padding-top: 26rpx;
|
height: 64rpx;
|
||||||
background-color: $J-bg-ff;
|
|
||||||
|
image {
|
||||||
.input-main {
|
padding: 22rpx;
|
||||||
|
width: 26rpx;
|
||||||
|
height: 26rpx;
|
||||||
|
}
|
||||||
|
|
||||||
|
input {
|
||||||
flex: 1;
|
flex: 1;
|
||||||
display: flex;
|
font-size: 27rpx;
|
||||||
align-items: center;
|
}
|
||||||
height: 64rpx;
|
|
||||||
|
::v-deep uni-button {
|
||||||
image {
|
font-size: 28rpx;
|
||||||
padding: 22rpx;
|
color: $my-main-color;
|
||||||
width: 26rpx;
|
background: rgba(255, 255, 255, 1);
|
||||||
height: 26rpx;
|
}
|
||||||
}
|
|
||||||
|
::v-deep.uni-easyinput {
|
||||||
input {
|
.uni-easyinput__content {
|
||||||
flex: 1;
|
background-color: $J-bg-f5 !important;
|
||||||
font-size: 27rpx;
|
border-radius: $J-b-r12;
|
||||||
}
|
|
||||||
|
.uni-easyinput__content-input {
|
||||||
::v-deep uni-button {
|
padding-left: 0 !important;
|
||||||
font-size: 28rpx;
|
|
||||||
color: $my-main-color;
|
.uni-input-input {
|
||||||
background: rgba(255, 255, 255, 1);
|
border-radius: $J-b-r12 !important;
|
||||||
}
|
overflow: hidden !important;
|
||||||
|
|
||||||
::v-deep.uni-easyinput {
|
|
||||||
.uni-easyinput__content {
|
|
||||||
background-color: $J-bg-f5 !important;
|
|
||||||
border-radius: $J-b-r12;
|
|
||||||
|
|
||||||
.uni-easyinput__content-input {
|
|
||||||
padding-left: 0 !important;
|
|
||||||
|
|
||||||
.uni-input-input {
|
|
||||||
border-radius: $J-b-r12 !important;
|
|
||||||
overflow: hidden !important;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
.uni-input-placeholder {
|
|
||||||
font-size: 27rpx;
|
|
||||||
}
|
|
||||||
|
|
||||||
.uni-icons {
|
|
||||||
color: rgba(230, 230, 230, 1) !important;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.uni-input-placeholder {
|
||||||
|
font-size: 27rpx;
|
||||||
|
}
|
||||||
|
|
||||||
|
.uni-icons {
|
||||||
|
color: rgba(230, 230, 230, 1) !important;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
.table-type {
|
.table-type {
|
||||||
flex-wrap: wrap;
|
flex-wrap: wrap;
|
||||||
padding: 0 10rpx 0 10rpx;
|
padding: 0 10rpx 0 10rpx;
|
||||||
|
|
||||||
.item {
|
.item {
|
||||||
width: 25%;
|
width: 25%;
|
||||||
margin-bottom: 10rpx;
|
margin-bottom: 10rpx;
|
||||||
|
|
||||||
|
.box {
|
||||||
|
position: relative;
|
||||||
|
padding: 10rpx;
|
||||||
|
border-radius: 10rpx;
|
||||||
|
|
||||||
|
&::after {
|
||||||
|
position: absolute;
|
||||||
|
display: block;
|
||||||
|
content: '';
|
||||||
|
top: 0;
|
||||||
|
bottom: 0;
|
||||||
|
width: 2px;
|
||||||
|
border-radius: 2px;
|
||||||
|
right: -20rpx;
|
||||||
|
background-color: rgba(255, 255, 255, 0.5);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
&:nth-of-type(4n) {
|
||||||
|
.box::after {
|
||||||
|
background-color: transparent;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
&.sel {
|
||||||
.box {
|
.box {
|
||||||
position: relative;
|
background-color: rgba(255, 255, 255, 0.6);
|
||||||
padding: 10rpx;
|
|
||||||
border-radius: 10rpx;
|
|
||||||
|
|
||||||
&::after {
|
|
||||||
position: absolute;
|
|
||||||
display: block;
|
|
||||||
content: '';
|
|
||||||
top: 0;
|
|
||||||
bottom: 0;
|
|
||||||
width: 2px;
|
|
||||||
border-radius: 2px;
|
|
||||||
right: -20rpx;
|
|
||||||
background-color: rgba(255, 255, 255, .5);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
&:nth-of-type(4n) {
|
|
||||||
.box::after {
|
|
||||||
background-color: transparent;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
&.sel {
|
|
||||||
.box {
|
|
||||||
background-color: rgba(255, 255, 255, .6);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
.search-box {
|
||||||
.search-box {
|
background-color: #fff;
|
||||||
background-color: #fff;
|
padding: 16rpx 0;
|
||||||
padding: 16rpx 0;
|
display: flex;
|
||||||
|
.search-btn {
|
||||||
|
padding: 0 30rpx;
|
||||||
|
box-sizing: border-box;
|
||||||
display: flex;
|
display: flex;
|
||||||
.search-btn {
|
align-items: center;
|
||||||
padding: 0 30rpx;
|
// width: 164rpx;
|
||||||
box-sizing: border-box;
|
transition: all 0.3s ease-in-out;
|
||||||
display: flex;
|
background-color: rgb(247, 247, 247);
|
||||||
align-items: center;
|
border-radius: 100px;
|
||||||
// width: 164rpx;
|
|
||||||
transition: all .3s ease-in-out;
|
|
||||||
background-color: rgb(247, 247, 247);
|
|
||||||
border-radius: 100px;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
.status {
|
.status {
|
||||||
position: absolute;
|
position: absolute;
|
||||||
top: 100%;
|
top: 100%;
|
||||||
left: 0;
|
left: 0;
|
||||||
right: 0;
|
right: 0;
|
||||||
z-index: 10;
|
z-index: 10;
|
||||||
background-color: #fff;
|
background-color: #fff;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.icon-arrow-down-fill {
|
||||||
|
width: 16rpx;
|
||||||
|
height: 10rpx;
|
||||||
|
}
|
||||||
|
|
||||||
.icon-arrow-down-fill {
|
.list {
|
||||||
width: 16rpx;
|
// margin-top: 52px;
|
||||||
height: 10rpx;
|
}
|
||||||
}
|
</style>
|
||||||
|
|
||||||
.list {
|
|
||||||
// margin-top: 52px;
|
|
||||||
}
|
|
||||||
</style>
|
|
||||||
|
|||||||
41
pageTable/index/tableStatus.js
Normal file
41
pageTable/index/tableStatus.js
Normal file
@@ -0,0 +1,41 @@
|
|||||||
|
export default [{
|
||||||
|
label: "未绑定",
|
||||||
|
type: "unbound",
|
||||||
|
color: "#909090",
|
||||||
|
},
|
||||||
|
{
|
||||||
|
label: "空闲",
|
||||||
|
type: "idle",
|
||||||
|
color: "#3F9EFF",
|
||||||
|
},
|
||||||
|
{
|
||||||
|
label: "点餐中",
|
||||||
|
type: "ordering",
|
||||||
|
color: "#46AEA4",
|
||||||
|
},
|
||||||
|
{
|
||||||
|
label: "未结账",
|
||||||
|
type: "unsettled",
|
||||||
|
color: "#DD3F41",
|
||||||
|
},
|
||||||
|
{
|
||||||
|
label: "支付中",
|
||||||
|
type: "paying",
|
||||||
|
color: "#909090",
|
||||||
|
},
|
||||||
|
{
|
||||||
|
label: "待清台",
|
||||||
|
type: "settled ",
|
||||||
|
color: "#FF9500",
|
||||||
|
},
|
||||||
|
{
|
||||||
|
label: "关台",
|
||||||
|
type: "closed",
|
||||||
|
color: "#DDDDDD",
|
||||||
|
},
|
||||||
|
{
|
||||||
|
label: "预定",
|
||||||
|
type: "subscribe",
|
||||||
|
color: "#58B22C",
|
||||||
|
},
|
||||||
|
];
|
||||||
File diff suppressed because it is too large
Load Diff
Reference in New Issue
Block a user