fix: 代客下单增加转台功能,修复临时菜价格展示问题,增加就餐类型切换为打包时,加菜默认为打包

This commit is contained in:
2025-03-13 18:31:36 +08:00
parent dc5dc45893
commit a3f8c8c012
11 changed files with 268 additions and 52 deletions

View File

@@ -123,6 +123,7 @@
@packClick="showPack"
@changePriceClick="showChangePrice"
@return="refReturnCartShow"
@rottable="rottableShow"
/>
</div>
<div class="right">
@@ -213,6 +214,8 @@
<returnCart ref="refReturnCart" @confirm="refReturnCartConfirm"></returnCart>
<!-- 美团抖音核销 -->
<quanHexiao ref="refQuanHexiao"></quanHexiao>
<!-- 转桌 -->
<rottable ref="refRotTable" :cartGoods="carts.list"></rottable>
</div>
</template>
<script setup>
@@ -228,6 +231,7 @@ import chooseUser from "./components/choose-user.vue";
import changeWeight from "./components/popup-weight-goods.vue";
import changeTaocan from "./components/popup-taocan-goods.vue";
import addLingShiCai from "./components/popup-linshiCai.vue";
import rottable from "./components/popup-rottable.vue";
import GoodsItem from "./components/goods-item.vue";
import dialogGoodsSel from "./components/dialog-goods-sel.vue";
import cartsList from "./components/carts/list.vue";
@@ -247,6 +251,15 @@ const shopUser = useUserStore();
const route = useRoute();
const router = useRouter();
//转桌
const refRotTable = ref();
function rottableShow() {
refRotTable.value.open({
sourceOrderId: carts.oldOrder.id,
});
}
//美团抖音核销
const refQuanHexiao = ref();
function refQuanHexiaoOpen() {
@@ -473,20 +486,10 @@ function showaddLingShiCai() {
refAddLingShiCai.value.open();
}
function addLingShiCaiConfirm(data) {
carts.add({
addCarts({
sku_id: "-999",
product_id: "-999",
is_temporary: 1,
sku_name: 1,
number: 1,
is_pack: 0,
is_gift: 0,
discount_sale_amount: 0,
discount_sale_note: "",
is_print: 0,
is_wait_call: 0,
product_name: "",
remark: "",
...data,
});
}
@@ -537,8 +540,16 @@ const diners = reactive({
function changeDinersSel(index) {
diners.sel = index;
carts.dinnerType = diners.sel == 0 ? "dine-in" : "take-out";
}
watch(
() => diners.sel,
(newval) => {
carts.changePack(newval);
}
);
// 商品分类
const category = reactive({
list: [],
@@ -588,7 +599,6 @@ async function getGoods() {
goodsMapisFinish.value = true;
}
const cartsLoading = computed(() => {
console.log(goodsMapisFinish.value, carts.isLinkFinshed);
return !goodsMapisFinish.value || !carts.isLinkFinshed;
});
function goodsClick(item) {
@@ -659,7 +669,7 @@ function clearCarts() {
});
}
function addCarts(item) {
carts.add(item);
carts.add({ pack_number: diners.sel ? item.number : 0, ...item });
}
watch(
@@ -676,7 +686,6 @@ function init() {
onMounted(async () => {
const { id, tableCode } = route.query;
console.log(id, tableCode);
if (id) {
// 获取历史订单数据
const res = await orderApi.getHistoryList({
@@ -707,7 +716,9 @@ onMounted(async () => {
//获取台桌数据
if (res.tableCode) {
const tableRes = await tableApi.get({ tableCode: res.tableCode });
table.value = tableRes || {};
if (tableRes.tableCode) {
table.value = tableRes || {};
}
}
if (res) {
oldOrder.value = res;
@@ -718,13 +729,15 @@ onMounted(async () => {
}
if (tableCode) {
const tableRes = await tableApi.get({ tableCode: tableCode });
table.value = tableRes || {};
if (tableRes.tableCode) {
table.value = tableRes || {};
}
}
console.log(table.value);
init();
});
function refresh() {
console.log(refresh);
oldOrder.value = {
detailMap: [],
};
@@ -777,7 +790,7 @@ $pl: 30px;
height: 100%;
max-height: calc(100vh - 256px);
.left {
flex: 1;
width: 330px;
padding-right: 14px;
box-sizing: border-box;
display: flex;
@@ -790,7 +803,7 @@ $pl: 30px;
}
}
.right {
flex: 4;
flex: 1;
overflow-x: hidden;
overflow-y: scroll;
&::-webkit-scrollbar {