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