Spaces:
Running
Running
Update index.html
Browse files- index.html +344 -66
index.html
CHANGED
@@ -1272,47 +1272,6 @@
|
|
1272 |
align-items: center;
|
1273 |
}
|
1274 |
|
1275 |
-
/* طراحی واکنشگرا */
|
1276 |
-
@media (max-width: 768px) {
|
1277 |
-
.tabs-nav {
|
1278 |
-
flex-direction: column;
|
1279 |
-
gap: 0.75rem;
|
1280 |
-
}
|
1281 |
-
|
1282 |
-
.progress-container {
|
1283 |
-
flex-direction: column;
|
1284 |
-
align-items: center;
|
1285 |
-
}
|
1286 |
-
|
1287 |
-
.circle-progress {
|
1288 |
-
margin: 0 0 1.5rem 0;
|
1289 |
-
}
|
1290 |
-
|
1291 |
-
.progress-info {
|
1292 |
-
text-align: center;
|
1293 |
-
}
|
1294 |
-
|
1295 |
-
.comparison-table {
|
1296 |
-
display: block;
|
1297 |
-
overflow-x: auto;
|
1298 |
-
white-space: nowrap;
|
1299 |
-
}
|
1300 |
-
|
1301 |
-
.steps-list::before {
|
1302 |
-
right: 1rem;
|
1303 |
-
}
|
1304 |
-
|
1305 |
-
.step-item {
|
1306 |
-
padding-right: 2.75rem;
|
1307 |
-
}
|
1308 |
-
|
1309 |
-
.step-dot {
|
1310 |
-
width: 2rem;
|
1311 |
-
height: 2rem;
|
1312 |
-
font-size: 0.9rem;
|
1313 |
-
}
|
1314 |
-
}
|
1315 |
-
|
1316 |
@media (max-width: 576px) {
|
1317 |
.tabs {
|
1318 |
flex-direction: column;
|
@@ -1328,6 +1287,116 @@
|
|
1328 |
background-color: var(--light-bg);
|
1329 |
}
|
1330 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1331 |
</style>
|
1332 |
</head>
|
1333 |
<body>
|
@@ -1364,6 +1433,9 @@
|
|
1364 |
</div>
|
1365 |
</header>
|
1366 |
|
|
|
|
|
|
|
1367 |
<!-- محتوای اصلی -->
|
1368 |
<main class="container">
|
1369 |
<div class="page-header">
|
@@ -1402,15 +1474,25 @@
|
|
1402 |
<div class="tabs-container">
|
1403 |
<div class="tabs-nav">
|
1404 |
<button class="tab-btn active" data-tab="branch">
|
1405 |
-
<
|
|
|
|
|
|
|
|
|
|
|
1406 |
<span>شعبه</span>
|
1407 |
</button>
|
1408 |
<button class="tab-btn" data-tab="regional">
|
1409 |
-
<
|
|
|
|
|
|
|
1410 |
<span>منطقه</span>
|
1411 |
</button>
|
1412 |
<button class="tab-btn" data-tab="central">
|
1413 |
-
<
|
|
|
|
|
1414 |
<span>ستاد مرکزی</span>
|
1415 |
</button>
|
1416 |
</div>
|
@@ -1475,7 +1557,10 @@
|
|
1475 |
|
1476 |
<div class="special-note">
|
1477 |
<div class="note-icon">
|
1478 |
-
<
|
|
|
|
|
|
|
1479 |
</div>
|
1480 |
<div class="note-content">
|
1481 |
<h3>نکته مهم</h3>
|
@@ -1486,7 +1571,9 @@
|
|
1486 |
</div>
|
1487 |
|
1488 |
<h2 class="section-title">
|
1489 |
-
<
|
|
|
|
|
1490 |
مراحل درخواست تعمیرات در شعبه
|
1491 |
</h2>
|
1492 |
|
@@ -1588,7 +1675,10 @@
|
|
1588 |
|
1589 |
<div class="special-note">
|
1590 |
<div class="note-icon">
|
1591 |
-
<
|
|
|
|
|
|
|
1592 |
</div>
|
1593 |
<div class="note-content">
|
1594 |
<h3>نکته مهم</h3>
|
@@ -1599,7 +1689,9 @@
|
|
1599 |
</div>
|
1600 |
|
1601 |
<h2 class="section-title">
|
1602 |
-
<
|
|
|
|
|
1603 |
مراحل درخواست تعمیرات در منطقه
|
1604 |
</h2>
|
1605 |
|
@@ -1688,7 +1780,9 @@
|
|
1688 |
|
1689 |
<div class="special-note">
|
1690 |
<div class="note-icon">
|
1691 |
-
<
|
|
|
|
|
1692 |
</div>
|
1693 |
<div class="note-content">
|
1694 |
<h3>نکته مهم</h3>
|
@@ -1699,7 +1793,9 @@
|
|
1699 |
</div>
|
1700 |
|
1701 |
<h2 class="section-title">
|
1702 |
-
<
|
|
|
|
|
1703 |
مراحل درخواست تعمیرات در ستاد مرکزی
|
1704 |
</h2>
|
1705 |
|
@@ -1758,7 +1854,9 @@
|
|
1758 |
<!-- بخش مقایسه -->
|
1759 |
<div class="comparison-section">
|
1760 |
<h2 class="section-title">
|
1761 |
-
<
|
|
|
|
|
1762 |
مقایسه حدود اختیارات واحدها
|
1763 |
</h2>
|
1764 |
|
@@ -1846,10 +1944,16 @@
|
|
1846 |
<label>دستهبندی تعمیرات</label>
|
1847 |
<div class="tabs">
|
1848 |
<button class="tab-button active" data-repair-group="building">
|
1849 |
-
<
|
|
|
|
|
|
|
1850 |
</button>
|
1851 |
<button class="tab-button" data-repair-group="furniture">
|
1852 |
-
<
|
|
|
|
|
|
|
1853 |
</button>
|
1854 |
</div>
|
1855 |
</div>
|
@@ -1919,14 +2023,22 @@
|
|
1919 |
<div class="result-section mt-4 d-none" id="calculationResults">
|
1920 |
<div class="result-header">
|
1921 |
<div class="result-title">
|
1922 |
-
<
|
|
|
|
|
|
|
1923 |
</div>
|
1924 |
<div class="result-actions">
|
1925 |
<button class="card-header-btn" id="printResultBtn" title="چاپ نتایج">
|
1926 |
-
<
|
|
|
|
|
|
|
1927 |
</button>
|
1928 |
<button class="card-header-btn" id="shareResultBtn" title="اشتراکگذاری">
|
1929 |
-
<
|
|
|
|
|
1930 |
</button>
|
1931 |
</div>
|
1932 |
</div>
|
@@ -2153,22 +2265,22 @@
|
|
2153 |
document.getElementById('resultCost').textContent = formatNumber(estimatedCost) + ' ریال';
|
2154 |
|
2155 |
document.getElementById('resultQuotes').innerHTML = needsThreeQuotes ?
|
2156 |
-
'<span class="badge badge-warning"><
|
2157 |
-
'<span class="badge badge-primary"><
|
2158 |
|
2159 |
document.getElementById('resultApprovalLevel').innerHTML = approvalLevel === 'مرکزی' ?
|
2160 |
-
'<span class="badge badge-danger"><
|
2161 |
(approvalLevel === 'منطقه' ?
|
2162 |
-
'<span class="badge badge-warning"><
|
2163 |
-
'<span class="badge badge-success"><
|
2164 |
|
2165 |
document.getElementById('resultRegionCoordination').innerHTML = needsHigherApproval ?
|
2166 |
-
`<span class="badge badge-warning"><
|
2167 |
-
`<span class="badge badge-primary"><
|
2168 |
|
2169 |
document.getElementById('resultDocuments').innerHTML = needsThreeQuotes ?
|
2170 |
-
'<span class="badge badge-warning"><
|
2171 |
-
'<span class="badge badge-primary"><
|
2172 |
|
2173 |
// افزودن اطلاعات اضافی اگر وجود نداشته باشد
|
2174 |
let additionalInfo = document.getElementById('additionalResultInfo');
|
@@ -2184,7 +2296,11 @@
|
|
2184 |
<div class="result-label">وضعیت مصرف بودجه:</div>
|
2185 |
<div class="result-value">
|
2186 |
<span class="badge ${percentOfLimit > 75 ? 'badge-warning' : 'badge-success'}">
|
2187 |
-
<
|
|
|
|
|
|
|
|
|
2188 |
</span>
|
2189 |
</div>
|
2190 |
`;
|
@@ -2236,6 +2352,98 @@
|
|
2236 |
});
|
2237 |
}
|
2238 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2239 |
/* دکمه چاپ */
|
2240 |
const printBtn = document.getElementById('printBtn');
|
2241 |
if (printBtn) {
|
@@ -2276,8 +2484,78 @@
|
|
2276 |
const group = activeRepairGroup.getAttribute('data-repair-group');
|
2277 |
updateRepairOptions(group);
|
2278 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2279 |
}
|
2280 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2281 |
// راهاندازی برنامه
|
2282 |
initializeApp();
|
2283 |
});
|
|
|
1272 |
align-items: center;
|
1273 |
}
|
1274 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1275 |
@media (max-width: 576px) {
|
1276 |
.tabs {
|
1277 |
flex-direction: column;
|
|
|
1287 |
background-color: var(--light-bg);
|
1288 |
}
|
1289 |
}
|
1290 |
+
|
1291 |
+
/* سیستم نمایش پیامهای خطا و هشدار */
|
1292 |
+
.toast-container {
|
1293 |
+
position: fixed;
|
1294 |
+
top: 20px;
|
1295 |
+
left: 20px;
|
1296 |
+
z-index: 9999;
|
1297 |
+
max-width: 350px;
|
1298 |
+
}
|
1299 |
+
|
1300 |
+
.toast {
|
1301 |
+
background-color: white;
|
1302 |
+
color: var(--dark-text);
|
1303 |
+
padding: 1rem;
|
1304 |
+
margin-bottom: 0.75rem;
|
1305 |
+
border-radius: var(--radius-md);
|
1306 |
+
box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
|
1307 |
+
display: flex;
|
1308 |
+
align-items: flex-start;
|
1309 |
+
transform: translateX(120%);
|
1310 |
+
transition: transform 0.3s ease;
|
1311 |
+
overflow: hidden;
|
1312 |
+
max-width: 100%;
|
1313 |
+
}
|
1314 |
+
|
1315 |
+
.toast.show {
|
1316 |
+
transform: translateX(0);
|
1317 |
+
}
|
1318 |
+
|
1319 |
+
.toast-icon {
|
1320 |
+
min-width: 24px;
|
1321 |
+
height: 24px;
|
1322 |
+
margin-left: 0.75rem;
|
1323 |
+
display: flex;
|
1324 |
+
align-items: center;
|
1325 |
+
justify-content: center;
|
1326 |
+
}
|
1327 |
+
|
1328 |
+
.toast-content {
|
1329 |
+
flex: 1;
|
1330 |
+
}
|
1331 |
+
|
1332 |
+
.toast-title {
|
1333 |
+
font-weight: bold;
|
1334 |
+
margin-bottom: 0.25rem;
|
1335 |
+
}
|
1336 |
+
|
1337 |
+
.toast-message {
|
1338 |
+
font-size: 0.9rem;
|
1339 |
+
color: var(--gray-text);
|
1340 |
+
}
|
1341 |
+
|
1342 |
+
.toast-close {
|
1343 |
+
background: transparent;
|
1344 |
+
border: none;
|
1345 |
+
color: var(--gray-text);
|
1346 |
+
cursor: pointer;
|
1347 |
+
font-size: 1.25rem;
|
1348 |
+
padding: 0;
|
1349 |
+
margin-right: 0.5rem;
|
1350 |
+
line-height: 1;
|
1351 |
+
transition: color 0.2s;
|
1352 |
+
}
|
1353 |
+
|
1354 |
+
.toast-close:hover {
|
1355 |
+
color: var(--dark-text);
|
1356 |
+
}
|
1357 |
+
|
1358 |
+
.toast-progress {
|
1359 |
+
position: absolute;
|
1360 |
+
bottom: 0;
|
1361 |
+
right: 0;
|
1362 |
+
width: 100%;
|
1363 |
+
height: 3px;
|
1364 |
+
background: rgba(0, 0, 0, 0.1);
|
1365 |
+
}
|
1366 |
+
|
1367 |
+
.toast-progress-bar {
|
1368 |
+
height: 100%;
|
1369 |
+
background: var(--primary-color);
|
1370 |
+
width: 100%;
|
1371 |
+
}
|
1372 |
+
|
1373 |
+
.toast.error .toast-progress-bar {
|
1374 |
+
background: var(--danger-color);
|
1375 |
+
}
|
1376 |
+
|
1377 |
+
.toast.warning .toast-progress-bar {
|
1378 |
+
background: var(--warning-color);
|
1379 |
+
}
|
1380 |
+
|
1381 |
+
.toast.success .toast-progress-bar {
|
1382 |
+
background: var(--success-color);
|
1383 |
+
}
|
1384 |
+
|
1385 |
+
.error-message {
|
1386 |
+
color: var(--danger-color);
|
1387 |
+
font-size: 0.8rem;
|
1388 |
+
margin-top: 0.35rem;
|
1389 |
+
display: none;
|
1390 |
+
}
|
1391 |
+
|
1392 |
+
.form-group.has-error .form-control {
|
1393 |
+
border-color: var(--danger-color);
|
1394 |
+
background-color: #fff5f5;
|
1395 |
+
}
|
1396 |
+
|
1397 |
+
.form-group.has-error .error-message {
|
1398 |
+
display: block;
|
1399 |
+
}
|
1400 |
</style>
|
1401 |
</head>
|
1402 |
<body>
|
|
|
1433 |
</div>
|
1434 |
</header>
|
1435 |
|
1436 |
+
<!-- کانتینر نمایش پیامهای خطا و هشدار -->
|
1437 |
+
<div class="toast-container" id="toastContainer"></div>
|
1438 |
+
|
1439 |
<!-- محتوای اصلی -->
|
1440 |
<main class="container">
|
1441 |
<div class="page-header">
|
|
|
1474 |
<div class="tabs-container">
|
1475 |
<div class="tabs-nav">
|
1476 |
<button class="tab-btn active" data-tab="branch">
|
1477 |
+
<svg width="24" height="24" viewBox="0 0 24 24" fill="currentColor" style="margin-bottom: 0.5rem;">
|
1478 |
+
<path d="M22,8.52V3.98C22,2.57,21.36,2,19.77,2H15.73C14.14,2,13.5,2.57,13.5,3.98V8.51C13.5,9.93,14.14,10.49,15.73,10.49H19.77C21.36,10.5,22,9.93,22,8.52Z"/>
|
1479 |
+
<path d="M22,19.77V15.73C22,14.14,21.36,13.5,19.77,13.5H15.73C14.14,13.5,13.5,14.14,13.5,15.73V19.77C13.5,21.36,14.14,22,15.73,22H19.77C21.36,22,22,21.36,22,19.77Z"/>
|
1480 |
+
<path d="M10.5,8.52V3.98C10.5,2.57,9.86,2,8.27,2H4.23C2.64,2,2,2.57,2,3.98V8.51C2,9.93,2.64,10.49,4.23,10.49H8.27C9.86,10.5,10.5,9.93,10.5,8.52Z"/>
|
1481 |
+
<path d="M10.5,19.77V15.73C10.5,14.14,9.86,13.5,8.27,13.5H4.23C2.64,13.5,2,14.14,2,15.73V19.77C2,21.36,2.64,22,4.23,22H8.27C9.86,22,10.5,21.36,10.5,19.77Z"/>
|
1482 |
+
</svg>
|
1483 |
<span>شعبه</span>
|
1484 |
</button>
|
1485 |
<button class="tab-btn" data-tab="regional">
|
1486 |
+
<svg width="24" height="24" viewBox="0 0 24 24" fill="currentColor" style="margin-bottom: 0.5rem;">
|
1487 |
+
<path d="M12,11.5A2.5,2.5,0,1,1,14.5,9,2.5,2.5,0,0,1,12,11.5Zm0-9A6.5,6.5,0,0,0,5.5,9c0,4.171,5.5,10.144,5.5,10.144S16.5,13.171,16.5,9A6.5,6.5,0,0,0,12,2.5ZM12,12.5a3.5,3.5,0,1,1,3.5-3.5A3.5,3.5,0,0,1,12,12.5Z"/>
|
1488 |
+
<circle cx="12" cy="9" r="1.5"/>
|
1489 |
+
</svg>
|
1490 |
<span>منطقه</span>
|
1491 |
</button>
|
1492 |
<button class="tab-btn" data-tab="central">
|
1493 |
+
<svg width="24" height="24" viewBox="0 0 24 24" fill="currentColor" style="margin-bottom: 0.5rem;">
|
1494 |
+
<path d="M21,6H19V2a1,1,0,0,0-1-1H6A1,1,0,0,0,5,2V6H3A1,1,0,0,0,2,7v3a1,1,0,0,0,1,1h2a1,1,0,0,0,1-1V7h3v7H8v2H6a1,1,0,0,0-1,1v3a1,1,0,0,0,1,1h2a1,1,0,0,0,1-1v-3h3v3a1,1,0,0,0,1,1h2a1,1,0,0,0,1-1V16a1,1,0,0,0-1-1H14v-2h3v3a1,1,0,0,0,1,1h2a1,1,0,0,0,1-1V10a1,1,0,0,0-1-1H18V7h2a1,1,0,0,0,1-1V7A1,1,0,0,0,21,6Z"/>
|
1495 |
+
</svg>
|
1496 |
<span>ستاد مرکزی</span>
|
1497 |
</button>
|
1498 |
</div>
|
|
|
1557 |
|
1558 |
<div class="special-note">
|
1559 |
<div class="note-icon">
|
1560 |
+
<svg width="24" height="24" viewBox="0 0 24 24" fill="currentColor">
|
1561 |
+
<path d="M12,6a1,1,0,0,0-1,1v6a1,1,0,0,0,1,1h5a1,1,0,0,0,0-2H13V7A1,1,0,0,0,12,6Z"/>
|
1562 |
+
<path d="M12,2A10,10,0,1,0,22,12,10,10,0,0,0,12,2Zm0,18a8,8,0,1,1,8-8A8,8,0,0,1,12,20Z"/>
|
1563 |
+
</svg>
|
1564 |
</div>
|
1565 |
<div class="note-content">
|
1566 |
<h3>نکته مهم</h3>
|
|
|
1571 |
</div>
|
1572 |
|
1573 |
<h2 class="section-title">
|
1574 |
+
<svg width="20" height="20" viewBox="0 0 24 24" fill="currentColor" style="margin-left: 0.75rem;">
|
1575 |
+
<path d="M7,6H6a3,3,0,0,0-3,3V8a1,1,0,0,0,2,0V9a1,1,0,0,1,1-1H7a1,1,0,0,0,0-2ZM5,15a1,1,0,0,0-2,0v1a3,3,0,0,0,3,3H7a1,1,0,0,0,0-2H6a1,1,0,0,1-1-1ZM18,6h1a1,1,0,0,1,1,1V8a1,1,0,0,0,2,0V7a3,3,0,0,0-3-3H18a1,1,0,0,0,0,2Zm3,9a1,1,0,0,0-1,1v1a1,1,0,0,1-1,1H18a1,1,0,0,0,0,2h1a3,3,0,0,0,3-3V15A1,1,0,0,0,21,15ZM12,8a4,4,0,1,0,4,4A4,4,0,0,0,12,8Zm0,6a2,2,0,1,1,2-2A2,2,0,0,1,12,14Z"/>
|
1576 |
+
</svg>
|
1577 |
مراحل درخواست تعمیرات در شعبه
|
1578 |
</h2>
|
1579 |
|
|
|
1675 |
|
1676 |
<div class="special-note">
|
1677 |
<div class="note-icon">
|
1678 |
+
<svg width="24" height="24" viewBox="0 0 24 24" fill="currentColor">
|
1679 |
+
<path d="M12,6a1,1,0,0,0-1,1v6a1,1,0,0,0,1,1h5a1,1,0,0,0,0-2H13V7A1,1,0,0,0,12,6Z"/>
|
1680 |
+
<path d="M12,2A10,10,0,1,0,22,12,10,10,0,0,0,12,2Zm0,18a8,8,0,1,1,8-8A8,8,0,0,1,12,20Z"/>
|
1681 |
+
</svg>
|
1682 |
</div>
|
1683 |
<div class="note-content">
|
1684 |
<h3>نکته مهم</h3>
|
|
|
1689 |
</div>
|
1690 |
|
1691 |
<h2 class="section-title">
|
1692 |
+
<svg width="20" height="20" viewBox="0 0 24 24" fill="currentColor" style="margin-left: 0.75rem;">
|
1693 |
+
<path d="M7,6H6a3,3,0,0,0-3,3V8a1,1,0,0,0,2,0V9a1,1,0,0,1,1-1H7a1,1,0,0,0,0-2ZM5,15a1,1,0,0,0-2,0v1a3,3,0,0,0,3,3H7a1,1,0,0,0,0-2H6a1,1,0,0,1-1-1ZM18,6h1a1,1,0,0,1,1,1V8a1,1,0,0,0,2,0V7a3,3,0,0,0-3-3H18a1,1,0,0,0,0,2Zm3,9a1,1,0,0,0-1,1v1a1,1,0,0,1-1,1H18a1,1,0,0,0,0,2h1a3,3,0,0,0,3-3V15A1,1,0,0,0,21,15ZM12,8a4,4,0,1,0,4,4A4,4,0,0,0,12,8Zm0,6a2,2,0,1,1,2-2A2,2,0,0,1,12,14Z"/>
|
1694 |
+
</svg>
|
1695 |
مراحل درخواست تعمیرات در منطقه
|
1696 |
</h2>
|
1697 |
|
|
|
1780 |
|
1781 |
<div class="special-note">
|
1782 |
<div class="note-icon">
|
1783 |
+
<svg width="24" height="24" viewBox="0 0 24 24" fill="currentColor">
|
1784 |
+
<path d="M12,0A12,12,0,1,0,24,12,12.014,12.014,0,0,0,12,0Zm6.927,8.2-6.845,9.289a1.011,1.011,0,0,1-1.43.188L5.764,13.769a1,1,0,1,1,1.25-1.562l4.076,3.261,6.227-8.451A1,1,0,1,1,18.927,8.2Z"/>
|
1785 |
+
</svg>
|
1786 |
</div>
|
1787 |
<div class="note-content">
|
1788 |
<h3>نکته مهم</h3>
|
|
|
1793 |
</div>
|
1794 |
|
1795 |
<h2 class="section-title">
|
1796 |
+
<svg width="20" height="20" viewBox="0 0 24 24" fill="currentColor" style="margin-left: 0.75rem;">
|
1797 |
+
<path d="M7,6H6a3,3,0,0,0-3,3V8a1,1,0,0,0,2,0V9a1,1,0,0,1,1-1H7a1,1,0,0,0,0-2ZM5,15a1,1,0,0,0-2,0v1a3,3,0,0,0,3,3H7a1,1,0,0,0,0-2H6a1,1,0,0,1-1-1ZM18,6h1a1,1,0,0,1,1,1V8a1,1,0,0,0,2,0V7a3,3,0,0,0-3-3H18a1,1,0,0,0,0,2Zm3,9a1,1,0,0,0-1,1v1a1,1,0,0,1-1,1H18a1,1,0,0,0,0,2h1a3,3,0,0,0,3-3V15A1,1,0,0,0,21,15ZM12,8a4,4,0,1,0,4,4A4,4,0,0,0,12,8Zm0,6a2,2,0,1,1,2-2A2,2,0,0,1,12,14Z"/>
|
1798 |
+
</svg>
|
1799 |
مراحل درخواست تعمیرات در ستاد مرکزی
|
1800 |
</h2>
|
1801 |
|
|
|
1854 |
<!-- بخش مقایسه -->
|
1855 |
<div class="comparison-section">
|
1856 |
<h2 class="section-title">
|
1857 |
+
<svg width="20" height="20" viewBox="0 0 24 24" fill="currentColor" style="margin-left: 0.75rem;">
|
1858 |
+
<path d="M20.33,3.67A1,1,0,0,0,18.92,5.08a8,8,0,1,1-3.75-2.28A10,10,0,1,0,22,12,9.87,9.87,0,0,0,20.33,3.67ZM13,12a1,1,0,0,1-1,1H8a1,1,0,0,1,0-2h3V7A1,1,0,0,1,13,7Z"/>
|
1859 |
+
</svg>
|
1860 |
مقایسه حدود اختیارات واحدها
|
1861 |
</h2>
|
1862 |
|
|
|
1944 |
<label>دستهبندی تعمیرات</label>
|
1945 |
<div class="tabs">
|
1946 |
<button class="tab-button active" data-repair-group="building">
|
1947 |
+
<svg width="16" height="16" viewBox="0 0 24 24" fill="currentColor" style="margin-left: 0.5rem;">
|
1948 |
+
<path d="M21,6H19V2a1,1,0,0,0-1-1H6A1,1,0,0,0,5,2V6H3A1,1,0,0,0,2,7v3a1,1,0,0,0,1,1h2a1,1,0,0,0,1-1V7h3v7H8v2H6a1,1,0,0,0-1,1v3a1,1,0,0,0,1,1h2a1,1,0,0,0,1-1v-3h3v3a1,1,0,0,0,1,1h2a1,1,0,0,0,1-1V16a1,1,0,0,0-1-1H14v-2h3v3a1,1,0,0,0,1,1h2a1,1,0,0,0,1-1V10a1,1,0,0,0-1-1H18V7h2a1,1,0,0,0,1-1V7A1,1,0,0,0,21,6Z"/>
|
1949 |
+
</svg>
|
1950 |
+
تعمیرات ساختمان
|
1951 |
</button>
|
1952 |
<button class="tab-button" data-repair-group="furniture">
|
1953 |
+
<svg width="16" height="16" viewBox="0 0 24 24" fill="currentColor" style="margin-left: 0.5rem;">
|
1954 |
+
<path d="M20,8H18V5a1,1,0,0,0-1-1H7A1,1,0,0,0,6,5V8H4a3,3,0,0,0-3,3v8a3,3,0,0,0,3,3H20a3,3,0,0,0,3-3V11A3,3,0,0,0,20,8ZM8,5h8V8H8ZM21,19a1,1,0,0,1-1,1H4a1,1,0,0,1-1-1V16H6v1a1,1,0,0,0,2,0V16h8v1a1,1,0,0,0,2,0V16h3Zm0-5H3V11a1,1,0,0,1,1-1H20a1,1,0,0,1,1,1Z"/>
|
1955 |
+
</svg>
|
1956 |
+
تعمیرات اثاثیه
|
1957 |
</button>
|
1958 |
</div>
|
1959 |
</div>
|
|
|
2023 |
<div class="result-section mt-4 d-none" id="calculationResults">
|
2024 |
<div class="result-header">
|
2025 |
<div class="result-title">
|
2026 |
+
<svg width="16" height="16" viewBox="0 0 24 24" fill="currentColor" style="margin-left: 0.625rem;">
|
2027 |
+
<path d="M11.23,20.23a1,1,0,0,1-1.46,0L3.7,14.16c-.2-.2-.3-.5-.3-.76,0-.3.1-.6.3-.8L9.78,6.5a1.89,1.89,0,0,1,2.45,0,1.65,1.65,0,0,1,0,2.4L8.7,12.55l15.3.05a1.65,1.65,0,0,1,1.7,1.7,1.65,1.65,0,0,1-1.7,1.7H8.7l3.53,3.55A1.7,1.7,0,0,1,11.23,20.23Z"/>
|
2028 |
+
</svg>
|
2029 |
+
نتیجه محاسبه حدود اختیارات
|
2030 |
</div>
|
2031 |
<div class="result-actions">
|
2032 |
<button class="card-header-btn" id="printResultBtn" title="چاپ نتایج">
|
2033 |
+
<svg width="16" height="16" viewBox="0 0 24 24" fill="currentColor">
|
2034 |
+
<path d="M19,7H17V2a1,1,0,0,0-1-1H8A1,1,0,0,0,7,2V7H5a3,3,0,0,0-3,3v7a3,3,0,0,0,3,3h2v3a1,1,0,0,0,1,1h8a1,1,0,0,0,1-1V20h2a3,3,0,0,0,3-3V10A3,3,0,0,0,19,7ZM9,3h6V7H9Zm6,19H9V16h6Zm5-5a1,1,0,0,1-1,1H17V15a1,1,0,0,0-1-1H8a1,1,0,0,0-1,1v3H5a1,1,0,0,1-1-1V10A1,1,0,0,1,5,9H19a1,1,0,0,1,1,1Z"/>
|
2035 |
+
<path d="M17,11H15a1,1,0,0,0,0,2h2a1,1,0,0,0,0-2Z"/>
|
2036 |
+
</svg>
|
2037 |
</button>
|
2038 |
<button class="card-header-btn" id="shareResultBtn" title="اشتراکگذاری">
|
2039 |
+
<svg width="16" height="16" viewBox="0 0 24 24" fill="currentColor">
|
2040 |
+
<path d="M16.53,11.16a1.5,1.5,0,0,0-1.14.53L8.75,8.93a2.5,2.5,0,0,0,0-.86l6.64-2.76a1.5,1.5,0,1,0-.26-.86,1.46,1.46,0,0,0,.14.63L8.63,7.84A2.5,2.5,0,1,0,8.5,13a2.46,2.46,0,0,0,1.4-.43l6.29,2.57a1.5,1.5,0,1,0,.34-.94Z"/>
|
2041 |
+
</svg>
|
2042 |
</button>
|
2043 |
</div>
|
2044 |
</div>
|
|
|
2265 |
document.getElementById('resultCost').textContent = formatNumber(estimatedCost) + ' ریال';
|
2266 |
|
2267 |
document.getElementById('resultQuotes').innerHTML = needsThreeQuotes ?
|
2268 |
+
'<span class="badge badge-warning"><svg width="12" height="12" viewBox="0 0 24 24" fill="currentColor" style="margin-left: 0.375rem;"><path d="M23.119,20,13.772,2.15h0a2,2,0,0,0-3.543,0L.881,20a2,2,0,0,0,1.772,2.928H21.347A2,2,0,0,0,23.119,20ZM11,8.423a1,1,0,0,1,2,0v6a1,1,0,1,1-2,0Zm1.05,11.51h-.028a1.528,1.528,0,0,1-1.522-1.47,1.476,1.476,0,0,1,1.448-1.53h.028A1.527,1.527,0,0,1,13.5,18.4,1.475,1.475,0,0,1,12.05,19.933Z"></path></svg> بله - نیاز به سه استعلام</span>' :
|
2269 |
+
'<span class="badge badge-primary"><svg width="12" height="12" viewBox="0 0 24 24" fill="currentColor" style="margin-left: 0.375rem;"><path d="M22.319,4.431,8.5,18.249a1,1,0,0,1-1.417,0L1.739,12.9a1,1,0,0,1,0-1.417l.119-.119a1,1,0,0,1,1.3-.116l4.72,3.777a.25.25,0,0,0,.319-.034l11.172-11.2a1,1,0,0,1,1.43,0l1.435,1.435A1,1,0,0,1,22.319,4.431Z"></path></svg> خیر - یک استعلام کافیست</span>';
|
2270 |
|
2271 |
document.getElementById('resultApprovalLevel').innerHTML = approvalLevel === 'مرکزی' ?
|
2272 |
+
'<span class="badge badge-danger"><svg width="12" height="12" viewBox="0 0 24 24" fill="currentColor" style="margin-left: 0.375rem;"><path d="M21,6H19V2a1,1,0,0,0-1-1H6A1,1,0,0,0,5,2V6H3A1,1,0,0,0,2,7v3a1,1,0,0,0,1,1h2a1,1,0,0,0,1-1V7h3v7H8v2H6a1,1,0,0,0-1,1v3a1,1,0,0,0,1,1h2a1,1,0,0,0,1-1v-3h3v3a1,1,0,0,0,1,1h2a1,1,0,0,0,1-1V16a1,1,0,0,0-1-1H14v-2h3v3a1,1,0,0,0,1,1h2a1,1,0,0,0,1-1V10a1,1,0,0,0-1-1H18V7h2a1,1,0,0,0,1-1V7A1,1,0,0,0,21,6Z"></path></svg> واحد مرکزی</span>' :
|
2273 |
(approvalLevel === 'منطقه' ?
|
2274 |
+
'<span class="badge badge-warning"><svg width="12" height="12" viewBox="0 0 24 24" fill="currentColor" style="margin-left: 0.375rem;"><path d="M12,11.5A2.5,2.5,0,1,1,14.5,9,2.5,2.5,0,0,1,12,11.5Zm0-9A6.5,6.5,0,0,0,5.5,9c0,4.171,5.5,10.144,5.5,10.144S16.5,13.171,16.5,9A6.5,6.5,0,0,0,12,2.5ZM12,12.5a3.5,3.5,0,1,1,3.5-3.5A3.5,3.5,0,0,1,12,12.5Z"></path><circle cx="12" cy="9" r="1.5"></circle></svg> سرپرستی منطقه</span>' :
|
2275 |
+
'<span class="badge badge-success"><svg width="12" height="12" viewBox="0 0 24 24" fill="currentColor" style="margin-left: 0.375rem;"><path d="M12,0A12,12,0,1,0,24,12,12.014,12.014,0,0,0,12,0Zm6.927,8.2-6.845,9.289a1.011,1.011,0,0,1-1.43.188L5.764,13.769a1,1,0,1,1,1.25-1.562l4.076,3.261,6.227-8.451A1,1,0,1,1,18.927,8.2Z"></path></svg> واحد</span>');
|
2276 |
|
2277 |
document.getElementById('resultRegionCoordination').innerHTML = needsHigherApproval ?
|
2278 |
+
`<span class="badge badge-warning"><svg width="12" height="12" viewBox="0 0 24 24" fill="currentColor" style="margin-left: 0.375rem;"><path d="M19.87,13.1a1,1,0,0,0-1.44,0l-5.18,5.19V4a1,1,0,0,0-2,0V18.25l-5.19-5.19a1,1,0,0,0-1.44,0,1,1,0,0,0,0,1.41l6.89,6.89a1,1,0,0,0,.16.13.9.9,0,0,0,.15.09,1,1,0,0,0,.16.07,1,1,0,0,0,.18,0,.93.93,0,0,0,.19,0,1,1,0,0,0,.19,0,1.02,1.02,0,0,0,.18,0,1.09,1.09,0,0,0,.16-.07.88.88,0,0,0,.15-.09,1,1,0,0,0,.16-.13l6.89-6.89A1,1,0,0,0,19.87,13.1Z"></path></svg> بله (${formatNumber(percentOfLimit)}% از سقف مجاز)</span>` :
|
2279 |
+
`<span class="badge badge-primary"><svg width="12" height="12" viewBox="0 0 24 24" fill="currentColor" style="margin-left: 0.375rem;"><path d="M18.3,8.59l.91-.9a1,1,0,0,0-1.42-1.42l-.9.91a8,8,0,0,0-9.79,0l-.91-.92A1,1,0,0,0,4.77,7.69l.92.91A7.92,7.92,0,0,0,4,13.5,8,8,0,1,0,18.3,8.59ZM12,19.5a6,6,0,1,1,6-6A6,6,0,0,1,12,19.5Zm-2-15h4a1,1,0,0,0,0-2H10a1,1,0,0,0,0,2Zm3,10H12a1,1,0,0,0-.71.29l-2,2a1,1,0,1,0,1.42,1.42l1.29-1.3V15.5a1,1,0,0,0,2,0Z"></path></svg> خیر (${formatNumber(percentOfLimit)}% از سقف مجاز)</span>`;
|
2280 |
|
2281 |
document.getElementById('resultDocuments').innerHTML = needsThreeQuotes ?
|
2282 |
+
'<span class="badge badge-warning"><svg width="12" height="12" viewBox="0 0 24 24" fill="currentColor" style="margin-left: 0.375rem;"><path d="M22.47,5.46h0a1,1,0,0,0,.22-0.33,1,1,0,0,0,0-.76,1,1,0,0,0-.22-0.33h0l-4-4h0a1,1,0,0,0-.33-0.22,1,1,0,0,0-.76,0,1,1,0,0,0-.33.22h0L13.06,4H6A3,3,0,0,0,3,7V24H19V10.94ZM17.06,7H15V4.94ZM5,7A1,1,0,0,1,6,6h7V9h4v13H5Z"></path></svg> سه استعلام قیمت / فاکتور</span>' :
|
2283 |
+
'<span class="badge badge-primary"><svg width="12" height="12" viewBox="0 0 24 24" fill="currentColor" style="margin-left: 0.375rem;"><path d="M22.47,5.46h0a1,1,0,0,0,.22-0.33,1,1,0,0,0,0-.76,1,1,0,0,0-.22-0.33h0l-4-4h0a1,1,0,0,0-.33-0.22,1,1,0,0,0-.76,0,1,1,0,0,0-.33.22h0L13.06,4H6A3,3,0,0,0,3,7V24H19V10.94ZM17.06,7H15V4.94ZM5,7A1,1,0,0,1,6,6h7V9h4v13H5Z"></path></svg> یک فاکتور / پیشفاکتور</span>';
|
2284 |
|
2285 |
// افزودن اطلاعات اضافی اگر وجود نداشته باشد
|
2286 |
let additionalInfo = document.getElementById('additionalResultInfo');
|
|
|
2296 |
<div class="result-label">وضعیت مصرف بودجه:</div>
|
2297 |
<div class="result-value">
|
2298 |
<span class="badge ${percentOfLimit > 75 ? 'badge-warning' : 'badge-success'}">
|
2299 |
+
<svg width="12" height="12" viewBox="0 0 24 24" fill="currentColor" style="margin-left: 0.375rem;">
|
2300 |
+
<path d="M12,2A10,10,0,1,0,22,12,10,10,0,0,0,12,2Zm0,18a8,8,0,1,1,8-8A8,8,0,0,1,12,20Z"/>
|
2301 |
+
<path d="M12,6a1,1,0,0,0-1,1v5a1,1,0,0,0,.293.707l3,3a1,1,0,0,0,1.414-1.414L13,11.586V7A1,1,0,0,0,12,6Z"/>
|
2302 |
+
</svg>
|
2303 |
+
${formatNumber(percentOfLimit)}% از سقف سالانه
|
2304 |
</span>
|
2305 |
</div>
|
2306 |
`;
|
|
|
2352 |
});
|
2353 |
}
|
2354 |
|
2355 |
+
/* نمایش خطا */
|
2356 |
+
function showError(fieldId, message) {
|
2357 |
+
const field = document.getElementById(fieldId);
|
2358 |
+
const errorElement = document.getElementById(fieldId + 'Error');
|
2359 |
+
|
2360 |
+
if (field && errorElement) {
|
2361 |
+
field.closest('.form-group').classList.add('has-error');
|
2362 |
+
errorElement.textContent = message;
|
2363 |
+
}
|
2364 |
+
}
|
2365 |
+
|
2366 |
+
/* حذف خطاها */
|
2367 |
+
function resetErrors() {
|
2368 |
+
document.querySelectorAll('.form-group.has-error').forEach(group => {
|
2369 |
+
group.classList.remove('has-error');
|
2370 |
+
});
|
2371 |
+
}
|
2372 |
+
|
2373 |
+
/* سیستم نمایش اعلان */
|
2374 |
+
function showToast(title, message, type = 'info') {
|
2375 |
+
const toastContainer = document.getElementById('toastContainer');
|
2376 |
+
if (!toastContainer) return;
|
2377 |
+
|
2378 |
+
const toast = document.createElement('div');
|
2379 |
+
toast.className = `toast ${type}`;
|
2380 |
+
|
2381 |
+
let iconSvg = '';
|
2382 |
+
switch (type) {
|
2383 |
+
case 'success':
|
2384 |
+
iconSvg = '<svg width="24" height="24" viewBox="0 0 24 24" fill="#059669"><path d="M12,0A12,12,0,1,0,24,12,12.014,12.014,0,0,0,12,0Zm6.927,8.2-6.845,9.289a1.011,1.011,0,0,1-1.43.188L5.764,13.769a1,1,0,1,1,1.25-1.562l4.076,3.261,6.227-8.451A1,1,0,1,1,18.927,8.2Z"></path></svg>';
|
2385 |
+
break;
|
2386 |
+
case 'error':
|
2387 |
+
iconSvg = '<svg width="24" height="24" viewBox="0 0 24 24" fill="#dc2626"><path d="M11.983,0a12.206,12.206,0,0,0-8.51,3.653A11.8,11.8,0,0,0,0,12.207,11.779,11.779,0,0,0,11.8,24h.214A12.111,12.111,0,0,0,24,11.791h0A11.766,11.766,0,0,0,11.983,0ZM10.5,16.542a1.476,1.476,0,0,1,1.449-1.53h.027a1.527,1.527,0,0,1,1.523,1.47,1.475,1.475,0,0,1-1.449,1.53h-.027A1.529,1.529,0,0,1,10.5,16.542ZM11,12.5v-6a1,1,0,0,1,2,0v6a1,1,0,1,1-2,0Z"></path></svg>';
|
2388 |
+
break;
|
2389 |
+
case 'warning':
|
2390 |
+
iconSvg = '<svg width="24" height="24" viewBox="0 0 24 24" fill="#d97706"><path d="M23.119,20,13.772,2.15h0a2,2,0,0,0-3.543,0L.881,20a2,2,0,0,0,1.772,2.928H21.347A2,2,0,0,0,23.119,20ZM11,8.423a1,1,0,0,1,2,0v6a1,1,0,1,1-2,0Zm1.05,11.51h-.028a1.528,1.528,0,0,1-1.522-1.47,1.476,1.476,0,0,1,1.448-1.53h.028A1.527,1.527,0,0,1,13.5,18.4,1.475,1.475,0,0,1,12.05,19.933Z"></path></svg>';
|
2391 |
+
break;
|
2392 |
+
default:
|
2393 |
+
iconSvg = '<svg width="24" height="24" viewBox="0 0 24 24" fill="#2563eb"><path d="M12,0A12,12,0,1,0,24,12,12.013,12.013,0,0,0,12,0Zm.25,5a1.5,1.5,0,1,1-1.5,1.5A1.5,1.5,0,0,1,12.25,5ZM14.5,18.5h-4a1,1,0,0,1,0-2h.75v-5.5h-.75a1,1,0,0,1,0-2H13a1,1,0,0,1,1,1V16.5h.5a1,1,0,0,1,0,2Z"></path></svg>';
|
2394 |
+
}
|
2395 |
+
|
2396 |
+
toast.innerHTML = `
|
2397 |
+
<div class="toast-icon">${iconSvg}</div>
|
2398 |
+
<div class="toast-content">
|
2399 |
+
<div class="toast-title">${title}</div>
|
2400 |
+
<div class="toast-message">${message}</div>
|
2401 |
+
</div>
|
2402 |
+
<button class="toast-close">×</button>
|
2403 |
+
<div class="toast-progress">
|
2404 |
+
<div class="toast-progress-bar"></div>
|
2405 |
+
</div>
|
2406 |
+
`;
|
2407 |
+
|
2408 |
+
toastContainer.appendChild(toast);
|
2409 |
+
|
2410 |
+
// تأخیر کوتاه برای اعمال انیمیشن
|
2411 |
+
setTimeout(() => {
|
2412 |
+
toast.classList.add('show');
|
2413 |
+
}, 10);
|
2414 |
+
|
2415 |
+
// حذف اعلان پس از مدت مشخص
|
2416 |
+
const progressBar = toast.querySelector('.toast-progress-bar');
|
2417 |
+
let timeout;
|
2418 |
+
|
2419 |
+
const duration = 5000; // مدت نمایش (5 ثانیه)
|
2420 |
+
|
2421 |
+
// انیمیشن نوار پیشرفت
|
2422 |
+
progressBar.style.transition = `width ${duration}ms linear`;
|
2423 |
+
setTimeout(() => {
|
2424 |
+
progressBar.style.width = '0';
|
2425 |
+
}, 10);
|
2426 |
+
|
2427 |
+
timeout = setTimeout(() => {
|
2428 |
+
toast.classList.remove('show');
|
2429 |
+
setTimeout(() => {
|
2430 |
+
toastContainer.removeChild(toast);
|
2431 |
+
}, 300);
|
2432 |
+
}, duration);
|
2433 |
+
|
2434 |
+
// دکمه بستن اعلان
|
2435 |
+
const closeBtn = toast.querySelector('.toast-close');
|
2436 |
+
closeBtn.addEventListener('click', () => {
|
2437 |
+
clearTimeout(timeout);
|
2438 |
+
toast.classList.remove('show');
|
2439 |
+
setTimeout(() => {
|
2440 |
+
if (toast.parentNode) {
|
2441 |
+
toastContainer.removeChild(toast);
|
2442 |
+
}
|
2443 |
+
}, 300);
|
2444 |
+
});
|
2445 |
+
}
|
2446 |
+
|
2447 |
/* دکمه چاپ */
|
2448 |
const printBtn = document.getElementById('printBtn');
|
2449 |
if (printBtn) {
|
|
|
2484 |
const group = activeRepairGroup.getAttribute('data-repair-group');
|
2485 |
updateRepairOptions(group);
|
2486 |
}
|
2487 |
+
|
2488 |
+
// اضافه کردن رویدادها برای اعتبارسنجی فرم
|
2489 |
+
const estimatedCostInput = document.getElementById('estimatedCost');
|
2490 |
+
if (estimatedCostInput) {
|
2491 |
+
estimatedCostInput.addEventListener('blur', function() {
|
2492 |
+
validateField('estimatedCost');
|
2493 |
+
});
|
2494 |
+
}
|
2495 |
+
|
2496 |
+
const yearlySpentInput = document.getElementById('yearlySpent');
|
2497 |
+
if (yearlySpentInput) {
|
2498 |
+
yearlySpentInput.addEventListener('blur', function() {
|
2499 |
+
validateField('yearlySpent');
|
2500 |
+
});
|
2501 |
+
}
|
2502 |
+
|
2503 |
+
const repairCategorySelect = document.getElementById('repairCategory');
|
2504 |
+
if (repairCategorySelect) {
|
2505 |
+
repairCategorySelect.addEventListener('change', function() {
|
2506 |
+
validateField('repairCategory');
|
2507 |
+
});
|
2508 |
+
}
|
2509 |
}
|
2510 |
|
2511 |
+
function validateField(fieldId) {
|
2512 |
+
resetErrors();
|
2513 |
+
|
2514 |
+
switch (fieldId) {
|
2515 |
+
case 'repairCategory':
|
2516 |
+
const category = document.getElementById(fieldId);
|
2517 |
+
if (!category.value) {
|
2518 |
+
showError(fieldId, 'لطفاً نوع تعمیرات را انتخاب کنید');
|
2519 |
+
return false;
|
2520 |
+
}
|
2521 |
+
break;
|
2522 |
+
|
2523 |
+
case 'estimatedCost':
|
2524 |
+
const cost = document.getElementById(fieldId);
|
2525 |
+
if (!cost.value) {
|
2526 |
+
showError(fieldId, 'لطفاً برآورد هزینه را وارد کنید');
|
2527 |
+
return false;
|
2528 |
+
} else {
|
2529 |
+
const costValue = parseNumber(cost.value);
|
2530 |
+
if (isNaN(costValue) || costValue <= 0) {
|
2531 |
+
showError(fieldId, 'لطفاً مبلغ را به صورت عدد صحیح و مثبت وارد کنید');
|
2532 |
+
return false;
|
2533 |
+
}
|
2534 |
+
}
|
2535 |
+
break;
|
2536 |
+
|
2537 |
+
case 'yearlySpent':
|
2538 |
+
const yearly = document.getElementById(fieldId);
|
2539 |
+
if (yearly.value) {
|
2540 |
+
const yearlyValue = parseNumber(yearly.value);
|
2541 |
+
if (isNaN(yearlyValue) || yearlyValue < 0) {
|
2542 |
+
showError(fieldId, 'لطفاً مبلغ را به صورت عدد صحیح و غیرمنفی وارد کنید');
|
2543 |
+
return false;
|
2544 |
+
}
|
2545 |
+
}
|
2546 |
+
break;
|
2547 |
+
}
|
2548 |
+
|
2549 |
+
return true;
|
2550 |
+
}
|
2551 |
+
|
2552 |
+
// تشخیص خطاهای اجرا و نمایش پیام مناسب
|
2553 |
+
window.addEventListener('error', function(e) {
|
2554 |
+
console.error('خطای اجرا:', e.message);
|
2555 |
+
showToast('خطای اجرا', 'متأسفانه خطایی در اجرای برنامه رخ داده است. لطفاً صفحه را مجدداً بارگذاری نمایید.', 'error');
|
2556 |
+
return false;
|
2557 |
+
});
|
2558 |
+
|
2559 |
// راهاندازی برنامه
|
2560 |
initializeApp();
|
2561 |
});
|