WIP Настроил отправление данных с формы создания медицинской карты
This commit is contained in:
@@ -8,6 +8,7 @@
|
||||
:currentStep="currentStep",
|
||||
:next-step="nextStep",
|
||||
:prev-step="prevStep",
|
||||
:finish="finishCreateCard",
|
||||
finishLabel="Создать медицинскую карту",
|
||||
flat
|
||||
)
|
||||
@@ -23,6 +24,7 @@ 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";
|
||||
import { requestMedicalCardData } from "@/pages/clients/utils/wrapperClientForm";
|
||||
import { fetchWrapper } from "@/shared/fetchWrapper.js";
|
||||
import BaseStepperQuasar from "@/components/base/BaseStepperQuasar";
|
||||
|
||||
@@ -81,17 +83,31 @@ export default {
|
||||
prevStep() {
|
||||
this.currentStep -= 1;
|
||||
},
|
||||
finish() {},
|
||||
finishCreateCard() {
|
||||
requestMedicalCardData(this.clientData, this.sourceСlientDetail).then(
|
||||
() =>
|
||||
fetchWrapper.post(`medical_card/medical_history/create/`, {
|
||||
person: this.sourceСlientDetail.id,
|
||||
organization: "3883e8f5-cede-4645-97a3-6d1511e63d10",
|
||||
agreement: false,
|
||||
})
|
||||
);
|
||||
},
|
||||
fetchClientDetail() {
|
||||
fetchWrapper
|
||||
.get(`/general/person/${this.selectedClientId}/detail/`)
|
||||
.get(`general/person/${this.selectedClientId}/detail/`)
|
||||
.then((detail) => this.saveClientDetail(detail));
|
||||
},
|
||||
saveClientDetail(detail) {
|
||||
this.sourceСlientDetail = detail;
|
||||
this.clientData = {
|
||||
id: detail.id,
|
||||
address: detail.address,
|
||||
registration_address: detail.address.find(
|
||||
(address) => address.registration_flg
|
||||
)?.join_address,
|
||||
temporary_address: detail.address.find(
|
||||
(address) => address.temporary_registration_flg
|
||||
)?.join_address,
|
||||
benefit_code: detail.benefit_code,
|
||||
birth_date: detail.birth_date ? new Date(detail.birth_date) : null,
|
||||
//contacts: detail.contacts,
|
||||
@@ -103,6 +119,9 @@ export default {
|
||||
special_mark: detail.special_mark,
|
||||
phone: detail.contacts.find((el) => el.kind === "PHONE")?.username,
|
||||
email: detail.contacts.find((el) => el.kind === "EMAIL")?.username,
|
||||
confidant_name: "",
|
||||
confidant_phone: "",
|
||||
policy: "OMS",
|
||||
};
|
||||
this.saveClientIdentityDoc(detail.identity_documents);
|
||||
this.saveCLientPolicy(detail.insurance_policy);
|
||||
@@ -133,7 +152,7 @@ export default {
|
||||
let identityDoc = data.find((el) => el.kind === "PASSPORT");
|
||||
this.clientData.identity_documents = {
|
||||
kind: "PASSPORT",
|
||||
number:
|
||||
series_number:
|
||||
identityDoc?.series && identityDoc?.number
|
||||
? `${identityDoc?.series} ${identityDoc?.number}`
|
||||
: "",
|
||||
|
||||
Reference in New Issue
Block a user