diff --git a/resources/js/Pages/Home/ArchiveHistoryCreateModal/Index.vue b/resources/js/Pages/Home/ArchiveHistoryCreateModal/Index.vue index 8ee71a2..584a822 100644 --- a/resources/js/Pages/Home/ArchiveHistoryCreateModal/Index.vue +++ b/resources/js/Pages/Home/ArchiveHistoryCreateModal/Index.vue @@ -167,6 +167,22 @@ const updateValueSearch = async (value) => { }) } +const onFilter = (pattern, option) => { + if (!pattern) return true + + const normalizeText = (text) => { + return text + .toLowerCase() + .replace(/[-\s]/g, '') // удаляем дефисы и пробелы + .trim(); + } + + const normalizedPattern = normalizeText(pattern) + const normalizedLabel = normalizeText(option.label || '') + + return normalizedLabel.includes(normalizedPattern) +} + watch(() => isCardInArchive.value, (val) => { if (val) onResetArchiveInfo({ @@ -193,6 +209,7 @@ watch(() => isCardInArchive.value, (val) => { filterable :loading="loadingFilterPatients" :options="filteredPatients" + :filter="(pattern, option) => onFilter(pattern, option)" v-model:value="archiveInfo.id" @update:value="(val) => updateValueSearch(val)" @search="handleSearchCard"