Merge branch 'ymf' of https://e.coding.net/g-cphe0354/yinshoukeguanliduan/management into test
This commit is contained in:
commit
8562f2243a
|
|
@ -233,6 +233,8 @@ import {
|
||||||
tbShopTable,
|
tbShopTable,
|
||||||
} from "@/api/table";
|
} from "@/api/table";
|
||||||
import dayjs from "dayjs";
|
import dayjs from "dayjs";
|
||||||
|
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
components: {
|
components: {
|
||||||
addEara,
|
addEara,
|
||||||
|
|
@ -253,18 +255,48 @@ export default {
|
||||||
selTable: "", //当前选中的桌台
|
selTable: "", //当前选中的桌台
|
||||||
areaMap: {},
|
areaMap: {},
|
||||||
shopInfo: {},
|
shopInfo: {},
|
||||||
|
timer:null
|
||||||
};
|
};
|
||||||
},
|
},
|
||||||
|
beforeDestroy() {
|
||||||
|
this.clearTimer();
|
||||||
|
console.log('beforeDestroy')
|
||||||
|
},
|
||||||
mounted() {
|
mounted() {
|
||||||
|
this.clearTimer();
|
||||||
|
this.setTimter(60);
|
||||||
this.tbShopAreaGet();
|
this.tbShopAreaGet();
|
||||||
this.getShopInfo();
|
this.getShopInfo();
|
||||||
},
|
},
|
||||||
filters: {
|
filters: {
|
||||||
formatTime(time) {
|
formatTime(milliseconds) {
|
||||||
return dayjs(time).format("HH小时mm分");
|
console.log(milliseconds)
|
||||||
|
if (!milliseconds) {
|
||||||
|
return "";
|
||||||
|
}
|
||||||
|
const days = Math.floor(milliseconds / (1000 * 60 * 60 * 24));
|
||||||
|
const hours = Math.floor(
|
||||||
|
(milliseconds % (1000 * 60 * 60 * 24)) / (1000 * 60 * 60)
|
||||||
|
);
|
||||||
|
const minutes = Math.floor(
|
||||||
|
(milliseconds % (1000 * 60 * 60)) / (1000 * 60)
|
||||||
|
);
|
||||||
|
return `${days ? days + "天" : ""} ${hours ? hours + "时" : ""} ${minutes + "分"
|
||||||
|
}`;
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
|
clearTimer(){
|
||||||
|
console.log('clearTimer')
|
||||||
|
clearInterval(this.timer);
|
||||||
|
this.timer=null;
|
||||||
|
},
|
||||||
|
setTimter(time=60){
|
||||||
|
this.timer=setInterval(() => {
|
||||||
|
const showloading=false
|
||||||
|
this.tbShopTableGet(showloading)
|
||||||
|
}, time*1000);
|
||||||
|
},
|
||||||
//获取店铺信息
|
//获取店铺信息
|
||||||
async getShopInfo() {
|
async getShopInfo() {
|
||||||
try {
|
try {
|
||||||
|
|
@ -322,7 +354,7 @@ export default {
|
||||||
this.selTable = item;
|
this.selTable = item;
|
||||||
if (this.shopInfo.isTableFee) {
|
if (this.shopInfo.isTableFee) {
|
||||||
//免餐位费
|
//免餐位费
|
||||||
this.toInstead({num: 0,key});
|
this.toInstead({ num: 0, key });
|
||||||
// this.$refs.diancan.open(item, key, '');
|
// this.$refs.diancan.open(item, key, '');
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
@ -330,20 +362,23 @@ export default {
|
||||||
if (item.useNum <= 0) {
|
if (item.useNum <= 0) {
|
||||||
return this.$refs.refChooseDinersNumber.open();
|
return this.$refs.refChooseDinersNumber.open();
|
||||||
}
|
}
|
||||||
this.toInstead({num: num,key});
|
this.toInstead({ num: num, key });
|
||||||
// this.$refs.diancan.open(item, key, num);
|
// this.$refs.diancan.open(item, key, num);
|
||||||
},
|
},
|
||||||
toInstead(query) {
|
toInstead(query) {
|
||||||
this.$router.push({ path: "/tool/Instead/index", query: {
|
this.$router.push({
|
||||||
table_name: this.selTable.name,
|
path: "/tool/Instead/index",
|
||||||
tableId: this.selTable.tableId,
|
query: {
|
||||||
maxCapacity:this.selTable.maxCapacity,
|
table_name: this.selTable.name,
|
||||||
useType: this.selTable.useType,
|
tableId: this.selTable.tableId,
|
||||||
...query
|
useType: this.selTable.useType,
|
||||||
}});
|
maxCapacity:this.selTable.maxCapacity,
|
||||||
|
...query,
|
||||||
|
},
|
||||||
|
});
|
||||||
},
|
},
|
||||||
chooseDinersNumberConfirm(num) {
|
chooseDinersNumberConfirm(num) {
|
||||||
this.toInstead({num: num});
|
this.toInstead({ num: num });
|
||||||
// this.$refs.diancan.open(this.selTable, undefined, num);
|
// this.$refs.diancan.open(this.selTable, undefined, num);
|
||||||
},
|
},
|
||||||
tabClick() {
|
tabClick() {
|
||||||
|
|
@ -369,8 +404,8 @@ export default {
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
// 台桌列表
|
// 台桌列表
|
||||||
async tbShopTableGet() {
|
async tbShopTableGet(showloading=true) {
|
||||||
this.loading = true;
|
this.loading = showloading;
|
||||||
try {
|
try {
|
||||||
const { content, total } = await tbShopTableGet({
|
const { content, total } = await tbShopTableGet({
|
||||||
shopId: localStorage.getItem("shopId"),
|
shopId: localStorage.getItem("shopId"),
|
||||||
|
|
|
||||||
|
|
@ -1,22 +1,22 @@
|
||||||
<template>
|
<template>
|
||||||
<div
|
<div class="flex order-item relative" :class="[isActive]" @click="itemClick">
|
||||||
class="flex order-item relative"
|
|
||||||
:class="[isActive]"
|
|
||||||
@click="itemClick"
|
|
||||||
>
|
|
||||||
<span class="absolute pack" v-if="item.isPack === 'true'"> 包 </span>
|
<span class="absolute pack" v-if="item.isPack === 'true'"> 包 </span>
|
||||||
<span class="absolute tui" v-if="item.status === 'return'"> 退 </span>
|
<span class="absolute tui" v-if="item.status === 'return'"> 退 </span>
|
||||||
<div class="flex">
|
<div class="flex">
|
||||||
|
|
||||||
<div class="img">
|
<div class="img">
|
||||||
<div class="isSeatFee img u-line-1 u-flex u-col-center u-row-center" v-if="isSeatFee">
|
<div
|
||||||
|
class="isSeatFee img u-line-1 u-flex u-col-center u-row-center"
|
||||||
|
v-if="isSeatFee"
|
||||||
|
>
|
||||||
<span>{{ item.name }}</span>
|
<span>{{ item.name }}</span>
|
||||||
</div>
|
</div>
|
||||||
<img v-else :src="item.coverImg" class="" alt="" />
|
<img v-else :src="item.coverImg" class="" alt="" />
|
||||||
</div>
|
</div>
|
||||||
<div class="good-info">
|
<div class="good-info">
|
||||||
<div class="flex lh-16">
|
<div class="flex lh-16">
|
||||||
<div class="name" :class="{ 'free-price': item.status === 'return' }">{{ item.name }}</div>
|
<div class="name" :class="{ 'free-price': item.status === 'return' }">
|
||||||
|
{{ item.name }}
|
||||||
|
</div>
|
||||||
<span class="good_info_discount" v-if="item.isGift === 'true'"
|
<span class="good_info_discount" v-if="item.isGift === 'true'"
|
||||||
>赠</span
|
>赠</span
|
||||||
>
|
>
|
||||||
|
|
@ -24,6 +24,9 @@
|
||||||
<div v-if="item.specSnap" class="specSnap">
|
<div v-if="item.specSnap" class="specSnap">
|
||||||
{{ item.specSnap }}
|
{{ item.specSnap }}
|
||||||
</div>
|
</div>
|
||||||
|
<template v-if="item.note">
|
||||||
|
<div class="note">备注:{{ item.note || "" }}</div>
|
||||||
|
</template>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="flex">
|
<div class="flex">
|
||||||
|
|
@ -52,8 +55,12 @@
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="color-333 total-price">
|
<div class="color-333 total-price">
|
||||||
<div v-if="item.isGift === 'true'||item.status=='return' ">¥0</div>
|
<div v-if="item.isGift === 'true' || item.status == 'return'">¥0</div>
|
||||||
<div :class="{ 'free-price': item.isGift === 'true'||item.status=='return' }">
|
<div
|
||||||
|
:class="{
|
||||||
|
'free-price': item.isGift === 'true' || item.status == 'return',
|
||||||
|
}"
|
||||||
|
>
|
||||||
<span v-if="isSeatFee"> ¥{{ item.totalAmount }}</span>
|
<span v-if="isSeatFee"> ¥{{ item.totalAmount }}</span>
|
||||||
<span v-else> ¥{{ item.salePrice }}</span>
|
<span v-else> ¥{{ item.salePrice }}</span>
|
||||||
</div>
|
</div>
|
||||||
|
|
@ -66,22 +73,22 @@
|
||||||
export default {
|
export default {
|
||||||
props: {
|
props: {
|
||||||
//是否是餐位费
|
//是否是餐位费
|
||||||
isSeatFee:{
|
isSeatFee: {
|
||||||
type: Boolean,
|
type: Boolean,
|
||||||
default: false,
|
default: false,
|
||||||
},
|
},
|
||||||
//是否是历史订单商品
|
//是否是历史订单商品
|
||||||
isOld:{
|
isOld: {
|
||||||
type: Boolean,
|
type: Boolean,
|
||||||
default: false,
|
default: false,
|
||||||
},
|
},
|
||||||
//第几次下单 1以及以上为历史订单 0为当前购物车
|
//第几次下单 1以及以上为历史订单 0为当前购物车
|
||||||
placeNum:{
|
placeNum: {
|
||||||
type: [String,Number],
|
type: [String, Number],
|
||||||
default: 0,
|
default: 0,
|
||||||
},
|
},
|
||||||
selPlaceNum:{
|
selPlaceNum: {
|
||||||
type: [String,Number],
|
type: [String, Number],
|
||||||
default: -1,
|
default: -1,
|
||||||
},
|
},
|
||||||
//是否允许改变数量
|
//是否允许改变数量
|
||||||
|
|
@ -112,11 +119,12 @@ export default {
|
||||||
};
|
};
|
||||||
},
|
},
|
||||||
computed: {
|
computed: {
|
||||||
isActive(){
|
isActive() {
|
||||||
const isSel= (this.selIndex === this.index)&&(this.placeNum===this.selPlaceNum)
|
const isSel =
|
||||||
console.log(isSel)
|
this.selIndex === this.index && this.placeNum === this.selPlaceNum;
|
||||||
return isSel?'active':'';
|
console.log(isSel);
|
||||||
}
|
return isSel ? "active" : "";
|
||||||
|
},
|
||||||
},
|
},
|
||||||
watch: {
|
watch: {
|
||||||
"item.number": function (val) {
|
"item.number": function (val) {
|
||||||
|
|
@ -135,26 +143,25 @@ export default {
|
||||||
}
|
}
|
||||||
newval = `${newval}`.split(".")[0] * 1;
|
newval = `${newval}`.split(".")[0] * 1;
|
||||||
this.number = newval;
|
this.number = newval;
|
||||||
this.$emit("cartGoodsNumberChange",newval, this.index);
|
this.$emit("cartGoodsNumberChange", newval, this.index);
|
||||||
|
|
||||||
},
|
},
|
||||||
//购物车商品输入框数量输入
|
//购物车商品输入框数量输入
|
||||||
cartGoodsNumberInput(newval) {
|
cartGoodsNumberInput(newval) {
|
||||||
if (newval <= 0) {
|
if (newval <= 0) {
|
||||||
return this.number =1
|
return (this.number = 1);
|
||||||
}
|
}
|
||||||
newval = `${newval}`.split(".")[0] * 1;
|
newval = `${newval}`.split(".")[0] * 1;
|
||||||
this.number = newval;
|
this.number = newval;
|
||||||
this.$emit("cartGoodsNumberInput",newval, this.index);
|
this.$emit("cartGoodsNumberInput", newval, this.index);
|
||||||
},
|
},
|
||||||
changeOrderNumber(isReduce) {
|
changeOrderNumber(isReduce) {
|
||||||
this.$emit("changeOrderNumber", this.index, isReduce);
|
this.$emit("changeOrderNumber", this.index, isReduce);
|
||||||
},
|
},
|
||||||
itemClick() {
|
itemClick() {
|
||||||
if(this.isSeatFee){
|
// if(this.isSeatFee){
|
||||||
return
|
// return
|
||||||
}
|
// }
|
||||||
this.$emit("itemClick", this.index,this.canChangeNumber,this.placeNum);
|
this.$emit("itemClick", this.index, this.canChangeNumber, this.placeNum);
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
};
|
};
|
||||||
|
|
@ -171,8 +178,8 @@ export default {
|
||||||
padding: 0 4px;
|
padding: 0 4px;
|
||||||
text-align: center;
|
text-align: center;
|
||||||
}
|
}
|
||||||
.isSeatFee{
|
.isSeatFee {
|
||||||
background: #3F9EFF;
|
background: #3f9eff;
|
||||||
color: #fff;
|
color: #fff;
|
||||||
font-size: 12px;
|
font-size: 12px;
|
||||||
}
|
}
|
||||||
|
|
@ -204,6 +211,7 @@ export default {
|
||||||
padding: 4px;
|
padding: 4px;
|
||||||
border-radius: 2px;
|
border-radius: 2px;
|
||||||
display: flex;
|
display: flex;
|
||||||
|
overflow: hidden;
|
||||||
cursor: pointer;
|
cursor: pointer;
|
||||||
align-items: center;
|
align-items: center;
|
||||||
justify-content: space-between;
|
justify-content: space-between;
|
||||||
|
|
@ -220,7 +228,7 @@ export default {
|
||||||
text-align: center;
|
text-align: center;
|
||||||
line-height: 17px;
|
line-height: 17px;
|
||||||
}
|
}
|
||||||
.tui{
|
.tui {
|
||||||
right: 100%;
|
right: 100%;
|
||||||
width: 18px;
|
width: 18px;
|
||||||
height: 18px;
|
height: 18px;
|
||||||
|
|
@ -272,7 +280,15 @@ export default {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
.note{
|
||||||
|
max-width: 70%;
|
||||||
|
font-size: 12px;
|
||||||
|
font-weight: 400;
|
||||||
|
text-align: left;
|
||||||
|
color: #999;
|
||||||
|
margin-top: 2px;
|
||||||
|
word-break: break-all;
|
||||||
|
}
|
||||||
.order-number-box {
|
.order-number-box {
|
||||||
position: relative;
|
position: relative;
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -59,7 +59,7 @@ export default {
|
||||||
this.tags.splice(index,1)
|
this.tags.splice(index,1)
|
||||||
},
|
},
|
||||||
addNote(tag) {
|
addNote(tag) {
|
||||||
if(this.note.length<=0){
|
if(!this.note){
|
||||||
return this.note = tag
|
return this.note = tag
|
||||||
}
|
}
|
||||||
this.note = tag + "," + this.note;
|
this.note = tag + "," + this.note;
|
||||||
|
|
@ -76,13 +76,14 @@ export default {
|
||||||
},
|
},
|
||||||
confirm(){
|
confirm(){
|
||||||
const originTags = [...this.tags]
|
const originTags = [...this.tags]
|
||||||
if(this.note.length>=1){
|
if(this.note){
|
||||||
if(originTags>=10){
|
if(originTags>=10){
|
||||||
originTags.shift()
|
originTags.shift()
|
||||||
}
|
}
|
||||||
const newTags=new Set([this.note,...originTags])
|
if(this.note.length<=16){
|
||||||
console.log(newTags)
|
const newTags=new Set([this.note,...originTags])
|
||||||
localStorage.setItem("tags", JSON.stringify([...newTags]));
|
localStorage.setItem("tags", JSON.stringify([...newTags]));
|
||||||
|
}
|
||||||
}
|
}
|
||||||
this.$emit('confirm',this.note)
|
this.$emit('confirm',this.note)
|
||||||
this.close()
|
this.close()
|
||||||
|
|
|
||||||
|
|
@ -51,8 +51,7 @@ export default {
|
||||||
async init() {
|
async init() {
|
||||||
const res = await $getPayType();
|
const res = await $getPayType();
|
||||||
this.list = res.filter(v=>v.isDisplay);
|
this.list = res.filter(v=>v.isDisplay);
|
||||||
console.log(res[0]);
|
this.sel = this.sel ? this.sel : 'scanCode';
|
||||||
this.sel = this.sel ? this.sel : res[0].payType;
|
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
mounted() {
|
mounted() {
|
||||||
|
|
|
||||||
|
|
@ -237,11 +237,8 @@
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
</div>
|
</div>
|
||||||
<el-button
|
<el-button @click="clearCart" type="text" size="mini"
|
||||||
@click="clearCart"
|
:disabled="order.list.length<=0"
|
||||||
type="text"
|
|
||||||
size="mini"
|
|
||||||
:disabled="order.list.length <= 0"
|
|
||||||
>清空</el-button
|
>清空</el-button
|
||||||
>
|
>
|
||||||
</div>
|
</div>
|
||||||
|
|
@ -306,18 +303,21 @@
|
||||||
</template>
|
</template>
|
||||||
<!-- 餐位费 -->
|
<!-- 餐位费 -->
|
||||||
<template v-if="order.seatFee && order.seatFee.totalAmount > 0">
|
<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
|
<cart-item
|
||||||
@itemClick="changeOrderOldSel"
|
@itemClick="changeOrderExtraSel"
|
||||||
:canChangeNumber="false"
|
:canChangeNumber="false"
|
||||||
key="seatFee"
|
key="seatFee"
|
||||||
:index="0"
|
:index="0"
|
||||||
:item="order.seatFee"
|
:item="order.seatFee"
|
||||||
isSeatFee
|
isSeatFee
|
||||||
:selIndex="order.old.selIndex"
|
:selIndex="order.extra.selIndex"
|
||||||
:placeNum="-1"
|
:placeNum="-10"
|
||||||
:selPlaceNum="order.selPlaceNum"
|
:selPlaceNum="order.selPlaceNum"
|
||||||
></cart-item>
|
></cart-item>
|
||||||
|
</div>
|
||||||
|
|
||||||
</template>
|
</template>
|
||||||
<div class="order_remark" v-if="note.content">
|
<div class="order_remark" v-if="note.content">
|
||||||
订单备注: {{ note.content }}
|
订单备注: {{ note.content }}
|
||||||
|
|
@ -349,41 +349,77 @@
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="flex mt-14">
|
<div class="flex mt-14">
|
||||||
<template v-if="isCreateOrder">
|
<template v-if="!postPay">
|
||||||
<button
|
<template v-if="isCreateOrder">
|
||||||
class="my-btn flex-1 default"
|
<button
|
||||||
@click="createOrderClose"
|
class="my-btn flex-1 default"
|
||||||
>
|
@click="createOrderClose"
|
||||||
<span>加菜/返回</span>
|
>
|
||||||
</button>
|
<span>加菜/返回</span>
|
||||||
<div style="width: 15px"></div>
|
</button>
|
||||||
<button class="my-btn flex-1 primary" @click="payOrder">
|
</template>
|
||||||
<span>立即支付</span>
|
<template v-else>
|
||||||
</button>
|
<button
|
||||||
|
class="my-btn flex-1 primary"
|
||||||
|
@click="scanPayClick"
|
||||||
|
>
|
||||||
|
<span>微信/支付宝</span>
|
||||||
|
</button>
|
||||||
|
<div style="width: 15px"></div>
|
||||||
|
<button
|
||||||
|
class="my-btn flex-1 primary"
|
||||||
|
@click="cashPayClick"
|
||||||
|
>
|
||||||
|
<span>现金</span>
|
||||||
|
</button>
|
||||||
|
<div style="width: 15px"></div>
|
||||||
|
<button
|
||||||
|
class="my-btn flex-1 default"
|
||||||
|
@click="morePayClick"
|
||||||
|
>
|
||||||
|
<span>更多支付</span>
|
||||||
|
</button>
|
||||||
|
</template>
|
||||||
</template>
|
</template>
|
||||||
<template v-else>
|
<template v-else>
|
||||||
<template v-if="postPay">
|
<template v-if="isCreateOrder">
|
||||||
|
<button
|
||||||
|
class="my-btn flex-1 default"
|
||||||
|
@click="createOrderClose"
|
||||||
|
>
|
||||||
|
<span>加菜/返回</span>
|
||||||
|
</button>
|
||||||
|
<div style="width: 15px"></div>
|
||||||
|
<button class="my-btn flex-1 primary" @click="payOrder">
|
||||||
|
<span>立即支付</span>
|
||||||
|
</button>
|
||||||
|
</template>
|
||||||
|
<template v-else>
|
||||||
|
<template v-if="postPay">
|
||||||
|
<div class="flex-1">
|
||||||
|
<el-button
|
||||||
|
type="primary"
|
||||||
|
size="medium"
|
||||||
|
:disabled="!order.list.length"
|
||||||
|
@click="toCreateOrderDebounce(false)"
|
||||||
|
>
|
||||||
|
仅下单
|
||||||
|
</el-button>
|
||||||
|
</div>
|
||||||
|
<div style="width: 15px"></div>
|
||||||
|
</template>
|
||||||
<div class="flex-1">
|
<div class="flex-1">
|
||||||
<el-button
|
<el-button
|
||||||
type="primary"
|
|
||||||
size="medium"
|
size="medium"
|
||||||
:disabled="!order.list.length"
|
:disabled="
|
||||||
@click="toCreateOrderDebounce(false)"
|
!order.list.length && !order.old.list.length
|
||||||
|
"
|
||||||
|
@click="toCreateOrderDebounce(true)"
|
||||||
>
|
>
|
||||||
仅下单
|
去结账
|
||||||
</el-button>
|
</el-button>
|
||||||
</div>
|
</div>
|
||||||
<div style="width: 15px"></div>
|
|
||||||
</template>
|
</template>
|
||||||
<div class="flex-1">
|
|
||||||
<el-button
|
|
||||||
size="medium"
|
|
||||||
:disabled="!order.list.length && !order.old.list.length"
|
|
||||||
@click="toCreateOrderDebounce(true)"
|
|
||||||
>
|
|
||||||
去结账
|
|
||||||
</el-button>
|
|
||||||
</div>
|
|
||||||
</template>
|
</template>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
@ -483,15 +519,15 @@
|
||||||
prveOrder.list.length
|
prveOrder.list.length
|
||||||
}}</span>
|
}}</span>
|
||||||
</div> -->
|
</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
|
<div
|
||||||
class="btn"
|
class="btn"
|
||||||
:class="{
|
:class="{
|
||||||
disabled:
|
disabled: disableTuicai,
|
||||||
order.placeNum <= 0 ||
|
|
||||||
order.old.selIndex < 0 ||
|
|
||||||
order.selGoods.status == 'return',
|
|
||||||
}"
|
}"
|
||||||
@click="orderBtnsClick('returnCart')"
|
@click="orderBtnsClick('returnCart')"
|
||||||
>
|
>
|
||||||
|
|
@ -885,7 +921,7 @@
|
||||||
v-if="!skuGoods.data.isGrounding"
|
v-if="!skuGoods.data.isGrounding"
|
||||||
disabled
|
disabled
|
||||||
>
|
>
|
||||||
已下架
|
已下架/库存不足
|
||||||
</button>
|
</button>
|
||||||
<template v-else>
|
<template v-else>
|
||||||
<button
|
<button
|
||||||
|
|
@ -1141,6 +1177,8 @@ export default {
|
||||||
},
|
},
|
||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
|
//是否是单品备注
|
||||||
|
isDanNote: false,
|
||||||
//店铺信息
|
//店铺信息
|
||||||
shopInfo: {},
|
shopInfo: {},
|
||||||
//就餐饭方式
|
//就餐饭方式
|
||||||
|
|
@ -1221,6 +1259,9 @@ export default {
|
||||||
total: 0,
|
total: 0,
|
||||||
},
|
},
|
||||||
order: {
|
order: {
|
||||||
|
extra: {
|
||||||
|
selIndex: -1,
|
||||||
|
},
|
||||||
seatFee: { totalAmount: 0 }, //餐位费
|
seatFee: { totalAmount: 0 }, //餐位费
|
||||||
orderId: "",
|
orderId: "",
|
||||||
payType: "",
|
payType: "",
|
||||||
|
|
@ -1315,6 +1356,12 @@ export default {
|
||||||
};
|
};
|
||||||
},
|
},
|
||||||
computed: {
|
computed: {
|
||||||
|
disableTuicai() {
|
||||||
|
return (
|
||||||
|
this.order.placeNum==1 ||this.order.selIndex>=0||!this.order.selGoods||this.order.old.list.length<=0||
|
||||||
|
this.order.selGoods.status == "return"
|
||||||
|
);
|
||||||
|
},
|
||||||
title() {
|
title() {
|
||||||
return this.table ? "代客下单" + `(${this.table.name})` : "代客下单";
|
return this.table ? "代客下单" + `(${this.table.name})` : "代客下单";
|
||||||
},
|
},
|
||||||
|
|
@ -1371,7 +1418,7 @@ export default {
|
||||||
.reduce((a, b) => {
|
.reduce((a, b) => {
|
||||||
return a + b.number * b.salePrice;
|
return a + b.number * b.salePrice;
|
||||||
}, 0);
|
}, 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() {
|
allNumber() {
|
||||||
const oldNumber = this.order.old.list.reduce((a, b) => {
|
const oldNumber = this.order.old.list.reduce((a, b) => {
|
||||||
|
|
@ -1571,14 +1618,60 @@ export default {
|
||||||
// this.refToggle('refScanCode',true)
|
// this.refToggle('refScanCode',true)
|
||||||
// this.refToggle("refDiscount", true);
|
// this.refToggle("refDiscount", true);
|
||||||
this.getShopInfo();
|
this.getShopInfo();
|
||||||
console.log(this.$route.query.tableId)
|
console.log(this.$route.query.tableId);
|
||||||
this.open(this.$route.query.tableId?this.$route.query:'');
|
this.open(this.$route.query.tableId ? this.$route.query : "");
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
|
changeOrderExtraSel(index, canChangeNumber, placeNum) {
|
||||||
|
// console.log(index,canChangeNumber,placeNum)
|
||||||
|
this.order.selGoods = this.order.seatFee;
|
||||||
|
this.order.selPlaceNum = placeNum;
|
||||||
|
this.order.extra.selIndex = index;
|
||||||
|
},
|
||||||
|
async morePayClick() {
|
||||||
|
const res = await this.returnCreateOrderData();
|
||||||
|
this.createOrder.data = res;
|
||||||
|
this.order.payType = "";
|
||||||
|
this.isCreateOrder = true;
|
||||||
|
},
|
||||||
|
cashPayClick() {
|
||||||
|
this.$confirm("是否确认已现金收款:" + this.allPrice + "?", "快捷支付", {
|
||||||
|
confirmButtonText: "确定",
|
||||||
|
cancelButtonText: "取消",
|
||||||
|
type: "warning",
|
||||||
|
}).then(() => {
|
||||||
|
this.order.payType = "cash";
|
||||||
|
this.cachePay();
|
||||||
|
});
|
||||||
|
},
|
||||||
|
returnCreateOrderData() {
|
||||||
|
return $createOrder({
|
||||||
|
masterId: this.order.masterId || this.masterId,
|
||||||
|
vipUserId: this.vipUser.id,
|
||||||
|
tableId: this.table.tableId,
|
||||||
|
note: this.note.content,
|
||||||
|
postPay: this.postPay,
|
||||||
|
orderld: this.order.orderId,
|
||||||
|
});
|
||||||
|
},
|
||||||
|
async cachePay() {
|
||||||
|
const res = await this.returnCreateOrderData();
|
||||||
|
this.createOrder.data = res;
|
||||||
|
this.pays();
|
||||||
|
},
|
||||||
|
async scanPayClick() {
|
||||||
|
const res = await this.returnCreateOrderData();
|
||||||
|
this.createOrder.data = res;
|
||||||
|
this.createOrder.discount = 1;
|
||||||
|
this.order.payType = "scanCode";
|
||||||
|
this.payTypeItemClick({ payType: "scanCode" });
|
||||||
|
},
|
||||||
changeOrderUseType(useType) {
|
changeOrderUseType(useType) {
|
||||||
if (useType && this.order.list.length) {
|
if (useType && this.order.list.length) {
|
||||||
|
const tableId = useType=='takeout'?undefined: this.table.tableId;
|
||||||
$changeUseType({
|
$changeUseType({
|
||||||
useType,
|
useType,
|
||||||
|
tableId,
|
||||||
cartIds: this.order.list.map((v) => v.id),
|
cartIds: this.order.list.map((v) => v.id),
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
@ -1645,18 +1738,27 @@ export default {
|
||||||
this.perpole = 1;
|
this.perpole = 1;
|
||||||
await this.changePerpole();
|
await this.changePerpole();
|
||||||
}
|
}
|
||||||
|
//设置就餐类型
|
||||||
|
const item=this.table;
|
||||||
|
if (item && item.useType) {
|
||||||
|
localStorage.setItem("useType", item.useType);
|
||||||
|
this.useTypes.sel =
|
||||||
|
item.useType == "takeout"
|
||||||
|
? item.useType
|
||||||
|
: item.useType.replace(/-after|-before/g, "");
|
||||||
|
}
|
||||||
this.getCart();
|
this.getCart();
|
||||||
this.getCacheOrder();
|
this.getCacheOrder();
|
||||||
console.log(this.isCreateOrder)
|
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({
|
const seatFee = await $choseCount({
|
||||||
masterId: this.masterId,
|
masterId: this.masterId,
|
||||||
tableId: this.table.tableId,
|
tableId: this.table.tableId,
|
||||||
num: this.perpole,
|
num: this.perpole,
|
||||||
});
|
});
|
||||||
this.order.seatFee = seatFee;
|
this.order.seatFee = seatFee;
|
||||||
this.perpole=seatFee.totalNumber
|
this.perpole = seatFee.totalNumber;
|
||||||
}
|
}
|
||||||
if (this.isCreateOrder) {
|
if (this.isCreateOrder) {
|
||||||
this.toCreateOrder(true);
|
this.toCreateOrder(true);
|
||||||
|
|
@ -1704,7 +1806,9 @@ export default {
|
||||||
const { content, total } = await tbShopTableGet({
|
const { content, total } = await tbShopTableGet({
|
||||||
shopId: localStorage.getItem("shopId"),
|
shopId: localStorage.getItem("shopId"),
|
||||||
});
|
});
|
||||||
this.tableList = content.filter((v) => v.status != "closed"&&v.status != "cleaning");
|
this.tableList = content.filter(
|
||||||
|
(v) => v.status != "closed" && v.status != "cleaning"
|
||||||
|
);
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
console.log(error);
|
console.log(error);
|
||||||
}
|
}
|
||||||
|
|
@ -1828,11 +1932,32 @@ export default {
|
||||||
console.log(e);
|
console.log(e);
|
||||||
this.isPrint = e;
|
this.isPrint = e;
|
||||||
},
|
},
|
||||||
refOrderNoteConfirm(note) {
|
async refOrderNoteConfirm(note) {
|
||||||
this.note.content = 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() {
|
refNoteShow(isDan=false) {
|
||||||
this.$refs.refOrderNote.open(this.note.content);
|
this.isDanNote = isDan;
|
||||||
|
const note=isDan?this.order.list[this.order.selIndex].note:this.note.content;
|
||||||
|
this.$refs.refOrderNote.open(note);
|
||||||
},
|
},
|
||||||
// 支付订单前的处理
|
// 支付订单前的处理
|
||||||
async payOrder() {
|
async payOrder() {
|
||||||
|
|
@ -1876,7 +2001,7 @@ export default {
|
||||||
type: "success",
|
type: "success",
|
||||||
});
|
});
|
||||||
this.close();
|
this.close();
|
||||||
// this.reset();
|
// this.reset();
|
||||||
},
|
},
|
||||||
chooseTableConfirm(item) {
|
chooseTableConfirm(item) {
|
||||||
console.log(item);
|
console.log(item);
|
||||||
|
|
@ -1897,7 +2022,7 @@ export default {
|
||||||
this.$refs.refChooseUser.open();
|
this.$refs.refChooseUser.open();
|
||||||
},
|
},
|
||||||
createOrderClose() {
|
createOrderClose() {
|
||||||
console.log('createOrderClose')
|
console.log("createOrderClose");
|
||||||
this.isCreateOrder = false;
|
this.isCreateOrder = false;
|
||||||
},
|
},
|
||||||
//生成订单
|
//生成订单
|
||||||
|
|
@ -2281,9 +2406,9 @@ export default {
|
||||||
},
|
},
|
||||||
//清空购物车
|
//清空购物车
|
||||||
clearCart() {
|
clearCart() {
|
||||||
if (this.order.list.length <= 0) {
|
// if (this.order.list.length <= 0) {
|
||||||
return;
|
// return;
|
||||||
}
|
// }
|
||||||
this.$confirm("确定要清空点餐列表吗?", "提示", {
|
this.$confirm("确定要清空点餐列表吗?", "提示", {
|
||||||
confirmButtonText: "确定",
|
confirmButtonText: "确定",
|
||||||
cancelButtonText: "取消",
|
cancelButtonText: "取消",
|
||||||
|
|
@ -2513,7 +2638,7 @@ export default {
|
||||||
.filter((v) => v.specSnap.match(i))
|
.filter((v) => v.specSnap.match(i))
|
||||||
.every((v) => {
|
.every((v) => {
|
||||||
// return isCanBuy(v,this.selGoods.data.isStock)
|
// return isCanBuy(v,this.selGoods.data.isStock)
|
||||||
return !isCanBuy(v);
|
return !isCanBuy(v, true);
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -2583,7 +2708,7 @@ export default {
|
||||||
this.useTypes.sel = "dine-in";
|
this.useTypes.sel = "dine-in";
|
||||||
},
|
},
|
||||||
//设置购物车数据
|
//设置购物车数据
|
||||||
setCart(res){
|
setCart(res) {
|
||||||
this.order.seatFee = res.seatFee ? res.seatFee : this.order.seatFee;
|
this.order.seatFee = res.seatFee ? res.seatFee : this.order.seatFee;
|
||||||
this.perpole = res.seatFee ? res.seatFee.totalNumber : 1;
|
this.perpole = res.seatFee ? res.seatFee.totalNumber : 1;
|
||||||
const nowCart = res.records.find((v) => v.placeNum == 0);
|
const nowCart = res.records.find((v) => v.placeNum == 0);
|
||||||
|
|
@ -2632,7 +2757,7 @@ export default {
|
||||||
return prve;
|
return prve;
|
||||||
}, {});
|
}, {});
|
||||||
const canBudyGoods = this.selGoods.data.specList
|
const canBudyGoods = this.selGoods.data.specList
|
||||||
.filter((v) => isCanBuy(v))
|
.filter((v) => isCanBuy(v, true))
|
||||||
.sort((a, b) => {
|
.sort((a, b) => {
|
||||||
const aNumber = a.specSnap.split(",").reduce((prve, cur) => {
|
const aNumber = a.specSnap.split(",").reduce((prve, cur) => {
|
||||||
return prve + skuMapNumber[cur];
|
return prve + skuMapNumber[cur];
|
||||||
|
|
@ -2753,19 +2878,20 @@ export default {
|
||||||
this.getGoods();
|
this.getGoods();
|
||||||
this.getCategory();
|
this.getCategory();
|
||||||
this.getTable();
|
this.getTable();
|
||||||
console.log(params)
|
console.log(params);
|
||||||
if (!params) {
|
if (!params) {
|
||||||
//无台桌代客下单
|
//无台桌代客下单
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
const item = { name: params.table_name, tableId: params.tableId , useType: params.useType,maxCapacity:params.maxCapacity*1},
|
const item = {
|
||||||
|
name: params.table_name,
|
||||||
|
tableId: params.tableId,
|
||||||
|
useType: params.useType,
|
||||||
|
maxCapacity: params.maxCapacity * 1,
|
||||||
|
},
|
||||||
key = params.key,
|
key = params.key,
|
||||||
perpoleNumber = params.num;
|
perpoleNumber = params.num;
|
||||||
//有台桌时的代客下单
|
//有台桌时的代客下单
|
||||||
this.key = key;
|
|
||||||
this.isCreateOrder =this.key == "isPayOrder"? true:false;
|
|
||||||
this.perpole = perpoleNumber;
|
|
||||||
this.table = item;
|
|
||||||
if (item && item.useType) {
|
if (item && item.useType) {
|
||||||
localStorage.setItem("useType", item.useType);
|
localStorage.setItem("useType", item.useType);
|
||||||
this.useTypes.sel =
|
this.useTypes.sel =
|
||||||
|
|
@ -2773,13 +2899,19 @@ export default {
|
||||||
? item.useType
|
? item.useType
|
||||||
: item.useType.replace(/-after|-before/g, "");
|
: item.useType.replace(/-after|-before/g, "");
|
||||||
}
|
}
|
||||||
// this.getCart();
|
this.key = key;
|
||||||
// this.getGoods();
|
this.isCreateOrder = this.key == "isPayOrder" ? true : false;
|
||||||
// this.getCategory();
|
this.perpole = perpoleNumber;
|
||||||
// this.getTable();
|
this.table = item;
|
||||||
},
|
},
|
||||||
close() {
|
close() {
|
||||||
this.$router.push({ path: "/table/table_list"});
|
if (this.table.tableId) {
|
||||||
|
this.$router.replace({ path: "/table/table_list" });
|
||||||
|
} else {
|
||||||
|
this.$router.go(0);
|
||||||
|
// this.reset();
|
||||||
|
// this.$router.replace({ path: "/tool/Instead/index" });
|
||||||
|
}
|
||||||
this.informationdialogshow = false;
|
this.informationdialogshow = false;
|
||||||
this.$emit("close");
|
this.$emit("close");
|
||||||
},
|
},
|
||||||
|
|
@ -4225,5 +4357,12 @@ input[type="number"]::-webkit-outer-spin-button {
|
||||||
.pay_btns .el-button:disabled {
|
.pay_btns .el-button:disabled {
|
||||||
border: 1px solid #dcdfe6;
|
border: 1px solid #dcdfe6;
|
||||||
}
|
}
|
||||||
|
.order_remark{
|
||||||
|
font-size: 14px;
|
||||||
|
color: #666;
|
||||||
|
margin-top: 5px;
|
||||||
|
max-width: 340px;
|
||||||
|
word-break: break-all;
|
||||||
|
}
|
||||||
</style>
|
</style>
|
||||||
|
|
||||||
Loading…
Reference in New Issue