代客下单部分逻辑处理优化,订单管理退款退菜结账跳转功能问题处理

This commit is contained in:
2024-11-01 11:16:12 +08:00
parent 924f296ad1
commit 8c99f49700
7 changed files with 162 additions and 52 deletions

View File

@@ -96,6 +96,8 @@ export default {
<style lang="scss" scoped>
::v-deep .number-box .el-input__inner {
border: none;
padding: 0 2px;
text-align: center;
}
.icon-add {
color: #1890ff;

View File

@@ -1,19 +1,32 @@
<template>
<el-dialog title="退菜" width="410px" :visible.sync="show" @close="reset" :modal="modal">
<div class="flex u-row-between u-p-b-20 border-bottom">
<span>退菜数量</span>
<div class="u-flex">
<number-box v-model="number" :min="1" :max="max"></number-box>
<el-dialog
title="退菜"
width="410px"
:visible.sync="show"
@close="reset"
:modal="modal"
>
<div class="u-p-b-16 border-bottom">
<div class="flex u-row-between">
<span>退菜数量</span>
<div class="u-flex" v-if="!isSeatFee">
<number-box v-model="number" :min="1" :max="max"></number-box>
</div>
<div class="u-flex" v-else>
{{ number }}
</div>
</div>
<div class="u-font-12 color-999 u-m-t-8" v-if="isSeatFee">
<div><span class="color-red">*</span><span>客座费只能全退</span> </div>
</div>
</div>
<div class="u-m-t-10 u-font-12 color-999">
菜品已点数量 {{max}}
</div>
<div class="u-m-t-10 u-font-12 color-999">菜品已点数量 {{ max }} </div>
<div class="u-m-t-26">
<div><span>退菜原因</span> <span class="color-red">*</span></div>
</div>
<div class="u-flex u-flex-wrap tags ">
<div class="u-flex u-flex-wrap tags">
<div
class="tag"
v-for="(tag, index) in tags"
@@ -41,28 +54,23 @@
</el-dialog>
</template>
<script>
import numberBox from './number-box.vue';
import numberBox from "./number-box.vue";
import {returnIsSeatFee} from '../util.js'
export default {
components:{numberBox},
props:{
modal:{
type:Boolean,
default:true
components: { numberBox },
props: {
modal: {
type: Boolean,
default: true,
},
goods:{
type:Object,
default:()=>{
return{}
}
max: {
type: Number,
default: 1,
},
max:{
type:Number,
default:1
}
},
data() {
return {
number:1,
number: 1,
isPrint: false,
tagSel: -1,
show: false,
@@ -72,17 +80,27 @@ export default {
{ label: "等待时间过长", checked: false },
],
note: "",
goods:{
productId: -999
}
};
},
computed:{
isSeatFee(){
return returnIsSeatFee(this.goods)
}
},
methods: {
changeSel(item) {
item.checked = !item.checked;
},
reset() {
this.note = "";
this.number=1;
console.log(this.number)
this.number = 1;
this.tags.map(v=>{
v.checked = false;
})
console.log(this.number);
},
delTag(index) {
this.tags.splice(index, 1);
@@ -93,22 +111,30 @@ export default {
}
this.note = tag + "," + this.note;
},
open(note) {
open(item) {
this.goods = item?item:this.goods;
this.show = true;
this.number=1;
if (item != "-999") {
this.number = 1;
} else {
this.number = item.num;
}
},
close() {
this.show = false;
this.number=1;
this.number = 1;
},
confirm() {
const selTag=this.tags.filter(item=>item.checked).map(item=>item.label).join(",")
const note=selTag+(this.note.length>0?","+this.note:"");
console.log(note)
if(!note){
const selTag = this.tags
.filter((item) => item.checked)
.map((item) => item.label)
.join(",");
const note = selTag + (this.note.length > 0 ? "," + this.note : "");
console.log(note);
if (!note) {
return this.$message.error("请输入退菜原因");
}
this.$emit("confirm", {note:note,num:this.number});
this.$emit("confirm", { note: note, num: this.number });
this.close();
},
},
@@ -120,6 +146,7 @@ export default {
::v-deep .el-dialog__body {
margin-bottom: 14px;
margin-top: 14px;
padding: 0 20px;
}
::v-deep .el-tag {
margin-top: 10px;