增加员工权限校验
This commit is contained in:
@@ -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);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user