WIP Изменила отправку документов
This commit is contained in:
@@ -75,21 +75,20 @@ export default {
|
|||||||
return {
|
return {
|
||||||
calendarVisibility: false,
|
calendarVisibility: false,
|
||||||
internalDate: null,
|
internalDate: null,
|
||||||
//internalValue: null,
|
|
||||||
};
|
};
|
||||||
},
|
},
|
||||||
computed: {
|
computed: {
|
||||||
value: {
|
value: {
|
||||||
get() {
|
get() {
|
||||||
this.changeInternalDate(
|
this.changeInternalDate(
|
||||||
moment(this.convertFormat(this.modelValue)).isValid()
|
moment(this.checkFormat(this.modelValue)).isValid()
|
||||||
? moment(this.convertFormat(this.modelValue))
|
? moment(this.modelValue)
|
||||||
: null
|
: null
|
||||||
);
|
);
|
||||||
return this.modelValue;
|
return this.convertISOFormat(this.modelValue);
|
||||||
},
|
},
|
||||||
set(value) {
|
set(value) {
|
||||||
this.$emit("update:modelValue", value);
|
this.$emit("update:modelValue", this.convertRUFormat(value));
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
sizeVariable() {
|
sizeVariable() {
|
||||||
@@ -138,13 +137,17 @@ export default {
|
|||||||
},
|
},
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
convertFormat(date) {
|
convertISOFormat(date) {
|
||||||
return date && date?.length === 10
|
return date?.split("-")?.reverse()?.join(".");
|
||||||
? date.split(".").reverse().join("-")
|
},
|
||||||
: null;
|
convertRUFormat(date) {
|
||||||
|
return date?.split(".")?.reverse()?.join("-");
|
||||||
|
},
|
||||||
|
checkFormat(date) {
|
||||||
|
return date && date?.length === 10 ? date : null;
|
||||||
},
|
},
|
||||||
defaultRule(val) {
|
defaultRule(val) {
|
||||||
return !val || moment(this.convertFormat(val)).isValid();
|
return !val || moment(this.convertRUFormat(val)).isValid();
|
||||||
},
|
},
|
||||||
closeCalendar() {
|
closeCalendar() {
|
||||||
this.calendarVisibility = false;
|
this.calendarVisibility = false;
|
||||||
|
|||||||
@@ -19,10 +19,10 @@
|
|||||||
q-avatar(
|
q-avatar(
|
||||||
rounded,
|
rounded,
|
||||||
size="40px",
|
size="40px",
|
||||||
v-if="docData[data.dataKey][field.key]?.photo"
|
v-if="docData[data.dataKey]?.attachments?.photo"
|
||||||
)
|
)
|
||||||
img.h-10.w-10.object-cover(
|
img.h-10.w-10.object-cover(
|
||||||
:src="docData[data.dataKey][field.key]?.photo",
|
:src="docData[data.dataKey]?.attachments?.photo",
|
||||||
:alt="docData[data.dataKey][field.label]"
|
:alt="docData[data.dataKey][field.label]"
|
||||||
)
|
)
|
||||||
q-badge.delete(
|
q-badge.delete(
|
||||||
@@ -114,6 +114,7 @@ export default {
|
|||||||
],
|
],
|
||||||
initializationData: {
|
initializationData: {
|
||||||
passport: {
|
passport: {
|
||||||
|
category: "passport",
|
||||||
id: null,
|
id: null,
|
||||||
series: null,
|
series: null,
|
||||||
number: null,
|
number: null,
|
||||||
@@ -124,11 +125,13 @@ export default {
|
|||||||
},
|
},
|
||||||
insurance_number: {
|
insurance_number: {
|
||||||
id: null,
|
id: null,
|
||||||
|
category: "insurance_number",
|
||||||
number: null,
|
number: null,
|
||||||
attachments: null,
|
attachments: null,
|
||||||
},
|
},
|
||||||
tax_identification_number: {
|
tax_identification_number: {
|
||||||
id: null,
|
id: null,
|
||||||
|
category: "tax_identification_number",
|
||||||
number: null,
|
number: null,
|
||||||
attachments: null,
|
attachments: null,
|
||||||
},
|
},
|
||||||
@@ -143,7 +146,14 @@ export default {
|
|||||||
},
|
},
|
||||||
computed: {
|
computed: {
|
||||||
initialDocData() {
|
initialDocData() {
|
||||||
return this.$store.state.medical?.documents;
|
// const { passport, insurance_number, tax_identification_number } =
|
||||||
|
// this.$store.state.medical.documents;
|
||||||
|
// return {
|
||||||
|
// passport: passport,
|
||||||
|
// insurance_number: insurance_number,
|
||||||
|
// tax_identification_number: tax_identification_number,
|
||||||
|
// };
|
||||||
|
return this.$store.state.medical.documents;
|
||||||
},
|
},
|
||||||
passportFields() {
|
passportFields() {
|
||||||
let excludedFields = ["attachments", "id", "category"];
|
let excludedFields = ["attachments", "id", "category"];
|
||||||
@@ -179,7 +189,15 @@ export default {
|
|||||||
return !this.isEdit && this.copiedFields.some((elem) => elem === key);
|
return !this.isEdit && this.copiedFields.some((elem) => elem === key);
|
||||||
},
|
},
|
||||||
cancelEdit() {
|
cancelEdit() {
|
||||||
this.docData = JSON.parse(JSON.stringify(this.initialDocData));
|
const { passport, insurance_number, tax_identification_number } =
|
||||||
|
this.initialDocData;
|
||||||
|
this.docData = {
|
||||||
|
passport: JSON.parse(JSON.stringify(passport)),
|
||||||
|
insurance_number: JSON.parse(JSON.stringify(insurance_number)),
|
||||||
|
tax_identification_number: JSON.parse(
|
||||||
|
JSON.stringify(tax_identification_number)
|
||||||
|
),
|
||||||
|
};
|
||||||
this.isEdit = false;
|
this.isEdit = false;
|
||||||
this.isCheckChange = false;
|
this.isCheckChange = false;
|
||||||
this.$refs.documentForm.resetValidation();
|
this.$refs.documentForm.resetValidation();
|
||||||
@@ -215,61 +233,34 @@ export default {
|
|||||||
} else {
|
} else {
|
||||||
let request = [];
|
let request = [];
|
||||||
Object.keys(this.docData).forEach((elem) => {
|
Object.keys(this.docData).forEach((elem) => {
|
||||||
let formData = new FormData();
|
this.checkChangePhoto(elem, "attachments");
|
||||||
form
|
let newData = JSON.parse(JSON.stringify(this.docData[elem]));
|
||||||
.getValidationComponents()
|
newData.attachments = {};
|
||||||
.filter(({ name }) => name?.split(":")?.[0] === elem)
|
if (!checkChangeData(this.initialDocData?.[elem], newData)) return;
|
||||||
.forEach((el) => {
|
delete newData.id;
|
||||||
const name = el?.name?.split(":")?.[1];
|
if (newData?.issued_by_org_code) {
|
||||||
if (name === "issued_at")
|
|
||||||
formData.append(name, this.convertFormat(el.modelValue));
|
|
||||||
else formData.append(name, el.modelValue ?? "");
|
|
||||||
});
|
|
||||||
this.checkChangePhoto(elem, "attachments", formData);
|
|
||||||
if (formData.get("attachments")) {
|
|
||||||
console.log(elem, "img", formData.get("attachments"));
|
|
||||||
formData.delete("attachments");
|
|
||||||
}
|
|
||||||
if (formData.get("issued_by_org_code")) {
|
|
||||||
console.log(
|
console.log(
|
||||||
"issued_by_org_code",
|
"passport issued_by_org_code",
|
||||||
formData.get("issued_by_org_code")
|
newData.issued_by_org_code
|
||||||
);
|
);
|
||||||
formData.delete("issued_by_org_code");
|
delete newData.issued_by_org_code;
|
||||||
}
|
}
|
||||||
if (
|
delete newData.attachments;
|
||||||
!checkChangeData(
|
|
||||||
this.initialDocData?.[elem],
|
|
||||||
this.docData?.[elem]
|
|
||||||
)
|
|
||||||
)
|
|
||||||
return;
|
|
||||||
formData.append("category", elem);
|
|
||||||
if (!this.initialDocData?.[elem]?.id) {
|
if (!this.initialDocData?.[elem]?.id) {
|
||||||
formData.append(
|
newData.person_id =
|
||||||
"person_id",
|
this.$store.state.medical?.basicData?.personalData?.id;
|
||||||
this.$store.state.medical?.basicData?.personalData?.id
|
console.log("create", newData);
|
||||||
);
|
request.push(this.createData("documents/", newData));
|
||||||
// for (const key of formData.keys()) {
|
} else console.log("create", newData);
|
||||||
// console.log(key, formData.get(key));
|
|
||||||
// }
|
|
||||||
request.push(this.createData("documents/", formData));
|
|
||||||
} else {
|
|
||||||
// for (const key of formData.keys()) {
|
|
||||||
// console.log(key, formData.get(key));
|
|
||||||
// }
|
|
||||||
request.push(
|
request.push(
|
||||||
this.updateData(
|
this.updateData(
|
||||||
`documents/${this.initialDocData?.[elem]?.id}`,
|
`documents/${this.initialDocData?.[elem]?.id}`,
|
||||||
formData
|
newData
|
||||||
)
|
)
|
||||||
);
|
);
|
||||||
}
|
|
||||||
});
|
});
|
||||||
Promise.allSettled(request).then(() => {
|
Promise.allSettled(request).then(() => {
|
||||||
this.getMedicalCardData({
|
this.getMedicalCardData(this.$route.params.id);
|
||||||
personId: this.$store.state.medical?.basicData?.personalData?.id,
|
|
||||||
});
|
|
||||||
this.isEdit = false;
|
this.isEdit = false;
|
||||||
this.isCheckChange = false;
|
this.isCheckChange = false;
|
||||||
this.$refs.form?.resetValidation();
|
this.$refs.form?.resetValidation();
|
||||||
@@ -277,21 +268,19 @@ export default {
|
|||||||
}
|
}
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
checkChangePhoto(updatedObjId, field, formData) {
|
checkChangePhoto(updatedObjId, field) {
|
||||||
if (this.docData[updatedObjId][field]?.file)
|
if (this.docData[updatedObjId][field]?.file)
|
||||||
formData.append(field, this.docData[updatedObjId][field]?.file[0]);
|
console.log(
|
||||||
},
|
updatedObjId,
|
||||||
checkPhotoDeletion(updatedObjId, field) {
|
field,
|
||||||
return (
|
this.docData[updatedObjId][field]?.file[0]
|
||||||
!Object.keys(this.docData[updatedObjId][field]).length &&
|
|
||||||
this.initialDocData[updatedObjId][field]?.photo
|
|
||||||
);
|
);
|
||||||
},
|
},
|
||||||
async createData(url, body) {
|
async createData(url, body) {
|
||||||
return await fetchWrapper.post(url, body, "formData");
|
return await fetchWrapper.post(url, body);
|
||||||
},
|
},
|
||||||
async updateData(url, body) {
|
async updateData(url, body) {
|
||||||
return await fetchWrapper.patch(url, body, "formData");
|
return await fetchWrapper.patch(url, body);
|
||||||
},
|
},
|
||||||
async deletePhoto(url) {
|
async deletePhoto(url) {
|
||||||
return await fetchWrapper.del(url);
|
return await fetchWrapper.del(url);
|
||||||
@@ -303,7 +292,7 @@ export default {
|
|||||||
return date ? date.split(".").reverse().join("-") : "";
|
return date ? date.split(".").reverse().join("-") : "";
|
||||||
},
|
},
|
||||||
...mapActions({
|
...mapActions({
|
||||||
getMedicalCardData: "getMedicalCardDataByPersonId",
|
getMedicalCardData: "getMedicalCardDataById",
|
||||||
}),
|
}),
|
||||||
},
|
},
|
||||||
watch: {
|
watch: {
|
||||||
@@ -312,7 +301,15 @@ export default {
|
|||||||
immediate: true,
|
immediate: true,
|
||||||
handler(value) {
|
handler(value) {
|
||||||
if (Object.keys(value).length) {
|
if (Object.keys(value).length) {
|
||||||
this.docData = JSON.parse(JSON.stringify(value));
|
const { passport, insurance_number, tax_identification_number } =
|
||||||
|
value;
|
||||||
|
this.docData = {
|
||||||
|
passport: JSON.parse(JSON.stringify(passport)),
|
||||||
|
insurance_number: JSON.parse(JSON.stringify(insurance_number)),
|
||||||
|
tax_identification_number: JSON.parse(
|
||||||
|
JSON.stringify(tax_identification_number)
|
||||||
|
),
|
||||||
|
};
|
||||||
} else this.docData = this.initializationData;
|
} else this.docData = this.initializationData;
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
|||||||
@@ -77,7 +77,7 @@
|
|||||||
) {{"\xa0" + basic?.benefit[insurance?.discount] + "%"}}
|
) {{"\xa0" + basic?.benefit[insurance?.discount] + "%"}}
|
||||||
.input-container.flex.flex-col.relative(v-else)
|
.input-container.flex.flex-col.relative(v-else)
|
||||||
base-input(
|
base-input(
|
||||||
v-model="basic[insurance.insuranceKey][field.key]",
|
v-model="insuranceData[insurance.insuranceKey][field.key]",
|
||||||
@update:model-value="checkChangeInput",
|
@update:model-value="checkChangeInput",
|
||||||
:mask="field?.inputMask",
|
:mask="field?.inputMask",
|
||||||
:readonly="!isEdit",
|
:readonly="!isEdit",
|
||||||
@@ -125,18 +125,26 @@ export default {
|
|||||||
showModalCategories: false,
|
showModalCategories: false,
|
||||||
photoId: "",
|
photoId: "",
|
||||||
copiedFields: ["series", "number"],
|
copiedFields: ["series", "number"],
|
||||||
|
insuranceData: {},
|
||||||
};
|
};
|
||||||
},
|
},
|
||||||
computed: {
|
computed: {
|
||||||
...mapGetters({
|
...mapGetters({
|
||||||
url: "getUrl",
|
url: "getUrl",
|
||||||
avatar: "getAvatar",
|
//avatar: "getAvatar",
|
||||||
initDataBasic: "getBasicData",
|
//initDataBasic: "getBasicData",
|
||||||
}),
|
}),
|
||||||
...mapState({
|
...mapState({
|
||||||
basic: (state) => state.medical?.basicData,
|
basic: (state) => state.medical?.basicData,
|
||||||
benefitData: (state) => state.medical?.benefitData,
|
benefitData: (state) => state.medical?.benefitData,
|
||||||
}),
|
}),
|
||||||
|
initialDocData() {
|
||||||
|
const { OMS, DMS } = this.$store.state.medical.documents;
|
||||||
|
return {
|
||||||
|
OMS: OMS,
|
||||||
|
DMS: DMS,
|
||||||
|
};
|
||||||
|
},
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
filterDataBenefit(text) {
|
filterDataBenefit(text) {
|
||||||
@@ -170,23 +178,25 @@ export default {
|
|||||||
this.isCheckChange = true;
|
this.isCheckChange = true;
|
||||||
},
|
},
|
||||||
changeModal(id) {
|
changeModal(id) {
|
||||||
|
if (id === "benefit") return;
|
||||||
this.photoId = id;
|
this.photoId = id;
|
||||||
this.showModal = true;
|
this.showModal = true;
|
||||||
},
|
},
|
||||||
closeModalCategories() {
|
closeModalCategories() {
|
||||||
this.showModalCategories = false;
|
this.showModalCategories = false;
|
||||||
},
|
},
|
||||||
|
openModalCategories() {
|
||||||
|
//if (this.isEdit) this.showModalCategories = true;
|
||||||
|
},
|
||||||
checkChangeInput() {
|
checkChangeInput() {
|
||||||
this.isCheckChange =
|
this.isCheckChange =
|
||||||
JSON.stringify(this.initDataBasic) !== JSON.stringify(this.basic)
|
JSON.stringify(this.initialDocData) !==
|
||||||
? true
|
JSON.stringify(this.insuranceData);
|
||||||
: false;
|
|
||||||
},
|
},
|
||||||
confirmChangePhoto() {
|
confirmChangePhoto() {
|
||||||
this.showModal = false;
|
this.showModal = false;
|
||||||
this.isCheckChange = true;
|
this.isCheckChange = true;
|
||||||
},
|
},
|
||||||
|
|
||||||
updateBasicData() {
|
updateBasicData() {
|
||||||
let insuranceDMS = this.basic.insuranceDMS;
|
let insuranceDMS = this.basic.insuranceDMS;
|
||||||
let insuranceOMS = this.basic.insuranceOMS;
|
let insuranceOMS = this.basic.insuranceOMS;
|
||||||
@@ -360,6 +370,21 @@ export default {
|
|||||||
});
|
});
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
watch: {
|
||||||
|
showModalCategories: {
|
||||||
|
immediate: true,
|
||||||
|
handler(newVal) {
|
||||||
|
if (newVal) this.$store.dispatch("getBenefitData");
|
||||||
|
},
|
||||||
|
},
|
||||||
|
initialDocData: {
|
||||||
|
deep: true,
|
||||||
|
immediate: true,
|
||||||
|
handler(newVal) {
|
||||||
|
this.insuranceData = JSON.parse(JSON.stringify(newVal));
|
||||||
|
},
|
||||||
|
},
|
||||||
|
},
|
||||||
};
|
};
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
|
|||||||
@@ -3,7 +3,7 @@
|
|||||||
basic-data-form
|
basic-data-form
|
||||||
//contacts-form
|
//contacts-form
|
||||||
documents-form
|
documents-form
|
||||||
insurance-form
|
//insurance-form
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
|
|||||||
@@ -379,7 +379,7 @@ export const baseInfoMenu = [
|
|||||||
export const baseInsuranceForm = [
|
export const baseInsuranceForm = [
|
||||||
{
|
{
|
||||||
insuranceLabel: "ОМС",
|
insuranceLabel: "ОМС",
|
||||||
insuranceKey: "insuranceOMS",
|
insuranceKey: "OMS",
|
||||||
fields: [
|
fields: [
|
||||||
{
|
{
|
||||||
key: "series",
|
key: "series",
|
||||||
@@ -394,15 +394,15 @@ export const baseInsuranceForm = [
|
|||||||
inputMask: "####-####-####",
|
inputMask: "####-####-####",
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
key: "photo",
|
key: "attachments",
|
||||||
label: "Фото ОМС",
|
label: "Фото ОМС",
|
||||||
type: "avatar",
|
type: "photo",
|
||||||
},
|
},
|
||||||
],
|
],
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
insuranceLabel: "ДМС",
|
insuranceLabel: "ДМС",
|
||||||
insuranceKey: "insuranceDMS",
|
insuranceKey: "DMS",
|
||||||
fields: [
|
fields: [
|
||||||
{
|
{
|
||||||
key: "series",
|
key: "series",
|
||||||
@@ -417,9 +417,9 @@ export const baseInsuranceForm = [
|
|||||||
inputMask: "####-####-####",
|
inputMask: "####-####-####",
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
key: "photo",
|
key: "attachments",
|
||||||
label: "Фото ДМС",
|
label: "Фото ДМС",
|
||||||
type: "avatar",
|
type: "photo",
|
||||||
},
|
},
|
||||||
],
|
],
|
||||||
},
|
},
|
||||||
@@ -436,7 +436,7 @@ export const baseInsuranceForm = [
|
|||||||
{
|
{
|
||||||
key: "photo",
|
key: "photo",
|
||||||
label: "Документы",
|
label: "Документы",
|
||||||
type: "avatar",
|
type: "photo",
|
||||||
},
|
},
|
||||||
],
|
],
|
||||||
},
|
},
|
||||||
|
|||||||
@@ -34,20 +34,20 @@ const state = () => ({
|
|||||||
house: null,
|
house: null,
|
||||||
flat: null,
|
flat: null,
|
||||||
},
|
},
|
||||||
insuranceDMS: {
|
// insuranceDMS: {
|
||||||
series: null,
|
// series: null,
|
||||||
number: null,
|
// number: null,
|
||||||
photo: null,
|
// photo: null,
|
||||||
id: null,
|
// id: null,
|
||||||
organization: null,
|
// organization: null,
|
||||||
},
|
// },
|
||||||
insuranceOMS: {
|
// insuranceOMS: {
|
||||||
series: null,
|
// series: null,
|
||||||
number: null,
|
// number: null,
|
||||||
photo: null,
|
// photo: null,
|
||||||
id: null,
|
// id: null,
|
||||||
organization: null,
|
// organization: null,
|
||||||
},
|
// },
|
||||||
benefit: {
|
benefit: {
|
||||||
id: null,
|
id: null,
|
||||||
discount: null,
|
discount: null,
|
||||||
@@ -142,8 +142,6 @@ const getters = {
|
|||||||
(el) => el.category === "CURRENT_ADDRESS"
|
(el) => el.category === "CURRENT_ADDRESS"
|
||||||
) || {};
|
) || {};
|
||||||
let person = state.medicalCard.person;
|
let person = state.medicalCard.person;
|
||||||
let OMS = person?.insurance_policy?.find((e) => e.title === "OMS");
|
|
||||||
let DMS = person?.insurance_policy?.find((e) => e.title === "DMS");
|
|
||||||
return {
|
return {
|
||||||
personalData: {
|
personalData: {
|
||||||
last_name: person?.last_name || "",
|
last_name: person?.last_name || "",
|
||||||
@@ -176,30 +174,6 @@ const getters = {
|
|||||||
house: residenceAddress?.house || "",
|
house: residenceAddress?.house || "",
|
||||||
flat: residenceAddress?.flat || "",
|
flat: residenceAddress?.flat || "",
|
||||||
},
|
},
|
||||||
insuranceDMS: {
|
|
||||||
series: DMS?.series,
|
|
||||||
number: DMS?.number,
|
|
||||||
photo: DMS?.photo
|
|
||||||
? {
|
|
||||||
photo: rootState.getUrl + DMS?.photo,
|
|
||||||
file: null,
|
|
||||||
}
|
|
||||||
: {},
|
|
||||||
id: DMS?.id,
|
|
||||||
organization: DMS?.organization,
|
|
||||||
},
|
|
||||||
insuranceOMS: {
|
|
||||||
series: OMS?.series,
|
|
||||||
number: OMS?.number,
|
|
||||||
photo: OMS?.photo
|
|
||||||
? {
|
|
||||||
photo: rootState.getUrl + OMS?.photo,
|
|
||||||
file: null,
|
|
||||||
}
|
|
||||||
: {},
|
|
||||||
id: OMS?.id,
|
|
||||||
organization: OMS?.organization,
|
|
||||||
},
|
|
||||||
benefit: {
|
benefit: {
|
||||||
name: person?.benefit?.name,
|
name: person?.benefit?.name,
|
||||||
id: person?.benefit?.id,
|
id: person?.benefit?.id,
|
||||||
@@ -214,27 +188,25 @@ const getters = {
|
|||||||
};
|
};
|
||||||
},
|
},
|
||||||
getDocumentsData(state, rootState) {
|
getDocumentsData(state, rootState) {
|
||||||
const person = state.medicalCard?.person,
|
const documents = state.medicalCard?.person?.documents,
|
||||||
passport = person?.documents?.find(
|
passport = documents?.find(({ category }) => category === "passport"),
|
||||||
({ category }) => category === "passport"
|
insurance_number = documents?.find(
|
||||||
),
|
|
||||||
insurance_number = person?.documents?.find(
|
|
||||||
({ category }) => category === "insurance_number"
|
({ category }) => category === "insurance_number"
|
||||||
),
|
),
|
||||||
tax_identification_number = person?.documents?.find(
|
tax_identification_number = documents?.find(
|
||||||
({ category }) => category === "tax_identification_number"
|
({ category }) => category === "tax_identification_number"
|
||||||
);
|
),
|
||||||
|
OMS = documents?.find(({ category }) => category === "OMS"),
|
||||||
|
DMS = documents?.find(({ category }) => category === "DMS");
|
||||||
return {
|
return {
|
||||||
passport: {
|
passport: {
|
||||||
category: passport?.category || "",
|
category: "passport",
|
||||||
id: passport?.id || "",
|
id: passport?.id || "",
|
||||||
series: passport?.series || "",
|
series: passport?.series || "",
|
||||||
number: passport?.number || "",
|
number: passport?.number || "",
|
||||||
issued_by: passport?.issued_by || "",
|
issued_by: passport?.issued_by || "",
|
||||||
issued_by_org_code: passport?.issued_by_org_code || "",
|
issued_by_org_code: passport?.issued_by_org_code || "",
|
||||||
issued_at: passport?.issued_at
|
issued_at: passport?.issued_at ? passport?.issued_at : "",
|
||||||
? passport?.issued_at?.split("-")?.reverse()?.join(".")
|
|
||||||
: "",
|
|
||||||
attachments: passport?.attachments?.length
|
attachments: passport?.attachments?.length
|
||||||
? {
|
? {
|
||||||
photo: rootState.getUrl + passport?.attachments?.[0],
|
photo: rootState.getUrl + passport?.attachments?.[0],
|
||||||
@@ -243,7 +215,7 @@ const getters = {
|
|||||||
: {},
|
: {},
|
||||||
},
|
},
|
||||||
insurance_number: {
|
insurance_number: {
|
||||||
category: insurance_number?.category || "",
|
category: "insurance_number",
|
||||||
id: insurance_number?.id || "",
|
id: insurance_number?.id || "",
|
||||||
number: insurance_number?.number || "",
|
number: insurance_number?.number || "",
|
||||||
attachments: insurance_number?.attachments?.length
|
attachments: insurance_number?.attachments?.length
|
||||||
@@ -254,7 +226,7 @@ const getters = {
|
|||||||
: {},
|
: {},
|
||||||
},
|
},
|
||||||
tax_identification_number: {
|
tax_identification_number: {
|
||||||
category: tax_identification_number?.category || "",
|
category: "tax_identification_number",
|
||||||
id: tax_identification_number?.id || "",
|
id: tax_identification_number?.id || "",
|
||||||
number: tax_identification_number?.number || "",
|
number: tax_identification_number?.number || "",
|
||||||
attachments: tax_identification_number?.attachments?.length
|
attachments: tax_identification_number?.attachments?.length
|
||||||
@@ -265,6 +237,28 @@ const getters = {
|
|||||||
}
|
}
|
||||||
: {},
|
: {},
|
||||||
},
|
},
|
||||||
|
OMS: {
|
||||||
|
category: OMS?.category || "",
|
||||||
|
id: OMS?.id || "",
|
||||||
|
number: OMS?.number || "",
|
||||||
|
attachments: OMS?.attachments?.length
|
||||||
|
? {
|
||||||
|
photo: rootState.getUrl + OMS?.attachments?.[0],
|
||||||
|
file: null,
|
||||||
|
}
|
||||||
|
: {},
|
||||||
|
},
|
||||||
|
DMS: {
|
||||||
|
category: DMS?.category || "",
|
||||||
|
id: DMS?.id || "",
|
||||||
|
number: DMS?.number || "",
|
||||||
|
attachments: OMS?.attachments?.length
|
||||||
|
? {
|
||||||
|
photo: rootState.getUrl + DMS?.attachments?.[0],
|
||||||
|
file: null,
|
||||||
|
}
|
||||||
|
: {},
|
||||||
|
},
|
||||||
};
|
};
|
||||||
},
|
},
|
||||||
getContactsData(state) {
|
getContactsData(state) {
|
||||||
|
|||||||
Reference in New Issue
Block a user