合并桌问题与称重退款

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

@@ -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) {