8 Commits
gh ... test

Author SHA1 Message Date
wwz
7b0c291492 Merge branch 'dev' of https://e.coding.net/g-cphe0354/yinshoukeguanliduan/management into test 2024-12-23 09:41:57 +08:00
wwz
f62b1fde5d Merge branch 'test' of https://e.coding.net/g-cphe0354/yinshoukeguanliduan/management into wwz 2024-12-19 14:47:09 +08:00
wwz
b69a95c92c 赠送管理 2024-12-19 14:45:37 +08:00
wwz
b566eaf516 台桌费 2024-12-18 11:22:14 +08:00
gyq
d85c6db3f6 修复添加商品时间 2024-12-18 09:42:53 +08:00
gyq
e959aba44d 修复添加商品时间 2024-12-18 09:41:10 +08:00
wwz
9f72777317 代客下单增加课座费 2024-12-17 10:29:00 +08:00
73a6736075 挂账金额禁止编辑 2024-12-10 18:30:00 +08:00
7 changed files with 206 additions and 245 deletions

View File

@@ -666,8 +666,8 @@ export default {
singlePeopleLimit: 0, singlePeopleLimit: 0,
weight: '', weight: '',
days: couponEnum.cycle.map(item => item.value), days: couponEnum.cycle.map(item => item.value),
startTime: '', startTime: '00:00',
endTime: '' endTime: '23:59'
}, },
useTime: ['00:00', '23:59'], useTime: ['00:00', '23:59'],
imgList: [], imgList: [],

View File

@@ -187,7 +187,6 @@ export default {
isActive() { isActive() {
const isSel = const isSel =
this.selIndex === this.index && this.placeNum === this.selPlaceNum; this.selIndex === this.index && this.placeNum === this.selPlaceNum;
console.log(isSel);
return isSel ? "active" : ""; return isSel ? "active" : "";
}, },
}, },

View File

@@ -65,7 +65,6 @@ export default {
this.$set(this.listdata.proGroupVo, index, { ...this.listdata.proGroupVo[index], alertshow: this.listdata.proGroupVo[index].number != this.multipleSelection[index].length ? true : false }); this.$set(this.listdata.proGroupVo, index, { ...this.listdata.proGroupVo[index], alertshow: this.listdata.proGroupVo[index].number != this.multipleSelection[index].length ? true : false });
}, },
confirm() { confirm() {
console.log(listdata.proGroupVo)
this.$emit("dialogpackageconfirm", this.listdata, this.multipleSelection); this.$emit("dialogpackageconfirm", this.listdata, this.multipleSelection);
this.show = false; this.show = false;
@@ -84,7 +83,6 @@ export default {
return false; return false;
} }
this.disabledshow = true this.disabledshow = true
console.log(this.listdata, this.multipleSelection);
this.show = true; this.show = true;
}, },
}, },

View File

@@ -7,7 +7,7 @@
</slot> </slot>
</div> </div>
<slot name="tips"></slot> <slot name="tips"></slot>
<div class="number_list_box"> <div class="number_list_box" v-if="!disabled">
<div class="yd-keyboard"> <div class="yd-keyboard">
<div class="mini-number-box1"> <div class="mini-number-box1">
<div class="mini-number"> <div class="mini-number">
@@ -65,6 +65,10 @@ export default {
type: Boolean, type: Boolean,
default: false, default: false,
}, },
disabled:{
type:Boolean,
default:false
},
max: { max: {
type: [Number, String], type: [Number, String],
default: Infinity, default: Infinity,

View File

@@ -25,6 +25,7 @@
v-model="number" v-model="number"
isFloat isFloat
@clear="clear" @clear="clear"
:disabled="true"
:max="payMoney" :max="payMoney"
:maxTips="'超出未结账金额'" :maxTips="'超出未结账金额'"
> >
@@ -36,7 +37,7 @@
> >
{{ tips }} {{ tips }}
</div> </div>
<div slot="input" class="u-p-l-20 u-p-r-20 u-flex w-full"> <div slot="input" class="u-p-l-20 u-p-r-20 u-flex w-full u-relative">
<div class="font-bold u-font-32">¥</div> <div class="font-bold u-font-32">¥</div>
<el-input <el-input
placeholder="请输入挂账金额" placeholder="请输入挂账金额"
@@ -48,6 +49,7 @@
:type="focus ? 'number' : 'text'" :type="focus ? 'number' : 'text'"
> >
</el-input> </el-input>
<div class="zhezhao"></div>
</div> </div>
</key-board> </key-board>
<div class="confirm_btns"> <div class="confirm_btns">
@@ -267,7 +269,14 @@ export default {
font-size: 20px; font-size: 20px;
position: relative; position: relative;
} }
.zhezhao{
position: absolute;
top: 0;
left: 0;
bottom: 0;
right: 0;
z-index: 1;
}
.select_desk .select_desk_dialog .inputs .close { .select_desk .select_desk_dialog .inputs .close {
color: #aaa; color: #aaa;
position: absolute; position: absolute;

View File

@@ -1,14 +1,18 @@
<template> <template>
<div class="select_desk"> <div class="select_desk">
<el-dialog title="请选择商品" :visible.sync="show"> <el-dialog title="请选择商品" :visible.sync="show">
<div style="padding: 10px 0;display: flex;justify-content: space-between;align-items: center;"> <div style="
padding: 10px 0;
display: flex;
justify-content: space-between;
align-items: center;
">
<el-checkbox v-model="isFull">并桌</el-checkbox> <el-checkbox v-model="isFull">并桌</el-checkbox>
<el-select v-model="targetTableId" placeholder="请选择目标台桌"> <el-select v-model="targetTableId" placeholder="请选择目标台桌">
<el-option v-for="item in originTableList" :key="item.tableId" :label="item.name" <el-option v-for="item in originTableList" :key="item.tableId" :label="item.name"
:value="item.tableId" @click="changeTable(item, index)"> :value="item.tableId">
</el-option> </el-option>
</el-select> </el-select>
</div> </div>
<div v-if="!isFull"> <div v-if="!isFull">
<div v-if="itemdata.list.length > 0"> <div v-if="itemdata.list.length > 0">
@@ -53,7 +57,6 @@
{{ (scope.row.salePrice * scope.row.number).toFixed(2) }} {{ (scope.row.salePrice * scope.row.number).toFixed(2) }}
</div> </div>
</template> </template>
</el-table-column> </el-table-column>
</el-table> </el-table>
</div> </div>
@@ -64,7 +67,6 @@
<el-button @click="toggleSelection">取消</el-button> <el-button @click="toggleSelection">取消</el-button>
</div> </div>
</el-dialog> </el-dialog>
</div> </div>
</template> </template>
@@ -74,16 +76,22 @@ import { forEach } from "lodash";
export default { export default {
data() { data() {
return { return {
selectalllist: [],
show: false, show: false,
itemdata: {}, itemdata: {
list: [],
old: {
list: [],
}
},
list: [], list: [],
masterId: '', masterId: "",
currentTableId: '', currentTableId: "",
targetTableId: '', targetTableId: "",
originTableList: [],//桌台列表 originTableList: [], //桌台列表
multipleSelection: [], multipleSelection: [],
refcartSelection: [], refcartSelection: [],
isFull: false isFull: false,
}; };
}, },
methods: { methods: {
@@ -92,79 +100,80 @@ export default {
this.$refs.refcart.clearSelection(); this.$refs.refcart.clearSelection();
this.$refs.reftransfertoPinpin.forEach((a) => { this.$refs.reftransfertoPinpin.forEach((a) => {
a.clearSelection(); a.clearSelection();
}) });
} catch (error) { } catch (error) { }
}
}, },
handleSelectionChange(val, index) { handleSelectionChange(val, index) {
try { try {
this.itemdata.old.list.forEach((a, i) => { this.itemdata.old.list.forEach((a, i) => {
this.multipleSelection[index] = i === index ? val : this.multipleSelection[index] || [] this.multipleSelection[index] =
}) i === index ? val : this.multipleSelection[index] || [];
});
} catch (error) { } } catch (error) { }
}, },
handlerefcart(val) { handlerefcart(val) {
this.refcartSelection = val this.refcartSelection = val;
}, },
async confirm() { async confirm() {
console.log(this.itemdata, this.multipleSelection)
if (!this.targetTableId) { if (!this.targetTableId) {
this.$message({ this.$message({
message: '请选择目标台桌!', message: "请选择目标台桌!",
type: 'warning' type: "warning",
}) });
return false; return false;
} }
// 判断全选增加课桌费
// var tzf = []
// try {
// let one = this.itemdata.old.list.every((i, index) => i.info.length == this.multipleSelection[index].length)
// let tow = this.itemdata.list.every((icon) => icon.length == this.refcartSelection.length)
// if (one && tow) {
// tzf = [999]
// }
// } catch (error) { }
// 数据处理 增加cartId方便判断
if (this.refcartSelection.length) { if (this.refcartSelection.length) {
this.refcartSelection.forEach((i) => { this.refcartSelection.forEach((i) => {
i.cartId = i.id i.cartId = i.id;
}) });
} }
let cartIds = [...this.multipleSelection, [...this.refcartSelection]] let cartIds = [...this.multipleSelection, [...this.refcartSelection]];
console.log(cartIds)
await placeswitch({ await placeswitch({
masterId: this.masterId, masterId: this.masterId,
orderId: this.itemdata.orderId,//当前台桌订单id 可选 orderId: this.itemdata.orderId, //当前台桌订单id 可选
cartIds: this.isFull ? '' : cartIds.flatMap(subArray => subArray.map(item => item.cartId)),//转单的购物车商品 并桌时可不传 可选 cartIds: this.isFull ? "" : cartIds.flatMap((subArray) => subArray.map((item) => item.cartId)), //转单的购物车商品 并桌时可不传 可选
isFull: this.isFull,//并台会将全部购物车商品转入默认为false 可选 isFull: this.isFull, //并台会将全部购物车商品转入默认为false 可选
currentTableId: this.currentTableId, currentTableId: this.currentTableId,
targetTableId: this.targetTableId, targetTableId: this.targetTableId,
});
})
this.$forceUpdate(); this.$forceUpdate();
this.$emit("transfertoPinpin"); this.$emit("transfertoPinpin");
this.show = false; this.show = false;
}, },
open(item, masterId, currentTableId, originTableList) { open(item, masterId, currentTableId, originTableList) {
// 订单信息,取餐码,用餐类型,桌台号id台桌列表 // 订单信息,取餐码,用餐类型,桌台号id台桌列表
console.log(item, masterId, currentTableId, originTableList) // console.log(item, masterId, currentTableId, originTableList);
this.itemdata = item this.itemdata = item;
this.masterId = masterId//取餐码 this.masterId = masterId; //取餐码
this.currentTableId = currentTableId//当前桌台id this.currentTableId = currentTableId; //当前桌台id
this.originTableList = originTableList.filter((i) => i.tableId != currentTableId && i.status == 'using')//台桌列表 this.originTableList = originTableList.filter(
(i) => i.tableId != currentTableId && i.status == "using"
); //台桌列表
try { try {
this.$refs.refcart.clearSelection(); this.$refs.refcart.clearSelection();
this.$refs.reftransfertoPinpin.forEach((a) => { this.$refs.reftransfertoPinpin.forEach((a) => {
a.clearSelection(); a.clearSelection();
}) });
} catch (error) { } } catch (error) { }
this.multipleSelection = []
this.refcartSelection = []
this.targetTableId = ''
this.show = true; this.show = true;
}, },
returnTableColor(key) { returnTableColor(key) {
const item = $status[key]; const item = $status[key];
return item ? item.type : ""; return item ? item.type : "";
}, },
changeTable(item, index) {
console.log(item, index)
},
searchInput(e) {
console.log(e);
// this.tableList = $originTableList.filter((v) =>
// $strMatch(v.name, e.trim())
// );
},
}, },
}; };
</script> </script>
@@ -179,7 +188,6 @@ export default {
margin: 20px 10px; margin: 20px 10px;
.boxspan {} .boxspan {}
} }
.buttonbox { .buttonbox {
@@ -188,4 +196,4 @@ export default {
text-align: right; text-align: right;
} }
} }
</style> </style>

View File

@@ -369,7 +369,8 @@
<div class="btn" :class="{ disabled: !isSku }" @click="orderBtnsClick('sku')"> <div class="btn" :class="{ disabled: !isSku }" @click="orderBtnsClick('sku')">
规格 规格
</div> </div>
<div class="btn" :class="{ disabled: order.selIndex < 0 }" @click="orderBtnsClick('gift')"> <div class="btn" :class="{ disabled: order.selIndex < 0 }" @click="orderBtnsClick('gift')"
v-if="returnGiftTextshow">
{{ returnGiftText }} {{ returnGiftText }}
</div> </div>
<div class="btn" :class="{ disabled: order.selIndex < 0 }" @click="orderBtnsClick('pack')"> <div class="btn" :class="{ disabled: order.selIndex < 0 }" @click="orderBtnsClick('pack')">
@@ -422,7 +423,6 @@
</div> </div>
<div @click="orderBtnsClick('print')" :class="{ disabled: order.selIndex < 0 }" class="btn"> <div @click="orderBtnsClick('print')" :class="{ disabled: order.selIndex < 0 }" class="btn">
{{ returnPrintText }} {{ returnPrintText }}
</div> </div>
<div @click="refPopChangePriceShow" :class="{ disabled: order.selIndex < 0 }" class="btn"> <div @click="refPopChangePriceShow" :class="{ disabled: order.selIndex < 0 }" class="btn">
单品改价 单品改价
@@ -435,7 +435,7 @@
{{ returnWaingAllText }} {{ returnWaingAllText }}
</div> </div>
<div class="btn no-wrap u-font-12" @click="clicktransfertoPinpin()" <div class="btn no-wrap u-font-12" @click="clicktransfertoPinpin()"
v-if="table.name && useTypes.sel == 'dine-in' && payAfter"> v-if="table.name && useTypes.sel == 'dine-in' && payAfter && cktableList">
转桌/并桌 转桌/并桌
</div> </div>
<!-- --> <!-- -->
@@ -1015,8 +1015,7 @@
<pop-tuan-quan :cartGoods="createOrder.data.detailList || []" ref="refPopTuanQuan" <pop-tuan-quan :cartGoods="createOrder.data.detailList || []" ref="refPopTuanQuan"
@confirm="tuanQuanConfirm"></pop-tuan-quan> @confirm="tuanQuanConfirm"></pop-tuan-quan>
<!-- 美团/抖音团购券核销 --> <!-- 美团/抖音团购券核销 -->
<pop-quan-hexiao ref="refQuanHexiao"> <pop-quan-hexiao ref="refQuanHexiao"> </pop-quan-hexiao>
</pop-quan-hexiao>
<!-- 挂账 --> <!-- 挂账 -->
<popup-choose-guazhang ref="refGuaZhang" :payMoney="yinFuJinE" <popup-choose-guazhang ref="refGuaZhang" :payMoney="yinFuJinE"
@confirm="guazhangPayConfirm"></popup-choose-guazhang> @confirm="guazhangPayConfirm"></popup-choose-guazhang>
@@ -1054,8 +1053,6 @@ import popupWeightGoods from "./components/popup-weight-goods.vue";
import dialogpackage from "./components/dialogpackage.vue"; import dialogpackage from "./components/dialogpackage.vue";
import transfertoPinpin from "./components/transfertoPinpin.vue"; import transfertoPinpin from "./components/transfertoPinpin.vue";
import dayjs from "dayjs"; import dayjs from "dayjs";
import { tbShopInfo } from "@/api/user"; import { tbShopInfo } from "@/api/user";
import { hasPermission } from "@/utils/limits.js"; import { hasPermission } from "@/utils/limits.js";
@@ -1108,11 +1105,13 @@ import { returnProductCoupAllPrice } from "./quan_util.js";
let $goodsPayPriceMap = {}; let $goodsPayPriceMap = {};
import { $status } from "@/utils/table.js"; import { $status } from "@/utils/table.js";
import PopupChooseGuazhang from "./components/popup-choose-guazhang.vue"; import PopupChooseGuazhang from "./components/popup-choose-guazhang.vue";
import { forEach } from "jszip";
let $originTableList = []; let $originTableList = [];
export default { export default {
components: { components: {
popupWeightGoods, popQuanHexiao, popupWeightGoods,
popQuanHexiao,
popupChooseGuazhang, popupChooseGuazhang,
cartChangePrice, cartChangePrice,
popTuanQuan, popTuanQuan,
@@ -1131,7 +1130,7 @@ export default {
chooseDinersNumber, chooseDinersNumber,
PopupChooseGuazhang, PopupChooseGuazhang,
dialogpackage, dialogpackage,
transfertoPinpin transfertoPinpin,
}, },
data() { data() {
return { return {
@@ -1354,14 +1353,27 @@ export default {
}; };
}, },
computed: { computed: {
cktableList() {
// 使用 reduce 方法统计指定值出现的次数
// const count = this.tableList.reduce((acc, cur) => {
// if (cur.status == "using") {
// return acc + 1;
// }
// return acc;
// }, 0);
if (this.tableList) {
let res = this.tableList.filter((i) => i.status == 'using')
return res.length >= 2 ? true : false
} else {
return false
}
},
returnPrintText() { returnPrintText() {
if (this.order.selIndex < 0) { if (this.order.selIndex < 0) {
return "免厨打"; return "免厨打";
} }
const cart = this.order.list[this.order.selIndex] const cart = this.order.list[this.order.selIndex];
return (cart.isPrint || cart.isPrint === null) return cart.isPrint || cart.isPrint === null ? "免厨打" : "打印";
? "免厨打"
: "打印";
}, },
returnWaingText() { returnWaingText() {
if (this.order.selIndex < 0) { if (this.order.selIndex < 0) {
@@ -1387,11 +1399,14 @@ export default {
}, },
gaijia() { gaijia() {
if (!this.createOrder.data.amount) { if (!this.createOrder.data.amount) {
return 0 return 0;
} }
const disCountOriginPrice = const disCountOriginPrice =
this.createOrder.data.amount - this.productCouponDiscountAmount; this.createOrder.data.amount - this.productCouponDiscountAmount;
const discountPrice = ((1 - this.createOrder.discount) * disCountOriginPrice).toFixed(2) const discountPrice = (
(1 - this.createOrder.discount) *
disCountOriginPrice
).toFixed(2);
return discountPrice; return discountPrice;
}, },
pointsCanDicountMoney() { pointsCanDicountMoney() {
@@ -1410,15 +1425,19 @@ export default {
return n; return n;
}, },
productCouponDiscountAmount() { productCouponDiscountAmount() {
const n = this.quansSelArr.filter(v => v.type == 2).reduce((prve, cur) => { const n = this.quansSelArr
return prve + cur.discountAmount * 1; .filter((v) => v.type == 2)
}, 0); .reduce((prve, cur) => {
return prve + cur.discountAmount * 1;
}, 0);
return n; return n;
}, },
fullCouponDiscountAmount() { fullCouponDiscountAmount() {
const n = this.quansSelArr.filter(v => v.type == 1).reduce((prve, cur) => { const n = this.quansSelArr
return prve + cur.discountAmount * 1; .filter((v) => v.type == 1)
}, 0); .reduce((prve, cur) => {
return prve + cur.discountAmount * 1;
}, 0);
return n; return n;
}, },
currentPayMoney() { currentPayMoney() {
@@ -1426,13 +1445,16 @@ export default {
const discount = this.createOrder.discount || 1; const discount = this.createOrder.discount || 1;
// const total=((amount - this.coupdiscount) * this.createOrder.discount - this.points.toMoney) // const total=((amount - this.coupdiscount) * this.createOrder.discount - this.points.toMoney)
// const total = amount - this.gaijia - this.coupdiscount; // const total = amount - this.gaijia - this.coupdiscount;
const total = amount - this.productCouponDiscountAmount - this.gaijia - this.fullCouponDiscountAmount; const total =
amount -
this.productCouponDiscountAmount -
this.gaijia -
this.fullCouponDiscountAmount;
return total <= 0 ? 0 : total; return total <= 0 ? 0 : total;
}, },
yinFuJinE() { yinFuJinE() {
const total = const total =
this.currentPayMoney - (this.points.selected ? this.points.toMoney : 0); this.currentPayMoney - (this.points.selected ? this.points.toMoney : 0);
console.log(total);
if (this.isCreateOrder) { if (this.isCreateOrder) {
return total.toFixed(2); return total.toFixed(2);
} else { } else {
@@ -1445,9 +1467,9 @@ export default {
this.order.selIndex >= 0 || this.order.selIndex >= 0 ||
!this.order.selGoods || !this.order.selGoods ||
this.order.old.list.length <= 0 || this.order.old.list.length <= 0 ||
this.order.selGoods.status == "return" this.order.selGoods.status == "return" ||
|| this.order.selGoods.useType == 'dine-in' this.order.selGoods.useType == "dine-in" ||
|| this.order.selGoods.useType == 'dine-in-before' this.order.selGoods.useType == "dine-in-before"
); );
}, },
title() { title() {
@@ -1521,6 +1543,16 @@ export default {
? "取消赠送" ? "取消赠送"
: "赠送"; : "赠送";
}, },
returnGiftTextshow() {
try {
// 选中的购物车里面是否已有
if (this.order.list.filter((i, v) => i.productId == this.order.list[this.order.selIndex].productId).length >= 2) {
return false;
} else {
return true;
}
} catch (error) { }
},
returnPackText() { returnPackText() {
if (this.order.selIndex < 0) { if (this.order.selIndex < 0) {
return "打包"; return "打包";
@@ -1634,8 +1666,8 @@ export default {
const cartNumber = this.order.list.reduce((a, b) => { const cartNumber = this.order.list.reduce((a, b) => {
return a + b.number * 1; return a + b.number * 1;
}, 0); }, 0);
const total = oldNumber + cartNumber const total = oldNumber + cartNumber;
return (Math.floor(total) == total ? total : total.toFixed(2)); return Math.floor(total) == total ? total : total.toFixed(2);
}, },
selGoodsHide() { selGoodsHide() {
this.selGoods.show = false; this.selGoods.show = false;
@@ -1703,7 +1735,6 @@ export default {
} }
}, },
"useTypes.sel": function (newval, oldval) { "useTypes.sel": function (newval, oldval) {
console.log(newval);
this.setPostPay(); this.setPostPay();
this.setUseType(); this.setUseType();
}, },
@@ -1737,7 +1768,6 @@ export default {
// } // }
// }, // },
masterId: function (val) { masterId: function (val) {
console.log(val);
}, },
isCreateOrder: function (val) { isCreateOrder: function (val) {
if (!val) { if (!val) {
@@ -1754,8 +1784,6 @@ export default {
// masterId = res.masterId; // masterId = res.masterId;
// } // }
// this.masterId = masterId; // this.masterId = masterId;
console.log("this.createOrder.data");
console.log(this.createOrder.data);
if (this.order.status == "finish") { if (this.order.status == "finish") {
return; return;
} }
@@ -1790,20 +1818,17 @@ export default {
} else { } else {
this.prveOrder.selCart = []; this.prveOrder.selCart = [];
} }
console.log(this.prveOrder.selCart);
}, },
"prveOrder.sel": function (val) { "prveOrder.sel": function (val) {
this.prveOrder.selCart = this.prveOrder.selCart =
this.prveOrder.list.length !== 0 this.prveOrder.list.length !== 0
? this.prveOrder.list[val].carList ? this.prveOrder.list[val].carList
: []; : [];
console.log(this.prveOrder.selCart);
if (val < 0) { if (val < 0) {
this.prveOrde.show = false; this.prveOrde.show = false;
} }
}, },
"order.allPack": function (val) { "order.allPack": function (val) {
console.log(val);
if (this.order.list.length <= 0) { if (this.order.list.length <= 0) {
return; return;
} }
@@ -1827,7 +1852,6 @@ export default {
const selItem = item.info[this.order.old.selIndex]; const selItem = item.info[this.order.old.selIndex];
goods = selItem ? selItem : ""; goods = selItem ? selItem : "";
} }
console.log(goods);
if (val === -1) { if (val === -1) {
this.order.cacheNumber = 1; this.order.cacheNumber = 1;
} else { } else {
@@ -1848,14 +1872,12 @@ export default {
return; return;
} }
this.createOrderClose(); this.createOrderClose();
let item = this.order.list[this.order.selIndex]; let item = this.order.list[this.order.selIndex];
console.log(item.specSnap);
const { productId, skuId, isPack, isGift, number } = item; const { productId, skuId, isPack, isGift, number } = item;
const oldGoods = this.order.old.list.find((v) => { const oldGoods = this.order.old.list.find((v) => {
return v.productId === productId && v.skuId === skuId; return v.productId === productId && v.skuId === skuId;
}); });
const newNum = this.order.number + (oldGoods ? oldGoods.number : 0) const newNum = this.order.number + (oldGoods ? oldGoods.number : 0);
$updateCart({ $updateCart({
cartId: item.id, cartId: item.id,
productId, productId,
@@ -1897,7 +1919,7 @@ export default {
methods: { methods: {
//美团抖音团购券核销弹窗 //美团抖音团购券核销弹窗
refQuanHexiaoOpen() { refQuanHexiaoOpen() {
this.$refs.refQuanHexiao.open() this.$refs.refQuanHexiao.open();
}, },
//称重商品弹窗 //称重商品弹窗
refWeightGoodsShow(item) { refWeightGoodsShow(item) {
@@ -1905,13 +1927,18 @@ export default {
}, },
//称重商品确认 //称重商品确认
async refWeightGoodsConfirm(item, number) { async refWeightGoodsConfirm(item, number) {
console.log(item) this.goodsClick(item, number, true);
console.log(number)
this.goodsClick(item, number, true)
}, },
//套餐下单 //套餐下单
async dialogpackageconfirm(item, multipleSelection) { async dialogpackageconfirm(item, multipleSelection) {
this.goodsClick(item, 1, true, multipleSelection.flatMap(subArray => subArray.map(item => item.proId))) this.goodsClick(
item,
1,
true,
multipleSelection.flatMap((subArray) =>
subArray.map((item) => item.proId)
)
);
}, },
//挂账人支付确认 //挂账人支付确认
guazhangPayConfirm(guazhangren, price) { guazhangPayConfirm(guazhangren, price) {
@@ -1930,14 +1957,13 @@ export default {
this.$refs.refPopTuanQuan.open(); this.$refs.refPopTuanQuan.open();
}, },
tuanQuanConfirm(e) { tuanQuanConfirm(e) {
console.log(e);
this.tuanQuan = e; this.tuanQuan = e;
}, },
//更新单品改价数据 //更新单品改价数据
updateCartItem(res) { updateCartItem(res) {
if (res) { if (res) {
// this.order.list[this.order.selIndex] = res; // this.order.list[this.order.selIndex] = res;
this.$set(this.order.list, this.order.selIndex, res) this.$set(this.order.list, this.order.selIndex, res);
} }
}, },
// 单品改价 // 单品改价
@@ -1946,7 +1972,6 @@ export default {
this.$refs.refPopChangePrice.open(orderGoods); this.$refs.refPopChangePrice.open(orderGoods);
}, },
returnProDiscount(row) { returnProDiscount(row) {
console.log(row);
//相同商品抵扣券数组 //相同商品抵扣券数组
const arr = this.quansSelArr.filter((v) => v.proId == row.proId); const arr = this.quansSelArr.filter((v) => v.proId == row.proId);
const index = arr.findIndex((v) => v.id == row.id); const index = arr.findIndex((v) => v.id == row.id);
@@ -1975,7 +2000,6 @@ export default {
}, },
delQuan(row) { delQuan(row) {
const index = this.quansSelArr.findIndex((v) => v.id == row.id); const index = this.quansSelArr.findIndex((v) => v.id == row.id);
console.log(index);
if (index != -1) { if (index != -1) {
this.quansSelArr.splice(index, 1); this.quansSelArr.splice(index, 1);
this.quansSelArr.map((v, index) => { this.quansSelArr.map((v, index) => {
@@ -2012,7 +2036,6 @@ export default {
}, },
//根据积分输入值变化计算抵扣金额 //根据积分输入值变化计算抵扣金额
pointsValueChange(e) { pointsValueChange(e) {
console.log(e);
if (e == 0 || !e) { if (e == 0 || !e) {
return (this.points.toMoney = 0); return (this.points.toMoney = 0);
} }
@@ -2026,7 +2049,6 @@ export default {
}, },
//积分抵扣类型改变 //积分抵扣类型改变
pointsChange(e) { pointsChange(e) {
console.log(e);
if (e == 1) { if (e == 1) {
this.points.value = Math.min( this.points.value = Math.min(
this.vipUser.accountPoints, this.vipUser.accountPoints,
@@ -2047,7 +2069,6 @@ export default {
); );
}, },
quansConfirm(e, goodsPayPriceMap) { quansConfirm(e, goodsPayPriceMap) {
console.log(e);
// this.createOrder.discount = 1; // this.createOrder.discount = 1;
this.points.selected = ""; this.points.selected = "";
e.map((v, index) => { e.map((v, index) => {
@@ -2061,7 +2082,6 @@ export default {
$goodsPayPriceMap = goodsPayPriceMap; $goodsPayPriceMap = goodsPayPriceMap;
}, },
searchInput(e) { searchInput(e) {
console.log(e);
this.tableList = $originTableList.filter((v) => this.tableList = $originTableList.filter((v) =>
$strMatch(v.name, e.trim()) $strMatch(v.name, e.trim())
); );
@@ -2086,7 +2106,6 @@ export default {
return this.canXiadan; return this.canXiadan;
}, },
changeOrderExtraSel(index, canChangeNumber, placeNum) { changeOrderExtraSel(index, canChangeNumber, placeNum) {
// console.log(index,canChangeNumber,placeNum)
this.order.selIndex = -1; this.order.selIndex = -1;
this.order.selGoods = this.order.seatFee; this.order.selGoods = this.order.seatFee;
this.order.selPlaceNum = placeNum; this.order.selPlaceNum = placeNum;
@@ -2151,7 +2170,6 @@ export default {
// ...this.order.old.list, // ...this.order.old.list,
// { info: this.order.list, placeNum: nowPlaceNum + 1 }, // { info: this.order.list, placeNum: nowPlaceNum + 1 },
// ]; // ];
console.log(this.order.old.list);
return res; return res;
}, },
async payBeforeClear() { async payBeforeClear() {
@@ -2240,8 +2258,6 @@ export default {
//munchies 先付 restaurant 后付 //munchies 先付 restaurant 后付
this.payAfter = this.shopInfo.registerType == "munchies" ? false : true; this.payAfter = this.shopInfo.registerType == "munchies" ? false : true;
} }
console.log("this.payAfter");
console.log(this.payAfter);
}, },
//获取店铺信息 //获取店铺信息
async getShopInfo() { async getShopInfo() {
@@ -2258,7 +2274,6 @@ export default {
if (this.order.old.list.length > 0) { if (this.order.old.list.length > 0) {
return this.$message("下单后不支持更改就餐方式"); return this.$message("下单后不支持更改就餐方式");
} }
console.log(type);
this.useTypes.sel = type; this.useTypes.sel = type;
}, },
//更改就餐人数 //更改就餐人数
@@ -2279,12 +2294,10 @@ export default {
async onTableChange() { async onTableChange() {
this.order.list = []; this.order.list = [];
this.order.old.list = []; this.order.old.list = [];
console.log("onTableChange");
const perpole = this.perpole || ""; const perpole = this.perpole || "";
const tableRes = await $returnTableDetail({ const tableRes = await $returnTableDetail({
tableId: this.table.tableId, tableId: this.table.tableId,
}); });
console.log(tableRes);
const orderId = tableRes.orderId || this.table.orderId; const orderId = tableRes.orderId || this.table.orderId;
if (orderId) { if (orderId) {
return this.getOrderData({ orderId: orderId }); return this.getOrderData({ orderId: orderId });
@@ -2351,7 +2364,6 @@ export default {
this.order.old.selIndex = -1; this.order.old.selIndex = -1;
// this.getCart(); // this.getCart();
this.getOrderData(); this.getOrderData();
// console.log(this.order.selGoods);
}, },
// 台桌列表 // 台桌列表
@@ -2369,7 +2381,6 @@ export default {
); );
$originTableList = this.tableList; $originTableList = this.tableList;
} catch (error) { } catch (error) {
console.log(error);
} }
}, },
async getTableDetail(tableId) { async getTableDetail(tableId) {
@@ -2380,8 +2391,6 @@ export default {
return res; return res;
}, },
async changeTable(item) { async changeTable(item) {
console.log("changeTable");
console.log(this.table, this.table.tableId);
if ( if (
(this.table && this.table.tableId) || (this.table && this.table.tableId) ||
(!this.table && !this.tableId && this.order.list.length <= 0) (!this.table && !this.tableId && this.order.list.length <= 0)
@@ -2398,7 +2407,6 @@ export default {
if (this.table && this.order.list.length <= 0) { if (this.table && this.order.list.length <= 0) {
this.table = item; this.table = item;
this.tableShow = false; this.tableShow = false;
console.log(this.table);
this.onTableChange(); this.onTableChange();
return; return;
} }
@@ -2421,7 +2429,6 @@ export default {
} }
); );
} catch (e) { } catch (e) {
console.log(e);
} }
} }
this.tableShow = false; this.tableShow = false;
@@ -2495,10 +2502,9 @@ export default {
if (!canDiscount) { if (!canDiscount) {
return; return;
} }
const amount = (this.createOrder.data.amount - this.productCouponDiscountAmount).toFixed( const amount = (
2 this.createOrder.data.amount - this.productCouponDiscountAmount
); ).toFixed(2);
console.log(amount);
this.refToggle("refDiscount", true, { this.refToggle("refDiscount", true, {
amount, amount,
discount: this.createOrder.discount * 100, discount: this.createOrder.discount * 100,
@@ -2513,7 +2519,6 @@ export default {
//购物车商品输入框数量输入 //购物车商品输入框数量输入
cartGoodsNumberInput(newval, index) { cartGoodsNumberInput(newval, index) {
const item = this.order.list[index]; const item = this.order.list[index];
console.log(item);
this.order.cacheNumber = newval; this.order.cacheNumber = newval;
item.number = newval; item.number = newval;
}, },
@@ -2521,7 +2526,6 @@ export default {
cartGoodsNumberChange(newval, index) { cartGoodsNumberChange(newval, index) {
const item = this.order.list[index]; const item = this.order.list[index];
newval = `${newval}`.split(".")[0] * 1; newval = `${newval}`.split(".")[0] * 1;
console.log(newval);
this.order.cacheNumber = newval; this.order.cacheNumber = newval;
this.order.number = newval; this.order.number = newval;
}, },
@@ -2578,7 +2582,6 @@ export default {
}, },
//改变是否打印 //改变是否打印
changeIsPrint(e) { changeIsPrint(e) {
console.log(e);
this.isPrint = e; this.isPrint = e;
}, },
async refOrderNoteConfirm(note) { async refOrderNoteConfirm(note) {
@@ -2629,10 +2632,6 @@ export default {
if (this.order.payType == "deposit") { if (this.order.payType == "deposit") {
return this.refToggle("refScanCode", true); return this.refToggle("refScanCode", true);
} }
console.log({
orderId: this.createOrder.data.id,
payType: this.order.payType,
});
if (this.order.payType == "cash") { if (this.order.payType == "cash") {
return this.$confirm( return this.$confirm(
"是否确认已现金收款:" + this.yinFuJinE + "?", "是否确认已现金收款:" + this.yinFuJinE + "?",
@@ -2701,14 +2700,12 @@ export default {
// this.reset(); // this.reset();
}, },
chooseTableConfirm(item) { chooseTableConfirm(item) {
console.log(item);
this.table = item; this.table = item;
}, },
chooseTableOpen() { chooseTableOpen() {
this.$refs.refChooseTable.open(); this.$refs.refChooseTable.open();
}, },
chooseUserConfirm(user) { chooseUserConfirm(user) {
console.log(user);
if (user) { if (user) {
this.vipUser = user; this.vipUser = user;
} else { } else {
@@ -2719,7 +2716,6 @@ export default {
this.$refs.refChooseUser.open(); this.$refs.refChooseUser.open();
}, },
createOrderClose() { createOrderClose() {
console.log("createOrderClose");
this.isCreateOrder = false; this.isCreateOrder = false;
}, },
//生成订单 //生成订单
@@ -2737,8 +2733,6 @@ export default {
return; return;
} }
} }
console.log(this.createOrder.status);
if ( if (
this.createOrder.status != "" && this.createOrder.status != "" &&
this.createOrder.status != "success" this.createOrder.status != "success"
@@ -2810,7 +2804,6 @@ export default {
//更新购物车商品数据 //更新购物车商品数据
updateOrder(par = {}) { updateOrder(par = {}) {
let item = this.order.list[this.order.selIndex]; let item = this.order.list[this.order.selIndex];
console.log(this.table);
const { const {
productId, productId,
skuId, skuId,
@@ -2842,8 +2835,8 @@ export default {
}); });
}, },
keyboradAdd(n) { keyboradAdd(n) {
if (this.selGoods.isSku != 'weight' && n == '.') { if (this.selGoods.isSku != "weight" && n == ".") {
return return;
} }
if (Number(this.keyborad.number) === 0) { if (Number(this.keyborad.number) === 0) {
return (this.keyborad.number = n); return (this.keyborad.number = n);
@@ -2873,12 +2866,12 @@ export default {
}, },
changeKeyboradShow(show) { changeKeyboradShow(show) {
if (show) { if (show) {
this.selGoods = this.order.list[this.order.selIndex] this.selGoods = this.order.list[this.order.selIndex];
this.keyborad.number = `${this.order.list[this.order.selIndex].number}`; this.keyborad.number = `${this.order.list[this.order.selIndex].number}`;
} }
this.keyborad.show = show; this.keyborad.show = show;
if (!show) { if (!show) {
this.selGoods = '' this.selGoods = "";
} }
}, },
// 获取本地缓存挂单 // 获取本地缓存挂单
@@ -2891,25 +2884,13 @@ export default {
// }); // });
// }, // },
clicktransfertoPinpin() { clicktransfertoPinpin() {
// 使用 reduce 方法统计指定值出现的次数 // 订单信息,取餐码,用餐类型,桌台号id台桌列表
const count = this.tableList.reduce((acc, cur) => { this.$refs.refransfertoPinpin.open(
if (cur.status == 'using') { this.order,
return acc + 1; this.masterId,
} this.table.tableId,
return acc; this.tableList
}, 0); );
console.log(count)
if (count >= 2) {
// console.log(this.order, this.masterId, this.table.tableId, this.tableList)
// 订单信息,取餐码,用餐类型,桌台号id台桌列表
this.$refs.refransfertoPinpin.open(this.order, this.masterId, this.table.tableId, this.tableList);
} else {
this.$message({
message: '暂无可转台桌!',
type: 'warning'
})
return false;
}
}, },
//右侧控制按钮点击事件 //右侧控制按钮点击事件
async orderBtnsClick(key) { async orderBtnsClick(key) {
@@ -2921,7 +2902,6 @@ export default {
this.selGoods.title = orderGoods.name; this.selGoods.title = orderGoods.name;
this.selGoods.isEdit = true; this.selGoods.isEdit = true;
const item = this.goods.list.find((v) => v.id == orderGoods.productId); const item = this.goods.list.find((v) => v.id == orderGoods.productId);
console.log(item);
return this.showSelGoods({ ...item, ...orderGoods }); return this.showSelGoods({ ...item, ...orderGoods });
} }
if (key === "gift") { if (key === "gift") {
@@ -2938,7 +2918,8 @@ export default {
return this.removeCart(); return this.removeCart();
} }
if (key === "print") { if (key === "print") {
const isPrint = (orderGoods.isPrint || orderGoods.isPrint === null) ? true : false; const isPrint =
orderGoods.isPrint || orderGoods.isPrint === null ? true : false;
this.updateOrder({ isPrint: !isPrint }); this.updateOrder({ isPrint: !isPrint });
return; return;
} }
@@ -2952,10 +2933,10 @@ export default {
orderId: this.createOrder.data.id, orderId: this.createOrder.data.id,
masterId: this.masterId, masterId: this.masterId,
tableId: this.table.tableId, tableId: this.table.tableId,
isWaitCall: !this.isAllWaitCall ? 1 : 0 isWaitCall: !this.isAllWaitCall ? 1 : 0,
}) });
this.isAllWaitCall = !this.isAllWaitCall; this.isAllWaitCall = !this.isAllWaitCall;
this.getCart() this.getCart();
return; return;
} }
if (key === "save") { if (key === "save") {
@@ -2986,7 +2967,6 @@ export default {
return; return;
} }
if (key === "returnCart") { if (key === "returnCart") {
console.log(this.order);
let selGoods = undefined; let selGoods = undefined;
if (this.order.selPlaceNum == -10) { if (this.order.selPlaceNum == -10) {
selGoods = { ...this.order.seatFee, num: this.order.seatFee.number }; selGoods = { ...this.order.seatFee, num: this.order.seatFee.number };
@@ -2996,7 +2976,6 @@ export default {
this.order.old.selIndex this.order.old.selIndex
]; ];
} }
console.log(selGoods);
this.refToggle("refReturnCart", true, selGoods); this.refToggle("refReturnCart", true, selGoods);
} }
}, },
@@ -3019,11 +2998,8 @@ export default {
isPending: false, isPending: false,
}); });
this.order.orderId = id; this.order.orderId = id;
console.log(this.order.orderId);
this.masterId = masterId; this.masterId = masterId;
this.isPrverOrder = true; this.isPrverOrder = true;
console.log(masterId);
const res = await getCart({ const res = await getCart({
masterId, masterId,
tableId, tableId,
@@ -3060,7 +3036,6 @@ export default {
type: "warning", type: "warning",
} }
).catch((err) => { ).catch((err) => {
console.log(err);
}); });
if (!res) { if (!res) {
return; return;
@@ -3089,7 +3064,6 @@ export default {
this.prveOrder.list = res; this.prveOrder.list = res;
if (this.prveOrder.list.length && this.prveOrder.sel !== -1) { if (this.prveOrder.list.length && this.prveOrder.sel !== -1) {
const item = this.prveOrder.list[this.prveOrder.sel]; const item = this.prveOrder.list[this.prveOrder.sel];
console.log(item);
if (item) { if (item) {
this.prveOrder.selCart = item.carList; this.prveOrder.selCart = item.carList;
} }
@@ -3142,12 +3116,11 @@ export default {
}, },
// 点击订单里的加减改变购物车商品数量 // 点击订单里的加减改变购物车商品数量
async changeOrderNumber(index, isReduce) { async changeOrderNumber(index, isReduce) {
console.log(index, isReduce, '点击订单里的加减改变购物车商品数量')
if (index < 0) { if (index < 0) {
return; return;
} }
this.changeOrderSel(index); this.changeOrderSel(index);
console.log(index);
console.log(isReduce);
const item = this.order.list[index]; const item = this.order.list[index];
const mumber = item.number * 1; const mumber = item.number * 1;
const newval = mumber + (isReduce ? -1 : 1); const newval = mumber + (isReduce ? -1 : 1);
@@ -3174,7 +3147,6 @@ export default {
return; return;
} }
const item = this.order.list[this.order.selIndex]; const item = this.order.list[this.order.selIndex];
console.log(item);
const mumber = item.number * 1; const mumber = item.number * 1;
const newval = mumber + (isReduce ? -1 : 1); const newval = mumber + (isReduce ? -1 : 1);
if (newval <= 0) { if (newval <= 0) {
@@ -3183,7 +3155,6 @@ export default {
if (newval >= 100000) { if (newval >= 100000) {
return; return;
} }
console.log(newval);
// this.order.list[this.order.selIndex].number = newval; // this.order.list[this.order.selIndex].number = newval;
this.order.number = newval; this.order.number = newval;
@@ -3276,7 +3247,6 @@ export default {
clearTimeout(this.timer); clearTimeout(this.timer);
this.timer = null; this.timer = null;
}, 500); }, 500);
console.log(this.timer);
}, },
async skuGoodsAdd() { async skuGoodsAdd() {
let name = this.selGoods.skuList.reduce((prve, cur) => { let name = this.selGoods.skuList.reduce((prve, cur) => {
@@ -3285,9 +3255,6 @@ export default {
name = name.substring(0, name.length - 1); name = name.substring(0, name.length - 1);
// const item = this.selGoods.data.specList.find((v) => v.specSnap === name); // const item = this.selGoods.data.specList.find((v) => v.specSnap === name);
const item = this.selGoods.skuMap[name]; const item = this.selGoods.skuMap[name];
console.log(this.selGoods, '调试1')
console.log(name, '调试2')
console.log(item, '调试1')
if (!item.isGrounding) { if (!item.isGrounding) {
//该商品已经下架 //该商品已经下架
return this.$notify({ return this.$notify({
@@ -3296,8 +3263,6 @@ export default {
}); });
} }
let res = ""; let res = "";
console.log(orderGoods);
//更改购物车订单商品规格数量 //更改购物车订单商品规格数量
if (this.selGoods.isEdit) { if (this.selGoods.isEdit) {
res = await $updateCart({ res = await $updateCart({
@@ -3319,13 +3284,11 @@ export default {
this.order.cacheNumber = this.skuGoods.number; this.order.cacheNumber = this.skuGoods.number;
return; return;
} }
const orderGoodsIndex = this.order.list.findIndex((V) => { const orderGoodsIndex = this.order.list.findIndex((V) => {
return V.skuId == item.id && V.productId == this.selGoods.data.id; return V.skuId == item.id && V.productId == this.selGoods.data.id && V.isGift == 'false';
}); });
const orderGoods = const orderGoods =
orderGoodsIndex != -1 ? this.order.list[orderGoodsIndex] : undefined; orderGoodsIndex != -1 ? this.order.list[orderGoodsIndex] : undefined;
if (orderGoods) { if (orderGoods) {
//更新 //更新
const newNum = const newNum =
@@ -3352,7 +3315,6 @@ export default {
} }
} else { } else {
//添加 //添加
console.log(this.table);
res = await addCart({ res = await addCart({
masterId: this.masterId, masterId: this.masterId,
vipUserId: this.vipUser.id, vipUserId: this.vipUser.id,
@@ -3361,7 +3323,7 @@ export default {
tableId: this.table.tableId, tableId: this.table.tableId,
num: this.skuGoods.number, // 0会删除此商品 num: this.skuGoods.number, // 0会删除此商品
isPack: false, // 是否打包 isPack: false, // 是否打包
isWaitCall: this.isAllWaitCall //是否等叫 isWaitCall: this.isAllWaitCall, //是否等叫
}); });
this.orderListPush({ ...res, specSnap: name }); this.orderListPush({ ...res, specSnap: name });
// this.orderListPush({ // this.orderListPush({
@@ -3394,9 +3356,7 @@ export default {
} }
return prve; return prve;
}, []); }, []);
console.log(selArr);
let selArrAllGroup = generateCombinations(selArr, selArr.length - 1); let selArrAllGroup = generateCombinations(selArr, selArr.length - 1);
console.log(selArrAllGroup);
const matchArr = []; const matchArr = [];
for (let key in this.selGoods.skuMap) { for (let key in this.selGoods.skuMap) {
const goods = this.selGoods.skuMap[key]; const goods = this.selGoods.skuMap[key];
@@ -3408,9 +3368,7 @@ export default {
} }
} }
} }
console.log(matchArr);
const skuList = this.selGoods.skuList; const skuList = this.selGoods.skuList;
console.log(skuList);
//全部规格都已下架 //全部规格都已下架
if (!matchArr.length) { if (!matchArr.length) {
for (let k in skuList) { for (let k in skuList) {
@@ -3434,7 +3392,6 @@ export default {
} }
return prve; return prve;
}, {}); }, {});
console.log(includeSkuMap);
for (let i in includeSkuMap) { for (let i in includeSkuMap) {
for (let k in skuList) { for (let k in skuList) {
const index = skuList[k].valueArr.findIndex((val) => val === i); const index = skuList[k].valueArr.findIndex((val) => val === i);
@@ -3451,7 +3408,6 @@ export default {
}, ""); }, "");
specSnap = specSnap.substring(0, specSnap.length - 1); specSnap = specSnap.substring(0, specSnap.length - 1);
for (let sku of this.selGoods.skuList) { for (let sku of this.selGoods.skuList) {
console.log(sku);
} }
this.setTagDisabled(); this.setTagDisabled();
const canChooseGoods = this.selGoods.skuList.every((v) => v.sel); const canChooseGoods = this.selGoods.skuList.every((v) => v.sel);
@@ -3500,11 +3456,10 @@ export default {
this.order.orderId = ""; this.order.orderId = "";
this.perpole = ""; this.perpole = "";
this.useTypes.sel = "dine-in"; this.useTypes.sel = "dine-in";
this.getTable() this.getTable();
}, },
//设置购物车数据 //设置购物车数据
setCart(res) { setCart(res) {
console.log(res);
try { try {
const { seatFee } = res; const { seatFee } = res;
this.order.seatFee = seatFee this.order.seatFee = seatFee
@@ -3516,7 +3471,6 @@ export default {
totalAmount: seatFee.priceAmount || seatFee.totalAmount, totalAmount: seatFee.priceAmount || seatFee.totalAmount,
} }
: this.order.seatFee; : this.order.seatFee;
console.log(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);
// this.order.list = nowCart ? nowCart.info.filter(v=>v.isGift!=='true') : []; // this.order.list = nowCart ? nowCart.info.filter(v=>v.isGift!=='true') : [];
@@ -3524,37 +3478,36 @@ export default {
const oldCart = res.records.filter((v) => v.placeNum != 0); const oldCart = res.records.filter((v) => v.placeNum != 0);
this.order.old.list = oldCart ? oldCart : []; this.order.old.list = oldCart ? oldCart : [];
// this.order.gift.list = returnGiftArr(res.records); // this.order.gift.list = returnGiftArr(res.records);
console.log(this.order.old.list);
} catch (error) { } catch (error) {
//当购物车数据发生错误时会导致页面报错购物车商品不展示 //当购物车数据发生错误时会导致页面报错购物车商品不展示
this.$confirm('购物车数据结构错误,是否清空购物车商品?', '提示', { this.$confirm("购物车数据结构错误,是否清空购物车商品?", "提示", {
confirmButtonText: '确定', confirmButtonText: "确定",
cancelButtonText: '取消', cancelButtonText: "取消",
type: 'warning' type: "warning",
}).then(() => { })
$clearCart({ .then(() => {
masterId: this.masterId, $clearCart({
tableId: this.table.tableId, masterId: this.masterId,
}).then((res) => { tableId: this.table.tableId,
this.order.list = []; }).then((res) => {
this.changeOrderSel(-1); this.order.list = [];
this.changeOrderSel(-1);
this.$message({
type: "success",
message: "清除成功!",
});
});
})
.catch(() => {
this.$message({ this.$message({
type: "success", type: "info",
message: "清除成功!", message: "已取消",
}); });
}); });
}).catch(() => {
this.$message({
type: 'info',
message: '已取消'
});
});
} }
}, },
//获取购物车数据 //获取购物车数据
async getCart() { async getCart() {
console.log(this.table);
const res = await getCart({ const res = await getCart({
...this.order.query, ...this.order.query,
masterId: this.masterId, masterId: this.masterId,
@@ -3568,7 +3521,6 @@ export default {
// } // }
}, },
showSelGoods(item) { showSelGoods(item) {
console.log(item);
this.selGoods.data = item; this.selGoods.data = item;
this.selGoods.skuMap = {}; this.selGoods.skuMap = {};
const specList = item.specList; const specList = item.specList;
@@ -3611,7 +3563,6 @@ export default {
const skuList = this.selGoods.skuList; const skuList = this.selGoods.skuList;
const goodsListMap = this.selGoods.skuMap; const goodsListMap = this.selGoods.skuMap;
const skuGoods = this.findGoods(skuList, goodsListMap); const skuGoods = this.findGoods(skuList, goodsListMap);
console.log(skuGoods);
if (skuGoods) { if (skuGoods) {
this.skuGoods.data = skuGoods; this.skuGoods.data = skuGoods;
this.skuGoods.number = skuGoods.suit || 1; this.skuGoods.number = skuGoods.suit || 1;
@@ -3642,40 +3593,34 @@ export default {
} }
}, },
//根据右侧商品单规格多规格做不同处理 //根据右侧商品单规格多规格做不同处理
async goodsClick(item, number = 0, isConfirm = false, multipleSelection = '') { async goodsClick(item, number = 0, isConfirm = false, multipleSelection = "") {
// if (!this.table) { // if (!this.table) {
// return this.$message.error("暂不支持无桌台下单,请先选择桌台"); // return this.$message.error("暂不支持无桌台下单,请先选择桌台");
// } // }
if (item.type == 'weigh' && !isConfirm) { if (item.type == "weigh" && !isConfirm) {
return this.refWeightGoodsShow(item) return this.refWeightGoodsShow(item);
} }
// 这是套餐 // 这是套餐
if (item.type == 'package' && !isConfirm) { if (item.type == "package" && !isConfirm) {
this.$refs.refdialogpackage.open(item); this.$refs.refdialogpackage.open(item);
return false return false;
} }
if (item.typeEnum === "sku") { if (item.typeEnum === "sku") {
this.selGoods.data = item; this.selGoods.data = item;
this.selGoods.skuMap = {}; this.selGoods.skuMap = {};
const specList = item.specList; const specList = item.specList;
this.setSelGoodsSkuMap(specList); this.setSelGoodsSkuMap(specList);
console.log(this.selGoods.skuMap);
this.setSelGoodsSkuList(JSON.parse(item.skuResult.tagSnap)); this.setSelGoodsSkuList(JSON.parse(item.skuResult.tagSnap));
this.setSkugoodsDefaultInit(); this.setSkugoodsDefaultInit();
this.selGoods.title = item.name; this.selGoods.title = item.name;
this.selGoods.show = true; this.selGoods.show = true;
return; return;
} }
//单规格 //单规格
const orderGoodsIndex = this.order.list.findIndex((V) => { let orderGoodsIndex = this.order.list.findIndex((V) => { //默认选择添加不是赠送 V.isGift == 'false'
return V.skuId == item.specList[0].id && V.productId == item.id; return V.skuId == item.specList[0].id && V.productId == item.id && V.isGift == 'false';
}); });
const orderGoods = const orderGoods = orderGoodsIndex != -1 ? this.order.list[orderGoodsIndex] : undefined;
orderGoodsIndex != -1 ? this.order.list[orderGoodsIndex] : undefined;
// const orderGoods = this.order.list.find((V) => {
// return V.skuId == item.specList[0].id && V.productId == item.id;
// });
let res = ""; let res = "";
if (orderGoods) { if (orderGoods) {
//更新 //更新
@@ -3686,13 +3631,12 @@ export default {
// tableId: this.table.tableId, // tableId: this.table.tableId,
// num: orderGoods.number * 1 + item.specList[0].suit, // 0会删除此商品 // num: orderGoods.number * 1 + item.specList[0].suit, // 0会删除此商品
// }); // });
const suit = number || item.specList[0].suit const suit = number || item.specList[0].suit;
orderGoods.number += suit * 1; orderGoods.number += suit * 1;
this.order.number = orderGoods.number; this.order.number = orderGoods.number;
this.changeOrderSel(orderGoodsIndex); this.changeOrderSel(orderGoodsIndex);
} else { } else {
//增加 //增加
console.log(item);
if (item.specList.length <= 0) { if (item.specList.length <= 0) {
return this.$message.error("该商品缺少skuID,skuList是空数组"); return this.$message.error("该商品缺少skuID,skuList是空数组");
} }
@@ -3705,7 +3649,7 @@ export default {
num: number || item.specList[0].suit, // 0会删除此商品 num: number || item.specList[0].suit, // 0会删除此商品
isPack: false, // 是否打包 isPack: false, // 是否打包
isWaitCall: this.isAllWaitCall, //是否等叫 isWaitCall: this.isAllWaitCall, //是否等叫
groupProductIdList: multipleSelection groupProductIdList: multipleSelection,
}); });
this.orderListPush(res); this.orderListPush(res);
} }
@@ -3777,7 +3721,6 @@ export default {
this.getGoods(); this.getGoods();
this.getCategory(); this.getCategory();
this.getTable(); this.getTable();
console.log(params);
if (key == "isJieZhang") { if (key == "isJieZhang") {
if (params.orderId) { if (params.orderId) {
@@ -3875,7 +3818,6 @@ export default {
}), }),
placeNum: key, placeNum: key,
})); }));
console.log(this.order.old.list);
return res; return res;
}, },
close() { close() {
@@ -3898,7 +3840,6 @@ export default {
this.informationdialogshow = false; this.informationdialogshow = false;
}, },
haocaiConfirm() { haocaiConfirm() {
console.log(haocaiSelectedMap);
this.$emit("confirm", haocaiSelectedMap); this.$emit("confirm", haocaiSelectedMap);
this.informationdialogshow = false; this.informationdialogshow = false;
@@ -5208,7 +5149,9 @@ input[type="number"]::-webkit-outer-spin-button {
.weight { .weight {
height: 15px; height: 15px;
background: linear-gradient(124deg, rgb(115, 201, 105) 6%, rgb(39, 146, 27) 93%); background: linear-gradient(124deg,
rgb(115, 201, 105) 6%,
rgb(39, 146, 27) 93%);
border-radius: 2px; border-radius: 2px;
font-size: 12px; font-size: 12px;
text-align: center; text-align: center;
@@ -5432,4 +5375,4 @@ input[type="number"]::-webkit-outer-spin-button {
max-width: 340px; max-width: 340px;
word-break: break-all; word-break: break-all;
} }
</style> </style>