WIP Изменила инпут, сделала документы
This commit is contained in:
@@ -214,41 +214,53 @@ const getters = {
|
||||
};
|
||||
},
|
||||
getDocumentsData(state, rootState) {
|
||||
let person = state.medicalCard?.person;
|
||||
const passport = person?.identity_document?.find(
|
||||
(el) => el.kind === "PASSPORT"
|
||||
);
|
||||
const person = state.medicalCard?.person,
|
||||
passport = person?.documents?.find(
|
||||
({ category }) => category === "passport"
|
||||
),
|
||||
insurance_number = person?.documents?.find(
|
||||
({ category }) => category === "insurance_number"
|
||||
),
|
||||
tax_identification_number = person?.documents?.find(
|
||||
({ category }) => category === "tax_identification_number"
|
||||
);
|
||||
return {
|
||||
passport: {
|
||||
id: passport?.id ?? "",
|
||||
series: passport?.series ?? "",
|
||||
number: passport?.number ?? "",
|
||||
issued_by_org: passport?.issued_by_org ?? "",
|
||||
issued_by_org_code: passport?.issued_by_org_code ?? "",
|
||||
issued_by_date: passport?.issued_by_date
|
||||
? new Date(passport?.issued_by_date)
|
||||
: null,
|
||||
photo: passport?.photo
|
||||
category: passport?.category || "",
|
||||
id: passport?.id || "",
|
||||
series: passport?.series || "",
|
||||
number: passport?.number || "",
|
||||
issued_by: passport?.issued_by || "",
|
||||
issued_by_org_code: passport?.issued_by_org_code || "",
|
||||
issued_at: passport?.issued_at
|
||||
? passport?.issued_at?.split("-")?.reverse()?.join(".")
|
||||
: "",
|
||||
attachments: passport?.attachments?.length
|
||||
? {
|
||||
photo: rootState.getUrl + passport.photo,
|
||||
photo: rootState.getUrl + passport?.attachments?.[0],
|
||||
file: null,
|
||||
}
|
||||
: {},
|
||||
},
|
||||
insurance_number: {
|
||||
insurance_number: person?.insurance_number ?? "",
|
||||
photo_insurance_number: person?.photo_insurance_number
|
||||
category: insurance_number?.category || "",
|
||||
id: insurance_number?.id || "",
|
||||
number: insurance_number?.number || "",
|
||||
attachments: insurance_number?.attachments?.length
|
||||
? {
|
||||
photo: rootState.getUrl + person.photo_insurance_number,
|
||||
photo: rootState.getUrl + insurance_number.attachments?.[0],
|
||||
file: null,
|
||||
}
|
||||
: {},
|
||||
},
|
||||
tax_identification_number: {
|
||||
tax_identification_number: person?.tax_identification_number ?? "",
|
||||
photo_tax_identification_number: person?.photo_tax_identification_number
|
||||
category: tax_identification_number?.category || "",
|
||||
id: tax_identification_number?.id || "",
|
||||
number: tax_identification_number?.number || "",
|
||||
attachments: tax_identification_number?.attachments?.length
|
||||
? {
|
||||
photo: rootState.getUrl + person?.photo_tax_identification_number,
|
||||
photo:
|
||||
rootState.getUrl + tax_identification_number?.attachments?.[0],
|
||||
file: null,
|
||||
}
|
||||
: {},
|
||||
|
||||
Reference in New Issue
Block a user