代客下单增加无台桌获取masterId
This commit is contained in:
parent
5ea24d76c8
commit
57ef84aae1
|
|
@ -5,7 +5,10 @@ ENV = 'development'
|
||||||
# VUE_APP_BASE_API = 'http://192.168.2.42:8000'
|
# VUE_APP_BASE_API = 'http://192.168.2.42:8000'
|
||||||
# VUE_APP_BASE_API = 'http://192.168.2.133:8000'
|
# VUE_APP_BASE_API = 'http://192.168.2.133:8000'
|
||||||
# 测试
|
# 测试
|
||||||
VUE_APP_BASE_API = 'https://admintestpapi.sxczgkj.cn'
|
# VUE_APP_BASE_API = 'https://admintestpapi.sxczgkj.cn'
|
||||||
|
#预发布
|
||||||
|
VUE_APP_BASE_API = 'https://pre-cashieradmin.sxczgkj.cn'
|
||||||
|
|
||||||
# 生产
|
# 生产
|
||||||
# VUE_APP_BASE_API = 'https://cashieradmin.sxczgkj.cn'
|
# VUE_APP_BASE_API = 'https://cashieradmin.sxczgkj.cn'
|
||||||
# VUE_APP_BASE_API = 'http://192.168.2.96:8000'
|
# VUE_APP_BASE_API = 'http://192.168.2.96:8000'
|
||||||
|
|
|
||||||
|
|
@ -3,13 +3,13 @@ ENV = 'production'
|
||||||
# 如果使用 Nginx 代理后端接口,那么此处需要改为 '/',文件查看 Docker 部署篇,Nginx 配置
|
# 如果使用 Nginx 代理后端接口,那么此处需要改为 '/',文件查看 Docker 部署篇,Nginx 配置
|
||||||
# 接口地址,注意协议,如果你没有配置 ssl,需要将 https 改为 http
|
# 接口地址,注意协议,如果你没有配置 ssl,需要将 https 改为 http
|
||||||
# 测试
|
# 测试
|
||||||
VUE_APP_BASE_API = 'https://admintestpapi.sxczgkj.cn'
|
# VUE_APP_BASE_API = 'https://admintestpapi.sxczgkj.cn'
|
||||||
|
|
||||||
# 生产
|
# 生产
|
||||||
# VUE_APP_BASE_API = 'https://cashieradmin.sxczgkj.cn'
|
# VUE_APP_BASE_API = 'https://cashieradmin.sxczgkj.cn'
|
||||||
|
|
||||||
# 预发布接口
|
# 预发布接口
|
||||||
# VUE_APP_BASE_API = 'https://pre-cashieradmin.sxczgkj.cn'
|
VUE_APP_BASE_API = 'https://pre-cashieradmin.sxczgkj.cn'
|
||||||
|
|
||||||
# VUE_APP_BASE_API = 'http://192.168.2.98:8000'
|
# VUE_APP_BASE_API = 'http://192.168.2.98:8000'
|
||||||
# 如果接口是 http 形式, wss 需要改为 ws
|
# 如果接口是 http 形式, wss 需要改为 ws
|
||||||
|
|
|
||||||
|
|
@ -594,7 +594,7 @@
|
||||||
</div> -->
|
</div> -->
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="goods">
|
<div class="goods" v-infinite-scroll="loadMoreGoods">
|
||||||
<template v-if="!isCreateOrder">
|
<template v-if="!isCreateOrder">
|
||||||
<div class="flex categoty u-col-center">
|
<div class="flex categoty u-col-center">
|
||||||
<div
|
<div
|
||||||
|
|
@ -637,6 +637,7 @@
|
||||||
>
|
>
|
||||||
未找到相关商品
|
未找到相关商品
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="goods-list" v-if="goods.list.length">
|
<div class="goods-list" v-if="goods.list.length">
|
||||||
<div
|
<div
|
||||||
class="goods-item"
|
class="goods-item"
|
||||||
|
|
@ -659,7 +660,12 @@
|
||||||
</div> -->
|
</div> -->
|
||||||
|
|
||||||
<div class="flex img-box" v-if="layout.sel !== 'text'">
|
<div class="flex img-box" v-if="layout.sel !== 'text'">
|
||||||
<img class="goods-img" :src="item.coverImg" alt="" />
|
<!-- <img class="goods-img" :src="item.coverImg" alt="" /> -->
|
||||||
|
<el-image
|
||||||
|
:src="item.coverImg"
|
||||||
|
scroll-container="goods"
|
||||||
|
class="goods-img"
|
||||||
|
></el-image>
|
||||||
<template v-if="layout.sel === 'img-and-text'">
|
<template v-if="layout.sel === 'img-and-text'">
|
||||||
<div class="sell-out-svg" v-if="isSellOut(item)">
|
<div class="sell-out-svg" v-if="isSellOut(item)">
|
||||||
<svg
|
<svg
|
||||||
|
|
@ -749,6 +755,12 @@
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
<div
|
||||||
|
class="no-search-result"
|
||||||
|
v-if="goods.list.length <= 0 && goods.query.productId === ''"
|
||||||
|
>
|
||||||
|
未找到相关商品
|
||||||
|
</div>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<template v-else>
|
<template v-else>
|
||||||
|
|
@ -1166,7 +1178,7 @@
|
||||||
|
|
||||||
<return-cart
|
<return-cart
|
||||||
ref="refReturnCart"
|
ref="refReturnCart"
|
||||||
:max="order.selGoods?order.selGoods.number:1"
|
:max="order.selGoods ? order.selGoods.number : 1"
|
||||||
@confirm="refReturnCartConfirm"
|
@confirm="refReturnCartConfirm"
|
||||||
></return-cart>
|
></return-cart>
|
||||||
</div>
|
</div>
|
||||||
|
|
@ -1317,7 +1329,7 @@ export default {
|
||||||
productId: "",
|
productId: "",
|
||||||
categoryId: "",
|
categoryId: "",
|
||||||
page: 1,
|
page: 1,
|
||||||
size: 300,
|
size: 20,
|
||||||
},
|
},
|
||||||
loading: false,
|
loading: false,
|
||||||
total: 0,
|
total: 0,
|
||||||
|
|
@ -1581,6 +1593,11 @@ export default {
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
watch: {
|
watch: {
|
||||||
|
"goods.query.categoryId": function (newval) {
|
||||||
|
this.goods.query.page = 1;
|
||||||
|
this.goods.list = [];
|
||||||
|
this.getGoods();
|
||||||
|
},
|
||||||
"useTypes.sel": function (newval, oldval) {
|
"useTypes.sel": function (newval, oldval) {
|
||||||
console.log(newval);
|
console.log(newval);
|
||||||
this.setPostPay();
|
this.setPostPay();
|
||||||
|
|
@ -1740,15 +1757,20 @@ export default {
|
||||||
this.open(this.$route.query.tableId ? this.$route.query : "");
|
this.open(this.$route.query.tableId ? this.$route.query : "");
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
|
loadMoreGoods() {
|
||||||
|
if (this.goods.query.page * this.goods.query.size < this.goods.total) {
|
||||||
|
this.goods.query.page = this.goods.query.page + 1;
|
||||||
|
this.getGoods();
|
||||||
|
}
|
||||||
|
},
|
||||||
async shoukuanClick() {
|
async shoukuanClick() {
|
||||||
this.canShoukuan = await hasPermission("允许收款");
|
this.canShoukuan = await hasPermission("允许收款");
|
||||||
return this.canShoukuan;
|
return this.canShoukuan;
|
||||||
},
|
},
|
||||||
// 打开页面
|
// 打开页面
|
||||||
async xiadanClick() {
|
async xiadanClick() {
|
||||||
this.canXiadan = await hasPermission("允许下单");
|
this.canXiadan = await hasPermission("允许下单");
|
||||||
return this.canXiadan;
|
return this.canXiadan;
|
||||||
|
|
||||||
},
|
},
|
||||||
changeOrderExtraSel(index, canChangeNumber, placeNum) {
|
changeOrderExtraSel(index, canChangeNumber, placeNum) {
|
||||||
// console.log(index,canChangeNumber,placeNum)
|
// console.log(index,canChangeNumber,placeNum)
|
||||||
|
|
@ -1856,7 +1878,7 @@ export default {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
await this.returnCreateOrderData();
|
await this.returnCreateOrderData();
|
||||||
console.log( this.createOrder.data )
|
console.log(this.createOrder.data);
|
||||||
this.order.payType = "scanCode";
|
this.order.payType = "scanCode";
|
||||||
this.payTypeItemClick({ payType: "scanCode" });
|
this.payTypeItemClick({ payType: "scanCode" });
|
||||||
this.payBeforeClear();
|
this.payBeforeClear();
|
||||||
|
|
@ -2048,7 +2070,7 @@ export default {
|
||||||
}
|
}
|
||||||
if (item.payType == "scanCode") {
|
if (item.payType == "scanCode") {
|
||||||
//扫码支付
|
//扫码支付
|
||||||
return this.refToggle("refWxScanCode", true,this.createOrder.data);
|
return this.refToggle("refWxScanCode", true, this.createOrder.data);
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
ChangeDiscount(discount) {
|
ChangeDiscount(discount) {
|
||||||
|
|
@ -2182,7 +2204,7 @@ export default {
|
||||||
return this.refChooseUserOpen();
|
return this.refChooseUserOpen();
|
||||||
}
|
}
|
||||||
if (this.order.payType == "scanCode") {
|
if (this.order.payType == "scanCode") {
|
||||||
return this.refToggle("refWxScanCode", true,this.createOrder.data);
|
return this.refToggle("refWxScanCode", true, this.createOrder.data);
|
||||||
}
|
}
|
||||||
if (this.order.payType == "deposit") {
|
if (this.order.payType == "deposit") {
|
||||||
return this.refToggle("refScanCode", true);
|
return this.refToggle("refScanCode", true);
|
||||||
|
|
@ -2250,7 +2272,7 @@ export default {
|
||||||
if (!canXiadan) {
|
if (!canXiadan) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
}else{
|
} else {
|
||||||
//去结算
|
//去结算
|
||||||
const canJiesuan = await this.shoukuanClick();
|
const canJiesuan = await this.shoukuanClick();
|
||||||
if (!canJiesuan) {
|
if (!canJiesuan) {
|
||||||
|
|
@ -2273,14 +2295,15 @@ export default {
|
||||||
console.log(this.order.orderId);
|
console.log(this.order.orderId);
|
||||||
let res = "";
|
let res = "";
|
||||||
try {
|
try {
|
||||||
const seatFee = await $choseCount({
|
if (!this.shopInfo.isTableFee) {
|
||||||
masterId: this.masterId,
|
const seatFee = await $choseCount({
|
||||||
tableId: this.table.tableId,
|
masterId: this.masterId,
|
||||||
num: this.perpole,
|
tableId: this.table.tableId,
|
||||||
});
|
num: this.perpole,
|
||||||
this.order.seatFee = seatFee;
|
});
|
||||||
|
this.order.seatFee = seatFee;
|
||||||
this.order.seatFee = res;
|
this.order.seatFee = res;
|
||||||
|
}
|
||||||
res = await $createOrder({
|
res = await $createOrder({
|
||||||
masterId: this.order.masterId || this.masterId,
|
masterId: this.order.masterId || this.masterId,
|
||||||
vipUserId: this.vipUser.id,
|
vipUserId: this.vipUser.id,
|
||||||
|
|
@ -2316,23 +2339,15 @@ export default {
|
||||||
},
|
},
|
||||||
|
|
||||||
// 获取取餐号
|
// 获取取餐号
|
||||||
getMasterId() {
|
async getMasterId() {
|
||||||
// if(!this.table.tableId){
|
const res=await $getMasterId({
|
||||||
// return this.$message.error("请选择桌台");
|
|
||||||
// }
|
|
||||||
if (this.table.tableId) {
|
|
||||||
return $getMasterId({
|
|
||||||
tableId: this.table.tableId,
|
tableId: this.table.tableId,
|
||||||
orderId: this.table.orderId,
|
orderId: this.table.orderId,
|
||||||
vipUserId: this.vipUser.id,
|
vipUserId: this.vipUser.id,
|
||||||
useType: this.useTypes.sel == "takeout" ? "takeout" : "",
|
useType: this.useTypes.sel == "takeout" ? "takeout" : ""
|
||||||
});
|
})
|
||||||
} else {
|
this.masterId=res.masterId;
|
||||||
// return $getMasterId({
|
return res
|
||||||
// useType:'takeout',
|
|
||||||
// vipUserId: this.vipUser.id,
|
|
||||||
// });
|
|
||||||
}
|
|
||||||
},
|
},
|
||||||
onSelGoodsSkuClose() {
|
onSelGoodsSkuClose() {
|
||||||
this.selGoods.isEdit = false;
|
this.selGoods.isEdit = false;
|
||||||
|
|
@ -3057,9 +3072,9 @@ export default {
|
||||||
},
|
},
|
||||||
//根据右侧商品单规格多规格做不同处理
|
//根据右侧商品单规格多规格做不同处理
|
||||||
async goodsClick(item) {
|
async goodsClick(item) {
|
||||||
if (!this.table) {
|
// if (!this.table) {
|
||||||
return this.$message.error("暂不支持无桌台下单,请先选择桌台");
|
// return this.$message.error("暂不支持无桌台下单,请先选择桌台");
|
||||||
}
|
// }
|
||||||
if (item.typeEnum === "sku") {
|
if (item.typeEnum === "sku") {
|
||||||
this.selGoods.data = item;
|
this.selGoods.data = item;
|
||||||
this.selGoods.skuMap = {};
|
this.selGoods.skuMap = {};
|
||||||
|
|
@ -3125,8 +3140,9 @@ export default {
|
||||||
});
|
});
|
||||||
return isShow;
|
return isShow;
|
||||||
});
|
});
|
||||||
console.log($goodsMap);
|
for (let i in goods) {
|
||||||
this.goods.list = goods;
|
this.goods.list.push(goods[i]);
|
||||||
|
}
|
||||||
this.goods.total = res.total;
|
this.goods.total = res.total;
|
||||||
this.$goodsData = goods;
|
this.$goodsData = goods;
|
||||||
},
|
},
|
||||||
|
|
@ -3976,11 +3992,12 @@ input[type="number"]::-webkit-outer-spin-button {
|
||||||
.goods-list {
|
.goods-list {
|
||||||
display: flex;
|
display: flex;
|
||||||
flex-wrap: wrap;
|
flex-wrap: wrap;
|
||||||
|
min-height: 10px;
|
||||||
.goods-item {
|
.goods-item {
|
||||||
position: relative;
|
position: relative;
|
||||||
cursor: pointer;
|
cursor: pointer;
|
||||||
min-width: 98px;
|
// min-width: 98px;
|
||||||
|
min-width: 100px;
|
||||||
max-width: 100px;
|
max-width: 100px;
|
||||||
height: 100px;
|
height: 100px;
|
||||||
// flex: 1;
|
// flex: 1;
|
||||||
|
|
@ -4448,6 +4465,11 @@ input[type="number"]::-webkit-outer-spin-button {
|
||||||
::v-deep .cashier_left .el-form-item__label {
|
::v-deep .cashier_left .el-form-item__label {
|
||||||
text-align: left;
|
text-align: left;
|
||||||
}
|
}
|
||||||
|
::v-deep .goods .el-image {
|
||||||
|
display: flex;
|
||||||
|
width: 100%;
|
||||||
|
justify-content: center;
|
||||||
|
}
|
||||||
.cashier_left .detail_box .usercard .info .nickname .vip_level {
|
.cashier_left .detail_box .usercard .info .nickname .vip_level {
|
||||||
font-size: 12px;
|
font-size: 12px;
|
||||||
padding: 0 5px;
|
padding: 0 5px;
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue