代客下单增加单品备注,退客座费

台桌列表修改时间展示不足1分钟显示0分
This commit is contained in:
2024-09-27 13:46:11 +08:00
parent 60bc61d40f
commit 1acf00daab
4 changed files with 102 additions and 47 deletions

View File

@@ -303,7 +303,8 @@
</template>
<!-- 餐位费 -->
<template v-if="order.seatFee && order.seatFee.totalAmount > 0">
<div class="carts_list_title">餐位费</div>
<div class="list">
<div class="carts_list_title">餐位费</div>
<cart-item
@itemClick="changeOrderExtraSel"
:canChangeNumber="false"
@@ -315,6 +316,8 @@
:placeNum="-10"
:selPlaceNum="order.selPlaceNum"
></cart-item>
</div>
</template>
<div class="order_remark" v-if="note.content">
订单备注 {{ note.content }}
@@ -516,8 +519,11 @@
prveOrder.list.length
}}</span>
</div> -->
<div class="btn"
:class="{ disabled: order.selIndex < 0 }"
@click="refNoteShow(true)">单品备注</div>
<div class="btn" @click="refNoteShow">整单备注</div>
<div class="btn" @click="refNoteShow(false)">整单备注</div>
<div
class="btn"
:class="{
@@ -1171,6 +1177,8 @@ export default {
},
data() {
return {
//是否是单品备注
isDanNote: false,
//店铺信息
shopInfo: {},
//就餐饭方式
@@ -1350,7 +1358,7 @@ export default {
computed: {
disableTuicai() {
return (
this.order.placeNum>=1 ||this.order.selIndex>=0||!this.order.selGoods||
this.order.placeNum==1 ||this.order.selIndex>=0||!this.order.selGoods||this.order.old.list.length<=0||
this.order.selGoods.status == "return"
);
},
@@ -1410,7 +1418,7 @@ export default {
.reduce((a, b) => {
return a + b.number * b.salePrice;
}, 0);
return (oldPrice + price + this.order.seatFee.totalAmount * 1).toFixed(2);
return (oldPrice + price + this.order.seatFee.totalAmount * (this.order.seatFee.status=='return'?0:1)).toFixed(2);
},
allNumber() {
const oldNumber = this.order.old.list.reduce((a, b) => {
@@ -1660,8 +1668,10 @@ export default {
},
changeOrderUseType(useType) {
if (useType && this.order.list.length) {
const tableId = useType=='takeout'?undefined: this.table.tableId;
$changeUseType({
useType,
tableId,
cartIds: this.order.list.map((v) => v.id),
});
}
@@ -1740,7 +1750,7 @@ export default {
this.getCart();
this.getCacheOrder();
console.log(this.isCreateOrder);
if (!this.shopInfo.isTableFee && this.table.tableId && this.perpole > 0) {
if (!this.shopInfo.isTableFee && this.table.tableId && this.perpole > 0 ) {
//不免餐位费
const seatFee = await $choseCount({
masterId: this.masterId,
@@ -1922,11 +1932,32 @@ export default {
console.log(e);
this.isPrint = e;
},
refOrderNoteConfirm(note) {
this.note.content = note;
async refOrderNoteConfirm(note) {
//单品备注
if(this.isDanNote){
const cart=this.order.list[this.order.selIndex]
const res= await $updateCart({
cartId: cart.id,
productId: cart.productId,
skuId: cart.skuId,
tableId: this.table.tableId,
note:note,
num: cart.number, // 0会删除此商品
});
this.$set(this.order.list, this.order.selIndex, res);
this.$notify({
title: "更新成功",
type: "success",
});
}else{
//订单备注
this.note.content = note;
}
},
refNoteShow() {
this.$refs.refOrderNote.open(this.note.content);
refNoteShow(isDan=false) {
this.isDanNote = isDan;
const note=isDan?this.order.list[this.order.selIndex].note:this.note.content;
this.$refs.refOrderNote.open(note);
},
// 支付订单前的处理
async payOrder() {
@@ -4326,5 +4357,12 @@ input[type="number"]::-webkit-outer-spin-button {
.pay_btns .el-button:disabled {
border: 1px solid #dcdfe6;
}
.order_remark{
font-size: 14px;
color: #666;
margin-top: 5px;
max-width: 340px;
word-break: break-all;
}
</style>