|
@@ -14,7 +14,12 @@
|
|
class="justify-between items-center flex text-xl font-semibold font-mono"
|
|
class="justify-between items-center flex text-xl font-semibold font-mono"
|
|
>
|
|
>
|
|
<span>{{ '桌台:' + data.deskName }}</span>
|
|
<span>{{ '桌台:' + data.deskName }}</span>
|
|
- <span>{{ data.currentNum + '/' + data.deskCap }}</span>
|
|
|
|
|
|
+ <div class="flex items-center">
|
|
|
|
+ <span>{{ data.currentNum + '/' + data.deskCap }}</span>
|
|
|
|
+ <el-icon class="ml-2 cursor-pointer" @click="open({name: data.deskName, num: data.deskCap, userNum: data.currentNum, ordersId: params.number})">
|
|
|
|
+ <Refresh />
|
|
|
|
+ </el-icon>
|
|
|
|
+ </div>
|
|
</div>
|
|
</div>
|
|
</template>
|
|
</template>
|
|
<el-scrollbar ref="scrollbarRef" class="scrollbar">
|
|
<el-scrollbar ref="scrollbarRef" class="scrollbar">
|
|
@@ -363,8 +368,8 @@ const open = (item: any, num?: number, orderNumber?: any) => {
|
|
data.deskCap = item.num
|
|
data.deskCap = item.num
|
|
data.currentNum = item.userNum ? item.userNum : num
|
|
data.currentNum = item.userNum ? item.userNum : num
|
|
params.number = item.ordersId ? item.ordersId : orderNumber
|
|
params.number = item.ordersId ? item.ordersId : orderNumber
|
|
- params.userId = null;
|
|
|
|
- params.couponId = null;
|
|
|
|
|
|
+ params.userId = '';
|
|
|
|
+ params.couponId = '';
|
|
//查询当前订单下的所有菜品
|
|
//查询当前订单下的所有菜品
|
|
deskOrderedDishListAll({ id: params.number }).then((res) => {
|
|
deskOrderedDishListAll({ id: params.number }).then((res) => {
|
|
res.forEach((good: { id:number, ordersDishId: number }) => {
|
|
res.forEach((good: { id:number, ordersDishId: number }) => {
|
|
@@ -635,37 +640,37 @@ const reduce = (item: any) => {
|
|
}
|
|
}
|
|
orderLoading.value = true
|
|
orderLoading.value = true
|
|
//查找未出单的餐品列表
|
|
//查找未出单的餐品列表
|
|
- const list = data.selectGoods.filter((element: any) => {return element.status != 1})
|
|
|
|
- let tempGoods: string | any[] = []
|
|
|
|
- //先从历史下单但是没有结单的餐品中找出要操作的餐品
|
|
|
|
- tempGoods = list.filter((element: any) => {
|
|
|
|
- const specsIds: number[] = [];
|
|
|
|
- element.specsList?.forEach((spec: any) => {
|
|
|
|
- specsIds.push(spec.specsId)
|
|
|
|
- })
|
|
|
|
- return element.artId && element.artId == item.artId &&
|
|
|
|
- specsIds.sort((a: number, b: number) => a - b).join(',') == (item.selectedSpecIds || []).sort((a: number, b: number) => a - b).join(',')
|
|
|
|
- })
|
|
|
|
|
|
+ // const list = data.selectGoods.filter((element: any) => {return element.status != 1})
|
|
|
|
+ // let tempGoods: string | any[] = []
|
|
|
|
+ // //先从历史下单但是没有结单的餐品中找出要操作的餐品
|
|
|
|
+ // tempGoods = list.filter((element: any) => {
|
|
|
|
+ // const specsIds: number[] = [];
|
|
|
|
+ // element.specsList?.forEach((spec: any) => {
|
|
|
|
+ // specsIds.push(spec.specsId)
|
|
|
|
+ // })
|
|
|
|
+ // return element.artId && element.artId == item.artId &&
|
|
|
|
+ // specsIds.sort((a: number, b: number) => a - b).join(',') == (item.selectedSpecIds || []).sort((a: number, b: number) => a - b).join(',')
|
|
|
|
+ // })
|
|
// if(tempGoods.length==0){//历史没有,则从当次下单的餐品列表中找
|
|
// if(tempGoods.length==0){//历史没有,则从当次下单的餐品列表中找
|
|
// tempGoods = list.filter((element: any) => {
|
|
// tempGoods = list.filter((element: any) => {
|
|
// return element.id == item.id && !element.artId
|
|
// return element.id == item.id && !element.artId
|
|
// })
|
|
// })
|
|
// }
|
|
// }
|
|
|
|
|
|
- console.log('tempGoods', tempGoods)
|
|
|
|
|
|
+ // console.log('tempGoods', tempGoods)
|
|
console.log('data.selectGoods', data.selectGoods)
|
|
console.log('data.selectGoods', data.selectGoods)
|
|
- const t = data.selectGoods.indexOf(tempGoods[0])
|
|
|
|
- const n = data.selectGoods[t].num
|
|
|
|
- console.log('reduce', n, tempGoods)
|
|
|
|
- if (n > 1) {
|
|
|
|
- dishDec({ id: item.ordersDishId || tempGoods[0].id}).then(() => {
|
|
|
|
|
|
+ const t = data.selectGoods.indexOf(item)
|
|
|
|
+ // const n = data.selectGoods[t].num
|
|
|
|
+ console.log('reduce', t, item)
|
|
|
|
+ if (item.num > 1) {
|
|
|
|
+ dishDec({ id: item.ordersDishId}).then(() => {
|
|
data.selectGoods[t].num--
|
|
data.selectGoods[t].num--
|
|
reduceHandle(item)
|
|
reduceHandle(item)
|
|
}).finally(()=>{
|
|
}).finally(()=>{
|
|
orderLoading.value = false;
|
|
orderLoading.value = false;
|
|
})
|
|
})
|
|
} else {//餐品数量为0,要删减该餐品
|
|
} else {//餐品数量为0,要删减该餐品
|
|
- dishDel({ id: item.ordersDishId || tempGoods[0].id}).then(() => {
|
|
|
|
|
|
+ dishDel({ id: item.ordersDishId}).then(() => {
|
|
data.selectGoods.splice(t, 1)
|
|
data.selectGoods.splice(t, 1)
|
|
reduceHandle(item)
|
|
reduceHandle(item)
|
|
}).finally(()=>{
|
|
}).finally(()=>{
|