合并桌问题与称重退款

This commit is contained in:
duan 2024-12-19 18:08:44 +08:00
parent f7a9a2b567
commit db6b1af326
4 changed files with 71 additions and 40 deletions

View File

@ -112,14 +112,13 @@
</view>
</view>
</template>
<template v-if="goods.list[0].tableId">
<!-- 不免餐位费 -->
<!-- <template v-if="goods.list[0].tableId&&goods.list[0].orderId">
<view class="block" @tap="rotatingTables"
style="display: flex;align-items: center;justify-content: space-between;">
<view>转桌/并桌</view>
<uni-icons type="right" color="#999" size="16"></uni-icons>
</view>
</template>
</template> -->
</template>

View File

@ -8,15 +8,17 @@
请选择其他桌
</view>
<view class="uni-list">
<radio-group @change="radioChange">
<radio-group @change="radioChange" v-if="datas.tableList.length">
<label class="uni-list-cell uni-list-cell-pd" v-for="(item, index) in datas.tableList" :key="index">
<view class="u-m-t-48 u-m-b-48" v-if="item.status=='using'">
<radio :value="item" /> {{item.name}}
<view class="u-m-t-48 u-m-b-48">
<radio :value="item.tableId" /> {{item.name}}
</view>
</label>
</radio-group>
<view v-else>
暂无数据
</view>
</view>
<view class="uni-list" v-if="datas.current==0">
<view class="u-m-t-48">
请选择需要转桌的菜品
@ -25,7 +27,7 @@
<label class="uni-list-cell uni-list-cell-pd" v-for="(item,index) in datas.item" :key="index">
<view class="u-flex u-m-t-48 u-m-b-48" style="justify-content: space-between;align-items: center;">
<view class="u-flex">
<checkbox :value="item.id" />
<checkbox :value="item.cartId" />
<image class="img" v-if="item.coverImg" :src="item.coverImg" mode=""></image>
&nbsp;&nbsp;
{{item.name}}
@ -96,13 +98,14 @@
item: {
type: Array
},
tableId: {
type: String
}
})
onLoad((opt) => {
// console.log(JSON.parse(opt.item) ,'1')
datas.item = JSON.parse(opt.item)
})
onShow(() => {
console.log(11111)
gettableList()
})
async function confirm() {
@ -116,11 +119,18 @@
useType: datas.item[0].useType,
cartIds: datas.changeTable,
currentTableId: datas.item[0].tableId,
targetTableId: datas.selecttableList.tableId
targetTableId: datas.selecttableList
})
if (res) {
go.back()
uni.navigateBack({
delta: 2
})
}
} else {
uni.showToast({
title: '请选择菜品或桌号!',
icon: 'none'
});
}
} else {
let res = await tableswitch({
@ -128,12 +138,19 @@
useType: datas.item[0].useType,
isFull: true,
currentTableId: datas.item[0].tableId,
targetTableId: datas.selecttableList.tableId
targetTableId: datas.selecttableList
})
if (res) {
go.back()
uni.navigateBack({
delta: 2
})
}
}
} else {
uni.showToast({
title: '请选择菜品或桌号!',
icon: 'none'
});
}
}
@ -152,7 +169,13 @@
page: 1,
size: 999
})
datas.tableList = res.content
let arr = []
res.content.forEach((ele) => {
if (ele.status == 'using' && props.tableId != ele.tableId) {
arr.push(ele)
}
});
datas.tableList = arr
}
function formatPrice(n) {

View File

@ -4,7 +4,7 @@
<text class="">桌号</text>
<text class="">{{orderInfo.tableName||""}}</text>
</view>
<view class=" font-bold u-p-b-32 border-bottom u-m-b-24">
<view class=" font-bold u-p-b-32 border-bottom u-m-b-24" v-if="orderInfo.tableName">
<view class="block" @tap="rotatingTables"
style="display: flex;align-items: center;justify-content: space-between;">
<view>转桌/并桌</view>
@ -571,11 +571,15 @@
res.salePrice = res.price
// number
res.number = res.num
res.masterId = props.orderInfo.masterId
res.useType = props.orderInfo.useType
res.tableId = props.orderInfo.tableId
arr.push(res)
})
})
uni.navigateTo({
url: '/pagesCreateOrder/confirm-order/rotatingTables?item=' + JSON.stringify(arr),
url: '/pagesCreateOrder/confirm-order/rotatingTables?item=' + JSON.stringify(arr) + '&tableId=' + props
.orderInfo.tableId
})
}
const goodsNumber = computed(() => {

View File

@ -6,22 +6,23 @@
{{data.productName}}
</view>
<view class="u-flex u-m-t-32" :class="{'gray':data.productId=='-999'}">
<up-number-box :min="1" :max="data.num" :buttonSize="44" v-model="number" integer :disabled="data.productId=='-999'">
<up-number-box :min="0" :max="data.num" :buttonSize="44" v-model="number" integer
:disabled="data.productId=='-999'">
<template #minus>
<view class="minus number-box-btn">
</view>
</template>
<template #input>
<view class="u-flex-1 u-row-center u-text-center input">
<up-input
:disabled="data.productId=='-999'"
@change="parseIntNumber($event,false)" @blur="parseIntNumber($event,true)"
v-model="number" border="none" type="number"></up-input>
<up-input :disabled="data.productId=='-999'" @change="parseIntNumber($event,false)"
@blur="parseIntNumber($event,true)" v-model="number" border="none"
type="number"></up-input>
</view>
</template>
<template #plus>
<view class="plus number-box-btn">
<up-icon v-if="data.productId=='-999'" name="plus" color="#ccc" size="16" bold></up-icon>
<up-icon v-if="data.productId=='-999'" name="plus" color="#ccc" size="16"
bold></up-icon>
<up-icon v-else name="plus" color="#999" size="16" bold></up-icon>
</view>
</template>
@ -50,8 +51,7 @@
<view class="u-p-t-18 u-p-l-30 u-p-r-30 u-p-b-10">
<my-button box-shadow shape="circle" @tap="confirm">确认退菜</my-button>
<view class="u-m-t-10">
<my-button @tap="onModelClose" shape="circle" bgColor="#fff" type="cancel"
box-shadow>取消</my-button>
<my-button @tap="onModelClose" shape="circle" bgColor="#fff" type="cancel" box-shadow>取消</my-button>
</view>
</view>
@ -71,7 +71,7 @@
type: Object,
default: () => {
return {
productId:'-999'
productId: '-999'
}
}
},
@ -86,7 +86,7 @@
const emits = defineEmits(['update:show', 'confirm'])
let model = ref(null)
let modelShow = ref(props.show)
let number = ref(1)
let number = ref(0)
const tags = ref([{
label: "点错",
checked: false
@ -108,8 +108,11 @@
if (newval > props.data.num) {
newval = props.data.num
}
if (newval < 1) {
newval = 1
//
if (props.data.isWeight != 1) {
if (newval < 1) {
newval = 1
}
}
if (isNow) {
number.value = parseInt(newval)
@ -138,10 +141,10 @@
function toggleModelShow(show) {
modelShow.value = show ? true : false
}
function onModelClose() {
number.value=1
number.value = 1
modelShow.value = false
}
@ -151,17 +154,17 @@
function open() {
model.value.open()
if(props.data.productId=='-999'){
number.value=props.data.num
if (props.data.productId == '-999') {
number.value = props.data.num
}
}
function close() {
model.value.close()
tags.value.map(v=>{
v.checked=false
tags.value.map(v => {
v.checked = false
})
form.note=''
form.note = ''
}
function confirm() {
@ -206,12 +209,14 @@
::v-deep .uni-input-input {
text-align: center;
}
.gray{
.minus::after{
.gray {
.minus::after {
border-color: #ccc;
}
}
.minus {
&::after {
content: '';