menu.blade.php 10 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159
  1. @if(auth()->check())
  2. @php
  3. $dkrActive = in_array($active ?? '', [
  4. 'orders',
  5. 'product_sku',
  6. 'catalog',
  7. 'reports',
  8. 'responsibles',
  9. 'maf_order',
  10. ], true);
  11. $schedulesActive = in_array($active ?? '', [
  12. 'schedule_orders',
  13. 'schedule_deliveries',
  14. 'schedule',
  15. ], true);
  16. $reclamationsActive = ($active ?? '') === 'reclamations';
  17. $sparePartsActive = in_array($active ?? '', [
  18. 'spare_parts',
  19. 'spare_part_orders',
  20. 'spare_part_inventory',
  21. 'pricing_codes',
  22. ], true);
  23. $stockActive = in_array($active ?? '', ['stock', 'stock_orders'], true);
  24. $adminActive = in_array($active ?? '', [
  25. 'contractors',
  26. 'contracts',
  27. 'users',
  28. 'roles',
  29. 'admin_settings',
  30. 'admin_districts',
  31. 'admin_areas',
  32. 'notification_logs',
  33. 'import',
  34. 'year-data',
  35. 'clear-data',
  36. ], true);
  37. @endphp
  38. @if(hasAnyPermission([
  39. 'orders.view',
  40. 'maf.view',
  41. 'catalog.view',
  42. 'reports.view',
  43. 'responsibles.view',
  44. 'maf_orders.view',
  45. ]))
  46. <li class="nav-item dropdown">
  47. <a class="nav-link dropdown-toggle @if($dkrActive) active @endif" href="#" role="button" data-bs-toggle="dropdown" aria-expanded="false">
  48. ДКР
  49. </a>
  50. <ul class="dropdown-menu">
  51. @if(hasPermission('orders.view'))<li><a class="dropdown-item @if(($active ?? '') === 'orders') active @endif" href="{{ route('order.index', session('gp_orders')) }}">Площадки</a></li>@endif
  52. @if(hasPermission('maf.view'))<li><a class="dropdown-item @if(($active ?? '') === 'product_sku') active @endif" href="{{ route('product_sku.index', session('gp_product_sku')) }}">МАФ</a></li>@endif
  53. @if(hasPermission('catalog.view'))<li><a class="dropdown-item @if(($active ?? '') === 'catalog') active @endif" href="{{ route('catalog.index', session('gp_products')) }}">Каталог</a></li>@endif
  54. @if(hasPermission('reports.view'))<li><a class="dropdown-item @if(($active ?? '') === 'reports') active @endif" href="{{ route('reports.index', session('gp_reports')) }}">Отчёты</a></li>@endif
  55. @if(hasPermission('responsibles.view'))<li><a class="dropdown-item @if(($active ?? '') === 'responsibles') active @endif" href="{{ route('responsible.index', session('gp_responsibles')) }}">Ответственные</a></li>@endif
  56. @if(hasPermission('maf_orders.view'))<li><a class="dropdown-item @if(($active ?? '') === 'maf_order') active @endif" href="{{ route('maf_order.index', session('gp_maf_order')) }}">Заказы МАФ</a></li>@endif
  57. </ul>
  58. </li>
  59. @endif
  60. <li class="nav-item dropdown">
  61. <a class="nav-link dropdown-toggle @if($schedulesActive) active @endif" href="#" role="button" data-bs-toggle="dropdown" aria-expanded="false">
  62. Графики
  63. </a>
  64. <ul class="dropdown-menu">
  65. <li><a class="dropdown-item @if(($active ?? '') === 'schedule_orders') active @endif" href="{{ route('schedule.orders') }}">График заказов</a></li>
  66. <li><a class="dropdown-item @if(($active ?? '') === 'schedule_deliveries') active @endif" href="{{ route('schedule.deliveries') }}">График доставок</a></li>
  67. @if(hasPermission('schedule.view'))<li><a class="dropdown-item @if(($active ?? '') === 'schedule') active @endif" href="{{ route('schedule.index', session('gp_schedule')) }}">График монтажей</a></li>@endif
  68. </ul>
  69. </li>
  70. @if(hasPermission('reclamations.view'))
  71. <li class="nav-item dropdown">
  72. <a class="nav-link dropdown-toggle @if($reclamationsActive) active @endif" href="#" role="button" data-bs-toggle="dropdown" aria-expanded="false">
  73. Рекламации
  74. </a>
  75. <ul class="dropdown-menu">
  76. <li><a class="dropdown-item @if(($active ?? '') === 'reclamations' && request('tab') !== 'dkr') active @endif" href="{{ route('reclamations.index', session('gp_reclamations')) }}">Все</a></li>
  77. <li><a class="dropdown-item @if(($active ?? '') === 'reclamations' && request('tab') === 'dkr') active @endif" href="{{ route('reclamations.index', array_merge((array) session('gp_reclamations', []), ['tab' => 'dkr'])) }}">ДКР</a></li>
  78. </ul>
  79. </li>
  80. @endif
  81. @if(hasPermission('spare_parts.view'))
  82. <li class="nav-item dropdown">
  83. <a class="nav-link dropdown-toggle @if($sparePartsActive) active @endif" href="#" role="button" data-bs-toggle="dropdown" aria-expanded="false">
  84. Запчасти
  85. </a>
  86. <ul class="dropdown-menu">
  87. <li><a class="dropdown-item @if(($active ?? '') === 'spare_parts') active @endif" href="{{ route('spare_parts.index', session('gp_spare_parts', [])) }}">Каталог</a></li>
  88. @if(hasPermission('spare_part_orders.view'))<li><a class="dropdown-item @if(($active ?? '') === 'spare_part_orders') active @endif" href="{{ route('spare_part_orders.index') }}">Заказы запчастей</a></li>@endif
  89. @if(hasPermission('spare_part_inventory.view'))<li><a class="dropdown-item @if(($active ?? '') === 'spare_part_inventory') active @endif" href="{{ route('spare_part_inventory.index') }}">Контроль наличия</a></li>@endif
  90. <li><a class="dropdown-item @if(($active ?? '') === 'pricing_codes') active @endif" href="{{ route('pricing_codes.index') }}">Справочник расшифровок</a></li>
  91. <li><a class="dropdown-item" href="{{ route('spare_parts.help') }}">Справка</a></li>
  92. </ul>
  93. </li>
  94. @endif
  95. <li class="nav-item dropdown">
  96. <a class="nav-link dropdown-toggle @if($stockActive) active @endif" href="#" role="button" data-bs-toggle="dropdown" aria-expanded="false">
  97. Склад наличие
  98. </a>
  99. <ul class="dropdown-menu">
  100. <li><a class="dropdown-item @if(($active ?? '') === 'stock') active @endif" href="{{ route('stock.index') }}">Наличие</a></li>
  101. <li><a class="dropdown-item @if(($active ?? '') === 'stock_orders') active @endif" href="{{ route('stock.orders') }}">Заказы</a></li>
  102. </ul>
  103. </li>
  104. <li class="nav-item">
  105. <a class="nav-link @if(($active ?? '') === 'common_catalog') active @endif" href="{{ route('common-catalog.index') }}">Каталог общий</a>
  106. </li>
  107. <li class="nav-item">
  108. <a class="nav-link @if(($active ?? '') === 'documents') active @endif" href="{{ route('documents.index') }}">Документация</a>
  109. </li>
  110. <li class="nav-item">
  111. <a class="nav-link @if(($active ?? '') === 'calculations') active @endif" href="{{ route('calculations.index') }}">Калькуляции</a>
  112. </li>
  113. @if(hasAnyPermission([
  114. 'contractors.view',
  115. 'contracts.view',
  116. 'users.view',
  117. 'admin.roles',
  118. 'admin.settings.view',
  119. 'districts.view',
  120. 'areas.view',
  121. 'admin.notification_logs.view',
  122. 'import.view',
  123. 'admin.year_data.view',
  124. 'admin.clear_data.view',
  125. ]))
  126. <li class="nav-item dropdown">
  127. <a class="nav-link dropdown-toggle @if($adminActive) active @endif" href="#" role="button" data-bs-toggle="dropdown" aria-expanded="false">
  128. Администратор
  129. </a>
  130. <ul class="dropdown-menu dropdown-menu-end">
  131. @if(hasPermission('contractors.view'))<li><a class="dropdown-item @if(($active ?? '') === 'contractors') active @endif" href="{{ route('contractors.index', session('gp_contractors')) }}">Подрядчики</a></li>@endif
  132. @if(hasPermission('contracts.view'))<li><a class="dropdown-item @if(($active ?? '') === 'contracts') active @endif" href="{{ route('contract.index', session('gp_contracts')) }}">Договоры</a></li>@endif
  133. @if(hasPermission('users.view'))<li><a class="dropdown-item @if(($active ?? '') === 'users') active @endif" href="{{ route('user.index', session('gp_users')) }}">Пользователи</a></li>@endif
  134. @if(hasPermission('admin.roles'))<li><a class="dropdown-item @if(($active ?? '') === 'roles') active @endif" href="{{ route('admin.roles.index') }}">Роли и права</a></li>@endif
  135. @if(hasPermission('admin.settings.view'))<li><a class="dropdown-item @if(($active ?? '') === 'admin_settings') active @endif" href="{{ route('admin.settings.index') }}">Настройки</a></li>@endif
  136. @if(hasPermission('districts.view'))<li><a class="dropdown-item @if(($active ?? '') === 'admin_districts') active @endif" href="{{ route('admin.district.index') }}">Округа</a></li>@endif
  137. @if(hasPermission('areas.view'))<li><a class="dropdown-item @if(($active ?? '') === 'admin_areas') active @endif" href="{{ route('admin.area.index') }}">Районы</a></li>@endif
  138. @if(hasPermission('admin.notification_logs.view'))<li><a class="dropdown-item @if(($active ?? '') === 'notification_logs') active @endif" href="{{ route('admin.notifications.log') }}">Журнал уведомлений</a></li>@endif
  139. @if(hasPermission('import.view'))<li><a class="dropdown-item @if(($active ?? '') === 'import') active @endif" href="{{ route('import.index', session('gp_import')) }}">Импорт</a></li>@endif
  140. @if(hasPermission('admin.year_data.view'))<li><a class="dropdown-item @if(($active ?? '') === 'year-data') active @endif" href="{{ route('year-data.index') }}">Экспорт/Импорт года</a></li>@endif
  141. @if(hasPermission('admin.clear_data.view'))<li><a class="dropdown-item @if(($active ?? '') === 'clear-data') active @endif" href="{{ route('clear-data.index') }}">Удалить данные</a></li>@endif
  142. </ul>
  143. </li>
  144. @endif
  145. @endif