undefined - Initial Deployment
Browse files- README.md +7 -5
- index.html +1091 -18
README.md
CHANGED
|
@@ -1,10 +1,12 @@
|
|
| 1 |
---
|
| 2 |
-
title:
|
| 3 |
-
emoji:
|
| 4 |
-
colorFrom:
|
| 5 |
-
colorTo:
|
| 6 |
sdk: static
|
| 7 |
pinned: false
|
|
|
|
|
|
|
| 8 |
---
|
| 9 |
|
| 10 |
-
Check out the configuration reference at https://huggingface.co/docs/hub/spaces-config-reference
|
|
|
|
| 1 |
---
|
| 2 |
+
title: mgb
|
| 3 |
+
emoji: 🐳
|
| 4 |
+
colorFrom: pink
|
| 5 |
+
colorTo: yellow
|
| 6 |
sdk: static
|
| 7 |
pinned: false
|
| 8 |
+
tags:
|
| 9 |
+
- deepsite
|
| 10 |
---
|
| 11 |
|
| 12 |
+
Check out the configuration reference at https://huggingface.co/docs/hub/spaces-config-reference
|
index.html
CHANGED
|
@@ -1,19 +1,1092 @@
|
|
| 1 |
-
<!
|
| 2 |
-
<html>
|
| 3 |
-
|
| 4 |
-
|
| 5 |
-
|
| 6 |
-
|
| 7 |
-
|
| 8 |
-
|
| 9 |
-
|
| 10 |
-
|
| 11 |
-
|
| 12 |
-
|
| 13 |
-
|
| 14 |
-
|
| 15 |
-
|
| 16 |
-
|
| 17 |
-
|
| 18 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|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| 3 |
+
<head>
|
| 4 |
+
<meta charset="UTF-8" />
|
| 5 |
+
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
|
| 6 |
+
<title>Интерактивная панель заявок — Demo</title>
|
| 7 |
+
<link rel="icon" type="image/x-icon" href="/static/favicon.ico" />
|
| 8 |
+
<!-- Tailwind -->
|
| 9 |
+
<script src="https://cdn.tailwindcss.com"></script>
|
| 10 |
+
<!-- Feather icons -->
|
| 11 |
+
<script src="https://unpkg.com/feather-icons"></script>
|
| 12 |
+
<!-- AOS -->
|
| 13 |
+
<link href="https://unpkg.com/aos@2.3.1/dist/aos.css" rel="stylesheet" />
|
| 14 |
+
<script src="https://unpkg.com/aos@2.3.1/dist/aos.js"></script>
|
| 15 |
+
<!-- Leaflet -->
|
| 16 |
+
<link rel="stylesheet" href="https://unpkg.com/leaflet@1.9.3/dist/leaflet.css" />
|
| 17 |
+
<script src="https://unpkg.com/leaflet@1.9.3/dist/leaflet.js"></script>
|
| 18 |
+
<!-- Leaflet MarkerCluster -->
|
| 19 |
+
<link rel="stylesheet" href="https://unpkg.com/leaflet.markercluster@1.5.3/dist/MarkerCluster.css" />
|
| 20 |
+
<link rel="stylesheet" href="https://unpkg.com/leaflet.markercluster@1.5.3/dist/MarkerCluster.Default.css" />
|
| 21 |
+
<script src="https://unpkg.com/leaflet.markercluster@1.5.3/dist/leaflet.markercluster.js"></script>
|
| 22 |
+
<!-- SheetJS for Excel export -->
|
| 23 |
+
<script src="https://cdn.jsdelivr.net/npm/xlsx@0.18.5/dist/xlsx.full.min.js"></script>
|
| 24 |
+
<style>
|
| 25 |
+
.status-badge{padding:.125rem .5rem;border-radius:.5rem;font-size:.75rem;font-weight:600}
|
| 26 |
+
.status-new{background:#dbeafe;color:#1d4ed8}
|
| 27 |
+
.status-inprogress{background:#fef9c3;color:#92400e}
|
| 28 |
+
.status-completed{background:#dcfce7;color:#065f46}
|
| 29 |
+
.status-rejected{background:#fee2e2;color:#991b1b}
|
| 30 |
+
.toast{animation:slideIn .25s ease-out}
|
| 31 |
+
@keyframes slideIn{from{transform:translateX(120%);opacity:0}to{transform:translateX(0);opacity:1}}
|
| 32 |
+
.map-container{transition:all .3s ease}
|
| 33 |
+
.map-container:hover{box-shadow:0 10px 25px rgba(0,0,0,.1)}
|
| 34 |
+
|
| 35 |
+
/* Новые стили для синей темы */
|
| 36 |
+
.stat-card {
|
| 37 |
+
background: linear-gradient(135deg, #1e40af 0%, #2563eb 100%);
|
| 38 |
+
color: white;
|
| 39 |
+
border-radius: 1rem;
|
| 40 |
+
padding: 1.25rem;
|
| 41 |
+
box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
|
| 42 |
+
}
|
| 43 |
+
.nav-link.active {
|
| 44 |
+
background-color: #dbeafe;
|
| 45 |
+
color: #1e40af;
|
| 46 |
+
font-weight: 600;
|
| 47 |
+
}
|
| 48 |
+
.nav-link.active i {
|
| 49 |
+
color: #1e40af;
|
| 50 |
+
}
|
| 51 |
+
.btn-primary {
|
| 52 |
+
background-color: #2563eb;
|
| 53 |
+
color: white;
|
| 54 |
+
transition: all 0.2s;
|
| 55 |
+
}
|
| 56 |
+
.btn-primary:hover {
|
| 57 |
+
background-color: #1e40af;
|
| 58 |
+
}
|
| 59 |
+
.sidebar-header {
|
| 60 |
+
background: linear-gradient(135deg, #1e40af 0%, #2563eb 100%);
|
| 61 |
+
color: white;
|
| 62 |
+
padding: 1rem;
|
| 63 |
+
border-radius: 1rem 1rem 0 0;
|
| 64 |
+
}
|
| 65 |
+
</style>
|
| 66 |
+
</head>
|
| 67 |
+
<body class="bg-gray-50 min-h-screen">
|
| 68 |
+
<!-- Topbar -->
|
| 69 |
+
<header class="sticky top-0 z-40 bg-white border-b">
|
| 70 |
+
<div class="max-w-7xl mx-auto px-4 py-3 flex items-center justify-between">
|
| 71 |
+
<div class="flex items-center gap-3">
|
| 72 |
+
<button id="btnToggleSidebar" class="p-2 rounded-xl hover:bg-gray-100" aria-label="Меню">
|
| 73 |
+
<i data-feather="menu"></i>
|
| 74 |
+
</button>
|
| 75 |
+
<h1 class="text-xl font-semibold">Панель заявок</h1>
|
| 76 |
+
<span id="onlineIndicator" class="ml-3 px-2 py-1 rounded-full text-xs bg-green-100 text-green-700 hidden">Онлайн</span>
|
| 77 |
+
<span id="offlineIndicator" class="ml-3 px-2 py-1 rounded-full text-xs bg-yellow-100 text-yellow-700 hidden">Оффлайн</span>
|
| 78 |
+
</div>
|
| 79 |
+
<div class="flex items-center gap-3">
|
| 80 |
+
<button id="btnNotifications" class="relative p-2 rounded-xl hover:bg-gray-100">
|
| 81 |
+
<i data-feather="bell"></i>
|
| 82 |
+
<span id="notifDot" class="absolute -top-1 -right-1 w-2 h-2 rounded-full bg-red-500 hidden"></span>
|
| 83 |
+
</button>
|
| 84 |
+
<div class="flex items-center gap-2">
|
| 85 |
+
<div id="currentUserEmail" class="text-sm text-gray-600"></div>
|
| 86 |
+
<button id="btnLogout" class="text-sm text-gray-500 hover:text-gray-800">Выйти</button>
|
| 87 |
+
</div>
|
| 88 |
+
</div>
|
| 89 |
+
</div>
|
| 90 |
+
</header>
|
| 91 |
+
|
| 92 |
+
<!-- Layout -->
|
| 93 |
+
<div class="max-w-7xl mx-auto px-4 py-6 grid grid-cols-12 gap-6" id="appRoot">
|
| 94 |
+
<!-- Sidebar -->
|
| 95 |
+
<aside id="sidebar" class="col-span-12 md:col-span-3 lg:col-span-2 space-y-2 transition-all">
|
| 96 |
+
<nav class="bg-white rounded-2xl shadow overflow-hidden">
|
| 97 |
+
<div class="sidebar-header">
|
| 98 |
+
<h2 class="font-bold text-lg">Главная панель</h2>
|
| 99 |
+
</div>
|
| 100 |
+
<div class="p-3">
|
| 101 |
+
<button class="nav-link w-full text-left px-3 py-2 rounded-xl hover:bg-blue-50 text-blue-700" data-target="dashboard">
|
| 102 |
+
<i data-feather="activity" class="inline w-4 mr-2"></i>Дашборд
|
| 103 |
+
</button>
|
| 104 |
+
<button class="nav-link w-full text-left px-3 py-2 rounded-xl hover:bg-blue-50" data-target="registry">
|
| 105 |
+
<i data-feather="list" class="inline w-4 mr-2"></i>Реестр заявок
|
| 106 |
+
</button>
|
| 107 |
+
<button class="nav-link w-full text-left px-3 py-2 rounded-xl hover:bg-blue-50" data-target="tc">
|
| 108 |
+
<i data-feather="package" class="inline w-4 mr-2"></i>Танк‑контейнеры
|
| 109 |
+
</button>
|
| 110 |
+
<button class="nav-link w-full text-left px-3 py-2 rounded-xl hover:bg-blue-50" data-target="act">
|
| 111 |
+
<i data-feather="file-text" class="inline w-4 mr-2"></i>Акт обследования
|
| 112 |
+
</button>
|
| 113 |
+
<button class="nav-link w-full text-left px-3 py-2 rounded-xl hover:bg-blue-50" data-target="dicts">
|
| 114 |
+
<i data-feather="book" class="inline w-4 mr-2"></i>Справочники
|
| 115 |
+
</button>
|
| 116 |
+
<button class="nav-link w-full text-left px-3 py-2 rounded-xl hover:bg-blue-50" data-target="log">
|
| 117 |
+
<i data-feather="clock" class="inline w-4 mr-2"></i>Журнал действий
|
| 118 |
+
</button>
|
| 119 |
+
<button class="nav-link w-full text-left px-3 py-2 rounded-xl hover:bg-blue-50" data-target="settings">
|
| 120 |
+
<i data-feather="settings" class="inline w-4 mr-2"></i>Настройки
|
| 121 |
+
</button>
|
| 122 |
+
</div>
|
| 123 |
+
</nav>
|
| 124 |
+
|
| 125 |
+
<!-- Import/Export -->
|
| 126 |
+
<div class="bg-white rounded-2xl shadow overflow-hidden">
|
| 127 |
+
<div class="sidebar-header">
|
| 128 |
+
<h3 class="font-semibold">Импорт/Экспорт</h3>
|
| 129 |
+
</div>
|
| 130 |
+
<div class="p-4 flex flex-col gap-2">
|
| 131 |
+
<input type="file" id="importJson" accept="application/json" class="block w-full text-sm" />
|
| 132 |
+
<button id="btnExportJSON" class="px-3 py-2 text-sm rounded-xl btn-primary">Экспорт JSON</button>
|
| 133 |
+
<button id="btnExportExcel" class="px-3 py-2 text-sm rounded-xl btn-primary">Экспорт Excel</button>
|
| 134 |
+
</div>
|
| 135 |
+
</div>
|
| 136 |
+
</aside>
|
| 137 |
+
|
| 138 |
+
<!-- Main content -->
|
| 139 |
+
<main class="col-span-12 md:col-span-9 lg:col-span-10 space-y-6">
|
| 140 |
+
<!-- Dashboard -->
|
| 141 |
+
<section id="screen-dashboard" class="screen hidden">
|
| 142 |
+
<div class="grid grid-cols-1 md:grid-cols-2 xl:grid-cols-4 gap-4">
|
| 143 |
+
<div class="stat-card">
|
| 144 |
+
<div class="text-blue-100">Всего заявок</div>
|
| 145 |
+
<div id="statNew" class="text-3xl font-semibold">5</div>
|
| 146 |
+
<div class="text-sm text-blue-200 mt-1">+2.5% с прошлой недели</div>
|
| 147 |
+
</div>
|
| 148 |
+
<div class="stat-card">
|
| 149 |
+
<div class="text-blue-100">В работе</div>
|
| 150 |
+
<div id="statInProgress" class="text-3xl font-semibold">2</div>
|
| 151 |
+
<div class="text-sm text-blue-200 mt-1">-1.2% с прошлой недели</div>
|
| 152 |
+
</div>
|
| 153 |
+
<div class="stat-card">
|
| 154 |
+
<div class="text-blue-100">Завершено</div>
|
| 155 |
+
<div id="statCompleted" class="text-3xl font-semibold">1</div>
|
| 156 |
+
<div class="text-sm text-blue-200 mt-1">+5.3% с прошлой недели</div>
|
| 157 |
+
</div>
|
| 158 |
+
<div class="stat-card">
|
| 159 |
+
<div class="text-blue-100">Танк-контейнеров</div>
|
| 160 |
+
<div id="statTotal" class="text-3xl font-semibold">4</div>
|
| 161 |
+
<div class="text-sm text-blue-200 mt-1">+8.7% с прошлого месяца</div>
|
| 162 |
+
</div>
|
| 163 |
+
</div>
|
| 164 |
+
|
| 165 |
+
<!-- Map -->
|
| 166 |
+
<div class="mt-6 p-4 bg-white rounded-3xl shadow map-container" data-aos="fade-up">
|
| 167 |
+
<div class="flex items-center justify-between mb-3">
|
| 168 |
+
<h3 class="font-semibold">Карта заявок</h3>
|
| 169 |
+
<div class="text-sm flex gap-2">
|
| 170 |
+
<label class="flex items-center gap-1"><input type="checkbox" id="toggleLayerNew" checked /> Новые</label>
|
| 171 |
+
<label class="flex items-center gap-1"><input type="checkbox" id="toggleLayerCompleted" checked /> Завершённые</label>
|
| 172 |
+
</div>
|
| 173 |
+
</div>
|
| 174 |
+
<!-- Уменьшили высоту карты с 420px до 300px -->
|
| 175 |
+
<div id="map" class="h-[300px] w-full rounded-2xl"></div>
|
| 176 |
+
</div>
|
| 177 |
+
|
| 178 |
+
<!-- Notifications panel -->
|
| 179 |
+
<div class="bg-white rounded-2xl shadow p-4">
|
| 180 |
+
<div class="flex items-center justify-between mb-3">
|
| 181 |
+
<h3 class="font-semibold">Уведомления</h3>
|
| 182 |
+
<button id="btnClearNotifs" class="text-sm text-blue-600 hover:text-blue-800">Очистить</button>
|
| 183 |
+
</div>
|
| 184 |
+
<ul id="notifList" class="space-y-2 text-sm"></ul>
|
| 185 |
+
</div>
|
| 186 |
+
</section>
|
| 187 |
+
|
| 188 |
+
<!-- Registry -->
|
| 189 |
+
<section id="screen-registry" class="screen hidden">
|
| 190 |
+
<div class="bg-white rounded-2xl shadow p-4">
|
| 191 |
+
<div class="flex flex-wrap items-end gap-3">
|
| 192 |
+
<div class="grow">
|
| 193 |
+
<label class="text-xs text-gray-500">Поиск</label>
|
| 194 |
+
<input id="searchInput" class="w-full border rounded-xl px-3 py-2" placeholder="Организация / Номер / Адрес" />
|
| 195 |
+
</div>
|
| 196 |
+
<div>
|
| 197 |
+
<label class="text-xs text-gray-500">Статус</label>
|
| 198 |
+
<select id="filterStatus" class="border rounded-xl px-3 py-2">
|
| 199 |
+
<option value="">Все</option>
|
| 200 |
+
<option value="new">Новая</option>
|
| 201 |
+
<option value="in-progress">В работе</option>
|
| 202 |
+
<option value="completed">Завершена</option>
|
| 203 |
+
<option value="rejected">Отменена</option>
|
| 204 |
+
</select>
|
| 205 |
+
</div>
|
| 206 |
+
<div>
|
| 207 |
+
<label class="text-xs text-gray-500">Регион</label>
|
| 208 |
+
<select id="filterRegion" class="border rounded-xl px-3 py-2">
|
| 209 |
+
<option value="">Все</option>
|
| 210 |
+
</select>
|
| 211 |
+
</div>
|
| 212 |
+
<button id="btnAddRequest" class="px-4 py-2 rounded-xl btn-primary"><i data-feather="plus" class="inline w-4 mr-1"></i>Добавить</button>
|
| 213 |
+
</div>
|
| 214 |
+
|
| 215 |
+
<div class="mt-4 overflow-x-auto">
|
| 216 |
+
<table class="min-w-full">
|
| 217 |
+
<thead>
|
| 218 |
+
<tr class="text-left text-xs uppercase text-gray-500 bg-blue-50">
|
| 219 |
+
<th class="p-2">#</th>
|
| 220 |
+
<th class="p-2">Дата</th>
|
| 221 |
+
<th class="p-2">Номер</th>
|
| 222 |
+
<th class="p-2">Организация</th>
|
| 223 |
+
<th class="p-2">Адрес</th>
|
| 224 |
+
<th class="p-2">ТК</th>
|
| 225 |
+
<th class="p-2">Регион</th>
|
| 226 |
+
<th class="p-2">Статус</th>
|
| 227 |
+
<th class="p-2">Действия</th>
|
| 228 |
+
</tr>
|
| 229 |
+
</thead>
|
| 230 |
+
<tbody id="registryTbody" class="text-sm"></tbody>
|
| 231 |
+
</table>
|
| 232 |
+
</div>
|
| 233 |
+
</div>
|
| 234 |
+
</section>
|
| 235 |
+
|
| 236 |
+
<!-- TC characteristics -->
|
| 237 |
+
<section id="screen-tc" class="screen hidden">
|
| 238 |
+
<div class="bg-white rounded-2xl shadow p-4">
|
| 239 |
+
<div class="flex items-center justify-between mb-3">
|
| 240 |
+
<h3 class="font-semibold">Характеристики танк‑контейнера</h3>
|
| 241 |
+
<div class="text-sm flex gap-2 items-center">
|
| 242 |
+
<span>Статус карточки:</span>
|
| 243 |
+
<select id="tcStatus" class="border rounded-xl px-2 py-1">
|
| 244 |
+
<option value="draft">Формируется</option>
|
| 245 |
+
<option value="review">На проверке</option>
|
| 246 |
+
<option value="approved">Проверен</option>
|
| 247 |
+
</select>
|
| 248 |
+
<button id="btnSendTcForReview" class="px-3 py-2 rounded-xl btn-primary">Отправить на проверку</button>
|
| 249 |
+
</div>
|
| 250 |
+
</div>
|
| 251 |
+
|
| 252 |
+
<form id="tcForm" class="grid grid-cols-1 md:grid-cols-2 gap-4">
|
| 253 |
+
<!-- Left column: numbers/dates -->
|
| 254 |
+
<div class="space-y-3">
|
| 255 |
+
<div>
|
| 256 |
+
<label class="text-xs text-gray-500">Заводской номер</label>
|
| 257 |
+
<input id="tcSerial" class="w-full border rounded-xl px-3 py-2" placeholder="Напр. FV 17056940" />
|
| 258 |
+
</div>
|
| 259 |
+
<div class="grid grid-cols-2 gap-3">
|
| 260 |
+
<div>
|
| 261 |
+
<label class="text-xs text-gray-500">Мин. доп. толщина днища</label>
|
| 262 |
+
<input id="tcMinFloor" type="number" step="0.01" class="w-full border rounded-xl px-3 py-2" />
|
| 263 |
+
</div>
|
| 264 |
+
<div>
|
| 265 |
+
<label class="text-xs text-gray-500">Мин. замер. толщина днища</label>
|
| 266 |
+
<input id="tcMeasFloor" type="number" step="0.01" class="w-full border rounded-xl px-3 py-2" />
|
| 267 |
+
</div>
|
| 268 |
+
</div>
|
| 269 |
+
<div class="grid grid-cols-2 gap-3">
|
| 270 |
+
<div>
|
| 271 |
+
<label class="text-xs text-gray-500">Номинал толщины обечайки</label>
|
| 272 |
+
<input id="tcNomCyl" type="number" step="0.01" class="w-full border rounded-xl px-3 py-2" />
|
| 273 |
+
</div>
|
| 274 |
+
<div>
|
| 275 |
+
<label class="text-xs text-gray-500">Мин. доп. толщина обечайки</label>
|
| 276 |
+
<input id="tcMinCyl" type="number" step="0.01" class="w-full border rounded-xl px-3 py-2" />
|
| 277 |
+
</div>
|
| 278 |
+
</div>
|
| 279 |
+
<div class="grid grid-cols-2 gap-3">
|
| 280 |
+
<div>
|
| 281 |
+
<label class="text-xs text-gray-500">МДРД сосуда (МПа)</label>
|
| 282 |
+
<input id="tcMdrcVessel" type="number" step="0.01" class="w-full border rounded-xl px-3 py-2" />
|
| 283 |
+
</div>
|
| 284 |
+
<div>
|
| 285 |
+
<label class="text-xs text-gray-500">МДРД пароподогревателя (МПа)</label>
|
| 286 |
+
<input id="tcMdrcHeater" type="number" step="0.01" class="w-full border rounded-xl px-3 py-2" />
|
| 287 |
+
</div>
|
| 288 |
+
</div>
|
| 289 |
+
<div class="grid grid-cols-2 gap-3">
|
| 290 |
+
<div>
|
| 291 |
+
<label class="text-xs text-gray-500">Давление испытаний сосуда</label>
|
| 292 |
+
<input id="tcTestPressV" type="number" step="0.01" class="w-full border rounded-xl px-3 py-2" />
|
| 293 |
+
</div>
|
| 294 |
+
<div>
|
| 295 |
+
<label class="text-xs text-gray-500">Давление испытаний пароподогревателя</label>
|
| 296 |
+
<input id="tcTestPressH" type="number" step="0.01" class="w-full border rounded-xl px-3 py-2" />
|
| 297 |
+
</div>
|
| 298 |
+
</div>
|
| 299 |
+
<div>
|
| 300 |
+
<label class="text-xs text-gray-500">Дата испытаний на прочность</label>
|
| 301 |
+
<input id="tcTestDate" type="date" class="w-full border rounded-xl px-3 py-2" />
|
| 302 |
+
</div>
|
| 303 |
+
</div>
|
| 304 |
+
|
| 305 |
+
<!-- Right column: equipment block -->
|
| 306 |
+
<div class="space-y-3">
|
| 307 |
+
<div class="grid grid-cols-2 gap-3">
|
| 308 |
+
<div>
|
| 309 |
+
<label class="text-xs text-gray-500">Верхний слив</label>
|
| 310 |
+
<select id="tcTopDrain" class="w-full border rounded-xl px-3 py-2"><option>Ок</option><option>Отсутствует</option></select>
|
| 311 |
+
</div>
|
| 312 |
+
<div>
|
| 313 |
+
<label class="text-xs text-gray-500">Нижний слив</label>
|
| 314 |
+
<select id="tcBottomDrain" class="w-full border rounded-xl px-3 py-2"><option>Ок</option><option>Отсутствует</option></select>
|
| 315 |
+
</div>
|
| 316 |
+
</div>
|
| 317 |
+
<div>
|
| 318 |
+
<label class="text-xs text-gray-500">Клапан предохранительный №</label>
|
| 319 |
+
<input id="tcReliefValveNo" class="w-full border rounded-xl px-3 py-2" placeholder="Напр. FV 17056940" />
|
| 320 |
+
</div>
|
| 321 |
+
<div class="grid grid-cols-2 gap-3">
|
| 322 |
+
<div>
|
| 323 |
+
<label class="text-xs text-gray-500">Кол-во пред. клапанов</label>
|
| 324 |
+
<input id="tcReliefCount" type="number" class="w-full border rounded-xl px-3 py-2" />
|
| 325 |
+
</div>
|
| 326 |
+
<div>
|
| 327 |
+
<label class="text-xs text-gray-500">Давл. открытия (МПа)</label>
|
| 328 |
+
<input id="tcReliefOpenP" type="text" class="w-full border rounded-xl px-3 py-2" placeholder="0,43/-0,20" />
|
| 329 |
+
</div>
|
| 330 |
+
</div>
|
| 331 |
+
<div class="grid grid-cols-2 gap-3">
|
| 332 |
+
<div>
|
| 333 |
+
<label class="text-xs text-gray-500">Разрывные мембраны, кол-во</label>
|
| 334 |
+
<input id="tcBurstCount" type="number" class="w-full border rounded-xl px-3 py-2" />
|
| 335 |
+
</div>
|
| 336 |
+
<div>
|
| 337 |
+
<label class="text-xs text-gray-500">Производитель П/К</label>
|
| 338 |
+
<input id="tcReliefMaker" class="w-full border rounded-xl px-3 py-2" placeholder="FV" />
|
| 339 |
+
</div>
|
| 340 |
+
</div>
|
| 341 |
+
<div class="grid grid-cols-2 gap-3">
|
| 342 |
+
<div>
|
| 343 |
+
<label class="text-xs text-gray-500">Солнцезащитный экран</label>
|
| 344 |
+
<select id="tcSunShield" class="w-full border rounded-xl px-3 py-2"><option>—</option><option>Да</option><option>Нет</option></select>
|
| 345 |
+
</div>
|
| 346 |
+
<div>
|
| 347 |
+
<label class="text-xs text-gray-500">Уровнемер</label>
|
| 348 |
+
<select id="tcLevelGauge" class="w-full border rounded-xl px-3 py-2"><option>—</option><option>Да</option><option>Нет</option></select>
|
| 349 |
+
</div>
|
| 350 |
+
</div>
|
| 351 |
+
<div>
|
| 352 |
+
<button id="btnSaveTc" type="button" class="px-4 py-2 rounded-xl btn-primary">Сохранить</button>
|
| 353 |
+
</div>
|
| 354 |
+
</div>
|
| 355 |
+
</form>
|
| 356 |
+
</div>
|
| 357 |
+
</section>
|
| 358 |
+
|
| 359 |
+
<!-- Act form -->
|
| 360 |
+
<section id="screen-act" class="screen hidden">
|
| 361 |
+
<div class="bg-white rounded-2xl shadow p-4">
|
| 362 |
+
<div class="flex items-center justify-between mb-3">
|
| 363 |
+
<h3 class="font-semibold">Акт обследования</h3>
|
| 364 |
+
<div class="flex gap-2">
|
| 365 |
+
<label class="flex items-center gap-1 text-sm"><input type="checkbox" id="signInspector" /> Подписано инспектором</label>
|
| 366 |
+
<label class="flex items-center gap-1 text-sm"><input type="checkbox" id="signDepot" /> Подписано депо</label>
|
| 367 |
+
<button id="btnPrintAct" class="px-3 py-2 rounded-xl bg-gray-100 hover:bg-gray-200">Печать</button>
|
| 368 |
+
</div>
|
| 369 |
+
</div>
|
| 370 |
+
<form id="actForm" class="grid grid-cols-1 md:grid-cols-2 gap-4">
|
| 371 |
+
<div>
|
| 372 |
+
<label class="text-xs text-gray-500">№ Акта</label>
|
| 373 |
+
<input id="actNumber" class="w-full border rounded-xl px-3 py-2" required />
|
| 374 |
+
</div>
|
| 375 |
+
<div>
|
| 376 |
+
<label class="text-xs text-gray-500">Место составления акта</label>
|
| 377 |
+
<input id="actPlace" class="w-full border rounded-xl px-3 py-2" required />
|
| 378 |
+
</div>
|
| 379 |
+
<div>
|
| 380 |
+
<label class="text-xs text-gray-500">Дата обследования</label>
|
| 381 |
+
<input id="actDate" type="date" class="w-full border rounded-xl px-3 py-2" required />
|
| 382 |
+
</div>
|
| 383 |
+
<div>
|
| 384 |
+
<label class="text-xs text-gray-500">Время начала</label>
|
| 385 |
+
<input id="actTime" type="time" class="w-full border rounded-xl px-3 py-2" required />
|
| 386 |
+
</div>
|
| 387 |
+
<div class="md:col-span-2">
|
| 388 |
+
<label class="text-xs text-gray-500">Основания для проведения обследования</label>
|
| 389 |
+
<input id="actReason" class="w-full border rounded-xl px-3 py-2" required />
|
| 390 |
+
</div>
|
| 391 |
+
<div>
|
| 392 |
+
<label class="text-xs text-gray-500">Номер контейнера</label>
|
| 393 |
+
<input id="actContainerNo" class="w-full border rounded-xl px-3 py-2" required />
|
| 394 |
+
</div>
|
| 395 |
+
<div>
|
| 396 |
+
<label class="text-xs text-gray-500">Заводской номер контейнера</label>
|
| 397 |
+
<input id="actSerialNo" class="w-full border rounded-xl px-3 py-2" required />
|
| 398 |
+
</div>
|
| 399 |
+
<div>
|
| 400 |
+
<label class="text-xs text-gray-500">Акт составлен (ФИО, должность)</label>
|
| 401 |
+
<input id="actAuthor" class="w-full border rounded-xl px-3 py-2" required />
|
| 402 |
+
</div>
|
| 403 |
+
<div>
|
| 404 |
+
<label class="text-xs text-gray-500">Представитель депо (ФИО, должность)</label>
|
| 405 |
+
<input id="actDepotRep" class="w-full border rounded-xl px-3 py-2" required />
|
| 406 |
+
</div>
|
| 407 |
+
<div class="md:col-span-2">
|
| 408 |
+
<label class="text-xs text-gray-500">1.1 Визуальный осмотр</label>
|
| 409 |
+
<textarea id="actInspect1" class="w-full border rounded-xl px-3 py-2" rows="2" placeholder="Несущая конструкция, изоляция, наружная поверхность..." required></textarea>
|
| 410 |
+
</div>
|
| 411 |
+
<div class="md:col-span-2">
|
| 412 |
+
<label class="text-xs text-gray-500">1.2 Неразрушающий контроль швов</label>
|
| 413 |
+
<textarea id="actInspect2" class="w-full border rounded-xl px-3 py-2" rows="2" required></textarea>
|
| 414 |
+
</div>
|
| 415 |
+
<div class="grid grid-cols-2 gap-3 md:col-span-2">
|
| 416 |
+
<div>
|
| 417 |
+
<label class="text-xs text-gray-500">1.3 Мин. толщина днища (мм)</label>
|
| 418 |
+
<input id="actTminFloor" type="number" step="0.01" class="w-full border rounded-xl px-3 py-2" />
|
| 419 |
+
</div>
|
| 420 |
+
<div>
|
| 421 |
+
<label class="text-xs text-gray-500">1.3 Мин. толщина обечайки (мм)</label>
|
| 422 |
+
<input id="actTminCyl" type="number" step="0.01" class="w-full border rounded-xl px-3 py-2" />
|
| 423 |
+
</div>
|
| 424 |
+
</div>
|
| 425 |
+
<div class="md:col-span-2">
|
| 426 |
+
<label class="text-xs text-gray-500">1.4–1.7 Оборудование/клапаны/мембраны/маркировка</label>
|
| 427 |
+
<textarea id="actEquip" class="w-full border rounded-xl px-3 py-2" rows="2" required></textarea>
|
| 428 |
+
</div>
|
| 429 |
+
<div class="grid grid-cols-3 gap-3 md:col-span-2">
|
| 430 |
+
<div>
|
| 431 |
+
<label class="text-xs text-gray-500">1.8 Давление (МПа)</label>
|
| 432 |
+
<input id="actPtest" type="number" step="0.01" class="w-full border rounded-xl px-3 py-2" />
|
| 433 |
+
</div>
|
| 434 |
+
<div>
|
| 435 |
+
<label class="text-xs text-gray-500">1.8 Дата</label>
|
| 436 |
+
<input id="actPtestDate" type="date" class="w-full border rounded-xl px-3 py-2" />
|
| 437 |
+
</div>
|
| 438 |
+
<div>
|
| 439 |
+
<label class="text-xs text-gray-500">1.9 Давление пароподогрева</label>
|
| 440 |
+
<input id="actPsteam" type="number" step="0.01" class="w-full border rounded-xl px-3 py-2" />
|
| 441 |
+
</div>
|
| 442 |
+
</div>
|
| 443 |
+
<div class="md:col-span-2 flex gap-2">
|
| 444 |
+
<button id="btnSaveAct" type="button" class="px-4 py-2 rounded-xl btn-primary">Сохранить</button>
|
| 445 |
+
<button id="btnResetAct" type="button" class="px-4 py-2 rounded-xl bg-gray-100 hover:bg-gray-200">Очистить</button>
|
| 446 |
+
</div>
|
| 447 |
+
</form>
|
| 448 |
+
</div>
|
| 449 |
+
</section>
|
| 450 |
+
|
| 451 |
+
<!-- Dictionaries -->
|
| 452 |
+
<section id="screen-dicts" class="screen hidden">
|
| 453 |
+
<div class="bg-white rounded-2xl shadow p-4">
|
| 454 |
+
<h3 class="font-semibold mb-3">Справочники</h3>
|
| 455 |
+
<div class="grid md:grid-cols-3 gap-4">
|
| 456 |
+
<div>
|
| 457 |
+
<div class="flex items-center justify-between mb-2"><div class="font-medium">Компании</div><button class="text-sm text-blue-600" data-add-dict="companies">Добавить</button></div>
|
| 458 |
+
<ul id="dictCompanies" class="text-sm space-y-1"></ul>
|
| 459 |
+
</div>
|
| 460 |
+
<div>
|
| 461 |
+
<div class="flex items-center justify-between mb-2"><div class="font-medium">Адреса</div><button class="text-sm text-blue-600" data-add-dict="addresses">Добавить</button></div>
|
| 462 |
+
<ul id="dictAddresses" class="text-sm space-y-1"></ul>
|
| 463 |
+
</div>
|
| 464 |
+
<div>
|
| 465 |
+
<div class="flex items-center justify-between mb-2"><div class="font-medium">Инспекторы</div><button class="text-sm text-blue-600" data-add-dict="inspectors">Добавить</button></div>
|
| 466 |
+
<ul id="dictInspectors" class="text-sm space-y-1"></ul>
|
| 467 |
+
</div>
|
| 468 |
+
</div>
|
| 469 |
+
</div>
|
| 470 |
+
</section>
|
| 471 |
+
|
| 472 |
+
<!-- Action log -->
|
| 473 |
+
<section id="screen-log" class="screen hidden">
|
| 474 |
+
<div class="bg-white rounded-2xl shadow p-4">
|
| 475 |
+
<div class="flex items-center justify-between mb-3">
|
| 476 |
+
<h3 class="font-semibold">Журнал действий</h3>
|
| 477 |
+
<button id="btnClearLog" class="text-sm text-blue-600 hover:text-blue-800">Очистить</button>
|
| 478 |
+
</div>
|
| 479 |
+
<ul id="logList" class="text-sm space-y-1"></ul>
|
| 480 |
+
</div>
|
| 481 |
+
</section>
|
| 482 |
+
|
| 483 |
+
<!-- Settings -->
|
| 484 |
+
<section id="screen-settings" class="screen hidden">
|
| 485 |
+
<div class="bg-white rounded-2xl shadow p-4">
|
| 486 |
+
<h3 class="font-semibold mb-3">Настройки</h3>
|
| 487 |
+
<div class="space-y-3">
|
| 488 |
+
<div>Версия демо: <span id="appVersion" class="font-mono"></span></div>
|
| 489 |
+
<div>Роль: <span id="userRoleLabel" class="font-semibold"></span></div>
|
| 490 |
+
</div>
|
| 491 |
+
</div>
|
| 492 |
+
</section>
|
| 493 |
+
</main>
|
| 494 |
+
</div>
|
| 495 |
+
|
| 496 |
+
<!-- Floating toasts -->
|
| 497 |
+
<div id="toastArea" class="fixed right-4 top-16 space-y-2 z-50"></div>
|
| 498 |
+
|
| 499 |
+
<!-- Login overlay (shown when not authenticated) -->
|
| 500 |
+
<div id="loginOverlay" class="fixed inset-0 bg-gradient-to-br from-blue-100 via-indigo-100 to-pink-100 flex items-center justify-center p-4 hidden">
|
| 501 |
+
<!-- Убрали правую колонку с информацией по проекту, оставили только форму входа -->
|
| 502 |
+
<div class="w-full max-w-md">
|
| 503 |
+
<!-- LEFT: Login form (не трогаем логику входа) -->
|
| 504 |
+
<div class="bg-white rounded-3xl shadow-xl p-8">
|
| 505 |
+
<h2 class="text-center mb-4 font-bold text-2xl text-blue-700">Вход в систему</h2>
|
| 506 |
+
<form id="loginForm" class="space-y-3">
|
| 507 |
+
<input type="email" id="loginEmail" class="w-full border rounded-2xl px-4 py-3" placeholder="Логин (email)" required />
|
| 508 |
+
<input type="password" id="loginPassword" class="w-full border rounded-2xl px-4 py-3" placeholder="Пароль" required />
|
| 509 |
+
<div class="text-xs text-gray-500">Демо-логин: <b>kuxtenko82@inbox.ru</b> Пароль: <b>irik2005</b></div>
|
| 510 |
+
<button type="submit" class="w-full py-3 rounded-2xl btn-primary">Войти</button>
|
| 511 |
+
</form>
|
| 512 |
+
</div>
|
| 513 |
+
</div>
|
| 514 |
+
</div>
|
| 515 |
+
|
| 516 |
+
<!-- Modal Add/Edit Request -->
|
| 517 |
+
<div id="modalRequest" class="fixed inset-0 bg-black/30 items-center justify-center hidden z-50">
|
| 518 |
+
<div class="bg-white w-full max-w-3xl rounded-2xl shadow-xl p-6">
|
| 519 |
+
<div class="flex items-center justify-between mb-3">
|
| 520 |
+
<h3 id="modalRequestTitle" class="font-semibold">Заявка</h3>
|
| 521 |
+
<button id="btnCloseModalRequest" class="p-2 hover:bg-gray-100 rounded-xl"><i data-feather="x"></i></button>
|
| 522 |
+
</div>
|
| 523 |
+
<form id="requestForm" class="grid grid-cols-1 md:grid-cols-2 gap-4">
|
| 524 |
+
<div>
|
| 525 |
+
<label class="text-xs text-gray-500">Заявитель / Компания</label>
|
| 526 |
+
<div class="flex gap-2">
|
| 527 |
+
<input id="reqCompany" class="w-full border rounded-xl px-3 py-2" list="listCompanies" required />
|
| 528 |
+
<button type="button" class="px-3 py-2 rounded-xl bg-gray-100 hover:bg-gray-200" data-add-dict="companies"><i data-feather="plus"></i></button>
|
| 529 |
+
</div>
|
| 530 |
+
<datalist id="listCompanies"></datalist>
|
| 531 |
+
</div>
|
| 532 |
+
<div>
|
| 533 |
+
<label class="text-xs text-gray-500">Дата заявки</label>
|
| 534 |
+
<input id="reqDate" type="date" class="w-full border rounded-xl px-3 py-2" required />
|
| 535 |
+
</div>
|
| 536 |
+
<div>
|
| 537 |
+
<label class="text-xs text-gray-500">Номер заявки</label>
|
| 538 |
+
<input id="reqNumber" class="w-full border rounded-xl px-3 py-2" required />
|
| 539 |
+
</div>
|
| 540 |
+
<div>
|
| 541 |
+
<label class="text-xs text-gray-500">Место оказания услуг (адрес)</label>
|
| 542 |
+
<div class="flex gap-2">
|
| 543 |
+
<input id="reqAddress" class="w-full border rounded-xl px-3 py-2" list="listAddresses" required />
|
| 544 |
+
<button type="button" class="px-3 py-2 rounded-xl bg-gray-100 hover:bg-gray-200" data-add-dict="addresses"><i data-feather="plus"></i></button>
|
| 545 |
+
</div>
|
| 546 |
+
<datalist id="listAddresses"></datalist>
|
| 547 |
+
</div>
|
| 548 |
+
<div>
|
| 549 |
+
<label class="text-xs text-gray-500">Количество ТК</label>
|
| 550 |
+
<input id="reqTcCount" type="number" min="1" class="w-full border rounded-xl px-3 py-2" required />
|
| 551 |
+
</div>
|
| 552 |
+
<div>
|
| 553 |
+
<label class="text-xs text-gray-500">Сроки предоставления услуги</label>
|
| 554 |
+
<input id="reqServiceDates" class="w-full border rounded-xl px-3 py-2" placeholder="ДД.ММ.ГГГГ–ДД.ММ.ГГГГ" />
|
| 555 |
+
</div>
|
| 556 |
+
<div>
|
| 557 |
+
<label class="text-xs text-gray-500">Регион</label>
|
| 558 |
+
<select id="reqRegion" class="w-full border rounded-xl px-3 py-2" required></select>
|
| 559 |
+
</div>
|
| 560 |
+
<div>
|
| 561 |
+
<label class="text-xs text-gray-500">Инспекторы (можно несколько)</label>
|
| 562 |
+
<select id="reqInspectors" class="w-full border rounded-xl px-3 py-2" multiple size="3"></select>
|
| 563 |
+
</div>
|
| 564 |
+
<div class="md:col-span-2">
|
| 565 |
+
<label class="text-xs text-gray-500">Документы (загрузка)</label>
|
| 566 |
+
<input id="reqDocs" type="file" multiple class="block w-full" />
|
| 567 |
+
</div>
|
| 568 |
+
<div class="md:col-span-2">
|
| 569 |
+
<label class="text-xs text-gray-500">Счета</label>
|
| 570 |
+
<div id="invoiceArea" class="space-y-2"></div>
|
| 571 |
+
<button type="button" id="btnAddInvoice" class="mt-2 px-3 py-2 rounded-xl bg-gray-100 hover:bg-gray-200">Добавить счёт</button>
|
| 572 |
+
</div>
|
| 573 |
+
<div class="md:col-span-2 flex gap-2 mt-1">
|
| 574 |
+
<button id="btnSaveRequest" type="submit" class="px-4 py-2 rounded-xl btn-primary">Сохранить</button>
|
| 575 |
+
<button id="btnCancelRequest" type="button" class="px-4 py-2 rounded-xl bg-gray-100 hover:bg-gray-200">Отмена</button>
|
| 576 |
+
</div>
|
| 577 |
+
</form>
|
| 578 |
+
</div>
|
| 579 |
+
</div>
|
| 580 |
+
|
| 581 |
+
<!-- Templates -->
|
| 582 |
+
<template id="tplInvoice">
|
| 583 |
+
<div class="grid grid-cols-1 md:grid-cols-4 gap-2 border rounded-xl p-2">
|
| 584 |
+
<input class="invoice-number border rounded-xl px-3 py-2" placeholder="счёт № 12 от 02.07.2025" />
|
| 585 |
+
<input class="invoice-sum border rounded-xl px-3 py-2" placeholder="50 000" />
|
| 586 |
+
<input type="date" class="invoice-date border rounded-xl px-3 py-2" />
|
| 587 |
+
<select class="invoice-status border rounded-xl px-3 py-2"><option value="PAID">ОПЛАЧЕНО</option><option value="UNPAID">НЕОПЛАЧЕНО</option></select>
|
| 588 |
+
</div>
|
| 589 |
+
</template>
|
| 590 |
+
|
| 591 |
+
<script>
|
| 592 |
+
const APP_VERSION = '1.6.0';
|
| 593 |
+
|
| 594 |
+
// --- Simple state ---
|
| 595 |
+
const state = {
|
| 596 |
+
user: null,
|
| 597 |
+
role: 'ADMIN',
|
| 598 |
+
data: { requests: [], dicts: {companies: [], addresses: [], inspectors: []}, notifs: [], log: [] },
|
| 599 |
+
map: null,
|
| 600 |
+
layers: { new: null, completed: null },
|
| 601 |
+
clusters: { new: null, completed: null }
|
| 602 |
+
};
|
| 603 |
+
|
| 604 |
+
// --- Utilities ---
|
| 605 |
+
const el = id => document.getElementById(id);
|
| 606 |
+
const fmtDate = ts => new Date(ts).toLocaleDateString('ru-RU');
|
| 607 |
+
|
| 608 |
+
function saveAll(){ localStorage.setItem('appData', JSON.stringify(state.data)); }
|
| 609 |
+
function loadAll(){
|
| 610 |
+
const raw = localStorage.getItem('appData');
|
| 611 |
+
if(raw){ try{ state.data = JSON.parse(raw);}catch(e){ console.warn('Reset appData due parse error'); localStorage.removeItem('appData'); } }
|
| 612 |
+
if(!state.data.requests) state.data.requests=[];
|
| 613 |
+
if(!state.data.dicts) state.data.dicts={companies:[],addresses:[],inspectors:[]};
|
| 614 |
+
if(!state.data.notifs) state.data.notifs=[];
|
| 615 |
+
if(!state.data.log) state.data.log=[];
|
| 616 |
+
}
|
| 617 |
+
|
| 618 |
+
function logAction(text){
|
| 619 |
+
const item = { id: Date.now(), text, at: Date.now(), user: state.user?.email||'anon' };
|
| 620 |
+
state.data.log.unshift(item); saveAll(); renderLog();
|
| 621 |
+
}
|
| 622 |
+
|
| 623 |
+
function notify(text){
|
| 624 |
+
const id = Date.now();
|
| 625 |
+
state.data.notifs.unshift({ id, text, at: Date.now() });
|
| 626 |
+
saveAll();
|
| 627 |
+
renderNotifs();
|
| 628 |
+
const li = document.createElement('div');
|
| 629 |
+
li.className = 'toast bg-white shadow rounded-xl p-3 text-sm';
|
| 630 |
+
li.textContent = text;
|
| 631 |
+
el('toastArea').appendChild(li);
|
| 632 |
+
setTimeout(()=> li.remove(), 3500);
|
| 633 |
+
el('notifDot').classList.remove('hidden');
|
| 634 |
+
}
|
| 635 |
+
|
| 636 |
+
function statusBadge(st){
|
| 637 |
+
const map = { 'new':'status-new', 'in-progress':'status-inprogress', 'completed':'status-completed', 'rejected':'status-rejected' };
|
| 638 |
+
const title = { 'new':'Новая', 'in-progress':'В работе', 'completed':'Завершена', 'rejected':'Отменена' };
|
| 639 |
+
return `<span class="status-badge ${map[st]}">${title[st]||st}</span>`;
|
| 640 |
+
}
|
| 641 |
+
|
| 642 |
+
function genId(){ return Math.floor(Math.random()*1e6); }
|
| 643 |
+
|
| 644 |
+
// --- Auth ---
|
| 645 |
+
function checkAuth(){
|
| 646 |
+
const raw = localStorage.getItem('sessionUser');
|
| 647 |
+
if(raw){ try{ state.user = JSON.parse(raw);}catch(_){} }
|
| 648 |
+
if(!state.user){ showLogin(); } else { hideLogin(); }
|
| 649 |
+
}
|
| 650 |
+
|
| 651 |
+
function showLogin(){ el('loginOverlay').classList.remove('hidden'); }
|
| 652 |
+
function hideLogin(){ el('loginOverlay').classList.add('hidden'); }
|
| 653 |
+
|
| 654 |
+
function doLogin(email, password){
|
| 655 |
+
// Credentials from user
|
| 656 |
+
const VALID_EMAIL = 'kuxtenko82@inbox.ru';
|
| 657 |
+
const VALID_PASS = 'irik2005';
|
| 658 |
+
if(email === VALID_EMAIL && password === VALID_PASS){
|
| 659 |
+
state.user = { email, role: 'ADMIN' };
|
| 660 |
+
localStorage.setItem('sessionUser', JSON.stringify(state.user));
|
| 661 |
+
hideLogin();
|
| 662 |
+
afterAuthInit();
|
| 663 |
+
notify('Вход выполнен');
|
| 664 |
+
return true;
|
| 665 |
+
}
|
| 666 |
+
return false;
|
| 667 |
+
}
|
| 668 |
+
|
| 669 |
+
function logout(){ localStorage.removeItem('sessionUser'); state.user=null; showLogin(); }
|
| 670 |
+
|
| 671 |
+
// --- Seed demo data once ---
|
| 672 |
+
function seed(){
|
| 673 |
+
if(state.data.requests.length) return;
|
| 674 |
+
state.data.dicts.companies = ['ООО "ТрансКонтейнер"','АО "ЛогистикСервис"','ООО "РосТанк"'];
|
| 675 |
+
state.data.dicts.addresses = ['Санкт‑Петербург, ул. Пушкина, 1','Москва, ул. Тверская, 10','Екатеринбург, пр. Ленина, 5','Владивосток, ул. Морская, 2'];
|
| 676 |
+
state.data.dicts.inspectors = ['Семенов Владислав','Иванов Иван'];
|
| 677 |
+
state.data.requests = [
|
| 678 |
+
{id: genId(), date: Date.now()-86400000, number:'Z-001', company:'ООО "ТрансКонтейнер"', address:'Санкт‑Петербург, ул. Пушкина, 1', tcCount:3, serviceDates:'02.02.2025–03.02.2025', region:'СЗФО', inspectors:['Семенов Владислав'], status:'new', docs:[], invoices:[], lat:59.93, lng:30.31},
|
| 679 |
+
{id: genId(), date: Date.now()-43200000, number:'Z-002', company:'АО "ЛогистикСервис"', address:'Москва, ул. Тверская, 10', tcCount:5, serviceDates:'05.02.2025–07.02.2025', region:'ЦФО', inspectors:['Иванов Иван'], status:'in-progress', docs:[], invoices:[], lat:55.75, lng:37.62},
|
| 680 |
+
{id: genId(), date: Date.now()-172800000, number:'Z-003', company:'ООО "РосТанк"', address:'Екатеринбург, пр. Ленина, 5', tcCount:2, serviceDates:'10.02.2025–12.02.2025', region:'УФО', inspectors:['Семенов Владислав','Иванов Иван'], status:'completed', docs:[], invoices:[], lat:56.83, lng:60.60},
|
| 681 |
+
{id: genId(), date: Date.now()-259200000, number:'Z-004', company:'ООО "РосТанк"', address:'Владивосток, ул. Морская, 2', tcCount:1, serviceDates:'15.02.2025–16.02.2025', region:'ДФО', inspectors:['Иванов Иван'], status:'new', docs:[], invoices:[], lat:43.11, lng:131.87},
|
| 682 |
+
];
|
| 683 |
+
saveAll();
|
| 684 |
+
}
|
| 685 |
+
|
| 686 |
+
// --- Screens ---
|
| 687 |
+
function showScreen(name){
|
| 688 |
+
document.querySelectorAll('.screen').forEach(s=>s.classList.add('hidden'));
|
| 689 |
+
el('screen-'+name).classList.remove('hidden');
|
| 690 |
+
document.querySelectorAll('.nav-link').forEach(b=>{
|
| 691 |
+
if(b.dataset.target===name) b.classList.add('active'); else b.classList.remove('active');
|
| 692 |
+
})
|
| 693 |
+
if(name==='dashboard'){ renderStats(); renderMap(); renderNotifs(); }
|
| 694 |
+
if(name==='registry'){ renderRegistry(); }
|
| 695 |
+
if(name==='tc'){ /* keep */ }
|
| 696 |
+
if(name==='act'){ /* keep */ }
|
| 697 |
+
if(name==='dicts'){ renderDicts(); }
|
| 698 |
+
if(name==='log'){ renderLog(); }
|
| 699 |
+
if(name==='settings'){ el('appVersion').textContent = APP_VERSION; el('userRoleLabel').textContent = state.user?.role || '—'; }
|
| 700 |
+
}
|
| 701 |
+
|
| 702 |
+
// --- Dashboard ---
|
| 703 |
+
function renderStats(){
|
| 704 |
+
const a = state.data.requests;
|
| 705 |
+
el('statNew').textContent = a.filter(r=>r.status==='new').length;
|
| 706 |
+
el('statInProgress').textContent = a.filter(r=>r.status==='in-progress').length;
|
| 707 |
+
el('statCompleted').textContent = a.filter(r=>r.status==='completed').length;
|
| 708 |
+
el('statTotal').textContent = a.length;
|
| 709 |
+
}
|
| 710 |
+
|
| 711 |
+
function renderMap(){
|
| 712 |
+
if(!state.map){
|
| 713 |
+
state.map = L.map('map').setView([58.5, 60], 4);
|
| 714 |
+
L.tileLayer('https://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png',{attribution:'© OpenStreetMap'}).addTo(state.map);
|
| 715 |
+
state.layers.new = L.layerGroup();
|
| 716 |
+
state.layers.completed = L.layerGroup();
|
| 717 |
+
state.clusters.new = L.markerClusterGroup();
|
| 718 |
+
state.clusters.completed = L.markerClusterGroup();
|
| 719 |
+
state.layers.new.addLayer(state.clusters.new);
|
| 720 |
+
state.layers.completed.addLayer(state.clusters.completed);
|
| 721 |
+
}
|
| 722 |
+
state.clusters.new.clearLayers();
|
| 723 |
+
state.clusters.completed.clearLayers();
|
| 724 |
+
|
| 725 |
+
state.data.requests.forEach(r=>{
|
| 726 |
+
if(!r.lat||!r.lng) return;
|
| 727 |
+
const m = L.marker([r.lat,r.lng]);
|
| 728 |
+
m.bindPopup(`<b>${r.number}</b><br>${r.company}<br>${r.address}<br>${statusBadge(r.status)}`);
|
| 729 |
+
if(r.status==='new' || r.status==='in-progress') state.clusters.new.addLayer(m);
|
| 730 |
+
if(r.status==='completed') state.clusters.completed.addLayer(m);
|
| 731 |
+
});
|
| 732 |
+
|
| 733 |
+
if(!state.map.hasLayer(state.layers.new)) state.layers.new.addTo(state.map);
|
| 734 |
+
if(!state.map.hasLayer(state.layers.completed)) state.layers.completed.addTo(state.map);
|
| 735 |
+
|
| 736 |
+
// toggles
|
| 737 |
+
el('toggleLayerNew').onchange = (e)=>{ if(e.target.checked){ state.map.addLayer(state.layers.new);} else { state.map.removeLayer(state.layers.new);} };
|
| 738 |
+
el('toggleLayerCompleted').onchange = (e)=>{ if(e.target.checked){ state.map.addLayer(state.layers.completed);} else { state.map.removeLayer(state.layers.completed);} };
|
| 739 |
+
}
|
| 740 |
+
|
| 741 |
+
function renderNotifs(){
|
| 742 |
+
const list = el('notifList'); list.innerHTML='';
|
| 743 |
+
state.data.notifs.slice(0,50).forEach(n=>{
|
| 744 |
+
const li = document.createElement('li');
|
| 745 |
+
li.className='border rounded-xl p-2 flex items-center justify-between';
|
| 746 |
+
li.innerHTML = `<div>${n.text}</div><div class='text-xs text-gray-500'>${new Date(n.at).toLocaleString('ru-RU')}</div>`;
|
| 747 |
+
list.appendChild(li);
|
| 748 |
+
});
|
| 749 |
+
el('notifDot').classList.toggle('hidden', state.data.notifs.length===0);
|
| 750 |
+
}
|
| 751 |
+
|
| 752 |
+
// --- Registry ---
|
| 753 |
+
function renderRegistry(){
|
| 754 |
+
// fill filters
|
| 755 |
+
const regions = ['ЦФО','СЗФО','ЮФО','СКФО','ПФО','УФО','СФО','ДФО'];
|
| 756 |
+
const regionSel = el('filterRegion');
|
| 757 |
+
if(regionSel.options.length<=1){ regions.forEach(r=>{ const o=document.createElement('option'); o.value=o.textContent=r; regionSel.appendChild(o);});}
|
| 758 |
+
|
| 759 |
+
const tbody = el('registryTbody'); tbody.innerHTML='';
|
| 760 |
+
const q = el('searchInput').value.toLowerCase();
|
| 761 |
+
const st = el('filterStatus').value;
|
| 762 |
+
const reg = el('filterRegion').value;
|
| 763 |
+
|
| 764 |
+
const rows = state.data.requests.filter(r=>{
|
| 765 |
+
const matchQ = !q || (r.company+r.number+r.address).toLowerCase().includes(q);
|
| 766 |
+
const matchS = !st || r.status===st;
|
| 767 |
+
const matchR = !reg || r.region===reg;
|
| 768 |
+
return matchQ && matchS && matchR;
|
| 769 |
+
});
|
| 770 |
+
|
| 771 |
+
rows.sort((a,b)=> b.date - a.date);
|
| 772 |
+
|
| 773 |
+
rows.forEach(r=>{
|
| 774 |
+
const tr = document.createElement('tr'); tr.className='border-t';
|
| 775 |
+
tr.innerHTML = `
|
| 776 |
+
<td class='p-2'>${r.id}</td>
|
| 777 |
+
<td class='p-2'>${fmtDate(r.date)}</td>
|
| 778 |
+
<td class='p-2 font-mono'>${r.number}</td>
|
| 779 |
+
<td class='p-2'>${r.company}</td>
|
| 780 |
+
<td class='p-2'>${r.address}</td>
|
| 781 |
+
<td class='p-2 text-center'>${r.tcCount}</td>
|
| 782 |
+
<td class='p-2'>${r.region||'—'}</td>
|
| 783 |
+
<td class='p-2'>${statusBadge(r.status)}</td>
|
| 784 |
+
<td class='p-2'>
|
| 785 |
+
<button class='text-blue-600 hover:text-blue-800 mr-2' data-view='${r.id}'>Просмотр</button>
|
| 786 |
+
<button class='text-gray-600 hover:text-gray-800 mr-2' data-edit='${r.id}'>Редактировать</button>
|
| 787 |
+
<button class='text-green-700 hover:text-green-900 mr-2' data-accept='${r.id}'>Принять</button>
|
| 788 |
+
<button class='text-red-700 hover:text-red-900 mr-2' data-cancel='${r.id}'>Отменить</button>
|
| 789 |
+
<button class='text-gray-700 hover:text-black mr-2' data-print='${r.id}'>Печать</button>
|
| 790 |
+
<button class='text-gray-500 hover:text-black' data-del='${r.id}'>Удалить</button>
|
| 791 |
+
</td>`;
|
| 792 |
+
tbody.appendChild(tr);
|
| 793 |
+
});
|
| 794 |
+
|
| 795 |
+
tbody.querySelectorAll('[data-edit]').forEach(b=> b.onclick=()=> openRequestModal( findReq(+b.dataset.edit) ));
|
| 796 |
+
tbody.querySelectorAll('[data-view]').forEach(b=> b.onclick=()=> viewRequest( findReq(+b.dataset.view) ));
|
| 797 |
+
tbody.querySelectorAll('[data-accept]').forEach(b=> b.onclick=()=> changeStatus(+b.dataset.accept,'in-progress'));
|
| 798 |
+
tbody.querySelectorAll('[data-cancel]').forEach(b=> b.onclick=()=> changeStatus(+b.dataset.cancel,'rejected'));
|
| 799 |
+
tbody.querySelectorAll('[data-print]').forEach(b=> b.onclick=()=> printRequest(findReq(+b.dataset.print)) );
|
| 800 |
+
tbody.querySelectorAll('[data-del]').forEach(b=> b.onclick=()=> deleteRequest(+b.dataset.del));
|
| 801 |
+
}
|
| 802 |
+
|
| 803 |
+
function changeStatus(id, status){
|
| 804 |
+
const r = findReq(id); if(!r) return;
|
| 805 |
+
const prev = r.status; r.status = status; saveAll(); renderRegistry(); renderStats(); renderMap();
|
| 806 |
+
logAction(`Статус заявки ${r.number} изменён: ${prev} → ${status}`);
|
| 807 |
+
notify(`Статус ${r.number}: ${status}`);
|
| 808 |
+
}
|
| 809 |
+
|
| 810 |
+
function findReq(id){ return state.data.requests.find(r=>r.id===id); }
|
| 811 |
+
|
| 812 |
+
function openRequestModal(data){
|
| 813 |
+
// fill selects
|
| 814 |
+
const regions = ['ЦФО','СЗФО','ЮФО','СКФО','ПФО','УФО','СФО','ДФО'];
|
| 815 |
+
const regionSel = el('reqRegion'); regionSel.innerHTML=''; regions.forEach(r=>{ const o=document.createElement('option'); o.value=o.textContent=r; regionSel.appendChild(o);});
|
| 816 |
+
const inspSel = el('reqInspectors'); inspSel.innerHTML=''; state.data.dicts.inspectors.forEach(n=>{ const o=document.createElement('option'); o.value=o.textContent=n; inspSel.appendChild(o);});
|
| 817 |
+
const dlCompanies = el('listCompanies'); dlCompanies.innerHTML=''; state.data.dicts.companies.forEach(n=>{ const o=document.createElement('option'); o.value=n; dlCompanies.appendChild(o);});
|
| 818 |
+
const dlAddresses = el('listAddresses'); dlAddresses.innerHTML=''; state.data.dicts.addresses.forEach(n=>{ const o=document.createElement('option'); o.value=n; dlAddresses.appendChild(o);});
|
| 819 |
+
|
| 820 |
+
el('invoiceArea').innerHTML='';
|
| 821 |
+
if(data){
|
| 822 |
+
el('modalRequestTitle').textContent = `Заявка ${data.number}`;
|
| 823 |
+
el('reqCompany').value = data.company;
|
| 824 |
+
el('reqDate').valueAsDate = new Date(data.date);
|
| 825 |
+
el('reqNumber').value = data.number;
|
| 826 |
+
el('reqAddress').value = data.address;
|
| 827 |
+
el('reqTcCount').value = data.tcCount;
|
| 828 |
+
el('reqServiceDates').value = data.serviceDates||'';
|
| 829 |
+
el('reqRegion').value = data.region||'';
|
| 830 |
+
Array.from(el('reqInspectors').options).forEach(o=> o.selected = data.inspectors?.includes(o.value));
|
| 831 |
+
(data.invoices||[]).forEach(addInvoiceRowFromData);
|
| 832 |
+
el('requestForm').dataset.editId = data.id;
|
| 833 |
+
} else {
|
| 834 |
+
el('modalRequestTitle').textContent = 'Новая заявка';
|
| 835 |
+
el('requestForm').reset();
|
| 836 |
+
delete el('requestForm').dataset.editId;
|
| 837 |
+
}
|
| 838 |
+
el('modalRequest').classList.remove('hidden');
|
| 839 |
+
}
|
| 840 |
+
|
| 841 |
+
function addInvoiceRow(){
|
| 842 |
+
const tpl = el('tplInvoice').content.cloneNode(true);
|
| 843 |
+
el('invoiceArea').appendChild(tpl);
|
| 844 |
+
}
|
| 845 |
+
function addInvoiceRowFromData(inv){ addInvoiceRow(); const rows = el('invoiceArea').querySelectorAll('.grid'); const row = rows[rows.length-1];
|
| 846 |
+
row.querySelector('.invoice-number').value = inv.number||'';
|
| 847 |
+
row.querySelector('.invoice-sum').value = inv.sum||'';
|
| 848 |
+
row.querySelector('.invoice-date').value = inv.date||'';
|
| 849 |
+
row.querySelector('.invoice-status').value = inv.status||'UNPAID';
|
| 850 |
+
}
|
| 851 |
+
|
| 852 |
+
function viewRequest(r){
|
| 853 |
+
if(!r) return;
|
| 854 |
+
openRequestModal(r);
|
| 855 |
+
// Readonly view (lock fields) if both signatures present in act
|
| 856 |
+
// For demo, just allow edit always
|
| 857 |
+
}
|
| 858 |
+
|
| 859 |
+
function deleteRequest(id){
|
| 860 |
+
const i = state.data.requests.findIndex(r=>r.id===id); if(i<0) return;
|
| 861 |
+
const r = state.data.requests[i];
|
| 862 |
+
if(!confirm(`Удалить заявку ${r.number}?`)) return;
|
| 863 |
+
state.data.requests.splice(i,1); saveAll(); renderRegistry(); renderStats(); renderMap();
|
| 864 |
+
logAction(`Удалена заявка ${r.number}`);
|
| 865 |
+
}
|
| 866 |
+
|
| 867 |
+
function requestFormToObj(){
|
| 868 |
+
const inspectors = Array.from(el('reqInspectors').selectedOptions).map(o=>o.value);
|
| 869 |
+
const files = Array.from(el('reqDocs').files).map(f=>({name:f.name, size:f.size}));
|
| 870 |
+
const invoices = Array.from(el('invoiceArea').querySelectorAll('.grid')).map(row=>({
|
| 871 |
+
number: row.querySelector('.invoice-number').value.trim(),
|
| 872 |
+
sum: row.querySelector('.invoice-sum').value.trim(),
|
| 873 |
+
date: row.querySelector('.invoice-date').value,
|
| 874 |
+
status: row.querySelector('.invoice-status').value
|
| 875 |
+
}));
|
| 876 |
+
return {
|
| 877 |
+
company: el('reqCompany').value.trim(),
|
| 878 |
+
date: el('reqDate').valueAsDate?.getTime()||Date.now(),
|
| 879 |
+
number: el('reqNumber').value.trim(),
|
| 880 |
+
address: el('reqAddress').value.trim(),
|
| 881 |
+
tcCount: +el('reqTcCount').value||0,
|
| 882 |
+
serviceDates: el('reqServiceDates').value.trim(),
|
| 883 |
+
region: el('reqRegion').value,
|
| 884 |
+
inspectors,
|
| 885 |
+
docs: files,
|
| 886 |
+
invoices
|
| 887 |
+
};
|
| 888 |
+
}
|
| 889 |
+
|
| 890 |
+
function validateRequest(r){
|
| 891 |
+
if(!r.company||!r.date||!r.address||!r.number) return false;
|
| 892 |
+
if(!r.tcCount||r.tcCount<1) return false;
|
| 893 |
+
return true;
|
| 894 |
+
}
|
| 895 |
+
|
| 896 |
+
function saveRequest(e){
|
| 897 |
+
e.preventDefault();
|
| 898 |
+
const data = requestFormToObj();
|
| 899 |
+
if(!validateRequest(data)){ alert('Заполните обязательные поля'); return; }
|
| 900 |
+
|
| 901 |
+
const editId = el('requestForm').dataset.editId;
|
| 902 |
+
if(editId){
|
| 903 |
+
const r = findReq(+editId);
|
| 904 |
+
Object.assign(r, data);
|
| 905 |
+
logAction(`Изменена заявка ${r.number}`);
|
| 906 |
+
} else {
|
| 907 |
+
const id = genId();
|
| 908 |
+
state.data.requests.push({ id, status:'new', lat: guessLatLng(data.address).lat, lng: guessLatLng(data.address).lng, ...data });
|
| 909 |
+
logAction(`Создана заявка ${data.number}`);
|
| 910 |
+
notify(`Новая заявка: ${data.number}`);
|
| 911 |
+
}
|
| 912 |
+
saveAll(); el('modalRequest').classList.add('hidden'); renderRegistry(); renderStats(); renderMap();
|
| 913 |
+
}
|
| 914 |
+
|
| 915 |
+
function guessLatLng(address){
|
| 916 |
+
// Demo mapping
|
| 917 |
+
if(address.includes('Санкт')) return {lat:59.93,lng:30.31};
|
| 918 |
+
if(address.includes('Москва')) return {lat:55.75,lng:37.62};
|
| 919 |
+
if(address.includes('Екатеринбург')) return {lat:56.83,lng:60.60};
|
| 920 |
+
if(address.includes('Владивосток')) return {lat:43.11,lng:131.87};
|
| 921 |
+
return {lat:58.5,lng:60};
|
| 922 |
+
}
|
| 923 |
+
|
| 924 |
+
function printRequest(r){
|
| 925 |
+
const html = `<!doctype html><html><head><meta charset='utf-8'><title>${r.number}</title>
|
| 926 |
+
<style>body{font-family:system-ui,-apple-system,Segoe UI,Roboto; padding:24px;} .badge{padding:2px 8px;border-radius:8px;border:1px solid #ddd;}</style>
|
| 927 |
+
</head><body>
|
| 928 |
+
<h2>Карточка заявки ${r.number}</h2>
|
| 929 |
+
<div><span class='badge'>${r.company}</span> · ${r.address}</div>
|
| 930 |
+
<div>Дата: ${fmtDate(r.date)} · ТК: ${r.tcCount} · Регион: ${r.region}</div>
|
| 931 |
+
<div>Статус: ${r.status}</div>
|
| 932 |
+
<hr/>
|
| 933 |
+
<h3>Счета</h3>
|
| 934 |
+
${(r.invoices||[]).map(i=>`${i.number} · ${i.sum} · ${i.date} · ${i.status}`).join('<br>')}
|
| 935 |
+
</body></html>`;
|
| 936 |
+
const w = window.open('','_blank'); w.document.write(html); w.document.close(); w.focus(); w.print();
|
| 937 |
+
}
|
| 938 |
+
|
| 939 |
+
// --- Dicts ---
|
| 940 |
+
function renderDicts(){
|
| 941 |
+
const ulC = el('dictCompanies'); ulC.innerHTML=''; state.data.dicts.companies.forEach((n,i)=>{ const li=document.createElement('li'); li.className='flex items-center justify-between'; li.innerHTML=`<span>${n}</span><button class='text-red-500' data-del-company='${i}'>Удалить</button>`; ulC.appendChild(li); });
|
| 942 |
+
const ulA = el('dictAddresses'); ulA.innerHTML=''; state.data.dicts.addresses.forEach((n,i)=>{ const li=document.createElement('li'); li.className='flex items-center justify-between'; li.innerHTML=`<span>${n}</span><button class='text-red-500' data-del-address='${i}'>Удалить</button>`; ulA.appendChild(li); });
|
| 943 |
+
const ulI = el('dictInspectors'); ulI.innerHTML=''; state.data.dicts.inspectors.forEach((n,i)=>{ const li=document.createElement('li'); li.className='flex items-center justify-between'; li.innerHTML=`<span>${n}</span><button class='text-red-500' data-del-inspector='${i}'>Удалить</button>`; ulI.appendChild(li); });
|
| 944 |
+
|
| 945 |
+
ulC.querySelectorAll('[data-del-company]').forEach(b=> b.onclick=()=>{ state.data.dicts.companies.splice(+b.dataset.delCompany,1); saveAll(); renderDicts(); });
|
| 946 |
+
ulA.querySelectorAll('[data-del-address]').forEach(b=> b.onclick=()=>{ state.data.dicts.addresses.splice(+b.dataset.delAddress,1); saveAll(); renderDicts(); });
|
| 947 |
+
ulI.querySelectorAll('[data-del-inspector]').forEach(b=> b.onclick=()=>{ state.data.dicts.inspectors.splice(+b.dataset.delInspector,1); saveAll(); renderDicts(); });
|
| 948 |
+
}
|
| 949 |
+
|
| 950 |
+
// --- Act ---
|
| 951 |
+
function saveAct(){
|
| 952 |
+
const required = ['actNumber','actPlace','actDate','actTime','actReason','actContainerNo','actSerialNo','actAuthor','actDepotRep','actInspect1','actInspect2','actEquip'];
|
| 953 |
+
for(const id of required){ if(!el(id).value){ alert('Заполните все обязательные поля акта'); return; } }
|
| 954 |
+
notify('Акт обследования сохранён');
|
| 955 |
+
logAction('Сохранён акт обследования');
|
| 956 |
+
// Demo: lock editing when both signed
|
| 957 |
+
if(el('signInspector').checked && el('signDepot').checked){
|
| 958 |
+
Array.from(el('actForm').elements).forEach(x=> x.disabled=true);
|
| 959 |
+
notify('Документ заблокирован для редактирования');
|
| 960 |
+
}
|
| 961 |
+
}
|
| 962 |
+
|
| 963 |
+
function printAct(){ window.print(); }
|
| 964 |
+
|
| 965 |
+
// --- Import/Export ---
|
| 966 |
+
function exportJSON(){ const data = JSON.stringify(state.data.requests, null, 2); downloadFile(data, 'requests.json', 'application/json'); }
|
| 967 |
+
function exportExcel(){
|
| 968 |
+
const rows = state.data.requests.map(r=>({
|
| 969 |
+
id:r.id, date:new Date(r.date).toISOString().slice(0,10), number:r.number, company:r.company, address:r.address, tcCount:r.tcCount, region:r.region, status:r.status
|
| 970 |
+
}));
|
| 971 |
+
const ws = XLSX.utils.json_to_sheet(rows);
|
| 972 |
+
const wb = XLSX.utils.book_new();
|
| 973 |
+
XLSX.utils.book_append_sheet(wb, ws, 'Requests');
|
| 974 |
+
const wbout = XLSX.write(wb, {bookType:'xlsx', type:'array'});
|
| 975 |
+
downloadBlob(new Blob([wbout], {type:'application/octet-stream'}), 'requests.xlsx');
|
| 976 |
+
}
|
| 977 |
+
|
| 978 |
+
function downloadFile(content, name, type){ const a=document.createElement('a'); a.href=URL.createObjectURL(new Blob([content],{type})); a.download=name; a.click(); URL.revokeObjectURL(a.href); }
|
| 979 |
+
function downloadBlob(blob, name){ const a=document.createElement('a'); a.href=URL.createObjectURL(blob); a.download=name; a.click(); URL.revokeObjectURL(a.href); }
|
| 980 |
+
|
| 981 |
+
function importJSONFile(file){ const reader = new FileReader(); reader.onload = () => { try{
|
| 982 |
+
const arr = JSON.parse(reader.result); if(Array.isArray(arr)) { state.data.requests = mergeById(state.data.requests, arr); saveAll(); renderRegistry(); renderStats(); renderMap(); notify('Импорт завершён'); logAction('Импорт заявок из JSON'); }
|
| 983 |
+
else alert('Неверный формат файла');
|
| 984 |
+
}catch(e){ alert('Ошибка чтения файла'); } }; reader.readAsText(file); }
|
| 985 |
+
|
| 986 |
+
function mergeById(oldArr, newArr){
|
| 987 |
+
const map = new Map(oldArr.map(x=>[x.id,x]));
|
| 988 |
+
newArr.forEach(n=>{ if(map.has(n.id)) Object.assign(map.get(n.id), n); else map.set(n.id, n); });
|
| 989 |
+
return Array.from(map.values());
|
| 990 |
+
}
|
| 991 |
+
|
| 992 |
+
// --- Online/Offline ---
|
| 993 |
+
function updateOnlineStatus(){
|
| 994 |
+
const on = navigator.onLine; el('onlineIndicator').classList.toggle('hidden', !on); el('offlineIndicator').classList.toggle('hidden', on);
|
| 995 |
+
state.data.isOnline = on; if(!on) notify('Оффлайн режим');
|
| 996 |
+
}
|
| 997 |
+
|
| 998 |
+
// --- Events binding ---
|
| 999 |
+
function bind(){
|
| 1000 |
+
document.querySelectorAll('.nav-link').forEach(b=> b.onclick=()=> showScreen(b.dataset.target));
|
| 1001 |
+
el('btnToggleSidebar').onclick = ()=> document.getElementById('sidebar').classList.toggle('hidden');
|
| 1002 |
+
el('btnLogout').onclick = logout;
|
| 1003 |
+
|
| 1004 |
+
// Registry
|
| 1005 |
+
el('btnAddRequest').onclick = ()=> openRequestModal(null);
|
| 1006 |
+
el('btnCloseModalRequest').onclick = ()=> el('modalRequest').classList.add('hidden');
|
| 1007 |
+
el('btnCancelRequest').onclick = ()=> el('modalRequest').classList.add('hidden');
|
| 1008 |
+
el('requestForm').onsubmit = saveRequest;
|
| 1009 |
+
el('btnAddInvoice').onclick = addInvoiceRow;
|
| 1010 |
+
el('searchInput').oninput = renderRegistry;
|
| 1011 |
+
el('filterStatus').onchange = renderRegistry;
|
| 1012 |
+
el('filterRegion').onchange = renderRegistry;
|
| 1013 |
+
|
| 1014 |
+
// Import/Export
|
| 1015 |
+
el('btnExportJSON').onclick = exportJSON;
|
| 1016 |
+
el('btnExportExcel').onclick = exportExcel;
|
| 1017 |
+
el('importJson').onchange = (e)=>{ if(e.target.files[0]) importJSONFile(e.target.files[0]); };
|
| 1018 |
+
|
| 1019 |
+
// Dashboard
|
| 1020 |
+
el('btnNotifications').onclick = ()=> showScreen('dashboard');
|
| 1021 |
+
el('btnClearNotifs').onclick = ()=> { state.data.notifs=[]; saveAll(); renderNotifs(); };
|
| 1022 |
+
|
| 1023 |
+
// Act
|
| 1024 |
+
el('btnSaveAct').onclick = saveAct;
|
| 1025 |
+
el('btnResetAct').onclick = ()=> el('actForm').reset();
|
| 1026 |
+
el('btnPrintAct').onclick = printAct;
|
| 1027 |
+
|
| 1028 |
+
// TC
|
| 1029 |
+
el('btnSaveTc').onclick = ()=>{ notify('Характеристики ТК сохранены'); logAction('Обновлены характеристики ТК'); };
|
| 1030 |
+
el('btnSendTcForReview').onclick = ()=>{ el('tcStatus').value='review'; notify('Карточка ТК отправлена на проверку'); };
|
| 1031 |
+
|
| 1032 |
+
// Login
|
| 1033 |
+
el('loginForm').onsubmit = (e)=>{
|
| 1034 |
+
e.preventDefault();
|
| 1035 |
+
const ok = doLogin(el('loginEmail').value.trim(), el('loginPassword').value);
|
| 1036 |
+
if(!ok){ alert('Неверный логин или пароль'); }
|
| 1037 |
+
};
|
| 1038 |
+
|
| 1039 |
+
// Clear log
|
| 1040 |
+
el('btnClearLog').onclick = ()=>{ if(confirm('Очистить журнал?')){ state.data.log=[]; saveAll(); renderLog(); } };
|
| 1041 |
+
|
| 1042 |
+
// Dict add buttons
|
| 1043 |
+
document.querySelectorAll('[data-add-dict]').forEach(b=> b.onclick = ()=>{
|
| 1044 |
+
const key = b.dataset.addDict; const val = prompt('Введите значение'); if(!val) return; state.data.dicts[key].push(val); saveAll(); renderDicts();
|
| 1045 |
+
});
|
| 1046 |
+
|
| 1047 |
+
// Online status
|
| 1048 |
+
window.addEventListener('online', updateOnlineStatus);
|
| 1049 |
+
window.addEventListener('offline', updateOnlineStatus);
|
| 1050 |
+
}
|
| 1051 |
+
|
| 1052 |
+
function renderLog(){
|
| 1053 |
+
const ul = el('logList'); ul.innerHTML='';
|
| 1054 |
+
state.data.log.slice(0,200).forEach(i=>{
|
| 1055 |
+
const li = document.createElement('li');
|
| 1056 |
+
li.className='border rounded-xl p-2 flex items-center justify-between';
|
| 1057 |
+
li.innerHTML = `<div>${i.text} <span class='text-gray-400'>— ${i.user}</span></div><div class='text-xs text-gray-500'>${new Date(i.at).toLocaleString('ru-RU')}</div>`;
|
| 1058 |
+
ul.appendChild(li);
|
| 1059 |
+
})
|
| 1060 |
+
}
|
| 1061 |
+
|
| 1062 |
+
// --- After auth init ---
|
| 1063 |
+
function afterAuthInit(){
|
| 1064 |
+
el('currentUserEmail').textContent = state.user?.email || '';
|
| 1065 |
+
showScreen('dashboard');
|
| 1066 |
+
renderStats(); renderMap(); renderNotifs(); renderDicts(); renderLog();
|
| 1067 |
+
updateOnlineStatus();
|
| 1068 |
+
}
|
| 1069 |
+
|
| 1070 |
+
// --- Tiny unit tests (dev) ---
|
| 1071 |
+
function runUnitTests(){
|
| 1072 |
+
console.group('Unit tests');
|
| 1073 |
+
console.assert(validateRequest({company:'A',date:Date.now(),address:'B',number:'1',tcCount:1})===true,'validateRequest positive');
|
| 1074 |
+
console.assert(validateRequest({company:'',date:Date.now(),address:'B',number:'1',tcCount:1})===false,'validateRequest requires company');
|
| 1075 |
+
const merged = mergeById([{id:1,a:1}], [{id:1,a:2},{id:2,a:3}]);
|
| 1076 |
+
console.assert(merged.length===2 && merged.find(x=>x.id===1).a===2,'mergeById works');
|
| 1077 |
+
console.groupEnd();
|
| 1078 |
+
}
|
| 1079 |
+
|
| 1080 |
+
// --- Bootstrap app ---
|
| 1081 |
+
(function init(){
|
| 1082 |
+
AOS.init();
|
| 1083 |
+
feather.replace();
|
| 1084 |
+
loadAll();
|
| 1085 |
+
seed();
|
| 1086 |
+
bind();
|
| 1087 |
+
checkAuth();
|
| 1088 |
+
runUnitTests();
|
| 1089 |
+
})();
|
| 1090 |
+
</script>
|
| 1091 |
+
</body>
|
| 1092 |
</html>
|