diff --git a/src/utils/menuTreePermission.js b/src/utils/menuTreePermission.js index 82cbc60..4961860 100644 --- a/src/utils/menuTreePermission.js +++ b/src/utils/menuTreePermission.js @@ -175,6 +175,9 @@ export const permissionMapping = { financial_accounting: 147, // 财务核算 cash_flow_ledger: 148, // 资金流水账 performance_attribution_accounting: 149, // 业绩归属台账 + + new_transaction_flow: 162, // 新增流水 + performance_adjustment: 163, // 业绩调整 } // 递归查找菜单中是否存在目标id diff --git a/src/views/moneyManage/financialAccount/cashFlow.vue b/src/views/moneyManage/financialAccount/cashFlow.vue index 1ea0cf4..90aca27 100644 --- a/src/views/moneyManage/financialAccount/cashFlow.vue +++ b/src/views/moneyManage/financialAccount/cashFlow.vue @@ -13,9 +13,10 @@ import { normalizePayType,MarketNameForId, CurrencyForId, } from '@/views/moneyM import { isTemplate } from 'element-plus/es/utils/index.mjs' import { Row } from 'vxe-pc-ui' import CashManagement from '@/components/workspace/CashManagement.vue' +import { permissionMapping, hasMenuPermission } from "@/utils/menuTreePermission.js" const adminStore = useAdminStore() -const { adminData } = storeToRefs(adminStore) +const { adminData, menuTree,flag } = storeToRefs(adminStore) const { t } = useI18n() const route = useRoute() @@ -38,6 +39,16 @@ const paytypeList = [ t('cash.payMethods.check'), // 支票 ] +// 新增流水权限 +const hasNewTransactionFlow = ref(false) + +// 初始化权限状态 +const initPermissions = async () => { + if (!menuTree.value || !menuTree.value.length) return; + // 新增流水权限 + hasNewTransactionFlow.value = hasMenuPermission(menuTree.value, permissionMapping.new_transaction_flow); +}; + const payPlatformOptions = ref([...paytypeList]) const marketFilter = (value) => { @@ -675,6 +686,7 @@ const handlePreviewClick=()=>{ } } onMounted(async () => { + await initPermissions() await getMarket() await getPayPlatformOptions() // 处理从工作台跳转过来的地区参数 @@ -746,7 +758,7 @@ onMounted(async () => { {{ t('common.reset') }}
- {{ t('common.addCashFlow') }} + {{ t('common.addCashFlow') }}
diff --git a/src/views/moneyManage/financialAccount/performanceAttribution.vue b/src/views/moneyManage/financialAccount/performanceAttribution.vue index 3cc411e..0dd12f1 100644 --- a/src/views/moneyManage/financialAccount/performanceAttribution.vue +++ b/src/views/moneyManage/financialAccount/performanceAttribution.vue @@ -6,8 +6,12 @@ import dayjs from 'dayjs' import { useI18n } from 'vue-i18n' import { refundOnline,performanceSelect,exportPerformance,adjustment } from '@/api/cash/financialAccount.js' import { getUserInfo } from '@/api/common/common.js' +import { useAdminStore } from '@/store/index.js' +import { permissionMapping, hasMenuPermission } from "@/utils/menuTreePermission.js" +import { storeToRefs } from 'pinia' - +const adminStore = useAdminStore() +const { menuTree,flag } = storeToRefs(adminStore) const adminData = ref({}) @@ -29,6 +33,16 @@ const paytypeList = [ t('cash.payMethods.paypal'), ] +const hasperformanceAdjustment = ref(false) +// 初始化权限状态 +const initPermissions = async () => { + if (!menuTree.value || !menuTree.value.length) return; + // 业绩调整 + hasperformanceAdjustment.value = hasMenuPermission(menuTree.value, permissionMapping.performance_adjustment); + console.log('业绩调整权限',hasperformanceAdjustment.value); + +}; + const payPlatformOptions = ref([...paytypeList]) const statusOptions = [ @@ -370,6 +384,7 @@ const submitAdjustment = async () => { } onMounted( async() => { + await initPermissions() await handleAdminInfo() getMarket() await fetchData() @@ -421,7 +436,7 @@ onMounted( async() => { {{ t('common.exportExcel') }} {{ t('common.viewExportList') }} {{ t('common.reset') }} - +