tapd相关修改更新
This commit is contained in:
@@ -1,5 +1,5 @@
|
||||
<template>
|
||||
<view class="item color-fff border-r-12" :class="[computedClass]" @click="toOrderDetail">
|
||||
<view class="item color-fff border-r-12" :class="[computedClass]">
|
||||
<view class="my-bg-main" :style="{'background-color':returnStutasColor(data.status)}">
|
||||
<view class="u-flex u-row-between">
|
||||
<view class="u-font-32">{{data.name}}</view>
|
||||
@@ -74,7 +74,7 @@
|
||||
import {hasPermission} from '@/commons/utils/hasPermission.js'
|
||||
import { $status } from '@/commons/table-status.js'
|
||||
import { $table } from '@/http/yskApi/table.js'
|
||||
import infoBox from '@/commons/utils/infoBox.js'
|
||||
|
||||
const emits = defineEmits(['more', 'update', 'bind'])
|
||||
const props = defineProps({
|
||||
data: {
|
||||
@@ -140,46 +140,12 @@
|
||||
console.log(res)
|
||||
if(res){
|
||||
const useType = props.status == 'using' ? props.data.useType : undefined
|
||||
go.to('PAGES_CREATE_ORDER', {
|
||||
tableId: props.data.id,
|
||||
name: props.data.name,
|
||||
maxCapacity: props.data.maxCapacity,
|
||||
status: props.data.status,
|
||||
})
|
||||
console.log(props.data)
|
||||
go.to('PAGES_CREATE_ORDER', props.data)
|
||||
}
|
||||
})
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* 查看订单详情
|
||||
*/
|
||||
function toOrderDetail() {
|
||||
if (props.data.status == 'using' && props.data.orderId) {
|
||||
const {
|
||||
id,
|
||||
name,
|
||||
status,
|
||||
amount,
|
||||
areaId,
|
||||
orderId
|
||||
} = props.data
|
||||
if (!orderId) {
|
||||
return uni.showToast({
|
||||
icon: 'none',
|
||||
title: '台桌未返回订单id'
|
||||
})
|
||||
}
|
||||
go.to('PAGES_ORDER_DETAIL', {
|
||||
id,
|
||||
name,
|
||||
status,
|
||||
amount,
|
||||
areaId,
|
||||
id: orderId
|
||||
})
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 清台
|
||||
@@ -196,7 +162,7 @@
|
||||
status: "idle",
|
||||
qrcode: item.id,
|
||||
}).then(res => {
|
||||
infoBox.showToast('清台成功')
|
||||
uni.$utils.showToast('清台成功')
|
||||
emits('update')
|
||||
})
|
||||
}
|
||||
|
||||
@@ -12,8 +12,9 @@
|
||||
<up-icon name="arrow-down" size="16"></up-icon>
|
||||
</view>
|
||||
<uni-easyinput clearable class='jeepay-search' :inputBorder="false"
|
||||
trim="all"
|
||||
placeholder="搜索" v-model="search.keyword"
|
||||
trim="all"
|
||||
placeholder="搜索"
|
||||
v-model="pageData.query.name"
|
||||
@clear="searchConfirm"
|
||||
@confirm="searchConfirm">
|
||||
<template #prefixIcon>
|
||||
@@ -29,7 +30,7 @@
|
||||
<view @tap="changestatusActive(index,item)" class="u-flex u-p-l-30 lh30 u-p-r-30 u-row-between"
|
||||
v-for="(item,index) in status.list" :key="index">
|
||||
<view>{{item.label}}</view>
|
||||
<uni-icons v-if="status.active===index" type="checkmarkempty" :color="color.ColorMain"></uni-icons>
|
||||
<uni-icons v-if="status.active===index" type="checkmarkempty" :color="$utils.ColorMain"></uni-icons>
|
||||
</view>
|
||||
<view :style="{height: status.bottomHeight+'px'}"></view>
|
||||
</view>
|
||||
@@ -58,7 +59,7 @@
|
||||
<table-item @bind="scanCode" @update="getTable" :areaMap="pageData.areaMap" @more="moreShow(item)" :data="item"></table-item>
|
||||
</view>
|
||||
</view>
|
||||
<my-pagination :page="pageData.query.page" :totalElements="pageData.query.totalElements" :size="pageData.query.size"
|
||||
<my-pagination :page="pageData.query.page" :totalElements="pageData.totalElements" :size="pageData.query.size"
|
||||
@change="pageChange"></my-pagination>
|
||||
</template>
|
||||
|
||||
@@ -79,27 +80,20 @@
|
||||
<script setup>
|
||||
import { onLoad, onReady, onShow, } from '@dcloudio/uni-app';
|
||||
import { ref, reactive, computed, watch } from 'vue';
|
||||
import {
|
||||
$table,
|
||||
$tableArea,
|
||||
$bind
|
||||
} from '@/http/yskApi/table.js'
|
||||
|
||||
import { objToArrary } from '@/commons/utils/returrn-data.js'
|
||||
import { $status } from '@/commons/table-status.js'
|
||||
import color from '@/commons/color';
|
||||
import go from '@/commons/utils/go.js';
|
||||
import myMask from '@/components/my-components/my-mask'
|
||||
import addTable from './components/add-table'
|
||||
import myActionSheet from '@/components/my-components/my-action-sheet';
|
||||
import tableItem from './components/table-item'
|
||||
import * as $fun from './util.js'
|
||||
import infoBox from '@/commons/utils/infoBox.js'
|
||||
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'
|
||||
|
||||
const statusList = objToArrary($status)
|
||||
console.log(statusList)
|
||||
statusList.unshift({
|
||||
key: '',
|
||||
label: '全部'
|
||||
@@ -119,8 +113,9 @@
|
||||
size: 10,
|
||||
status: '',
|
||||
areaId: '',
|
||||
totalElements:0
|
||||
name: '',
|
||||
},
|
||||
totalElements:0,
|
||||
tabList: [],
|
||||
area: {
|
||||
list: [],
|
||||
@@ -128,7 +123,6 @@
|
||||
}
|
||||
})
|
||||
const search = reactive({
|
||||
keyword: '',
|
||||
show: false
|
||||
})
|
||||
const refMoreSheet = ref(null)
|
||||
@@ -166,7 +160,7 @@
|
||||
const res = await getShopTable(pageData.query)
|
||||
pageData.hasAjax = true
|
||||
pageData.tabList = res.records
|
||||
pageData.query.totalElements= res.totalRow
|
||||
pageData.totalElements = res.totalRow
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -209,9 +203,9 @@
|
||||
const item = actionSheet.selTable
|
||||
if (index == 0) {
|
||||
if (!item.orderId) {
|
||||
return infoBox.showToast('该桌台暂无要结账的订单!')
|
||||
return uni.$utils.showToast('该桌台暂无要结账的订单!')
|
||||
}
|
||||
const canJieZhang=await hasPermission('允许收款')
|
||||
const canJieZhang = await hasPermission('允许收款')
|
||||
if(!canJieZhang){
|
||||
return
|
||||
}
|
||||
@@ -227,7 +221,7 @@
|
||||
shopTableClear({
|
||||
id: item.id,
|
||||
}).then(res => {
|
||||
infoBox.showToast('清台成功')
|
||||
uni.$utils.showToast('清台成功')
|
||||
pageData.query.page = 1
|
||||
getTable()
|
||||
})
|
||||
@@ -236,14 +230,17 @@
|
||||
})
|
||||
}
|
||||
if (index == 2) {
|
||||
return infoBox.showToast('待开放,请敬请期待!')
|
||||
return uni.$utils.showToast('待开放,请敬请期待!')
|
||||
}
|
||||
if (index == 3) {
|
||||
return infoBox.showToast('待开放,请敬请期待!')
|
||||
return uni.$utils.showToast('待开放,请敬请期待!')
|
||||
}
|
||||
if (index == 4) {
|
||||
//打印订单
|
||||
const res = await $fun.printOrder(actionSheet.selTable.tableId)
|
||||
if (!item.orderId) {
|
||||
return uni.$utils.showToast('该桌台暂无要打印的订单!')
|
||||
}
|
||||
let res = await printOrder( {id: actionSheet.selTable.orderId } )
|
||||
return
|
||||
}
|
||||
if (index == 6) {
|
||||
@@ -251,7 +248,7 @@
|
||||
scanCode(item)
|
||||
return
|
||||
}
|
||||
infoBox.showToast('待开放,请敬请期待!')
|
||||
uni.$utils.showToast('待开放,请敬请期待!')
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -275,7 +272,7 @@
|
||||
function scanCode(item) {
|
||||
console.log(item)
|
||||
if ( item.tableCode != '') {
|
||||
infoBox.showToast('当前桌台已绑定')
|
||||
uni.$utils.showToast('当前桌台已绑定')
|
||||
return;
|
||||
}
|
||||
uni.scanCode({
|
||||
@@ -288,7 +285,7 @@
|
||||
"tableCode": params.code,
|
||||
"id": item.id,
|
||||
}).then(res => {
|
||||
infoBox.showToast('桌台绑定成功')
|
||||
uni.$utils.showToast('桌台绑定成功')
|
||||
setTimeout(()=>{
|
||||
getTable()
|
||||
},1500)
|
||||
|
||||
@@ -1,31 +0,0 @@
|
||||
import * as Api from '@/http/yskApi/Instead.js'
|
||||
import go from '@/commons/utils/go.js'
|
||||
//打印订单
|
||||
export function printOrder(tableId) {
|
||||
return new Promise((resolve, reject) => {
|
||||
uni.showModal({
|
||||
title: '提示',
|
||||
content: '确定要打印订单吗?',
|
||||
success(res) {
|
||||
if (res.confirm) {
|
||||
Api.$printOrder({
|
||||
tableId
|
||||
}).then(res => {
|
||||
resolve(res)
|
||||
})
|
||||
}
|
||||
}
|
||||
})
|
||||
})
|
||||
|
||||
}
|
||||
//去支付页面
|
||||
export function toPay(options) {
|
||||
go.to('PAGES_CRESATE_ORDER_PAY', {
|
||||
tableId: options.tableId,
|
||||
tableName: options.name,
|
||||
masterId: options.masterId,
|
||||
orderId: orderDetail.info.id,
|
||||
discount: 1
|
||||
})
|
||||
}
|
||||
Reference in New Issue
Block a user