а теперь при нажатии кнопки "присвоить существующему" ничего не происходит - Follow Up Deployment
Browse files- index.html +9 -9
index.html
CHANGED
|
@@ -773,23 +773,22 @@
|
|
| 773 |
hideModal(newTagModal);
|
| 774 |
assignTagUid.textContent = currentUid;
|
| 775 |
|
| 776 |
-
// Populate assign patients list
|
| 777 |
assignPatientsList.innerHTML = '';
|
| 778 |
-
|
| 779 |
-
|
| 780 |
-
if (patientsWithoutUid.length === 0) {
|
| 781 |
noAssignPatientsFound.classList.remove('hidden');
|
| 782 |
} else {
|
| 783 |
noAssignPatientsFound.classList.add('hidden');
|
| 784 |
-
|
| 785 |
const row = document.createElement('tr');
|
| 786 |
-
row.className =
|
| 787 |
row.innerHTML = `
|
| 788 |
<td class="px-4 py-2 text-gray-300">${patient.name}</td>
|
| 789 |
<td class="px-4 py-2 text-gray-300">${patient.hist}</td>
|
|
|
|
| 790 |
<td class="px-4 py-2">
|
| 791 |
-
<button class="select-patient-btn px-3 py-1 bg-blue-600 hover:bg-blue-500 text-white rounded text-sm" data-id="${patient.id}" data-name="${patient.name}" data-hist="${patient.hist}">
|
| 792 |
-
|
| 793 |
</button>
|
| 794 |
</td>
|
| 795 |
`;
|
|
@@ -818,8 +817,9 @@
|
|
| 818 |
document.querySelectorAll('#assignPatientsList tr').forEach(row => {
|
| 819 |
const name = row.querySelector('td:first-child').textContent.toLowerCase();
|
| 820 |
const hist = row.querySelector('td:nth-child(2)').textContent.toLowerCase();
|
|
|
|
| 821 |
|
| 822 |
-
if (name.includes(searchTerm) || hist.includes(searchTerm)) {
|
| 823 |
row.classList.remove('hidden');
|
| 824 |
hasResults = true;
|
| 825 |
} else {
|
|
|
|
| 773 |
hideModal(newTagModal);
|
| 774 |
assignTagUid.textContent = currentUid;
|
| 775 |
|
| 776 |
+
// Populate assign patients list with ALL patients
|
| 777 |
assignPatientsList.innerHTML = '';
|
| 778 |
+
if (patients.length === 0) {
|
|
|
|
|
|
|
| 779 |
noAssignPatientsFound.classList.remove('hidden');
|
| 780 |
} else {
|
| 781 |
noAssignPatientsFound.classList.add('hidden');
|
| 782 |
+
patients.forEach(patient => {
|
| 783 |
const row = document.createElement('tr');
|
| 784 |
+
row.className = `hover:bg-gray-700 ${patient.uid ? 'bg-gray-700/50' : ''}`;
|
| 785 |
row.innerHTML = `
|
| 786 |
<td class="px-4 py-2 text-gray-300">${patient.name}</td>
|
| 787 |
<td class="px-4 py-2 text-gray-300">${patient.hist}</td>
|
| 788 |
+
<td class="px-4 py-2 text-gray-300 monospace text-sm">${patient.uid || 'нет метки'}</td>
|
| 789 |
<td class="px-4 py-2">
|
| 790 |
+
<button class="select-patient-btn px-3 py-1 ${patient.uid ? 'bg-yellow-600 hover:bg-yellow-500' : 'bg-blue-600 hover:bg-blue-500'} text-white rounded text-sm" data-id="${patient.id}" data-name="${patient.name}" data-hist="${patient.hist}">
|
| 791 |
+
${patient.uid ? 'Заменить' : 'Присвоить'}
|
| 792 |
</button>
|
| 793 |
</td>
|
| 794 |
`;
|
|
|
|
| 817 |
document.querySelectorAll('#assignPatientsList tr').forEach(row => {
|
| 818 |
const name = row.querySelector('td:first-child').textContent.toLowerCase();
|
| 819 |
const hist = row.querySelector('td:nth-child(2)').textContent.toLowerCase();
|
| 820 |
+
const uid = row.querySelector('td:nth-child(3)').textContent.toLowerCase();
|
| 821 |
|
| 822 |
+
if (name.includes(searchTerm) || hist.includes(searchTerm) || uid.includes(searchTerm)) {
|
| 823 |
row.classList.remove('hidden');
|
| 824 |
hasResults = true;
|
| 825 |
} else {
|