feat(tahesab): sales report snapshot with org-module gate
Sync linked asnad into CRM, filter by group/kind/metal, and require the tahesab superadmin module plus reports role access.
This commit is contained in:
@@ -88,6 +88,11 @@ export const router = createRouter({
|
||||
name: 'reports',
|
||||
component: () => import('@/views/ReportsView.vue'),
|
||||
},
|
||||
{
|
||||
path: 'reports/tahesab-sales',
|
||||
name: 'tahesab-sales-report',
|
||||
component: () => import('@/views/TahesabSalesReportView.vue'),
|
||||
},
|
||||
{
|
||||
path: 'behavior/disc',
|
||||
name: 'disc-report',
|
||||
@@ -637,6 +642,15 @@ router.beforeEach((to) => {
|
||||
const modules = auth.user?.enabledModules;
|
||||
if (modules && !modules.includes('treasury')) return { name: 'home' };
|
||||
}
|
||||
if (
|
||||
to.name === 'tahesab-sales-report' ||
|
||||
to.name === 'tahesab-settings' ||
|
||||
String(to.path).startsWith('/settings/tahesab') ||
|
||||
String(to.path).startsWith('/reports/tahesab')
|
||||
) {
|
||||
const modules = auth.user?.enabledModules;
|
||||
if (modules && !modules.includes('tahesab')) return { name: 'home' };
|
||||
}
|
||||
if (!canOpenPath(auth.user?.role, auth.user?.permissions, String(to.path))) {
|
||||
return { name: 'home' };
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user