diff --git a/src/components/base/BaseInputWithSearch.vue b/src/components/base/BaseInputWithSearch.vue
index 73688f5..5ed78c6 100644
--- a/src/components/base/BaseInputWithSearch.vue
+++ b/src/components/base/BaseInputWithSearch.vue
@@ -1,19 +1,19 @@
-.flex
+.flex
.col
- base-input(v-model="fullName", debounce="1000")
+ base-input(v-model="fullName", debounce="500", size="M" )
.state(v-if="showMessageBar")
.row
.col {{ message }}
.col
q-btn(
- @click="createPerson"
+ @click="createPerson"
)
q-icon(name="app:icon-plus", size="12px", left)
span Создать
.candidates
.row.w-full(
- v-for="candidate in candidates",
+ v-for="candidate in candidates",
key="candidate.id",
@click="pickPerson(candidate)"
)
@@ -30,7 +30,7 @@ export default {
BaseInput,
},
mixins: [v_model],
- emits: ["createPerson", "update:modelValue"],
+ emits: ["createPerson"],
data() {
return {
fullName: "",
@@ -39,22 +39,33 @@ export default {
candidates: [],
};
},
+ computed: {
+ pickedFullName() {
+ return (
+ this.value.last_name +
+ " " +
+ this.value.first_name +
+ " " +
+ this.value.patronymic
+ );
+ },
+ },
watch: {
- fullName: {
- immediate: true,
- handler(val) {
- if (!val) return;
- fetchWrapper.get(`persons/?full_name=${val}`).then((result) => {
- this.candidates = result;
- this.showMessageBar = true;
- this.message = `Нужный ${val} не найден?`;
- });
- },
+ fullName(val) {
+ if (!val || val === this.pickedFullName) return;
+ fetchWrapper.get(`persons/?full_name=${val}`).then((result) => {
+ this.candidates = result;
+ this.showMessageBar = true;
+ this.message = `Нужный ${val} не найден?`;
+ });
+ },
+ value() {
+ this.fullName = this.pickedFullName;
},
},
methods: {
pickPerson(person) {
- this.$emit("update:modelValue", { ...person });
+ this.value = { ...person };
},
createPerson() {
this.$emit("createPerson");
diff --git a/src/pages/newCalendar/TheCalendar.vue b/src/pages/newCalendar/TheCalendar.vue
index dda9e77..849a295 100644
--- a/src/pages/newCalendar/TheCalendar.vue
+++ b/src/pages/newCalendar/TheCalendar.vue
@@ -4,7 +4,7 @@
calendar-open-sidebar(v-else, :open-sidebar="openSidebar", :create-form="createForm")
calendar-wrapper.ml-2(:open-sidebar="isOpen")
base-modal(v-model="isShowForm", title="Создание записи <Переделка>", modal-padding)
- create-event-form(v-model="isShowForm", :close-form="closeForm")
+ create-event-form(:close-form="closeForm")
base-modal(v-model="previewVisibility", :hideHeader="true", :modalPadding="true")
calendar-record-preview(v-model:preview-visibility="previewVisibility")
diff --git a/src/pages/newCalendar/components/CreateEventForm.vue b/src/pages/newCalendar/components/CreateEventForm.vue
index 31615dc..f82e47a 100644
--- a/src/pages/newCalendar/components/CreateEventForm.vue
+++ b/src/pages/newCalendar/components/CreateEventForm.vue
@@ -4,31 +4,31 @@
:current-status="currentStatus",
:statuses="patientData.statuses",
:choice-status="choiceStatus"
+ v-model="time"
)
base-input-with-search(v-model="patient", @createPerson="createPerson")
- .text {{ patient }}
.flex.flex-col.flex-auto.l.gap-y-8
.wrapper-info.h-full
.grid.grid-cols-2.gap-x-4.gap-y-6
- base-input-date(
- v-model="patient",
- size="M",
- important,
- label="Дата рождения",
- placeholder="Дата рождения"
- )
base-input(
- v-model="patient",
+ v-model="phone",
placeholder="+7 (915) 644–92–23",
mask="+7 (###) ###-##-##",
label="Номер телефона",
size="M",
important
)
-
+ base-input-date(
+ v-model="birth_date",
+ size="M",
+ important,
+ label="Дата рождения",
+ placeholder="Дата рождения"
+ )
+
.footer.flex.gap-2
base-button(type="secondary", label="Отменить", width="126px", @click="closeForm")
- base-button(width="168px", label="Создать запись", @click="closeForm", disabled)
+ base-button(width="168px", label="Создать запись", @click="createEvent")