代客下单增加退单,选择就餐人数,更改桌台, 修改样式
台桌列表增加改为批量增加
This commit is contained in:
@@ -13,7 +13,7 @@
|
||||
{{ title }}
|
||||
</div>
|
||||
<el-dropdown @command="changePostPay">
|
||||
<el-button plain type="success" size="mini">
|
||||
<el-button plain type="primary" size="mini">
|
||||
{{ postPay ? "后付费" : "先付费" }}
|
||||
<i class="el-icon-caret-bottom"></i>
|
||||
</el-button>
|
||||
@@ -96,7 +96,7 @@
|
||||
<div class="head-container search-box flex row-between" v-if="false">
|
||||
<div>
|
||||
<el-dropdown @command="changePostPay">
|
||||
<el-button plain type="success" size="mini">
|
||||
<el-button plain type="primary" size="mini">
|
||||
{{ postPay ? "后付费" : "先付费" }}
|
||||
<i class="el-icon-caret-bottom"></i>
|
||||
</el-button>
|
||||
@@ -144,11 +144,11 @@
|
||||
</div>
|
||||
<div class="diancan" v-loading="loading">
|
||||
<div class="order">
|
||||
<div class="relative">
|
||||
<div style="padding-right: 14px">
|
||||
<div class="relative u-flex u-flex-col u-row-between">
|
||||
<div class="w-full" style="padding-right: 14px">
|
||||
<div class="choose-user flex">
|
||||
<el-button
|
||||
type="success"
|
||||
type="primary"
|
||||
v-if="vipUser.id === ''"
|
||||
@click="refChooseUserOpen"
|
||||
>选择用户</el-button
|
||||
@@ -173,16 +173,41 @@
|
||||
</div>
|
||||
</template>
|
||||
</div>
|
||||
<div class="flex row-between">
|
||||
<div class="flex row-between table-list">
|
||||
<!-- <div class="tableId" @click="chooseTableOpen"> -->
|
||||
<div class="tableId" @click="chooseTableOpen">
|
||||
{{ table ? "桌台号:" + table.name : "桌台号/取餐号" }}
|
||||
</div>
|
||||
<el-popover
|
||||
placement="right"
|
||||
width="333"
|
||||
trigger="click"
|
||||
v-model="tableShow"
|
||||
>
|
||||
<div style="max-height: 398px; overflow-y: scroll">
|
||||
<div
|
||||
class="u-flex u-row-between u-p-t-8 table-item u-p-b-8 u-p-r-30"
|
||||
v-for="(item, index) in tableList"
|
||||
:key="index"
|
||||
@click="changeTable(item, index)"
|
||||
>
|
||||
<span> {{ item.name }}</span>
|
||||
<span :style="{ color: status[item.status].type }">
|
||||
{{
|
||||
status[item.status] ? status[item.status].label : ""
|
||||
}}</span
|
||||
>
|
||||
</div>
|
||||
</div>
|
||||
<div class="tableId" slot="reference">
|
||||
{{ table ? "桌台号:" + table.name : "桌台号/取餐号" }}
|
||||
</div>
|
||||
</el-popover>
|
||||
|
||||
<div class="u-flex">
|
||||
<div class="u-p-r-14 border-r u-m-r-14">
|
||||
<div class="u-flex cursor-pointer" @click="refToggle('refChooseDinersNumber',true)">
|
||||
<span>就餐人数:{{perpole}}位</span>
|
||||
<div
|
||||
class="u-flex cursor-pointer"
|
||||
@click="refToggle('refChooseDinersNumber', true, perpole)"
|
||||
>
|
||||
<span>就餐人数:{{ perpole }}位</span>
|
||||
<span
|
||||
class="el-icon-arrow-right diningPeople_cell_arrow"
|
||||
></span>
|
||||
@@ -198,7 +223,67 @@
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="absolute bottom">
|
||||
|
||||
<div class="order-list-all" style="flex: 1; overflow-y: scroll">
|
||||
<div class="list">
|
||||
<!-- 当前购物车列表 -->
|
||||
<template v-if="order.list.length">
|
||||
<cart-item
|
||||
@itemClick="changeOrderSel"
|
||||
@changeOrderNumber="changeOrderNumber"
|
||||
@cartGoodsNumberInput="cartGoodsNumberInput"
|
||||
@cartGoodsNumberChange="cartGoodsNumberChange"
|
||||
v-for="(item, index) in order.list"
|
||||
:key="index"
|
||||
:index="index"
|
||||
:item="item"
|
||||
:selPlaceNum="order.selPlaceNum"
|
||||
:selIndex="order.selIndex"
|
||||
></cart-item>
|
||||
</template>
|
||||
<div v-if="order.gift.list.length">
|
||||
<div class="carts_list_title">以下是优惠菜品</div>
|
||||
</div>
|
||||
|
||||
<div v-if="!order.list.length">
|
||||
<el-empty
|
||||
:image-size="50"
|
||||
description="点餐列表为空"
|
||||
></el-empty>
|
||||
</div>
|
||||
</div>
|
||||
<!-- 已下单菜品列表 -->
|
||||
<template v-if="order.old.list.length">
|
||||
<!-- <div class="carts_list_title">已下单菜品</div> -->
|
||||
<div
|
||||
class="list"
|
||||
v-for="(orderItem, orderIndex) in order.old.list"
|
||||
:key="orderIndex"
|
||||
>
|
||||
<div class="carts_list_title">
|
||||
第{{ orderItem.placeNum }}次下单
|
||||
</div>
|
||||
<cart-item
|
||||
@itemClick="changeOrderOldSel"
|
||||
:canChangeNumber="false"
|
||||
v-for="(item, index) in orderItem.info"
|
||||
:key="index"
|
||||
:index="index"
|
||||
:item="item"
|
||||
isOld
|
||||
:selIndex="order.old.selIndex"
|
||||
:placeNum="orderItem.placeNum"
|
||||
:selPlaceNum="order.selPlaceNum"
|
||||
></cart-item>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<div class="order_remark" v-if="note.content">
|
||||
订单备注: {{ note.content }}
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="w-full bottom">
|
||||
<div class="flex row-right youhui" v-if="giftLen">
|
||||
<span> 已优惠¥{{ allGiftMoney | to2 }} </span>
|
||||
<i class="el-icon-arrow-right"></i>
|
||||
@@ -232,26 +317,10 @@
|
||||
</button>
|
||||
</template>
|
||||
<template v-else>
|
||||
<!-- <el-dropdown
|
||||
split-button
|
||||
size="medium"
|
||||
type="success"
|
||||
@command="changeIsPrint"
|
||||
>
|
||||
{{ isPrint ? "下单并打印制作单" : "仅下单(不打印)" }}
|
||||
<el-dropdown-menu slot="dropdown">
|
||||
<el-dropdown-item :command="false"
|
||||
>仅下单(不打印)</el-dropdown-item
|
||||
>
|
||||
<el-dropdown-item :command="true"
|
||||
>下单并打印制作单</el-dropdown-item
|
||||
>
|
||||
</el-dropdown-menu>
|
||||
</el-dropdown> -->
|
||||
<template v-if="postPay">
|
||||
<div class="flex-1">
|
||||
<el-button
|
||||
type="success"
|
||||
type="primary"
|
||||
size="medium"
|
||||
:disabled="!order.list.length"
|
||||
@click="toCreateOrderDebounce(false)"
|
||||
@@ -273,51 +342,6 @@
|
||||
</template>
|
||||
</div>
|
||||
</div>
|
||||
<div class="list">
|
||||
<!-- 当前购物车列表 -->
|
||||
<template v-if="order.list.length">
|
||||
<cart-item
|
||||
@itemClick="changeOrderSel"
|
||||
@changeOrderNumber="changeOrderNumber"
|
||||
@cartGoodsNumberInput="cartGoodsNumberInput"
|
||||
@cartGoodsNumberChange="cartGoodsNumberChange"
|
||||
v-for="(item, index) in order.list"
|
||||
:key="index"
|
||||
:index="index"
|
||||
:item="item"
|
||||
:selIndex="order.selIndex"
|
||||
></cart-item>
|
||||
</template>
|
||||
<div v-if="order.gift.list.length">
|
||||
<div class="carts_list_title">以下是优惠菜品</div>
|
||||
</div>
|
||||
|
||||
<div v-if="!order.list.length">
|
||||
<el-empty
|
||||
:image-size="50"
|
||||
description="点餐列表为空"
|
||||
></el-empty>
|
||||
</div>
|
||||
</div>
|
||||
<!-- 已下单菜品列表 -->
|
||||
<template v-if="order.old.list.length">
|
||||
<div class="carts_list_title">已下单菜品</div>
|
||||
<div class="list">
|
||||
<cart-item
|
||||
@itemClick="changeOrderOldSel"
|
||||
:canChangeNumber="false"
|
||||
v-for="(item, index) in order.old.list"
|
||||
:key="index"
|
||||
:index="index"
|
||||
:item="item"
|
||||
:selIndex="order.old.selIndex"
|
||||
></cart-item>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<div class="order_remark" v-if="note.content">
|
||||
订单备注: {{ note.content }}
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="controls">
|
||||
@@ -413,6 +437,13 @@
|
||||
</div> -->
|
||||
|
||||
<div class="btn" @click="refNoteShow">整单备注</div>
|
||||
<div
|
||||
class="btn"
|
||||
:class="{ disabled: order.old.list.length <= 0 }"
|
||||
@click="orderBtnsClick('returnCart')"
|
||||
>
|
||||
撤单
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="goods">
|
||||
@@ -441,12 +472,12 @@
|
||||
>
|
||||
<el-tag
|
||||
size="medium"
|
||||
type="success"
|
||||
type="primary"
|
||||
effect="dark"
|
||||
v-if="goods.query.categoryId === item.id"
|
||||
>{{ item.name }}</el-tag
|
||||
>
|
||||
<el-tag size="medium" type="success" v-else effect="plain">{{
|
||||
<el-tag size="medium" type="info" v-else effect="plain">{{
|
||||
item.name
|
||||
}}</el-tag>
|
||||
</div>
|
||||
@@ -630,12 +661,12 @@
|
||||
>
|
||||
</pay-type>
|
||||
<div style="margin-top: 20px">
|
||||
<el-button type="success" size="medium" @click="payOrder">
|
||||
<el-button type="primary" size="medium" @click="payOrder">
|
||||
<span>立即支付</span>
|
||||
</el-button>
|
||||
</div>
|
||||
<!-- <div class="flex row-right">
|
||||
<el-button size="medium" type="success" @click="payOrder"
|
||||
<el-button size="medium" type="primary" @click="payOrder"
|
||||
>确认支付</el-button
|
||||
>
|
||||
</div> -->
|
||||
@@ -643,7 +674,7 @@
|
||||
<div class="btn_group">
|
||||
<div class="price_select">
|
||||
<div class="pay_btns">
|
||||
<el-button size="medium" type="success">
|
||||
<el-button size="medium" type="primary">
|
||||
微信支付/支付宝
|
||||
</el-button>
|
||||
<el-button size="medium"> 余额支付 </el-button>
|
||||
@@ -755,7 +786,7 @@
|
||||
plain
|
||||
:disabled="val.disabled"
|
||||
@click="changeTagSel(index, val)"
|
||||
:type="val.name === item.sel ? 'success' : ''"
|
||||
:type="val.name === item.sel ? 'primary' : ''"
|
||||
>
|
||||
{{ val.name }}
|
||||
</el-button>
|
||||
@@ -804,7 +835,7 @@
|
||||
库存不足
|
||||
</button>
|
||||
<button
|
||||
class="my-btn success flex-1"
|
||||
class="my-btn primary flex-1"
|
||||
v-else
|
||||
:disabled="CanConfirm"
|
||||
@click="chooseSkuConfirm"
|
||||
@@ -932,7 +963,7 @@
|
||||
<div style="margin-right: 20px">
|
||||
<el-button
|
||||
size="medium"
|
||||
type="success"
|
||||
type="primary"
|
||||
@click="confirmChoosePrveOrder"
|
||||
>确认此单</el-button
|
||||
>
|
||||
@@ -976,7 +1007,15 @@
|
||||
<money-discount ref="refDiscount" @confirm="ChangeDiscount">
|
||||
</money-discount>
|
||||
<!-- 选择人数 -->
|
||||
<choose-diners-number ref="refChooseDinersNumber" @confirm="chooseDinersNumberConfirm"></choose-diners-number>
|
||||
<choose-diners-number
|
||||
ref="refChooseDinersNumber"
|
||||
@confirm="chooseDinersNumberConfirm"
|
||||
></choose-diners-number>
|
||||
|
||||
<return-cart
|
||||
ref="refReturnCart"
|
||||
@confirm="refReturnCartConfirm"
|
||||
></return-cart>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
@@ -990,6 +1029,7 @@ import scanPay from "./table-diancan-components/scan-pay.vue";
|
||||
import moneyDiscount from "./table-diancan-components/discount.vue";
|
||||
import orderNote from "./table-diancan-components/note.vue";
|
||||
import chooseDinersNumber from "./table-diancan-components/choose-diners-number.vue";
|
||||
import returnCart from "./table-diancan-components/return-cart.vue";
|
||||
import moneyKeyboard from "./money-keyboard.vue";
|
||||
import dayjs from "dayjs";
|
||||
import {
|
||||
@@ -1007,6 +1047,9 @@ import {
|
||||
$delOrder,
|
||||
$setUser,
|
||||
$payOrder,
|
||||
$choseTable,
|
||||
$choseCount,
|
||||
$returnCart
|
||||
} from "@/api/table";
|
||||
import { tbShopCategoryGet } from "@/api/shop";
|
||||
import {
|
||||
@@ -1015,8 +1058,11 @@ import {
|
||||
generateCombinations,
|
||||
returnReverseVal,
|
||||
} from "./util.js";
|
||||
import $status from "../status.js";
|
||||
import { tbShopTableGet } from "@/api/table";
|
||||
export default {
|
||||
components: {
|
||||
returnCart,
|
||||
chooseUser,
|
||||
chooseTable,
|
||||
payType,
|
||||
@@ -1029,8 +1075,12 @@ export default {
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
//台桌列表
|
||||
tableList: [],
|
||||
tableShow: false,
|
||||
status: $status,
|
||||
//就餐人数
|
||||
perpole:'',
|
||||
perpole: "",
|
||||
//整体点餐页面loading
|
||||
loading: false,
|
||||
//台桌点餐页面打开时带来的参数 isAddGoods 加菜 isPayOrder结账
|
||||
@@ -1093,6 +1143,10 @@ export default {
|
||||
payType: "",
|
||||
masterId: "",
|
||||
allPack: false,
|
||||
//当前选中的购物车商品(包含历史订单)
|
||||
selGoods:'',
|
||||
selPlaceNum: -1, //第几次下单 0当前 1以及以上历史订单
|
||||
|
||||
btns: [
|
||||
{
|
||||
text: "规格",
|
||||
@@ -1224,7 +1278,10 @@ export default {
|
||||
const oldPrice = this.order.old.list
|
||||
.filter((v) => v.isGift !== "true")
|
||||
.reduce((a, b) => {
|
||||
return a + b.number * b.salePrice;
|
||||
const bTotal = b.info.reduce((prve, cur) => {
|
||||
return prve + cur.number * cur.salePrice;
|
||||
}, 0);
|
||||
return a + bTotal;
|
||||
}, 0);
|
||||
const price = this.order.list
|
||||
.filter((v) => v.isGift !== "true")
|
||||
@@ -1235,11 +1292,17 @@ export default {
|
||||
},
|
||||
allNumber() {
|
||||
const oldNumber = this.order.old.list.reduce((a, b) => {
|
||||
return a + b.number * 1;
|
||||
const bTotal = b.info.reduce((prve, cur) => {
|
||||
return prve + cur.number * 1;
|
||||
}, 0);
|
||||
return a + bTotal;
|
||||
}, 0);
|
||||
const cartNumber = this.order.list.reduce((a, b) => {
|
||||
return a + b.number * 1;
|
||||
}, 0);
|
||||
console.log(oldNumber);
|
||||
console.log(cartNumber);
|
||||
|
||||
return oldNumber + cartNumber;
|
||||
},
|
||||
selGoodsHide() {
|
||||
@@ -1273,6 +1336,25 @@ export default {
|
||||
},
|
||||
},
|
||||
watch: {
|
||||
perpole(newval) {
|
||||
if (newval) {
|
||||
$choseCount({
|
||||
masterId: this.masterId,
|
||||
tableId: this.table.tableId,
|
||||
num: newval,
|
||||
});
|
||||
}
|
||||
},
|
||||
table(oldval, newval) {
|
||||
if (oldval && newval) {
|
||||
console.log(oldval, newval);
|
||||
$choseTable({
|
||||
orderId: 4462,
|
||||
oldTableId: oldval.tableId,
|
||||
newTableId: newval.tableId,
|
||||
});
|
||||
}
|
||||
},
|
||||
masterId: function (val) {
|
||||
console.log(val);
|
||||
},
|
||||
@@ -1314,30 +1396,6 @@ export default {
|
||||
this.prveOrde.show = false;
|
||||
}
|
||||
},
|
||||
// 本地缓存版本
|
||||
// "prveOrder.list.length": function (val) {
|
||||
// console.log(val);
|
||||
// if (val !== 0) {
|
||||
// this.prveOrder.selCart = this.prveOrder.list[this.prveOrder.sel].cart;
|
||||
// localStorage.setItem(
|
||||
// "orderList",
|
||||
// JSON.stringify(
|
||||
// this.prveOrder.list.map((v) => {
|
||||
// return { ...v, cart: JSON.stringify(v.cart) };
|
||||
// })
|
||||
// )
|
||||
// );
|
||||
// } else {
|
||||
// this.prveOrder.selCart = [];
|
||||
// localStorage.removeItem("orderList");
|
||||
// }
|
||||
// console.log(this.prveOrder.selCart);
|
||||
// },
|
||||
// "prveOrder.sel": function (val) {
|
||||
// this.prveOrder.selCart =
|
||||
// this.prveOrder.list.length !== 0 ? this.prveOrder.list[val].cart : [];
|
||||
// console.log(this.prveOrder.selCart);
|
||||
// },
|
||||
"order.allPack": function (val) {
|
||||
console.log(val);
|
||||
if (this.order.list.length <= 0) {
|
||||
@@ -1354,19 +1412,25 @@ export default {
|
||||
});
|
||||
},
|
||||
"order.selIndex": function (val, oldval) {
|
||||
console.log(val);
|
||||
this.order.old.selIndex = -1;
|
||||
let goods = this.order.list[val];
|
||||
const isOld = this.selPlaceNum > 0;
|
||||
if (isOld) {
|
||||
const item = this.order.list.find(
|
||||
(v) => v.placeNum == this.selPlaceNum
|
||||
);
|
||||
const selItem = item.info[this.order.old.selIndex];
|
||||
goods = selItem ? selItem : "";
|
||||
}
|
||||
console.log(goods);
|
||||
if (val === -1) {
|
||||
// return (this.order.number = 1);
|
||||
this.order.cacheNumber = 1;
|
||||
} else {
|
||||
this.order.cacheNumber = this.order.list[val].number;
|
||||
// this.order.number = this.order.list[val].number;
|
||||
this.order.cacheNumber = goods.number;
|
||||
}
|
||||
},
|
||||
"order.list.length": function (val) {
|
||||
if (val <= 0) {
|
||||
this.order.selIndex = -1;
|
||||
this.changeOrderSel(-1);
|
||||
}
|
||||
if (this.order.selIndex >= 0) {
|
||||
this.order.cacheNumber = this.order.list[this.order.selIndex].number;
|
||||
@@ -1425,8 +1489,31 @@ export default {
|
||||
// this.refToggle("refDiscount", true);
|
||||
},
|
||||
methods: {
|
||||
chooseDinersNumberConfirm(e){
|
||||
this.perpole=e
|
||||
//退单
|
||||
refReturnCartConfirm() {
|
||||
|
||||
$returnCart({
|
||||
cartId: this.order.selGoods.id,
|
||||
tableId: this.table.tableId
|
||||
});
|
||||
},
|
||||
// 台桌列表
|
||||
async getTable() {
|
||||
try {
|
||||
const { content, total } = await tbShopTableGet({
|
||||
shopId: localStorage.getItem("shopId"),
|
||||
});
|
||||
this.tableList = content;
|
||||
} catch (error) {
|
||||
console.log(error);
|
||||
}
|
||||
},
|
||||
changeTable(item) {
|
||||
this.table = item;
|
||||
this.tableShow = false;
|
||||
},
|
||||
chooseDinersNumberConfirm(e) {
|
||||
this.perpole = e;
|
||||
},
|
||||
//扫码支付弹窗确认
|
||||
scanPayConfirm(code) {
|
||||
@@ -1772,6 +1859,8 @@ export default {
|
||||
);
|
||||
this.order.list = [];
|
||||
this.order.selIndex = -1;
|
||||
|
||||
this.changeOrderSel(-1);
|
||||
return;
|
||||
}
|
||||
if (key === "getOrder") {
|
||||
@@ -1779,6 +1868,9 @@ export default {
|
||||
this.getPrveCart();
|
||||
return;
|
||||
}
|
||||
if (key === "returnCart") {
|
||||
this.refToggle("refReturnCart", true);
|
||||
}
|
||||
},
|
||||
//选择挂单确认
|
||||
async confirmChoosePrveOrder() {
|
||||
@@ -1895,7 +1987,7 @@ export default {
|
||||
this.isPrverOrder = false;
|
||||
this.order.masterId = "";
|
||||
this.order.list = [];
|
||||
this.order.selIndex = -1;
|
||||
this.changeOrderSel(-1);
|
||||
this.note.content = "";
|
||||
this.order.orderId = "";
|
||||
this.$nextTick(() => {
|
||||
@@ -1913,7 +2005,7 @@ export default {
|
||||
});
|
||||
this.order.list.splice(this.order.selIndex, 1);
|
||||
const newval = this.order.selIndex - 1;
|
||||
this.order.selIndex = newval <= 0 ? 0 : newval;
|
||||
this.changeOrderSel(newval <= 0 ? 0 : newval);
|
||||
|
||||
// this.$message({
|
||||
// type: "success",
|
||||
@@ -1925,7 +2017,7 @@ export default {
|
||||
if (index < 0) {
|
||||
return;
|
||||
}
|
||||
this.order.selIndex = index;
|
||||
this.changeOrderSel(index);
|
||||
console.log(index);
|
||||
console.log(isReduce);
|
||||
const item = this.order.list[index];
|
||||
@@ -1985,7 +2077,7 @@ export default {
|
||||
tableId: this.table.tableId,
|
||||
}).then((res) => {
|
||||
this.order.list = [];
|
||||
this.order.selIndex = -1;
|
||||
this.changeOrderSel(-1);
|
||||
this.$message({
|
||||
type: "success",
|
||||
message: "清除成功!",
|
||||
@@ -2031,13 +2123,21 @@ export default {
|
||||
},
|
||||
//改变购物车菜品选中
|
||||
changeOrderSel(index) {
|
||||
this.order.selPlaceNum = 0;
|
||||
this.order.selIndex = index;
|
||||
this.order.selGoods=this.order.list[index];
|
||||
this.order.old.selIndex = -1;
|
||||
},
|
||||
//改变已下单菜品选中
|
||||
changeOrderOldSel(index) {
|
||||
changeOrderOldSel(index, canChangeNumber, placeNum) {
|
||||
//是否是历史订单商品
|
||||
const isOld = placeNum >= 1;
|
||||
this.order.selIndex = -1;
|
||||
this.order.old.selIndex = index;
|
||||
this.order.cacheNumber = this.order.old.list[index].number;
|
||||
this.order.selPlaceNum = placeNum;
|
||||
const list = this.order.old.list.find((v) => v.placeNum == placeNum);
|
||||
this.order.selGoods=list.info[index];
|
||||
this.order.cacheNumber = list.info[index].number || 1;
|
||||
},
|
||||
chooseSkuConfirm() {
|
||||
if (this.timer) {
|
||||
@@ -2094,17 +2194,13 @@ export default {
|
||||
});
|
||||
const orderGoods =
|
||||
orderGoodsIndex != -1 ? this.order.list[orderGoodsIndex] : undefined;
|
||||
const oldOrderGoods = this.order.old.list.find((V) => {
|
||||
return V.skuId == item.id && V.productId == this.selGoods.data.id;
|
||||
});
|
||||
if (orderGoods || oldOrderGoods) {
|
||||
|
||||
if (orderGoods) {
|
||||
//更新
|
||||
const newNum =
|
||||
(oldOrderGoods ? oldOrderGoods.number : 0) +
|
||||
(orderGoods ? orderGoods.number * 1 : 0) +
|
||||
this.skuGoods.number;
|
||||
(orderGoods ? orderGoods.number * 1 : 0) + this.skuGoods.number;
|
||||
res = await $updateCart({
|
||||
cartId: orderGoods ? orderGoods.id : oldOrderGoods.id,
|
||||
cartId: orderGoods.id,
|
||||
productId: this.selGoods.data.id,
|
||||
skuId: item.id,
|
||||
tableId: this.table.tableId,
|
||||
@@ -2119,7 +2215,8 @@ export default {
|
||||
});
|
||||
} else {
|
||||
orderGoods.number += this.skuGoods.number;
|
||||
this.order.selIndex = orderGoodsIndex;
|
||||
this.order.selPlaceNum = 0;
|
||||
this.changeOrderSel(orderGoodsIndex);
|
||||
this.order.cacheNumber = orderGoods.number;
|
||||
}
|
||||
} else {
|
||||
@@ -2152,7 +2249,8 @@ export default {
|
||||
// const isPack=item.isPack==='false'?false:true
|
||||
// const isGift=item.isGift==='false'?false:true
|
||||
this.order.list.push({ ...item, isPack, isGift });
|
||||
this.order.selIndex = this.order.list.length - 1;
|
||||
this.order.selPlaceNum = 0;
|
||||
this.changeOrderSel(this.order.list.length - 1);
|
||||
},
|
||||
//设置规格按钮的禁止状态
|
||||
setTagDisabled() {
|
||||
@@ -2237,13 +2335,16 @@ export default {
|
||||
reset() {
|
||||
// this.goods.list = [];
|
||||
this.loading = false;
|
||||
this.table = "";
|
||||
this.order.masterId = "";
|
||||
this.order.list = [];
|
||||
this.order.query.page = 1;
|
||||
this.goods.total = 0;
|
||||
this.order.list = [];
|
||||
this.order.selIndex = -1;
|
||||
this.order.selPlaceNum = -1;
|
||||
this.order.old.list = [];
|
||||
this.order.selGoods='';
|
||||
this.prveOrder.list = [];
|
||||
this.prveOrder.selIndex = -1;
|
||||
this.order.old.selIndex = -1;
|
||||
@@ -2259,6 +2360,7 @@ export default {
|
||||
this.order.cacheNumber = 1;
|
||||
this.key = "";
|
||||
this.order.orderId = "";
|
||||
this.perpole = "";
|
||||
},
|
||||
//获取购物车数据
|
||||
async getCart() {
|
||||
@@ -2267,12 +2369,11 @@ export default {
|
||||
masterId: this.masterId,
|
||||
tableId: this.table.tableId,
|
||||
});
|
||||
this.order.list = res.records;
|
||||
if (this.key) {
|
||||
// this.order.old.list = res.records;
|
||||
if (this.key|| res.records.length) {
|
||||
this.order.old.list = res.records;
|
||||
} else {
|
||||
this.order.list = res.records;
|
||||
}
|
||||
this.order.total = res.total;
|
||||
},
|
||||
showSelGoods(item) {
|
||||
console.log(item);
|
||||
@@ -2373,7 +2474,7 @@ export default {
|
||||
// });
|
||||
orderGoods.number += item.specList[0].suit;
|
||||
this.order.number = orderGoods.number;
|
||||
this.order.selIndex = orderGoodsIndex;
|
||||
this.changeOrderSel(orderGoodsIndex);
|
||||
} else {
|
||||
//增加
|
||||
console.log(item);
|
||||
@@ -2481,7 +2582,7 @@ export default {
|
||||
// });
|
||||
orderGoods.number += item.specList[0].suit;
|
||||
this.order.number = orderGoods.number;
|
||||
this.order.selIndex = orderGoodsIndex;
|
||||
this.changeOrderSel(orderGoodsIndex);
|
||||
} else {
|
||||
//增加
|
||||
console.log(item);
|
||||
@@ -2513,7 +2614,7 @@ export default {
|
||||
this.goods.total = res.total;
|
||||
this.$goodsData = goods;
|
||||
},
|
||||
async open(item, key) {
|
||||
async open(item, key, perpoleNumber) {
|
||||
this.table = item;
|
||||
this.key = key;
|
||||
if (this.key == "isPayOrder") {
|
||||
@@ -2523,6 +2624,7 @@ export default {
|
||||
this.informationdialogshow = true;
|
||||
const res = await this.getMasterId();
|
||||
this.masterId = res.masterId;
|
||||
this.perpole = perpoleNumber;
|
||||
if (this.key == "isPayOrder") {
|
||||
this.toCreateOrder(true);
|
||||
}
|
||||
@@ -2531,6 +2633,7 @@ export default {
|
||||
this.getCategory();
|
||||
// this.getPrveCart();
|
||||
this.getCacheOrder();
|
||||
this.getTable();
|
||||
},
|
||||
close() {
|
||||
this.informationdialogshow = false;
|
||||
@@ -2584,7 +2687,7 @@ input[type="number"]::-webkit-outer-spin-button {
|
||||
}
|
||||
|
||||
.icon-add {
|
||||
color: rgb(34, 191, 100);
|
||||
color: #1890ff;
|
||||
font-size: 22px;
|
||||
cursor: pointer;
|
||||
}
|
||||
@@ -2844,7 +2947,11 @@ input[type="number"]::-webkit-outer-spin-button {
|
||||
padding: 0 5px;
|
||||
background-color: #fff;
|
||||
position: relative;
|
||||
|
||||
&.primary {
|
||||
color: #fff;
|
||||
background-color: #1890ff;
|
||||
border-color: #1890ff;
|
||||
}
|
||||
&.disabled {
|
||||
color: #c0c4cc;
|
||||
cursor: not-allowed;
|
||||
@@ -3026,7 +3133,7 @@ input[type="number"]::-webkit-outer-spin-button {
|
||||
font-weight: 600;
|
||||
}
|
||||
|
||||
::v-deep .categorys .el-tag--plain.el-tag--success {
|
||||
::v-deep .categorys .el-tag--plain.el-tag--info {
|
||||
border: 1px solid #dcdfe6;
|
||||
color: #000;
|
||||
font-weight: 600;
|
||||
@@ -3074,11 +3181,11 @@ input[type="number"]::-webkit-outer-spin-button {
|
||||
border: 1px solid #dcdfe6;
|
||||
}
|
||||
::v-deep .el-checkbox__input.is-checked .el-checkbox__inner {
|
||||
background-color: #22bf64;
|
||||
border-color: #22bf64;
|
||||
// background-color: #22bf64;
|
||||
// border-color: #22bf64;
|
||||
}
|
||||
::v-deep .el-checkbox__input.is-checked + .el-checkbox__label {
|
||||
color: #22bf64;
|
||||
// color: #22bf64;
|
||||
}
|
||||
|
||||
::v-deep .tag-group .el-tag--dark {
|
||||
@@ -3131,7 +3238,13 @@ input[type="number"]::-webkit-outer-spin-button {
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.table-item {
|
||||
cursor: pointer;
|
||||
transition: 0.2s ease-in-out;
|
||||
&:hover {
|
||||
background: #f4f9ff;
|
||||
}
|
||||
}
|
||||
.tag-group {
|
||||
margin-top: 10px;
|
||||
|
||||
@@ -3696,7 +3809,7 @@ input[type="number"]::-webkit-outer-spin-button {
|
||||
.submit {
|
||||
width: 366px;
|
||||
height: 44px;
|
||||
background: #22bf64;
|
||||
background: #1890ff;
|
||||
border-radius: 2px;
|
||||
|
||||
display: flex;
|
||||
|
||||
Reference in New Issue
Block a user