+
@@ -1409,116 +972,61 @@
-
-
+
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
@@ -1846,17 +1354,17 @@ export default {
},
computed: {
cktableList() {
- // 使用 reduce 方法统计指定值出现的次数
+ // 使用 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{
+ if (this.tableList) {
+ let res = this.tableList.filter((i) => i.status == 'using')
+ return res.length >= 2 ? true : false
+ } else {
return false
}
},
@@ -1947,7 +1455,6 @@ export default {
yinFuJinE() {
const total =
this.currentPayMoney - (this.points.selected ? this.points.toMoney : 0);
- console.log(total);
if (this.isCreateOrder) {
return total.toFixed(2);
} else {
@@ -2036,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() {
if (this.order.selIndex < 0) {
return "打包";
@@ -2218,7 +1735,6 @@ export default {
}
},
"useTypes.sel": function (newval, oldval) {
- console.log(newval);
this.setPostPay();
this.setUseType();
},
@@ -2252,7 +1768,6 @@ export default {
// }
// },
masterId: function (val) {
- console.log(val);
},
isCreateOrder: function (val) {
if (!val) {
@@ -2269,8 +1784,6 @@ export default {
// masterId = res.masterId;
// }
// this.masterId = masterId;
- console.log("this.createOrder.data");
- console.log(this.createOrder.data);
if (this.order.status == "finish") {
return;
}
@@ -2305,20 +1818,17 @@ export default {
} else {
this.prveOrder.selCart = [];
}
- console.log(this.prveOrder.selCart);
},
"prveOrder.sel": function (val) {
this.prveOrder.selCart =
this.prveOrder.list.length !== 0
? this.prveOrder.list[val].carList
: [];
- console.log(this.prveOrder.selCart);
if (val < 0) {
this.prveOrde.show = false;
}
},
"order.allPack": function (val) {
- console.log(val);
if (this.order.list.length <= 0) {
return;
}
@@ -2342,7 +1852,6 @@ export default {
const selItem = item.info[this.order.old.selIndex];
goods = selItem ? selItem : "";
}
- console.log(goods);
if (val === -1) {
this.order.cacheNumber = 1;
} else {
@@ -2363,9 +1872,7 @@ export default {
return;
}
this.createOrderClose();
-
let item = this.order.list[this.order.selIndex];
- console.log(item.specSnap);
const { productId, skuId, isPack, isGift, number } = item;
const oldGoods = this.order.old.list.find((v) => {
return v.productId === productId && v.skuId === skuId;
@@ -2420,8 +1927,6 @@ export default {
},
//称重商品确认
async refWeightGoodsConfirm(item, number) {
- console.log(item);
- console.log(number);
this.goodsClick(item, number, true);
},
//套餐下单
@@ -2452,7 +1957,6 @@ export default {
this.$refs.refPopTuanQuan.open();
},
tuanQuanConfirm(e) {
- console.log(e);
this.tuanQuan = e;
},
//更新单品改价数据
@@ -2468,7 +1972,6 @@ export default {
this.$refs.refPopChangePrice.open(orderGoods);
},
returnProDiscount(row) {
- console.log(row);
//相同商品抵扣券数组
const arr = this.quansSelArr.filter((v) => v.proId == row.proId);
const index = arr.findIndex((v) => v.id == row.id);
@@ -2497,7 +2000,6 @@ export default {
},
delQuan(row) {
const index = this.quansSelArr.findIndex((v) => v.id == row.id);
- console.log(index);
if (index != -1) {
this.quansSelArr.splice(index, 1);
this.quansSelArr.map((v, index) => {
@@ -2534,7 +2036,6 @@ export default {
},
//根据积分输入值变化计算抵扣金额
pointsValueChange(e) {
- console.log(e);
if (e == 0 || !e) {
return (this.points.toMoney = 0);
}
@@ -2548,7 +2049,6 @@ export default {
},
//积分抵扣类型改变
pointsChange(e) {
- console.log(e);
if (e == 1) {
this.points.value = Math.min(
this.vipUser.accountPoints,
@@ -2569,7 +2069,6 @@ export default {
);
},
quansConfirm(e, goodsPayPriceMap) {
- console.log(e);
// this.createOrder.discount = 1;
this.points.selected = "";
e.map((v, index) => {
@@ -2583,7 +2082,6 @@ export default {
$goodsPayPriceMap = goodsPayPriceMap;
},
searchInput(e) {
- console.log(e);
this.tableList = $originTableList.filter((v) =>
$strMatch(v.name, e.trim())
);
@@ -2608,7 +2106,6 @@ export default {
return this.canXiadan;
},
changeOrderExtraSel(index, canChangeNumber, placeNum) {
- // console.log(index,canChangeNumber,placeNum)
this.order.selIndex = -1;
this.order.selGoods = this.order.seatFee;
this.order.selPlaceNum = placeNum;
@@ -2673,7 +2170,6 @@ export default {
// ...this.order.old.list,
// { info: this.order.list, placeNum: nowPlaceNum + 1 },
// ];
- console.log(this.order.old.list);
return res;
},
async payBeforeClear() {
@@ -2762,8 +2258,6 @@ export default {
//munchies 先付 restaurant 后付
this.payAfter = this.shopInfo.registerType == "munchies" ? false : true;
}
- console.log("this.payAfter");
- console.log(this.payAfter);
},
//获取店铺信息
async getShopInfo() {
@@ -2773,14 +2267,13 @@ export default {
this.shopInfo = res;
this.setPostPay();
this.setUseType();
- } catch (error) {}
+ } catch (error) { }
},
//更改就餐方式
changeUseType(type) {
if (this.order.old.list.length > 0) {
return this.$message("下单后不支持更改就餐方式");
}
- console.log(type);
this.useTypes.sel = type;
},
//更改就餐人数
@@ -2801,12 +2294,10 @@ export default {
async onTableChange() {
this.order.list = [];
this.order.old.list = [];
- console.log("onTableChange");
const perpole = this.perpole || "";
const tableRes = await $returnTableDetail({
tableId: this.table.tableId,
});
- console.log(tableRes);
const orderId = tableRes.orderId || this.table.orderId;
if (orderId) {
return this.getOrderData({ orderId: orderId });
@@ -2858,7 +2349,7 @@ export default {
});
});
})
- .catch(() => {});
+ .catch(() => { });
},
//退菜
async refReturnCartConfirm(e) {
@@ -2873,7 +2364,6 @@ export default {
this.order.old.selIndex = -1;
// this.getCart();
this.getOrderData();
- // console.log(this.order.selGoods);
},
// 台桌列表
@@ -2891,7 +2381,6 @@ export default {
);
$originTableList = this.tableList;
} catch (error) {
- console.log(error);
}
},
async getTableDetail(tableId) {
@@ -2902,8 +2391,6 @@ export default {
return res;
},
async changeTable(item) {
- console.log("changeTable");
- console.log(this.table, this.table.tableId);
if (
(this.table && this.table.tableId) ||
(!this.table && !this.tableId && this.order.list.length <= 0)
@@ -2920,7 +2407,6 @@ export default {
if (this.table && this.order.list.length <= 0) {
this.table = item;
this.tableShow = false;
- console.log(this.table);
this.onTableChange();
return;
}
@@ -2943,7 +2429,6 @@ export default {
}
);
} catch (e) {
- console.log(e);
}
}
this.tableShow = false;
@@ -3020,7 +2505,6 @@ export default {
const amount = (
this.createOrder.data.amount - this.productCouponDiscountAmount
).toFixed(2);
- console.log(amount);
this.refToggle("refDiscount", true, {
amount,
discount: this.createOrder.discount * 100,
@@ -3035,7 +2519,6 @@ export default {
//购物车商品输入框数量输入
cartGoodsNumberInput(newval, index) {
const item = this.order.list[index];
- console.log(item);
this.order.cacheNumber = newval;
item.number = newval;
},
@@ -3043,7 +2526,6 @@ export default {
cartGoodsNumberChange(newval, index) {
const item = this.order.list[index];
newval = `${newval}`.split(".")[0] * 1;
- console.log(newval);
this.order.cacheNumber = newval;
this.order.number = newval;
},
@@ -3100,7 +2582,6 @@ export default {
},
//改变是否打印
changeIsPrint(e) {
- console.log(e);
this.isPrint = e;
},
async refOrderNoteConfirm(note) {
@@ -3151,10 +2632,6 @@ export default {
if (this.order.payType == "deposit") {
return this.refToggle("refScanCode", true);
}
- console.log({
- orderId: this.createOrder.data.id,
- payType: this.order.payType,
- });
if (this.order.payType == "cash") {
return this.$confirm(
"是否确认已现金收款:" + this.yinFuJinE + "?",
@@ -3223,14 +2700,12 @@ export default {
// this.reset();
},
chooseTableConfirm(item) {
- console.log(item);
this.table = item;
},
chooseTableOpen() {
this.$refs.refChooseTable.open();
},
chooseUserConfirm(user) {
- console.log(user);
if (user) {
this.vipUser = user;
} else {
@@ -3241,7 +2716,6 @@ export default {
this.$refs.refChooseUser.open();
},
createOrderClose() {
- console.log("createOrderClose");
this.isCreateOrder = false;
},
//生成订单
@@ -3259,8 +2733,6 @@ export default {
return;
}
}
-
- console.log(this.createOrder.status);
if (
this.createOrder.status != "" &&
this.createOrder.status != "success"
@@ -3290,7 +2762,7 @@ export default {
res ? { orderId: res.id } : { orderId: this.createOrder.data.id }
);
res = true;
- } catch (error) {}
+ } catch (error) { }
if (!res) {
this.createOrder.status = "success";
return;
@@ -3332,7 +2804,6 @@ export default {
//更新购物车商品数据
updateOrder(par = {}) {
let item = this.order.list[this.order.selIndex];
- console.log(this.table);
const {
productId,
skuId,
@@ -3413,15 +2884,13 @@ export default {
// });
// },
clicktransfertoPinpin() {
-
- // 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
- );
+ // 订单信息,取餐码,用餐类型,桌台号id,台桌列表
+ this.$refs.refransfertoPinpin.open(
+ this.order,
+ this.masterId,
+ this.table.tableId,
+ this.tableList
+ );
},
//右侧控制按钮点击事件
async orderBtnsClick(key) {
@@ -3433,7 +2902,6 @@ export default {
this.selGoods.title = orderGoods.name;
this.selGoods.isEdit = true;
const item = this.goods.list.find((v) => v.id == orderGoods.productId);
- console.log(item);
return this.showSelGoods({ ...item, ...orderGoods });
}
if (key === "gift") {
@@ -3499,17 +2967,15 @@ export default {
return;
}
if (key === "returnCart") {
- console.log(this.order);
let selGoods = undefined;
if (this.order.selPlaceNum == -10) {
selGoods = { ...this.order.seatFee, num: this.order.seatFee.number };
} else {
selGoods =
this.order.old.list[this.order.selPlaceNum - 1].info[
- this.order.old.selIndex
+ this.order.old.selIndex
];
}
- console.log(selGoods);
this.refToggle("refReturnCart", true, selGoods);
}
},
@@ -3532,11 +2998,8 @@ export default {
isPending: false,
});
this.order.orderId = id;
- console.log(this.order.orderId);
-
this.masterId = masterId;
this.isPrverOrder = true;
- console.log(masterId);
const res = await getCart({
masterId,
tableId,
@@ -3573,7 +3036,6 @@ export default {
type: "warning",
}
).catch((err) => {
- console.log(err);
});
if (!res) {
return;
@@ -3602,7 +3064,6 @@ export default {
this.prveOrder.list = res;
if (this.prveOrder.list.length && this.prveOrder.sel !== -1) {
const item = this.prveOrder.list[this.prveOrder.sel];
- console.log(item);
if (item) {
this.prveOrder.selCart = item.carList;
}
@@ -3655,12 +3116,11 @@ export default {
},
// 点击订单里的加减改变购物车商品数量
async changeOrderNumber(index, isReduce) {
+ console.log(index, isReduce, '点击订单里的加减改变购物车商品数量')
if (index < 0) {
return;
}
this.changeOrderSel(index);
- console.log(index);
- console.log(isReduce);
const item = this.order.list[index];
const mumber = item.number * 1;
const newval = mumber + (isReduce ? -1 : 1);
@@ -3687,7 +3147,6 @@ export default {
return;
}
const item = this.order.list[this.order.selIndex];
- console.log(item);
const mumber = item.number * 1;
const newval = mumber + (isReduce ? -1 : 1);
if (newval <= 0) {
@@ -3696,7 +3155,6 @@ export default {
if (newval >= 100000) {
return;
}
- console.log(newval);
// this.order.list[this.order.selIndex].number = newval;
this.order.number = newval;
@@ -3725,7 +3183,7 @@ export default {
});
});
})
- .catch(() => {});
+ .catch(() => { });
},
skuNumberAdd() {
const number = Number(this.skuGoods.number);
@@ -3789,7 +3247,6 @@ export default {
clearTimeout(this.timer);
this.timer = null;
}, 500);
- console.log(this.timer);
},
async skuGoodsAdd() {
let name = this.selGoods.skuList.reduce((prve, cur) => {
@@ -3798,9 +3255,6 @@ export default {
name = name.substring(0, name.length - 1);
// const item = this.selGoods.data.specList.find((v) => v.specSnap === name);
const item = this.selGoods.skuMap[name];
- console.log(this.selGoods, "调试1");
- console.log(name, "调试2");
- console.log(item, "调试1");
if (!item.isGrounding) {
//该商品已经下架
return this.$notify({
@@ -3809,8 +3263,6 @@ export default {
});
}
let res = "";
-
- console.log(orderGoods);
//更改购物车订单商品规格数量
if (this.selGoods.isEdit) {
res = await $updateCart({
@@ -3832,13 +3284,11 @@ export default {
this.order.cacheNumber = this.skuGoods.number;
return;
}
-
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 =
orderGoodsIndex != -1 ? this.order.list[orderGoodsIndex] : undefined;
-
if (orderGoods) {
//更新
const newNum =
@@ -3865,7 +3315,6 @@ export default {
}
} else {
//添加
- console.log(this.table);
res = await addCart({
masterId: this.masterId,
vipUserId: this.vipUser.id,
@@ -3907,9 +3356,7 @@ export default {
}
return prve;
}, []);
- console.log(selArr);
let selArrAllGroup = generateCombinations(selArr, selArr.length - 1);
- console.log(selArrAllGroup);
const matchArr = [];
for (let key in this.selGoods.skuMap) {
const goods = this.selGoods.skuMap[key];
@@ -3921,9 +3368,7 @@ export default {
}
}
}
- console.log(matchArr);
const skuList = this.selGoods.skuList;
- console.log(skuList);
//全部规格都已下架
if (!matchArr.length) {
for (let k in skuList) {
@@ -3947,7 +3392,6 @@ export default {
}
return prve;
}, {});
- console.log(includeSkuMap);
for (let i in includeSkuMap) {
for (let k in skuList) {
const index = skuList[k].valueArr.findIndex((val) => val === i);
@@ -3964,7 +3408,6 @@ export default {
}, "");
specSnap = specSnap.substring(0, specSnap.length - 1);
for (let sku of this.selGoods.skuList) {
- console.log(sku);
}
this.setTagDisabled();
const canChooseGoods = this.selGoods.skuList.every((v) => v.sel);
@@ -4017,19 +3460,17 @@ export default {
},
//设置购物车数据
setCart(res) {
- console.log(res);
try {
const { seatFee } = res;
this.order.seatFee = seatFee
? {
- ...seatFee,
- totalNumber: seatFee.num || seatFee.number,
- num: seatFee.number,
- name: seatFee.name || seatFee.productName,
- totalAmount: seatFee.priceAmount || seatFee.totalAmount,
- }
+ ...seatFee,
+ totalNumber: seatFee.num || seatFee.number,
+ num: seatFee.number,
+ name: seatFee.name || seatFee.productName,
+ totalAmount: seatFee.priceAmount || seatFee.totalAmount,
+ }
: this.order.seatFee;
- console.log(this.order.seatFee);
this.perpole = res.seatFee ? res.seatFee.totalNumber : 1;
const nowCart = res.records.find((v) => v.placeNum == 0);
// this.order.list = nowCart ? nowCart.info.filter(v=>v.isGift!=='true') : [];
@@ -4037,7 +3478,6 @@ export default {
const oldCart = res.records.filter((v) => v.placeNum != 0);
this.order.old.list = oldCart ? oldCart : [];
// this.order.gift.list = returnGiftArr(res.records);
- console.log(this.order.old.list);
} catch (error) {
//当购物车数据发生错误时会导致页面报错购物车商品不展示
this.$confirm("购物车数据结构错误,是否清空购物车商品?", "提示", {
@@ -4068,7 +3508,6 @@ export default {
},
//获取购物车数据
async getCart() {
- console.log(this.table);
const res = await getCart({
...this.order.query,
masterId: this.masterId,
@@ -4082,7 +3521,6 @@ export default {
// }
},
showSelGoods(item) {
- console.log(item);
this.selGoods.data = item;
this.selGoods.skuMap = {};
const specList = item.specList;
@@ -4125,7 +3563,6 @@ export default {
const skuList = this.selGoods.skuList;
const goodsListMap = this.selGoods.skuMap;
const skuGoods = this.findGoods(skuList, goodsListMap);
- console.log(skuGoods);
if (skuGoods) {
this.skuGoods.data = skuGoods;
this.skuGoods.number = skuGoods.suit || 1;
@@ -4156,12 +3593,7 @@ export default {
}
},
//根据右侧商品单规格多规格做不同处理
- async goodsClick(
- item,
- number = 0,
- isConfirm = false,
- multipleSelection = ""
- ) {
+ async goodsClick(item, number = 0, isConfirm = false, multipleSelection = "") {
// if (!this.table) {
// return this.$message.error("暂不支持无桌台下单,请先选择桌台");
// }
@@ -4178,22 +3610,17 @@ export default {
this.selGoods.skuMap = {};
const specList = item.specList;
this.setSelGoodsSkuMap(specList);
- console.log(this.selGoods.skuMap);
this.setSelGoodsSkuList(JSON.parse(item.skuResult.tagSnap));
this.setSkugoodsDefaultInit();
this.selGoods.title = item.name;
this.selGoods.show = true;
return;
}
- //单规格
- const orderGoodsIndex = this.order.list.findIndex((V) => {
- return V.skuId == item.specList[0].id && V.productId == item.id;
+ //单规格
+ let orderGoodsIndex = this.order.list.findIndex((V) => { //默认选择添加不是赠送 V.isGift == 'false'
+ return V.skuId == item.specList[0].id && V.productId == item.id && V.isGift == 'false';
});
- const orderGoods =
- 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;
- // });
+ const orderGoods = orderGoodsIndex != -1 ? this.order.list[orderGoodsIndex] : undefined;
let res = "";
if (orderGoods) {
//更新
@@ -4210,7 +3637,6 @@ export default {
this.changeOrderSel(orderGoodsIndex);
} else {
//增加
- console.log(item);
if (item.specList.length <= 0) {
return this.$message.error("该商品缺少skuID,skuList是空数组");
}
@@ -4258,13 +3684,13 @@ export default {
},
async open(params) {
const item = {
- name: params.table_name,
- tableId: params.tableId,
- useType: params.useType,
- maxCapacity: params.maxCapacity * 1,
- masterId: params.masterId,
- orderId: params.orderId,
- },
+ name: params.table_name,
+ tableId: params.tableId,
+ useType: params.useType,
+ maxCapacity: params.maxCapacity * 1,
+ masterId: params.masterId,
+ orderId: params.orderId,
+ },
key = params.key,
perpoleNumber = params.num || "";
this.key = key;
@@ -4295,7 +3721,6 @@ export default {
this.getGoods();
this.getCategory();
this.getTable();
- console.log(params);
if (key == "isJieZhang") {
if (params.orderId) {
@@ -4393,7 +3818,6 @@ export default {
}),
placeNum: key,
}));
- console.log(this.order.old.list);
return res;
},
close() {
@@ -4416,7 +3840,6 @@ export default {
this.informationdialogshow = false;
},
haocaiConfirm() {
- console.log(haocaiSelectedMap);
this.$emit("confirm", haocaiSelectedMap);
this.informationdialogshow = false;
@@ -5034,9 +4457,7 @@ input[type="number"]::-webkit-outer-spin-button {
display: none !important;
}
-::v-deep
- .el-radio:focus:not(.is-focus):not(:active):not(.is-disabled)
- .el-radio__inner {
+::v-deep .el-radio:focus:not(.is-focus):not(:active):not(.is-disabled) .el-radio__inner {
box-shadow: none !important;
}
@@ -5229,8 +4650,7 @@ input[type="number"]::-webkit-outer-spin-button {
margin-bottom: 10px;
}
- .order-list-all {
- }
+ .order-list-all {}
.order {
border-radius: 6px;
@@ -5729,11 +5149,9 @@ input[type="number"]::-webkit-outer-spin-button {
.weight {
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;
font-size: 12px;
text-align: center;
@@ -5937,7 +5355,7 @@ input[type="number"]::-webkit-outer-spin-button {
border: none;
}
-.pay_btns .el-button + .el-button {
+.pay_btns .el-button+.el-button {
margin-left: 0;
}