[WIP] Добавил поля на форму создания мед карты и уведомление на некорректный номер
This commit is contained in:
@@ -271,9 +271,22 @@ export default {
|
||||
contacts.push(this.dataClient.email);
|
||||
if (
|
||||
this.dataClient.phone.username &&
|
||||
this.dataClient.phone.username.length === 18 &&
|
||||
!contacts.find((el) => el.kind === "PHONE")
|
||||
)
|
||||
contacts.push(this.dataClient.phone);
|
||||
else if (
|
||||
this.dataClient.phone.username &&
|
||||
this.dataClient.phone.username.length < 18
|
||||
) {
|
||||
this.dataClient.phone.username =
|
||||
this.client.contacts.find((el) => el.kind === "PHONE")?.username ||
|
||||
"";
|
||||
this.addErrorNotification(
|
||||
"Некорректный номер телефона",
|
||||
"Введите мобильный номер состоящий из 11 цифр"
|
||||
);
|
||||
}
|
||||
let mapCreateContacts = this.client.contacts.map((el) => el.kind);
|
||||
let mapDeleteContacts = contacts.map((el) => el.kind);
|
||||
let createContacts = contacts.filter((el) =>
|
||||
@@ -288,9 +301,20 @@ export default {
|
||||
this.client.contacts.forEach((el) => {
|
||||
if (
|
||||
el.kind === "PHONE" &&
|
||||
this.dataClient.phone.username.length === 18 &&
|
||||
el.username !== this.dataClient.phone.username
|
||||
)
|
||||
updateContacts.push(this.dataClient.phone);
|
||||
else if (this.dataClient.phone.username.length < 18) {
|
||||
this.dataClient.phone.username =
|
||||
this.client.contacts.find((el) => el.kind === "PHONE")?.username ||
|
||||
"";
|
||||
this.addErrorNotification(
|
||||
"Некорректный номер телефона",
|
||||
"Введите мобильный номер состоящий из 11 цифр"
|
||||
);
|
||||
}
|
||||
|
||||
if (
|
||||
el.kind === "EMAIL" &&
|
||||
el.username !== this.dataClient.email.username
|
||||
|
||||
@@ -4,57 +4,20 @@
|
||||
span.text-center.font-bold.text-xl Создание медицинской карты стоматологического пациента
|
||||
.flex.justify-center.items-center.gap-x-2
|
||||
base-button.button(:size="32", :rounded="true")
|
||||
span(v-if="!isServices") 1
|
||||
span(v-if="isBaseData") 1
|
||||
.icon-ok.text-xs(v-else)
|
||||
span(:style="{color: 'var(--btn-blue-color)'}") Основное
|
||||
.line.flex.mx-2
|
||||
base-button.button(:class="{'active-button': !isServices}", :size="32", :rounded="true") 2
|
||||
span(:style="{color: isServices ? 'var(--btn-blue-color)' : 'var(--font-dark-blue-color)' }") Услуги
|
||||
medical-base-data(v-if="!isServices")
|
||||
.services.flex.flex-col.gap-y-6(v-else)
|
||||
.flex.flex-col.gap-y-6
|
||||
.flex.flex-col.gap-y-2
|
||||
.font-bold Услуги
|
||||
.counter.text-smm Выберите подходищие из списка
|
||||
.services-wrapper.flex.flex-col.pt-4.px-4
|
||||
.flex.gap-x-2
|
||||
base-input(
|
||||
:with-icon="true",
|
||||
icon-position="left",
|
||||
:width-input="310",
|
||||
placeholder="Поиск"
|
||||
)
|
||||
.counter.icon-search
|
||||
base-select.h-10(placeholder="Вид услуги")
|
||||
.flex.items-center.px-11px.py-9px(
|
||||
:style="{borderBottom: '1px solid var(--btn-grey-color)'}"
|
||||
)
|
||||
.flex.items-center.gap-x-3
|
||||
input.counter.w-4.h-4.checkbox.cursor-pointer(
|
||||
type="checkbox",
|
||||
@click="selectAll",
|
||||
v-model="isAllServices"
|
||||
)
|
||||
.counter.flex.p-2(:style="{width: '358px'}") Название услуги
|
||||
.counter Вид услуги
|
||||
.list-services.flex.flex-col.px-11px.py-9px
|
||||
.flex.items-center(v-for="service in services", :key="service.id")
|
||||
.flex.items-center.gap-x-3
|
||||
input.w-4.h-4.checkbox.cursor-pointer(
|
||||
type="checkbox",
|
||||
v-model="userIds",
|
||||
:value="service.id"
|
||||
)
|
||||
.flex.p-2(:style="{width: '358px'}") {{service.name}}
|
||||
.counter {{service.type}}
|
||||
base-button.custom-button(
|
||||
v-if="!isServices",
|
||||
:size="40",
|
||||
@click="changeServices"
|
||||
)
|
||||
span.font-semibold Далее
|
||||
base-button.custom-button(:size="40", v-else)
|
||||
span.font-semibold Создать медицинскую карту
|
||||
base-button.button(:class="{'active-button': !isIdentityDoc && isBaseData}", :size="32", :rounded="true")
|
||||
span(v-if="isBaseData") 2
|
||||
.icon-ok.text-xs(v-else)
|
||||
span(:style="{color: !isBaseData ? 'var(--btn-blue-color)' : 'var(--font-dark-blue-color)' }") ДУЛ
|
||||
.line.flex.mx-2
|
||||
base-button.button(:class="{'active-button': !isPolicyDoc }", :size="32", :rounded="true") 3
|
||||
span(:style="{color: isPolicyDoc ? 'var(--btn-blue-color)' : 'var(--font-dark-blue-color)' }") Полис
|
||||
medical-base-data(v-if="isBaseData", :change-base-data="changeBaseData")
|
||||
medical-identity-documents(v-if="isIdentityDoc", :change-identity-doc="changeIdentityDoc")
|
||||
medical-policy-documents(v-if="isPolicyDoc")
|
||||
</template>
|
||||
|
||||
<script>
|
||||
@@ -63,6 +26,9 @@ import BaseButton from "@/components/base/BaseButton";
|
||||
import BaseInputDate from "@/components/base/BaseInputDate";
|
||||
import BaseSelect from "@/components/base/BaseSelect";
|
||||
import MedicalBaseData from "@/pages/medicalCard/components/MedicalBaseData";
|
||||
import MedicalIdentityDocuments from "@/pages/medicalCard/components/MedicalIdentityDocuments";
|
||||
import MedicalPolicyDocuments from "@/pages/medicalCard/components/MedicalPolicyDocuments";
|
||||
|
||||
export default {
|
||||
name: "FormCreateMedicalCard",
|
||||
components: {
|
||||
@@ -71,23 +37,24 @@ export default {
|
||||
BaseInputDate,
|
||||
BaseSelect,
|
||||
MedicalBaseData,
|
||||
MedicalIdentityDocuments,
|
||||
MedicalPolicyDocuments,
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
isServices: false,
|
||||
isAllServices: false,
|
||||
userIds: [],
|
||||
isBaseData: true,
|
||||
isIdentityDoc: false,
|
||||
isPolicyDoc: false,
|
||||
};
|
||||
},
|
||||
methods: {
|
||||
changeServices() {
|
||||
this.isServices = !this.isServices;
|
||||
changeBaseData() {
|
||||
this.isBaseData = !this.isBaseData;
|
||||
this.isIdentityDoc = !this.isIdentityDoc;
|
||||
},
|
||||
selectAll() {
|
||||
this.userIds = [];
|
||||
if (!this.isAllServices) {
|
||||
this.services.forEach((el) => this.userIds.push(el.id));
|
||||
}
|
||||
changeIdentityDoc() {
|
||||
this.isIdentityDoc = !this.isIdentityDoc;
|
||||
this.isPolicyDoc = !this.isPolicyDoc;
|
||||
},
|
||||
},
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user