tablecode

This commit is contained in:
gyq
2026-03-19 17:25:24 +08:00
parent 392d4aa676
commit b3d153ab86
6 changed files with 91 additions and 102 deletions

View File

@@ -246,7 +246,8 @@ async function refReturnCartConfirm(e) {
if (res) {
// 获取历史订单数据
const res1 = await orderApi.getHistoryList({
orderId: carts.oldOrder.id,
// orderId: carts.oldOrder.id,
tableCode: carts.table_code,
});
if (res1) {
carts.setOldOrder(res1);
@@ -370,7 +371,8 @@ async function createOrder(key) {
if (res.id) {
// 获取历史订单数据
const res1 = await orderApi.getHistoryList({
orderId: res.id,
// orderId: carts.oldOrder.id,
tableCode: carts.table_code,
});
if (res1) {
carts.setOldOrder(res1);
@@ -403,7 +405,8 @@ async function clearOldOrderCallback() {
try {
// 获取历史订单数据
const res = await orderApi.getHistoryList({
orderId: carts.oldOrder.id,
// orderId: carts.oldOrder.id,
tableCode: carts.table_code,
});
const noPayStatus = {
cancelled: "订单已取消",
@@ -415,8 +418,23 @@ async function clearOldOrderCallback() {
showOrder.value = false;
return;
}
if (res) {
console.log('清空历史订单回调', res);
if (res.data !== null) {
console.log('还有历史订单数据');
carts.setOldOrder(res);
} else {
console.log('历史订单没数据了');
carts.oldOrder = {
detailMap: [],
originAmount: 0,
};
carts.setOldOrder({
detailMap: [],
originAmount: 0,
}, 9);
// carts.clearHistory();
// resetOldOrder();
}
} catch (error) {
console.log(error);
@@ -748,7 +766,7 @@ function init() {
getTableList();
getCategoryList();
changeCartsDinerType();
carts.init({ table_code: carts.tableInfo.tableCode }, carts.oldOrder);
carts.init({ table_code: carts.tableInfo.tableCode });
}
onBeforeRouteLeave(() => {
@@ -760,13 +778,18 @@ onMounted(async () => {
const { id, tableCode, key } = route.query;
if (id || tableCode) {
// 获取历史订单数据
const res = id
? await orderApi.getHistoryList({
orderId: id,
})
: await orderApi.getHistoryList({
tableCode,
});
// const res = id
// ? await orderApi.getHistoryList({
// orderId: id,
// })
// : await orderApi.getHistoryList({
// tableCode,
// });
const res = await orderApi.getHistoryList({
// orderId: carts.oldOrder.id,
tableCode: carts.table_code,
});
const noPayStatus = {
cancelled: "订单已取消",
done: "订单已关闭",
@@ -799,6 +822,8 @@ onMounted(async () => {
}
}
if (res) {
console.log('res31231231331-=====--', res);
carts.setOldOrder(res);
showOrder.value = key == "isPayOrder" ? true : false;
perpole.value = res.seatNum || 0;