增加员工权限校验

This commit is contained in:
gyq
2024-10-21 13:48:57 +08:00
parent 9d73a49a06
commit db8c41fd16
7 changed files with 126 additions and 47 deletions

View File

@@ -106,6 +106,8 @@ import receiptPrint from "@/components/lodop/receiptPrint.js";
import { useGlobal } from '@/store/global.js'
import { usePrint } from '@/store/print.js'
import { staffPermission } from '@/api/user.js'
const global = useGlobal()
const printStore = usePrint()
@@ -156,15 +158,21 @@ const isPrint = ref(true);
const discountLoading = ref(false)
// 显示员工折扣
async function showStaffDiscountHandle() {
discountLoading.value = true
await getStaffDiscountAjax()
discountLoading.value = false
if (staffDiscount.value <= 0) {
ElMessage.error('暂无折扣,请稍后再试')
} else {
showStaffDiscount.value = true
try {
discountLoading.value = true
await staffPermission('yun_xu_da_zhe')
await getStaffDiscountAjax()
discountLoading.value = false
global.updateData(false)
if (staffDiscount.value <= 0) {
ElMessage.error('暂无折扣,请稍后再试')
} else {
showStaffDiscount.value = true
discountLoading.value = false
global.updateData(false)
}
} catch (error) {
discountLoading.value = false
console.log(error);
}
}