修改桌台信息

fix
游梦婷 11 months ago
parent ce47d55a1f
commit 3bd7221bd4
  1. 4
      Utils/Request.js
  2. 18
      Utils/groupBuying.js
  3. 5
      pages.json
  4. 10
      pages/index/merchant-details/merchant-details.vue
  5. 6
      pages/welcome/welcome.vue
  6. 251
      subpackages/groupBuyingConfiguration/tableMessage/editTableOrder.vue
  7. 248
      subpackages/groupBuyingConfiguration/tableMessage/tableMessage.vue

@ -18,11 +18,11 @@ function request(method, url, data) {
app.globalData.userInfo = ''; app.globalData.userInfo = '';
app.globalData.token = ''; app.globalData.token = '';
uni.setStorage({ uni.setStorage({
key: "user", key: "payuser",
data: '' data: ''
}) })
uni.setStorage({ uni.setStorage({
key: "token", key: "paytoken",
data: '' data: ''
}) })
uni.showToast({ uni.showToast({

@ -179,3 +179,21 @@ export const getTable = params => {
export const getTableList = params => { export const getTableList = params => {
return POST('GET', `${base}/mealTable/getTableList`, params).then(res => res.data); return POST('GET', `${base}/mealTable/getTableList`, params).then(res => res.data);
} }
// 开台
export const startTable = params => {
return POST('POST', `${base}/mealTable/startTable`, params).then(res => res.data);
}
//关台
export const endTable = params => {
return POST('POST', `${base}/mealTable/endTable`, params).then(res => res.data);
}
// 查询桌台当前订单
export const queryCurrentOrder = params => {
return POST('GET', `${base}/mealTableOrder/queryCurrentOrder`, params).then(res => res.data);
}
// 操作订单产品
export const operateOrderProduct = params => {
return POST('POST', `${base}/mealTableOrder/operateOrderProduct`, params).then(res => res.data);
}

@ -715,6 +715,11 @@
"style": { "style": {
"navigationBarTitleText": "桌台信息" "navigationBarTitleText": "桌台信息"
} }
},{
"path":"groupBuyingConfiguration/tableMessage/editTableOrder",
"style": {
"navigationBarTitleText": "修改订单"
}
} }
] ]

@ -11,7 +11,7 @@
<view class="mart15 width100 backcorfff" v-if="current == 0"> <view class="mart15 width100 backcorfff" v-if="current == 0">
<view class="notes"> <view class="notes">
<view class="fcor666 width25">账号</view> <view class="fcor666 width25">账号</view>
<view class="font14 fcor333 text2 width75 fotrt">{{merDesInfo.account.loginName}}</view> <view class="font14 fcor333 text2 width75 fotrt" v-if="merDesInfo&&merDesInfo.account">{{merDesInfo.account.loginName}}</view>
</view> </view>
<view class="notes"> <view class="notes">
<view class="fcor666 width25">商户ID</view> <view class="fcor666 width25">商户ID</view>
@ -22,14 +22,14 @@
<view class="font14 fcor333 text2 width75 fotrt">{{merDesInfo.merName}}</view> <view class="font14 fcor333 text2 width75 fotrt">{{merDesInfo.merName}}</view>
</view> </view>
<view class="notes"> <view class="notes" v-if="merDesInfo&&merDesInfo.account">
<view class="fcor666 width25">商户状态</view> <view class="fcor666 width25">商户状态</view>
<view class="font14 fcor333 text2 width75 fotrt" v-if="merDesInfo.account.status == 1">正常</view> <view class="font14 fcor333 text2 width75 fotrt" v-if="merDesInfo.account.status == 1">正常</view>
<view class="font14 fcor333 text2 width75 fotrt" v-if="merDesInfo.account.status == 4">违规</view> <view class="font14 fcor333 text2 width75 fotrt" v-if="merDesInfo.account.status == 4">违规</view>
</view> </view>
<view class="notes"> <view class="notes">
<view class="fcor666 width25">联系人</view> <view class="fcor666 width25">联系人</view>
<view class="font14 fcor333 text2 width75 fotrt">{{merDesInfo.account.userName}}</view> <view class="font14 fcor333 text2 width75 fotrt" v-if="merDesInfo&&merDesInfo.account">{{merDesInfo.account.userName}}</view>
</view> </view>
<view class="notes"> <view class="notes">
<view class="fcor666 width25">手机号</view> <view class="fcor666 width25">手机号</view>
@ -41,11 +41,11 @@
</view> --> </view> -->
<view class="notes"> <view class="notes">
<view class="fcor666 width25">银行卡号</view> <view class="fcor666 width25">银行卡号</view>
<view class="font14 fcor333 text2 width75 fotrt">{{merDesInfo.merSettleAcct.bankCardNo}}</view> <view class="font14 fcor333 text2 width75 fotrt" v-if="merDesInfo.merSettleAcct">{{merDesInfo.merSettleAcct.bankCardNo}}</view>
</view> </view>
<view class="notes"> <view class="notes">
<view class="fcor666 width25">所属银行</view> <view class="fcor666 width25">所属银行</view>
<view class="font14 fcor333 text2 width75 fotrt">{{merDesInfo.merSettleAcct.bankName}}</view> <view class="font14 fcor333 text2 width75 fotrt" v-if="merDesInfo.merSettleAcct">{{merDesInfo.merSettleAcct.bankName}}</view>
</view> </view>
</view> </view>

@ -17,10 +17,10 @@
}, },
onLoad(options) { onLoad(options) {
/* uni.reLaunch({ uni.reLaunch({
url: '../tabBar/home/home' url: '/pages/login/login'
}) })
return */ return
let that = this; let that = this;

@ -0,0 +1,251 @@
<template>
<view class="all-container pd-main font15">
<view class="mart20 backcorfff" v-if="orderDetail">
<!-- <view class="dis-flex flex-wrap" >
<view class="width100 dis-flex bor-botm1">
<view class=" fotct fontwig6 backcor6 titleWidth minheight40">用餐桌名</view>
<view class="flex-1 fotct ">{{orderDetail.order.tableName}}</view>
</view>
<view class="width100 dis-flex bor-botm1">
<view class=" fotct fontwig6 backcor6 titleWidth minheight40">用餐人数</view>
<view class="flex-1 fotct ">{{orderDetail.order.peopleNum}}</view>
</view>
</view> -->
<view class="mart20 backcorfff">
<view class="dis-flex height40 bor-botm1 backcor6">
<view class="flex-1 fotct fontwig6 " ></view>
<view class="flex-1 fotct fontwig6">名称</view>
<view class="flex-1 fotct fontwig6">单价</view>
<view class="flex-1 fotct fontwig6">数量</view>
<view class="flex-1 fotct fontwig6">操作</view>
</view>
<view class="dis-flex bor-botm1 paddtop5 paddbotm5 fon15" v-for="(item,index) in orderDetail.product" @click="cilckToShowDetail(item)" :key="index">
<view class="flex-1 fotct">
<image :src="imgUrl+item.productImg" mode="aspectFit" class="width100 height60 verc"></image>
</view>
<view class="flex-1 fotct text1">{{item.productName}}</view>
<view class="flex-1 fotct">{{item.productPrice}}</view>
<view class="flex-1 fotct ">{{item.productNum}}</view>
<view class="flex-1 fotct fcor41c " @click.stop="clickToEdit(item)"><text class="icon bianji font15 fcor41c"></text>编辑</view>
</view>
</view>
<view class="width100 fotrt">共计:¥<text class="font20 fontwig6">{{orderDetail.order.orderAmount}}</text></view>
</view>
<!-- 添加菜品按钮 -->
<!-- <view class="btn-fix">
<button class="btn" @click="addProduct">添加菜品</button>
</view> -->
<!-- 编辑订单 -->
<uni-popup ref="inputDialog" type="dialog">
<uni-popup-dialog mode="input" title="输入菜品数量" :before-close="true" :value="productNum"
placeholder="请输入菜品数量" @confirm="dialogInputConfirm" @close="close"></uni-popup-dialog>
</uni-popup>
<uni-popup ref="popupDetail" type="bottom" background-color="#ffffff">
<view style="height: 80vh;overflow-y: auto;" class="backcorfff border-10r-lr pd-main font16">
<view class="pop-contain pd-main">
<view class="dis-flex height40 bor-botm1">
<view class="flex-1 fotct fontwig6 " ></view>
<view class="flex-1 fotct fontwig6">名称</view>
<view class="flex-1 fotct fontwig6">价格</view>
<view class="flex-1 fotct fontwig6">分类</view>
<!-- <view class="flex-1 fotct fontwig6">售卖数量</view> -->
<view class="flex-1 fotct fontwig6">操作</view>
</view>
<view class="dis-flex bor-botm1 paddtop5 paddbotm5 fon15" v-for="(item,index) in productList" @click="cilckToShowDetail(item)" :key="index">
<view class="flex-1 fotct">
<image :src="imgUrl+item.img" @click.stop="previewImage(imgUrl+item.img)" mode="aspectFit" class="width100 height60 verc"></image>
</view>
<view class="flex-1 fotct text1">{{item.name}}</view>
<view class="flex-1 fotct">{{item.price}}</view>
<view class="flex-1 fotct text1">{{item.productCategoryName}}</view>
<!-- <view class="flex-1 fotct">{{item.saleCount}}</view> -->
<view class="flex-1 fotct fcor41c " @click.stop="clickToEdit(item)"><text class="icon bianji font15 fcor41c"></text>编辑</view>
</view>
</view>
</view>
</uni-popup>
</view>
</template>
<script>
import {getStoreProductByList,queryCurrentOrder,operateOrderProduct
} from '@/Utils/groupBuying.js';
const app = getApp();
export default {
data(){
return{
imgUrl: app.globalData.imgUrl, //访
storeId:'',//id
serialNumber:'',//
productList:[],//
orderDetail:null,
productNum:'',//
productId:'',
}
},
onLoad(options) {
this.storeId = options.storeId;
this.serialNumber = options.serialNumber;
this.getStoreProductByList();
this.queryCurrentOrder();
},
methods:{
/* 添加菜品 */
addProduct(){
this.$refs.popupDetail.open('bottom')
},
/* 编辑订单 */
clickToEdit(item){
this.productNum = item.productNum;
this.productId = item.productId;
this.$refs.inputDialog.open()
},
dialogInputConfirm(e) {
let reg = /^[0-9]+$/;
if (!reg.test(e)) {
uni.showToast({
title: '请输入正确的数字哦!',
icon: 'none',
duration: 2000
})
return
}
this.productNum = e;
let params={
"orderNo": this.orderDetail.order.orderNo,
"productArray": [{
"productId": this.productId,
"number": this.productNum
}]
}
this.operateOrderProduct(params);
},
operateOrderProduct(params){
uni.showLoading({
title: '加载中'
})
operateOrderProduct(params).then(res=>{
uni.hideLoading();
this.$refs.inputDialog.close();
if (res.return_code == '000000') {
this.productNum = '';
this.productId ='';
this.queryCurrentOrder();
uni.showToast({
title: res.return_data,
icon: 'none',
duration: 2000
})
} else {
uni.showToast({
title: res.return_msg,
icon: 'none',
duration: 2000
})
}
}).catch(() => {
this.$refs.inputDialog.close();
})
},
close() {
this.productNum = '';
this.productId ='';
this.$refs.inputDialog.close();
},
//
queryCurrentOrder(){
let params={
serialNumber:this.serialNumber
}
uni.showLoading({
title:"加载中",
mask:true,
})
queryCurrentOrder(params).then(res=>{
uni.hideLoading();
if (res.return_code == '000000') {
this.orderDetail = res.return_data;
}else{
uni.showToast({
title: res.return_msg,
icon: 'none',
duration: 2000
})
}
})
},
/* 获取菜单列表 */
getStoreProductByList(){
let params={
storeId:this.storeId,
}
uni.showLoading({
title:"加载中",
mask:true,
})
getStoreProductByList(params).then(res=>{
uni.hideLoading();
if (res.return_code == '000000') {
this.productList = res.return_data;
}else{
uni.showToast({
title: res.return_msg,
icon: 'none',
duration: 2000
})
}
})
},
}
}
</script>
<style lang="scss" scoped>
.flex-wrap{
flex-wrap: wrap;
}
.titleWidth{
width: 120px;
text-align: center;
}
.minheight40{
padding: 15px 0;
}
/* 底部按钮 */
.btn-fix{
position: fixed;
bottom: 0;
left: 0;
right: 0;
.btn{
height: 50px;
line-height: 50px;
width: 100%;
color: white;
background-color: #089bf5;
border-radius: 6px;
}
}
</style>

@ -3,35 +3,52 @@
<view class=" width100 mart10"> <view class=" width100 mart10">
<button class="btns icon tianjia" @click.stop="clickToAdd()">生成桌台</button> <button class="btns icon tianjia" @click.stop="clickToAdd()">生成桌台</button>
</view> </view>
<view class="mart20 backcorfff marb20"> <view class="mart20 backcorfff marb20">
<view class="backcor6 paddbotm5 font13 fcor089">(长按二维码图片可保存至手机相册)</view>
<view class="dis-flex height40 bor-botm1"> <view class="dis-flex height40 bor-botm1">
<view class="flex-1 fotct fontwig6 ">二维码</view> <view class="flex-1 fotct fontwig6 ">二维码</view>
<view class=" fotct fontwig6">桌号</view> <view class="flex-1 fotct fontwig6">桌号</view>
<view class="flex-1 fotct fontwig6">桌名</view> <view class="flex-1 fotct fontwig6">桌名</view>
<view class="flex-1 fotct fontwig6">状态</view>
<view class="flex-1 fotct fontwig6">操作</view> <view class="flex-1 fotct fontwig6">操作</view>
</view> </view>
<view class="dis-flex bor-botm1 paddtop10 paddbotm10 " @click="openTableDetail(item)" v-for="(item,index) in tableList" :key="index"> <view class="dis-flex bor-botm1 paddtop10 paddbotm10 " @click="openTableDetail(item)"
v-for="(item,index) in tableList" :key="index">
<view class="flex-1 fotct"> <view class="flex-1 fotct" @click.stop>
<image :src="item.qrCodeImgUrl" @click.stop="previewImage(item.qrCodeImgUrl)" mode="aspectFit" class="width100 height60 verc"></image> <image :src="item.qrCodeImgUrl" mode="aspectFit" class="width100 height60 verc"></image>
</view> </view>
<view class=" fotct text1"> <view class="flex-1 fotct text1">
{{item.tableNumber}} {{item.tableNumber}}
</view> </view>
<view class="flex-1 fotct text1"> <view class="flex-1 fotct text1">
{{item.tableName}} {{item.tableName}}
</view> </view>
<view class="flex-1 fotct dis-flex flex-center"> <view class="flex-1 fotct text1" :class="{'fcorred':item.status==2}">
{{item.status | filterStatus}}
</view>
<next-bubble-menu class="flex-1" :d-width="150" :dataList="item.status |filterDataList"
bingEleId="moreType" @change="getItem($event,item)">
<view class="marglerig font15 fotct" id="moreType">更多<text class="icon xia font14"></text></view>
</next-bubble-menu>
<!-- <view class="flex-1 fotct dis-flex flex-center">
<view class="marglerig fcorred font13" @click.stop="toDeleteTable(item)"><text <view class="marglerig fcorred font13" @click.stop="toDeleteTable(item)"><text
class="icon shanchu font14 fcorred"></text>删除</view> class="icon shanchu font14 fcorred"></text>删除</view>
<view class="marglerig fcor41c font13" @click.stop="editTable(item)"><text <view class="marglerig fcor41c font13" @click.stop="editTable(item)"><text
class="icon bianji font14 fcor41c"></text>编辑</view> class="icon bianji font14 fcor41c"></text>编辑</view>
</view> -->
</view> </view>
</view> </view>
</view>
<!-- 开台 -->
<uni-popup ref="openTableDialog" type="dialog">
<uni-popup-dialog mode="input" :title="openTableName" :before-close="true" :value="peopleNum"
placeholder="请输入就餐人数" @confirm="dialogOpenTableConfirm" @close="closeOpenTable"></uni-popup-dialog>
</uni-popup>
<!-- 编辑桌台 --> <!-- 编辑桌台 -->
<uni-popup ref="popupEditTable" type="center"> <uni-popup ref="popupEditTable" type="center">
@ -53,8 +70,8 @@
</uni-popup> </uni-popup>
<!-- 生成桌台弹窗 --> <!-- 生成桌台弹窗 -->
<uni-popup ref="inputDialog" type="dialog"> <uni-popup ref="inputDialog" type="dialog">
<uni-popup-dialog ref="inputClose" mode="input" title="输入生产数量" :before-close="true" :value="generateNum" placeholder="请输入生产数量" <uni-popup-dialog mode="input" title="输入生产数量" :before-close="true" :value="generateNum"
@confirm="dialogInputConfirm" @close="close"></uni-popup-dialog> placeholder="请输入生产数量" @confirm="dialogInputConfirm" @close="close"></uni-popup-dialog>
</uni-popup> </uni-popup>
<!-- 查看详情 --> <!-- 查看详情 -->
@ -75,6 +92,10 @@
<view class=" fotct fontwig6 backcor6 titleWidth minheight40">桌台名称</view> <view class=" fotct fontwig6 backcor6 titleWidth minheight40">桌台名称</view>
<view class="flex-1 fotct ">{{tableDetail.tableName}}</view> <view class="flex-1 fotct ">{{tableDetail.tableName}}</view>
</view> </view>
<view class="width100 dis-flex bor-botm1 ">
<view class=" fotct fontwig6 backcor6 titleWidth minheight40">桌台状态</view>
<view class="flex-1 fotct ">{{tableDetail.status | filterStatus}}</view>
</view>
<view class="width100 dis-flex bor-botm1 "> <view class="width100 dis-flex bor-botm1 ">
<view class=" fotct fontwig6 backcor6 titleWidth minheight40">创建时间</view> <view class=" fotct fontwig6 backcor6 titleWidth minheight40">创建时间</view>
<view class="flex-1 fotct ">{{tableDetail.createTime | timeFormat}}</view> <view class="flex-1 fotct ">{{tableDetail.createTime | timeFormat}}</view>
@ -82,7 +103,9 @@
<view class="width100 dis-flex "> <view class="width100 dis-flex ">
<view class=" fotct fontwig6 backcor6 titleWidth minheight80">二维码</view> <view class=" fotct fontwig6 backcor6 titleWidth minheight80">二维码</view>
<view class="flex-1 fotct "> <view class="flex-1 fotct ">
<image :src="tableDetail.qrCodeImgUrl" @click.stop="previewImage(tableDetail.qrCodeImgUrl)" mode="aspectFit" class="width100 height60 verc"></image> <image :src="tableDetail.qrCodeImgUrl"
@click.stop="previewImage(tableDetail.qrCodeImgUrl)" mode="aspectFit"
class="width100 height60 verc"></image>
</view> </view>
</view> </view>
</view> </view>
@ -95,10 +118,18 @@
</template> </template>
<script> <script>
import {generateTable,getTableList, import {
editTable,delTable,getTable generateTable,
getTableList,
editTable,
delTable,
getTable,
startTable,
endTable
} from '@/Utils/groupBuying.js';
} from '@/Utils/groupBuying.js' import nextBubleMenu from "@/components/next-bubble-menu/next-bubble-menu.vue";
export default { export default {
data() { data() {
@ -114,13 +145,199 @@
tableName: '', // tableName: '', //
}, },
tableDetail: null, // tableDetail: null, //
/* 开台 */
openTableName:'',//
peopleNum:'',//
serialNumber:'',//
} }
}, },
onLoad(options) { onLoad(options) {
this.storeId = options.storeId; this.storeId = options.storeId;
this.getTableList(true); this.getTableList(true);
}, },
components: {
nextBubleMenu
},
filters: {
/* type:桌台状态 0:不可用 1:未开台 2:已开台 */
/* 1:编辑,2:开台,3:关台,4:删除,5查看订单 */
filterDataList(type) {
switch (type) {
case 0:
return [{
id: 1,
text: '编辑',
}, {
id: 4,
text: '删除',
}, ];
case 1:
return [{
id: 1,
text: '编辑',
}, {
id: 2,
text: '开台',
}, {
id: 4,
text: '删除',
}, ];
case 2:
return [{
id: 1,
text: '编辑',
}, {
id: 3,
text: '关台',
}, {
id: 4,
text: '删除',
}, {
id: 5,
text: '订单',
}, ];
default:
return [{
id: 1,
text: '编辑',
}, {
id: 4,
text: '删除',
}, ];
}
},
filterStatus(type){
switch (type) {
case 0:
return '不可用';
case 1:
return '未开台';
case 2:
return '已开台';
default:
return '未知';
}
},
},
methods: { methods: {
/* 更多操作的回调函数 */
getItem(data, item) {
if (data.id == 1) { //
this.editTable(item)
} else if (data.id == 2) {
//
this.serialNumber = item.serialNumber;
this.openTableName = item.tableName;
this.peopleNum = ''; //
this.$refs.openTableDialog.open();
}else if (data.id == 3) { //
this.endTableMethod(item)
}else if (data.id == 4) { //
this.toDeleteTable(item)
}else if(data.id == 5){
this.goEditTableOrder(item)
}
console.log(data, item)
},
goEditTableOrder(item){
uni.navigateTo({
url:`./editTableOrder?storeId=${item.storeId}&serialNumber=${item.serialNumber}`
})
},
/* 开台 -确认 pupup-回调 */
dialogOpenTableConfirm(e){
let reg = /^\+?[1-9][0-9]*$/;
if (!reg.test(e)) {
uni.showToast({
title: '请输入大于0的数字哦!',
icon: 'none',
duration: 2000
})
return
}
this.peopleNum = e;
this.startTableMethod()
},
/* 开台 -取消 pupup-回调 */
closeOpenTable(){
this.$refs.openTableDialog.close();
},
//
startTableMethod(){
uni.showLoading({
title: '加载中'
})
let params={
serialNumber:this.serialNumber,
peopleNum:this.peopleNum
}
console.log(params,"params")
startTable(params).then(res=>{
uni.hideLoading();
this.$refs.openTableDialog.close();
if (res.return_code == '000000') {
this.getTableList();
uni.showToast({
title: res.return_data,
icon: 'none',
duration: 2000
})
} else {
uni.showToast({
title: res.return_msg,
icon: 'none',
duration: 2000
})
}
}).catch(() => {
uni.hideLoading();
this.$refs.openTableDialog.close();
})
},
/* 关台 */
endTableMethod(item){
let _this = this;
uni.showModal({
title: '提示',
content: `确定把‘${item.tableName}’关台吗?`,
success: function(res) {
if (res.confirm) {
let params = {
serialNumber: item.serialNumber
}
uni.showLoading({
title: '加载中'
})
endTable(params).then(res => {
uni.hideLoading();
let title;
if (res.return_code == '000000') {
title = res.return_data;
_this.getTableList();
} else {
title = res.return_msg;
}
uni.showToast({
title: title,
icon: 'none',
duration: 2000
})
}).catch(() => {
uni.hideLoading();
})
} else if (res.cancel) {
// console.log('');
}
}
});
},
/* 生成桌台 */ /* 生成桌台 */
clickToAdd() { clickToAdd() {
this.generateNum = ''; this.generateNum = '';
@ -130,7 +347,7 @@
let reg = /^\+?[1-9][0-9]*$/; let reg = /^\+?[1-9][0-9]*$/;
if (!reg.test(e)) { if (!reg.test(e)) {
uni.showToast({ uni.showToast({
title:'请输入数字哦!', title: '请输入大于0的数字哦!',
icon: 'none', icon: 'none',
duration: 2000 duration: 2000
}) })
@ -349,6 +566,7 @@
.border-10r { .border-10r {
border-radius: 10px; border-radius: 10px;
} }
.border-10r-lr { .border-10r-lr {
border-radius: 10px 10px 0 0; border-radius: 10px 10px 0 0;
} }
@ -372,6 +590,7 @@
background: #ffffff; background: #ffffff;
} }
.titleWidth { .titleWidth {
min-width: 80px; min-width: 80px;
text-align: center; text-align: center;
@ -380,6 +599,7 @@
.minheight40 { .minheight40 {
padding: 15px 0; padding: 15px 0;
} }
.minheight80 { .minheight80 {
min-height: 80px; min-height: 80px;
line-height: 80px; line-height: 80px;

Loading…
Cancel
Save