[WIP] Добавил автоматический поиск категорий льгот при вводе трех символов, поменял местами ОМС и ДМС, добавил чек выбранной льготы
This commit is contained in:
@@ -5,7 +5,9 @@
|
||||
base-input(
|
||||
placeholder="Поиск",
|
||||
@keyup.enter="searchCategory",
|
||||
@input="searchCategory",
|
||||
v-model="searchBenefit",
|
||||
debounce="100",
|
||||
outlined,
|
||||
:width="300",
|
||||
iconLeft
|
||||
@@ -31,13 +33,13 @@
|
||||
.buttons-group.flex.py-4.px-8.justify-center
|
||||
base-button.text-base.font-semibold(outlined, :size="40", @click="closeModalCategories") Отменить
|
||||
base-button.text-base.font-semibold(
|
||||
v-if="selected.length > 0",
|
||||
v-if="selected[0]?.id",
|
||||
:size="40",
|
||||
@click="saveCategories(selected[0])"
|
||||
) Сохранить
|
||||
.right-side.flex.px-14.font-bold.relative
|
||||
q-icon(name="app:icon-cancel").text-sm.absolute.top-4.right-4.cursor-pointer(@click="closeModalCategories")
|
||||
.flex.py-10.gap-y-6.flex-col(v-if="selected.length > 0 && selected[0]?.name !== 'Без льготы'")
|
||||
.flex.py-10.gap-y-6.flex-col(v-if="selected[0]?.id && selected[0]?.name !== 'Без льготы'")
|
||||
.flex.text-6xl {{selected[0]?.name}}
|
||||
.flex.text-xm.flex-col.gap-y-3 Критерии:
|
||||
.flex.flex-col.gap-y-2
|
||||
@@ -69,6 +71,7 @@ export default {
|
||||
closeModalCategories: Function,
|
||||
saveCategories: Function,
|
||||
showModal: Boolean,
|
||||
basic: Object,
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
@@ -103,7 +106,28 @@ export default {
|
||||
showModal: {
|
||||
immediate: true,
|
||||
handler(newVal) {
|
||||
if (!newVal) this.searchBenefit = "";
|
||||
if (!newVal) {
|
||||
this.searchBenefit = "";
|
||||
} else {
|
||||
this.selected.push(
|
||||
this.benefitData.find((e) => e.name === "Без льготы")
|
||||
);
|
||||
}
|
||||
},
|
||||
},
|
||||
benefitData: {
|
||||
immediate: true,
|
||||
deep: true,
|
||||
handler() {
|
||||
if (this.benefitData && this.showModal && !this.basic.id) {
|
||||
this.selected.push(
|
||||
this.benefitData.find((e) => e.name === "Без льготы")
|
||||
);
|
||||
} else if (this.basic.id) {
|
||||
this.selected.push(
|
||||
this.benefitData.find((e) => e.id === this.basic.id)
|
||||
);
|
||||
}
|
||||
},
|
||||
},
|
||||
},
|
||||
|
||||
Reference in New Issue
Block a user