WIP Подтянула данные из стора
This commit is contained in:
@@ -51,24 +51,7 @@ const state = () => ({
|
||||
photo: null,
|
||||
},
|
||||
},
|
||||
documents: {
|
||||
passport: {
|
||||
series: null,
|
||||
number: null,
|
||||
issued_by_org: null,
|
||||
issued_by_org_code: null,
|
||||
issued_by_date: null,
|
||||
photo: null,
|
||||
},
|
||||
insurance_number: {
|
||||
insurance_number: null,
|
||||
photo_insurance_number: null,
|
||||
},
|
||||
tax_identification_number: {
|
||||
tax_identification_number: null,
|
||||
photo_tax_identification_number: null,
|
||||
},
|
||||
},
|
||||
documents: {},
|
||||
avatar: "",
|
||||
});
|
||||
|
||||
@@ -188,6 +171,7 @@ const actions = {
|
||||
commit("setMedicalCard", res);
|
||||
commit("setBasicData");
|
||||
commit("setContactsData");
|
||||
commit("setDocumentData", res.person);
|
||||
});
|
||||
},
|
||||
returnInitData({ commit }) {
|
||||
@@ -218,6 +202,34 @@ const mutations = {
|
||||
setContactsData(state) {
|
||||
state.contactsData = { ...this.getters.getContactsData };
|
||||
},
|
||||
setDocumentData(state, data, rootState) {
|
||||
const passport = data?.identity_document.find(
|
||||
(el) => el.kind === "PASSPORT"
|
||||
);
|
||||
state.documents = {
|
||||
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,
|
||||
photo: passport?.photo ? rootState.getUrl + passport.photo : "",
|
||||
},
|
||||
insurance_number: {
|
||||
insurance_number: data?.insurance_number,
|
||||
photo_insurance_number: data?.photo_insurance_number
|
||||
? rootState.getUrl + data.photo_insurance_number
|
||||
: "",
|
||||
},
|
||||
tax_identification_number: {
|
||||
tax_identification_number: data?.tax_identification_number,
|
||||
photo_tax_identification_number: data?.photo_tax_identification_number
|
||||
? rootState.getUrl + data?.photo_tax_identification_number
|
||||
: "",
|
||||
},
|
||||
};
|
||||
},
|
||||
};
|
||||
|
||||
export default {
|
||||
|
||||
Reference in New Issue
Block a user