menu.blade.php 10 KB

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