Files
CRM_Montzar/apps/web/src/components/treasury/TreasuryNav.vue
T
MahdiandCursor 96befd3867 feat: add treasury audit, attachment download, and installment SMS
Let cheque clearance pick a cash account and export income, expense, and installment lists to Excel.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-10-18 19:59:24 +03:30

67 lines
1.9 KiB
Vue

<script setup lang="ts">
import { computed } from 'vue';
import { useRoute } from 'vue-router';
import { useAuthStore } from '@/stores/auth';
const route = useRoute();
const auth = useAuthStore();
const canPayroll = computed(() =>
auth.user?.role === 'owner'
|| auth.user?.role === 'admin'
|| Boolean(auth.user?.permissions?.includes('treasury_payroll')),
);
const links = computed(() => [
{ to: '/finance', label: 'داشبورد', exact: true },
{ to: '/finance/incomes', label: 'دریافت‌ها و درآمدها' },
{ to: '/finance/expenses', label: 'پرداخت‌ها و هزینه‌ها' },
{ to: '/finance/receivables', label: 'اقساط و مطالبات' },
{ to: '/finance/accounts', label: 'صندوق و حساب‌ها' },
...(canPayroll.value ? [{ to: '/finance/payroll', label: 'حقوق' }] : []),
{ to: '/finance/recurring', label: 'تکرارشونده' },
{ to: '/finance/reports', label: 'گزارش' },
{ to: '/finance/audit', label: 'سوابق' },
{ to: '/finance/categories', label: 'دسته‌بندی‌ها' },
]);
function on(path: string, exact?: boolean) {
if (exact) return route.path === path;
return route.path === path || route.path.startsWith(`${path}/`);
}
</script>
<template>
<nav class="treasury-nav" aria-label="مدیریت مالی">
<RouterLink
v-for="link in links"
:key="link.to"
:to="link.to"
:class="{ on: on(link.to, link.exact) }"
>
{{ link.label }}
</RouterLink>
</nav>
</template>
<style scoped>
.treasury-nav {
display: flex;
gap: 0.35rem;
overflow: auto;
padding-bottom: 0.25rem;
}
.treasury-nav a {
flex: 0 0 auto;
border-radius: 999px;
padding: 0.4rem 0.8rem;
color: #475569;
text-decoration: none;
font-weight: 700;
font-size: 0.86rem;
background: #f8fafc;
}
.treasury-nav a.on {
background: #0f766e;
color: #fff;
}
</style>