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:
2026-10-22 18:20:46 +03:30
parent 65cf4e9a66
commit ade43fea0f
11 changed files with 1490 additions and 3 deletions
+14
View File
@@ -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' };
}