Repin777 commited on
Commit
4807d36
·
verified ·
1 Parent(s): 013c80d

давай в блоках пациентов поменяем последовательность отображения дат на ДД.ММ.ГГГГ - Follow Up Deployment

Browse files
Files changed (1) hide show
  1. index.html +65 -9
index.html CHANGED
@@ -33,11 +33,33 @@
33
  }
34
 
35
  .status-active {
36
- color: #10b981;
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
37
  }
38
 
39
  .status-inactive {
40
- color: #ef4444;
 
 
 
 
 
 
41
  }
42
 
43
  /* Custom scrollbar */
@@ -109,6 +131,7 @@
109
  <select id="statusFilter" class="w-full px-3 py-2 bg-gray-700 border border-gray-600 rounded-md text-gray-200 focus:outline-none focus:ring-1 focus:ring-blue-500">
110
  <option value="all">Все</option>
111
  <option value="Активен">Активен</option>
 
112
  <option value="Пропустил 2 дня">Пропустил 2 дня</option>
113
  </select>
114
  </div>
@@ -411,6 +434,16 @@
411
  uid: "",
412
  admission: "2025-08-15",
413
  discharge: "",
 
 
 
 
 
 
 
 
 
 
414
  lastVisit: "",
415
  status: "Пропустил 2 дня"
416
  }
@@ -602,19 +635,23 @@
602
  </div>
603
  <div>
604
  <p class="text-gray-400">Поступление:</p>
605
- <p class="text-gray-300">${patient.admission}</p>
606
  </div>
607
  <div>
608
  <p class="text-gray-400">Выписка:</p>
609
- <p class="text-gray-300">${patient.discharge || '-'}</p>
610
  </div>
611
  <div>
612
  <p class="text-gray-400">Последнее посещение:</p>
613
- <p class="text-gray-300">${patient.lastVisit || '-'}</p>
614
  </div>
615
  <div>
616
  <p class="text-gray-400">Статус:</p>
617
- <p class="${patient.status === 'Активен' ? 'status-active' : 'status-inactive'}">${patient.status}</p>
 
 
 
 
618
  </div>
619
  </div>
620
  `;
@@ -976,10 +1013,17 @@
976
  } else {
977
  // Check if patient has recent visit
978
  const lastVisit = patients[patientIndex].lastVisit;
979
- if (!lastVisit || isVisitOverdue(lastVisit)) {
980
  patients[patientIndex].status = "Пропустил 2 дня";
981
  } else {
982
- patients[patientIndex].status = "Активен";
 
 
 
 
 
 
 
983
  }
984
  }
985
 
@@ -1102,12 +1146,24 @@
1102
  handleNewUid(uid);
1103
  }
1104
 
 
 
 
 
 
 
1105
  function isVisitOverdue(lastVisitDate) {
1106
  const today = new Date();
1107
  const lastVisit = new Date(lastVisitDate);
1108
  const diffTime = today - lastVisit;
1109
  const diffDays = diffTime / (1000 * 60 * 60 * 24);
1110
- return diffDays > 2;
 
 
 
 
 
 
1111
  }
1112
 
1113
  function showModal(modal) {
 
33
  }
34
 
35
  .status-active {
36
+ color: white;
37
+ background: linear-gradient(135deg, #10b981 0%, #059669 100%);
38
+ padding: 2px 8px;
39
+ border-radius: 12px;
40
+ display: inline-block;
41
+ font-weight: 500;
42
+ box-shadow: 0 1px 2px rgba(0,0,0,0.1);
43
+ }
44
+
45
+ .status-warning {
46
+ color: white;
47
+ background: linear-gradient(135deg, #eab308 0%, #ca8a04 100%);
48
+ padding: 2px 8px;
49
+ border-radius: 12px;
50
+ display: inline-block;
51
+ font-weight: 500;
52
+ box-shadow: 0 1px 2px rgba(0,0,0,0.1);
53
  }
54
 
55
  .status-inactive {
56
+ color: white;
57
+ background: linear-gradient(135deg, #ef4444 0%, #dc2626 100%);
58
+ padding: 2px 8px;
59
+ border-radius: 12px;
60
+ display: inline-block;
61
+ font-weight: 500;
62
+ box-shadow: 0 1px 2px rgba(0,0,0,0.1);
63
  }
64
 
65
  /* Custom scrollbar */
 
131
  <select id="statusFilter" class="w-full px-3 py-2 bg-gray-700 border border-gray-600 rounded-md text-gray-200 focus:outline-none focus:ring-1 focus:ring-blue-500">
132
  <option value="all">Все</option>
133
  <option value="Активен">Активен</option>
134
+ <option value="Пропустил 1 день">Пропустил 1 день</option>
135
  <option value="Пропустил 2 дня">Пропустил 2 дня</option>
136
  </select>
137
  </div>
 
434
  uid: "",
435
  admission: "2025-08-15",
436
  discharge: "",
437
+ lastVisit: "2025-08-25",
438
+ status: "Пропустил 1 день"
439
+ },
440
+ {
441
+ id: 6,
442
+ name: "Васильев В.В.",
443
+ hist: "24680",
444
+ uid: "",
445
+ admission: "2025-08-10",
446
+ discharge: "",
447
  lastVisit: "",
448
  status: "Пропустил 2 дня"
449
  }
 
635
  </div>
636
  <div>
637
  <p class="text-gray-400">Поступление:</p>
638
+ <p class="text-gray-300">${formatDate(patient.admission)}</p>
639
  </div>
640
  <div>
641
  <p class="text-gray-400">Выписка:</p>
642
+ <p class="text-gray-300">${patient.discharge ? formatDate(patient.discharge) : '-'}</p>
643
  </div>
644
  <div>
645
  <p class="text-gray-400">Последнее посещение:</p>
646
+ <p class="text-gray-300">${patient.lastVisit ? formatDate(patient.lastVisit) : '-'}</p>
647
  </div>
648
  <div>
649
  <p class="text-gray-400">Статус:</p>
650
+ <span class="${
651
+ patient.status === 'Активен' ? 'status-active' :
652
+ patient.status === 'Пропустил 1 день' ? 'status-warning' :
653
+ 'status-inactive'
654
+ }">${patient.status}</span>
655
  </div>
656
  </div>
657
  `;
 
1013
  } else {
1014
  // Check if patient has recent visit
1015
  const lastVisit = patients[patientIndex].lastVisit;
1016
+ if (!lastVisit) {
1017
  patients[patientIndex].status = "Пропустил 2 дня";
1018
  } else {
1019
+ const overdueStatus = isVisitOverdue(lastVisit);
1020
+ if (overdueStatus === 2) {
1021
+ patients[patientIndex].status = "Пропустил 2 дня";
1022
+ } else if (overdueStatus === 1) {
1023
+ patients[patientIndex].status = "Пропустил 1 день";
1024
+ } else {
1025
+ patients[patientIndex].status = "Активен";
1026
+ }
1027
  }
1028
  }
1029
 
 
1146
  handleNewUid(uid);
1147
  }
1148
 
1149
+ function formatDate(isoDate) {
1150
+ if (!isoDate) return '';
1151
+ const [year, month, day] = isoDate.split('-');
1152
+ return `${day}.${month}.${year}`;
1153
+ }
1154
+
1155
  function isVisitOverdue(lastVisitDate) {
1156
  const today = new Date();
1157
  const lastVisit = new Date(lastVisitDate);
1158
  const diffTime = today - lastVisit;
1159
  const diffDays = diffTime / (1000 * 60 * 60 * 24);
1160
+
1161
+ if (diffDays > 2) {
1162
+ return 2; // Пропустил 2+ дней
1163
+ } else if (diffDays > 1) {
1164
+ return 1; // Пропустил 1 день
1165
+ }
1166
+ return 0; // Активен
1167
  }
1168
 
1169
  function showModal(modal) {