增加代客下单权限校验
This commit is contained in:
@@ -102,7 +102,7 @@ export async function hasPermission (params) {
|
|||||||
}
|
}
|
||||||
params = returnFormatParams(params)
|
params = returnFormatParams(params)
|
||||||
if (!params) {
|
if (!params) {
|
||||||
return infoBox.showToast('未找到相关权限,请检查代码或在权限配置文件commons/utils/hasPermission.js文件进行修改或增加')
|
return Notification.error('未找到相关权限,请检查代码或在权限配置文件commons/utils/hasPermission.js文件进行修改或增加')
|
||||||
}
|
}
|
||||||
const option = Object.assign({
|
const option = Object.assign({
|
||||||
tips: true,
|
tips: true,
|
||||||
|
|||||||
@@ -229,6 +229,7 @@ import tableDiancan from "./components/table-diancan.vue";
|
|||||||
import $status from "./status.js";
|
import $status from "./status.js";
|
||||||
import chooseDinersNumber from "./components/table-diancan-components/choose-diners-number.vue";
|
import chooseDinersNumber from "./components/table-diancan-components/choose-diners-number.vue";
|
||||||
import { tbShopInfo } from "@/api/user";
|
import { tbShopInfo } from "@/api/user";
|
||||||
|
import { hasPermission } from "@/utils/limits.js";
|
||||||
|
|
||||||
import {
|
import {
|
||||||
tbShopTableGet,
|
tbShopTableGet,
|
||||||
@@ -369,7 +370,12 @@ export default {
|
|||||||
onDiancanClose() {
|
onDiancanClose() {
|
||||||
this.tbShopTableGet();
|
this.tbShopTableGet();
|
||||||
},
|
},
|
||||||
diancanShow(item, key) {
|
async diancanShow(item, key) {
|
||||||
|
const canXiadan=await hasPermission('允许下单')
|
||||||
|
if(!canXiadan){
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
//key isAddGoods 加菜
|
//key isAddGoods 加菜
|
||||||
//key isPayOrder结账
|
//key isPayOrder结账
|
||||||
this.selTable = item;
|
this.selTable = item;
|
||||||
|
|||||||
@@ -1,7 +1,13 @@
|
|||||||
<!-- eslint-disable no-empty -->
|
<!-- eslint-disable no-empty -->
|
||||||
<template>
|
<template>
|
||||||
<div class="el-dialog">
|
<div class="el-dialog">
|
||||||
<div class="bg-fff">
|
<div class="bg-fff u-relative">
|
||||||
|
<div
|
||||||
|
class="u-fixed position-all"
|
||||||
|
style="z-index: 999"
|
||||||
|
v-if="!canXiadan"
|
||||||
|
@click="xiadanClick"
|
||||||
|
></div>
|
||||||
<div class="flex head row-between flex-y-center u-m-l-20">
|
<div class="flex head row-between flex-y-center u-m-l-20">
|
||||||
<div class="flex" style="width: 500px">
|
<div class="flex" style="width: 500px">
|
||||||
<div class="u-font-16 color-333 font-bold" style="margin-right: 10px">
|
<div class="u-font-16 color-333 font-bold" style="margin-right: 10px">
|
||||||
@@ -299,8 +305,6 @@
|
|||||||
></cart-item>
|
></cart-item>
|
||||||
</template>
|
</template>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
<!-- 已下单菜品列表 -->
|
<!-- 已下单菜品列表 -->
|
||||||
<template v-if="order.old.list.length">
|
<template v-if="order.old.list.length">
|
||||||
@@ -1181,6 +1185,7 @@ import returnCart from "./components/return-cart.vue";
|
|||||||
import moneyKeyboard from "./components/money-keyboard.vue";
|
import moneyKeyboard from "./components/money-keyboard.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 {
|
import {
|
||||||
getGoodsLists,
|
getGoodsLists,
|
||||||
@@ -1228,6 +1233,10 @@ export default {
|
|||||||
},
|
},
|
||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
|
//是否允许收款
|
||||||
|
canShoukuan: false,
|
||||||
|
//是否允许下单
|
||||||
|
canXiadan: false,
|
||||||
//是否是单品备注
|
//是否是单品备注
|
||||||
isDanNote: false,
|
isDanNote: false,
|
||||||
//店铺信息
|
//店铺信息
|
||||||
@@ -1721,6 +1730,7 @@ export default {
|
|||||||
},
|
},
|
||||||
},
|
},
|
||||||
mounted() {
|
mounted() {
|
||||||
|
this.xiadanClick();
|
||||||
// this.getGoods();
|
// this.getGoods();
|
||||||
// this.getCategory();
|
// this.getCategory();
|
||||||
// this.refToggle('refScanCode',true)
|
// this.refToggle('refScanCode',true)
|
||||||
@@ -1729,6 +1739,13 @@ export default {
|
|||||||
this.open(this.$route.query.tableId ? this.$route.query : "");
|
this.open(this.$route.query.tableId ? this.$route.query : "");
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
|
async shoukuanClick() {
|
||||||
|
this.canShoukuan = await hasPermission("允许收款");
|
||||||
|
},
|
||||||
|
// 打开页面
|
||||||
|
async xiadanClick() {
|
||||||
|
this.canXiadan = await hasPermission("允许下单");
|
||||||
|
},
|
||||||
changeOrderExtraSel(index, canChangeNumber, placeNum) {
|
changeOrderExtraSel(index, canChangeNumber, placeNum) {
|
||||||
// console.log(index,canChangeNumber,placeNum)
|
// console.log(index,canChangeNumber,placeNum)
|
||||||
this.order.selIndex = -1;
|
this.order.selIndex = -1;
|
||||||
@@ -1740,6 +1757,10 @@ export default {
|
|||||||
if (this.order.list.length <= 0) {
|
if (this.order.list.length <= 0) {
|
||||||
return this.$message("请选择菜品");
|
return this.$message("请选择菜品");
|
||||||
}
|
}
|
||||||
|
const canJiesuan = await this.shoukuanClick();
|
||||||
|
if (!canJiesuan) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
// if(this.isCreateOrder){
|
// if(this.isCreateOrder){
|
||||||
// return
|
// return
|
||||||
// }
|
// }
|
||||||
@@ -1749,7 +1770,11 @@ export default {
|
|||||||
this.order.payType = "";
|
this.order.payType = "";
|
||||||
this.isCreateOrder = true;
|
this.isCreateOrder = true;
|
||||||
},
|
},
|
||||||
cashPayClick() {
|
async cashPayClick() {
|
||||||
|
const canJiesuan = await this.shoukuanClick();
|
||||||
|
if (!canJiesuan) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
this.$confirm("是否确认已现金收款:" + this.allPrice + "?", "快捷支付", {
|
this.$confirm("是否确认已现金收款:" + this.allPrice + "?", "快捷支付", {
|
||||||
confirmButtonText: "确定",
|
confirmButtonText: "确定",
|
||||||
cancelButtonText: "取消",
|
cancelButtonText: "取消",
|
||||||
@@ -1813,11 +1838,19 @@ export default {
|
|||||||
// this.useTypes.sel = "dine-in";
|
// this.useTypes.sel = "dine-in";
|
||||||
},
|
},
|
||||||
async cachePay() {
|
async cachePay() {
|
||||||
|
const canJiesuan = await this.shoukuanClick();
|
||||||
|
if (!canJiesuan) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
await this.returnCreateOrderData();
|
await this.returnCreateOrderData();
|
||||||
this.payBeforeClear({});
|
this.payBeforeClear({});
|
||||||
this.pays();
|
this.pays();
|
||||||
},
|
},
|
||||||
async scanPayClick() {
|
async scanPayClick() {
|
||||||
|
const canJiesuan = await this.shoukuanClick();
|
||||||
|
if (!canJiesuan) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
await this.returnCreateOrderData();
|
await this.returnCreateOrderData();
|
||||||
this.payBeforeClear();
|
this.payBeforeClear();
|
||||||
this.order.payType = "scanCode";
|
this.order.payType = "scanCode";
|
||||||
@@ -1965,9 +1998,10 @@ export default {
|
|||||||
});
|
});
|
||||||
this.order.selGoods.status = "return";
|
this.order.selGoods.status = "return";
|
||||||
this.order.old.selIndex = -1;
|
this.order.old.selIndex = -1;
|
||||||
this.getCart()
|
this.getCart();
|
||||||
console.log(this.order.selGoods);
|
console.log(this.order.selGoods);
|
||||||
},
|
},
|
||||||
|
|
||||||
// 台桌列表
|
// 台桌列表
|
||||||
async getTable() {
|
async getTable() {
|
||||||
try {
|
try {
|
||||||
@@ -2015,7 +2049,11 @@ export default {
|
|||||||
ChangeDiscount(discount) {
|
ChangeDiscount(discount) {
|
||||||
this.createOrder.discount = discount;
|
this.createOrder.discount = discount;
|
||||||
},
|
},
|
||||||
disCountShow() {
|
async disCountShow() {
|
||||||
|
const canDiscount = await hasPermission("允许打折");
|
||||||
|
if (!canDiscount) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
const { amount } = this.createOrder.data;
|
const { amount } = this.createOrder.data;
|
||||||
this.refToggle("refDiscount", true, {
|
this.refToggle("refDiscount", true, {
|
||||||
amount,
|
amount,
|
||||||
@@ -2200,7 +2238,21 @@ export default {
|
|||||||
this.isCreateOrder = false;
|
this.isCreateOrder = false;
|
||||||
},
|
},
|
||||||
//生成订单
|
//生成订单
|
||||||
toCreateOrderDebounce(isNowPay) {
|
async toCreateOrderDebounce(isNowPay) {
|
||||||
|
if (!isNowPay) {
|
||||||
|
//仅下单
|
||||||
|
const canXiadan = await this.xiadanClick();
|
||||||
|
if (!canXiadan) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
}else{
|
||||||
|
//去结算
|
||||||
|
const canJiesuan = await this.shoukuanClick();
|
||||||
|
if (!canJiesuan) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
console.log(this.createOrder.status);
|
console.log(this.createOrder.status);
|
||||||
if (
|
if (
|
||||||
this.createOrder.status != "" &&
|
this.createOrder.status != "" &&
|
||||||
@@ -2216,14 +2268,14 @@ export default {
|
|||||||
console.log(this.order.orderId);
|
console.log(this.order.orderId);
|
||||||
let res = "";
|
let res = "";
|
||||||
try {
|
try {
|
||||||
const seatFee = await $choseCount({
|
const seatFee = await $choseCount({
|
||||||
masterId: this.masterId,
|
masterId: this.masterId,
|
||||||
tableId: this.table.tableId,
|
tableId: this.table.tableId,
|
||||||
num: this.perpole,
|
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,
|
||||||
|
|||||||
Reference in New Issue
Block a user