优化台桌点餐
This commit is contained in:
@@ -26,7 +26,7 @@
|
||||
</div>
|
||||
</div>
|
||||
<div class="list_wrap card" style="margin-top: var(--el-font-size-base)">
|
||||
<div class="item" v-for="item in props.cart" :key="item.id">
|
||||
<div class="item" v-for="item in cartList" :key="item.id">
|
||||
<div class="top">
|
||||
<span class="name">{{ item.name }}</span>
|
||||
<span class="n">x{{ item.number }}</span>
|
||||
@@ -148,6 +148,8 @@ const props = defineProps({
|
||||
}
|
||||
});
|
||||
|
||||
const cartList = ref([])
|
||||
|
||||
const isPrint = ref(true);
|
||||
|
||||
|
||||
@@ -202,7 +204,7 @@ const printHandle = _.throttle(async function () {
|
||||
shop_name: store.userInfo.shopName,
|
||||
loginAccount: store.userInfo.loginAccount,
|
||||
isBefore: true,
|
||||
carts: props.cart,
|
||||
carts: cartList.value,
|
||||
amount: formatDecimal(props.amount),
|
||||
discountAmount: propsDiscount.value > 0 ? formatDecimal(props.amount * propsDiscount.value) : formatDecimal(props.amount),
|
||||
discount: formatDecimal(propsDiscount.value * 10, 1, true),
|
||||
@@ -305,6 +307,16 @@ function paySuccess() {
|
||||
|
||||
function show() {
|
||||
dialogVisible.value = true;
|
||||
cartList.value = []
|
||||
props.cart.map(item => {
|
||||
if (item.info && item.info.length) {
|
||||
item.info.map(item => {
|
||||
cartList.value.push({ ...item })
|
||||
})
|
||||
} else {
|
||||
cartList.value.push({ ...item })
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
defineExpose({
|
||||
|
||||
Reference in New Issue
Block a user