代码更新
This commit is contained in:
@@ -103,11 +103,7 @@
|
||||
default: []
|
||||
}
|
||||
})
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
const discounts = [95, 90, 85, 80]
|
||||
const causes = reactive([{
|
||||
name: '顾客投诉质量问题',
|
||||
|
||||
@@ -70,7 +70,7 @@
|
||||
</view>
|
||||
</view>
|
||||
</template>
|
||||
<template v-if="!pageData.shopInfo.isTableFee">
|
||||
<template v-if="!pageData.shopInfo.isTableFee&&pageData.table&&pageData.table.id">
|
||||
<!-- 不免餐位费 -->
|
||||
<view class="block">
|
||||
<view class=" ">
|
||||
@@ -297,7 +297,6 @@
|
||||
import oneRemark from './components/remark'
|
||||
import editDiscount from '@/pagesCreateOrder/components/edit-discount.vue'
|
||||
import go from '@/commons/utils/go.js';
|
||||
import * as Api from '@/http/yskApi/Instead.js'
|
||||
import $storageManage from '@/commons/utils/storageManage.js'
|
||||
import { hasPermission } from '@/commons/utils/hasPermission.js'
|
||||
import { getNowCart } from '@/pagesCreateOrder/util.js'
|
||||
@@ -313,8 +312,8 @@
|
||||
selIndex: -1
|
||||
})
|
||||
const option = reactive({
|
||||
masterId: '',
|
||||
tableId: ""
|
||||
id: '',
|
||||
tableId: "",
|
||||
})
|
||||
/**
|
||||
* 用餐人数
|
||||
@@ -362,12 +361,11 @@
|
||||
|
||||
onLoad((opt) => {
|
||||
Object.assign(option, opt)
|
||||
console.log(opt);
|
||||
if (opt.tableId) {
|
||||
userNumbers.list = new Array(opt.maxCapacity ? opt.maxCapacity * 1 : 100).fill(1).map((v, index) => {
|
||||
return (index + 1) + '人'
|
||||
})
|
||||
getTableInfo(opt.tableId)
|
||||
console.log("opt====",opt);
|
||||
if (opt.tableId||opt.tableCode) {
|
||||
pageData.table.id = opt.tableId
|
||||
pageData.table.tableCode = opt.tableCode
|
||||
getTableInfo(opt)
|
||||
}
|
||||
getTbShopInfo()
|
||||
init()
|
||||
@@ -511,23 +509,26 @@
|
||||
break;
|
||||
case 'onboc_add':
|
||||
case 'add':
|
||||
cartItem = getNowCart(msg.data,$originGoods,pageData.user)
|
||||
cartItem = getNowCart(msg.data,$goods,pageData.user)
|
||||
cartControls(cartItem,'add')
|
||||
break;
|
||||
case 'onboc_edit':
|
||||
case 'edit':
|
||||
cartItem = getNowCart(msg.data,$originGoods,pageData.user)
|
||||
cartItem = getNowCart(msg.data,$goods,pageData.user)
|
||||
cartControls(cartItem,'edit')
|
||||
break;
|
||||
case 'onboc_del':
|
||||
case 'del':
|
||||
cartItem = getNowCart(msg.data,$originGoods,pageData.user)
|
||||
cartItem = getNowCart(msg.data,$goods,pageData.user)
|
||||
cartControls(cartItem,'del')
|
||||
break;
|
||||
case 'onboc_cleanup':
|
||||
case 'cleanup':
|
||||
goods.lis = []
|
||||
break;
|
||||
case 'product_update':
|
||||
init()
|
||||
break;
|
||||
}
|
||||
|
||||
});
|
||||
@@ -556,7 +557,6 @@
|
||||
let goodsRes = await getGoods()
|
||||
// await getCart()
|
||||
$goods = goodsRes.records
|
||||
console.log($seatFee);
|
||||
if (!$seatFee.totalNumber) {
|
||||
updateChoseCount()
|
||||
}
|
||||
@@ -603,10 +603,16 @@
|
||||
/**
|
||||
* 获取桌台信息
|
||||
*/
|
||||
async function getTableInfo(id) {
|
||||
const res = await getShopTableDetail({id: id})
|
||||
pageData.table = res
|
||||
getHistoryOrderDetail(res.tableCode)
|
||||
async function getTableInfo(opt) {
|
||||
const res = await getShopTableDetail({id: opt.tableId,tableCode: opt.tableCode})
|
||||
Object.assign(pageData.table, res)
|
||||
if(!pageData.shopInfo.isTableFee&&pageData.table&&pageData.table.id){
|
||||
userNumbers.list = new Array(res.maxCapacity ? res.maxCapacity * 1 : 100).fill(1).map((v, index) => {
|
||||
return (index + 1) + '人'
|
||||
})
|
||||
}
|
||||
|
||||
getHistoryOrderDetail(opt.tableCode)
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -797,15 +803,16 @@
|
||||
* 更新就餐人数
|
||||
*/
|
||||
async function updateChoseCount() {
|
||||
const maxCapacity = pageData.table.id ? (pageData.table.maxCapacity || 0) : 100
|
||||
if (pageData.table.id && userNumbers.defaultCateIndex * 1 + 1 > maxCapacity) {
|
||||
const maxCapacity = pageData.table&&pageData.table.id ? (pageData.table.maxCapacity || 0) : 100
|
||||
if (pageData.table&&pageData.table.id && userNumbers.defaultCateIndex * 1 + 1 > maxCapacity) {
|
||||
uni.showToast({
|
||||
title: '当前台桌最大人数为: ' + maxCapacity
|
||||
})
|
||||
userNumbers.defaultCateIndex = maxCapacity - 1
|
||||
return
|
||||
}
|
||||
if (!pageData.shopInfo.isTableFee && pageData.table.id) {
|
||||
console.log(pageData.table)
|
||||
if (!pageData.shopInfo.isTableFee && pageData.table && pageData.table.id) {
|
||||
//不免餐位费
|
||||
|
||||
let seatFee = {
|
||||
@@ -827,10 +834,6 @@
|
||||
userNumbers.defaultCateIndex = e.detail.value
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
function chooseUser() {
|
||||
go.to('PAGES_CHOOSE_USER')
|
||||
}
|
||||
@@ -841,11 +844,6 @@
|
||||
})
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
function watchChooseTable() {
|
||||
uni.$off('choose-table')
|
||||
uni.$on('choose-table', (data) => {
|
||||
@@ -854,9 +852,6 @@
|
||||
})
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
function changeGoodsSel(index) {
|
||||
goods.sel = index
|
||||
}
|
||||
@@ -878,23 +873,24 @@
|
||||
let placeNum = pageData.shopInfo.registerType == 'after'&&pageData.orderInfo ? pageData.orderInfo.placeNum + 1 : 1;
|
||||
let par = {
|
||||
shopId: pageData.shopInfo.id, //店铺Id
|
||||
userId: pageData.user.userId, //用户Id
|
||||
userId: pageData.user.userId, //用户Id
|
||||
tableCode: pageData.table.tableCode, //台桌编码
|
||||
dineMode: pageData.eatTypes.active, //用餐模式 堂食 dine-in 外带 take-out 外卖 take-away
|
||||
remark: pageData.form.note, //备注
|
||||
seatNum: userNumbers.defaultCateIndex * 1 + 1, //用餐人数
|
||||
seatNum: 0, //用餐人数
|
||||
packFee: $packFee.value, //打包费
|
||||
originAmount: goodsPrice.value, //订单原金额(包含打包费+餐位费) 不含折扣价格
|
||||
placeNum: placeNum, //当前订单下单次数
|
||||
waitCall: 0, //是否等叫 0 否 1 等叫
|
||||
vipPrice: vipPrice, //是否使用会员价
|
||||
}
|
||||
if(!pageData.shopInfo.isTableFee&&pageData.table&&pageData.table.id){
|
||||
par.seatNum = userNumbers.defaultCateIndex * 1 + 1
|
||||
}
|
||||
if(pageData.shopInfo.registerType == 'after'&&pageData.orderInfo){
|
||||
par.orderId = pageData.orderInfo.id
|
||||
}
|
||||
|
||||
console.log(userNumbers.defaultCateIndex * 1 + 1)
|
||||
console.log(pageData.shopInfo.registerType)
|
||||
const res = await createOrder(par)
|
||||
uni.$emit('update:createOrderIndex')
|
||||
websocketUtil.send(JSON.stringify({
|
||||
|
||||
Reference in New Issue
Block a user