fix create form and fix origin

This commit is contained in:
kandrusyak
2023-09-04 20:57:34 +03:00
parent e7b9cce5a2
commit 66efe5bc95
6 changed files with 35 additions and 40 deletions

View File

@@ -11,6 +11,7 @@
.wrapper-info.h-full
.grid.grid-cols-2.gap-x-4.gap-y-6
base-input(
:disabled="!!patient.id"
v-model="phone",
placeholder="+7 (915) 6449223",
mask="+7 (###) ###-##-##",
@@ -19,6 +20,7 @@
important
)
base-input-date(
:disabled="!!patient.id"
v-model="birth_date",
size="M",
important,
@@ -63,6 +65,11 @@ export default {
currentStatus: patientData.statuses.find((e) => e.name === "Не принят"),
};
},
computed: {
primaryNumber() {
return this.patient?.contacts?.find((e) => e.category === "PHONE")?.value;
},
},
methods: {
...mapActions({
getEvents: "getEvents",
@@ -90,6 +97,16 @@ export default {
},
},
mounted() {},
watch: {
patient(val) {
if (val.birth_date) {
this.birth_date = val.birth_date;
}
if (this.primaryNumber) {
this.phone = this.primaryNumber;
}
},
},
};
</script>