增加订单列表详情的客座费打包费
This commit is contained in:
@@ -2,61 +2,103 @@
|
||||
<view class="default-box-padding bg-fff border-r-12 u-m-t-20">
|
||||
<view class="u-flex u-row-between">
|
||||
<view class="font-bold">附加费</view>
|
||||
<template v-if="orderInfo.status=='unpaid'&&data.status!='return'">
|
||||
<template v-if="orderInfo.status=='unpaid'&&data.status!='return'">
|
||||
<my-button plain shape="circle" :width="160" :height="56" @click="tuicai">退菜</my-button>
|
||||
</template>
|
||||
<template v-if="orderInfo.status=='closed'&&data.status!='return'">
|
||||
<my-button plain shape="circle" :width="160" :height="56" @click="tuikuan">退款</my-button>
|
||||
</template>
|
||||
</view>
|
||||
<template v-if="data.status!='return'">
|
||||
<view class="u-flex u-row-between u-m-t-24">
|
||||
<view>{{data.name||'餐位费'}}</view>
|
||||
<view>x{{data.number}}</view>
|
||||
<view>¥{{data.totalAmount}}</view>
|
||||
</view>
|
||||
</template>
|
||||
<template v-else>
|
||||
<view class="u-flex u-row-between u-m-t-24 color-999">
|
||||
<view class="u-flex">
|
||||
<view class="line-th ">{{data.name||'餐位费'}}</view>
|
||||
<view class="tag yitui u-m-l-10">已退</view>
|
||||
<view>
|
||||
<template v-if="data.status!='return'">
|
||||
<view class="u-flex u-row-between u-m-t-24">
|
||||
<view>{{data.name||'餐位费'}}</view>
|
||||
<view>x{{data.number}}</view>
|
||||
<view class="price-min-width">¥{{data.totalAmount}}</view>
|
||||
</view>
|
||||
<view class="line-th">x{{data.number}}</view>
|
||||
<view class="line-th">¥{{data.totalAmount}}</view>
|
||||
</view>
|
||||
</template>
|
||||
</template>
|
||||
<template v-else>
|
||||
<view class="u-flex u-row-between u-m-t-24 color-999">
|
||||
<view class="u-flex">
|
||||
<view class="line-th ">{{data.name||'餐位费'}}</view>
|
||||
<view class="tag yitui u-m-l-10">已退</view>
|
||||
</view>
|
||||
<view class="line-th">x{{data.number||0}}</view>
|
||||
<view class="line-th">¥{{data.totalAmount}}</view>
|
||||
</view>
|
||||
</template>
|
||||
<!-- <view class="u-flex u-row-right u-m-t-24">
|
||||
<template v-if="orderInfo.status=='unpaid'&&data.status!='return'">
|
||||
<my-button plain shape="circle" :width="160" :height="56" @click="tuicai">退菜</my-button>
|
||||
</template>
|
||||
<template v-if="orderInfo.status=='closed'&&data.status!='return'">
|
||||
<my-button plain shape="circle" :width="160" :height="56" @click="tuikuan">退款</my-button>
|
||||
</template>
|
||||
</view> -->
|
||||
|
||||
</view>
|
||||
<view class="u-flex u-row-between u-m-t-24" v-if="packeFee>0">
|
||||
<view>打包费</view>
|
||||
<view>x{{packeNumbber}}</view>
|
||||
<view class="price-min-width">¥{{packeFee}}</view>
|
||||
</view>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script setup>
|
||||
import {
|
||||
computed
|
||||
} from 'vue'
|
||||
const props = defineProps({
|
||||
data: {
|
||||
type: Object,
|
||||
default: () => {}
|
||||
},
|
||||
orderInfo:{
|
||||
orderInfo: {
|
||||
type: Object,
|
||||
default: () => {}
|
||||
default: () => {
|
||||
return {
|
||||
detailList: []
|
||||
}
|
||||
}
|
||||
},
|
||||
table:{
|
||||
table: {
|
||||
type: Object,
|
||||
default: () => {}
|
||||
}
|
||||
})
|
||||
|
||||
const statusMap={
|
||||
unpaid:'未支付'
|
||||
const packeNumbber = computed(() => {
|
||||
if (!props.orderInfo.detailList) {
|
||||
return 0
|
||||
}
|
||||
return props.orderInfo.detailList.reduce((prve, cur) => {
|
||||
return prve + (cur.packAmount>0?cur.num:0)
|
||||
}, 0)
|
||||
})
|
||||
const packeFee = computed(() => {
|
||||
if (!props.orderInfo.detailList) {
|
||||
return 0
|
||||
}
|
||||
return props.orderInfo.detailList.reduce((prve, cur) => {
|
||||
return prve + cur.packAmount
|
||||
}, 0).toFixed(2)
|
||||
})
|
||||
|
||||
const statusMap = {
|
||||
unpaid: '未支付'
|
||||
}
|
||||
const emits=defineEmits(['tuicai','tuikuan','printOrder'])
|
||||
function returnStatus(status){
|
||||
return statusMap[status]||''
|
||||
const emits = defineEmits(['tuicai', 'tuikuan', 'printOrder'])
|
||||
|
||||
function returnStatus(status) {
|
||||
return statusMap[status] || ''
|
||||
}
|
||||
function tuikuan(){
|
||||
emits('tuikuan',props.data)
|
||||
|
||||
function tuikuan() {
|
||||
emits('tuikuan', props.data)
|
||||
}
|
||||
function tuicai(){
|
||||
emits('tuicai',props.data)
|
||||
|
||||
function tuicai() {
|
||||
emits('tuicai', props.data)
|
||||
}
|
||||
</script>
|
||||
|
||||
@@ -65,9 +107,14 @@
|
||||
padding: 0 6rpx;
|
||||
border-radius: 8rpx;
|
||||
font-size: 24rpx;
|
||||
|
||||
&.yitui {
|
||||
background-color: rgb(188, 188, 188);
|
||||
color: #fff;
|
||||
}
|
||||
}
|
||||
.price-min-width{
|
||||
min-width: 100rpx;
|
||||
text-align: right;
|
||||
}
|
||||
</style>
|
||||
@@ -53,7 +53,7 @@
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
<template v-if="orderInfo.status=='unpaid'">
|
||||
<template v-if="orderInfo.status=='unpaid'&&orderInfo.useType!='dine-in-before'">
|
||||
<view class="u-flex u-row-right gap-20 u-m-t-24" v-if="item.status!='return'">
|
||||
<!-- <my-button :height="60" color="#333" plain type="cancel" shape="circle">更多操作</my-button> -->
|
||||
<my-button :width="128" :height="48" plain shape="circle"
|
||||
|
||||
@@ -7,7 +7,8 @@
|
||||
</view> -->
|
||||
<goods-list @printOrder="onPrintOrder" @tuikuan="onTuikuan" :orderInfo="orderDetail.info"
|
||||
:data="orderDetail.goodsList" :seatFee="orderDetail.seatFee" @tuicai="onTuiCai"></goods-list>
|
||||
<template v-if="orderDetail.seatFee.totalNumber&&orderDetail.seatFee.totalAmount">
|
||||
<!-- <template v-if="orderDetail.seatFee.totalNumber&&orderDetail.seatFee.totalAmount"> -->
|
||||
<template v-if="true">
|
||||
<extra-vue @tuicai="onSeatFeeTuicai" @tuikuan="onSeatFeeTuiKuan" :orderInfo="orderDetail.info"
|
||||
:data="orderDetail.seatFee"></extra-vue>
|
||||
</template>
|
||||
@@ -16,7 +17,7 @@
|
||||
<view style="height: 200rpx;"></view>
|
||||
<view class="u-fixed bottom bg-fff ">
|
||||
<view class="u-flex u-abso">
|
||||
<template v-if="orderDetail.info.useType=='takeout'">
|
||||
<template v-if="orderDetail.info.useType=='takeout'||!orderDetail.info.tableId||orderDetail.info.useType=='dine-in-before'">
|
||||
<view class="u-flex-1" v-if="orderDetail.info.status=='unpaid'">
|
||||
<my-button @tap="toPay" borderRadius="100rpx" shape="circle"
|
||||
type="primary">结账</my-button>
|
||||
|
||||
Reference in New Issue
Block a user