WIP Добавил отображение данных медицинской карты

This commit is contained in:
DwCay
2022-12-30 17:52:22 +03:00
parent 1c824bc540
commit 969416cd26
5 changed files with 211 additions and 36 deletions

View File

@@ -1,20 +1,87 @@
<template lang="pug">
.wrapper.flex.w-full.relative.mx-2
.wrapper-medical.relative.flex.flex-col.px-6.py-6.h-full.w-full
base-detail-info(:title="configData.identity_document.title" :height="configData.identity_document.height")
base-detail-info(
:title="configData.identity_document.title"
:height="configData.identity_document.height"
:data="medicalDataInit.identity_document"
)
base-detail-input(
v-for="field in configData.identity_document.fields"
:field="field"
:data="medicalDataInit.identity_document"
)
.flex.flex-col.gap-30px
base-detail-info(:title="configData.registration_address.title" :height="configData.registration_address.height")
base-detail-info(:title="configData.temporary_address.title" :height="configData.temporary_address.height")
base-detail-info(
:title="configData.registration_address.title"
:height="configData.registration_address.height"
:data="medicalDataInit.registration_address"
)
base-detail-input(
v-for="field in configData.registration_address.fields"
:field="field"
:data="medicalDataInit.registration_address"
)
base-detail-info(
:title="configData.temporary_address.title"
:height="configData.temporary_address.height"
:data="medicalDataInit.temporary_address"
)
base-detail-input(
v-for="field in configData.temporary_address.fields"
:field="field"
:data="medicalDataInit.temporary_address"
)
.flex.flex-col.gap-2
base-detail-info(:title="configData.snils.title" :height="configData.snils.height")
base-detail-info(:title="configData.policy_number_series.title" :height="configData.policy_number_series.height")
base-detail-info(:title="configData.policy_organization.title" :height="configData.policy_organization.height")
base-detail-info(
:title="configData.snils.title"
:height="configData.snils.height"
:data="medicalDataInit.snils"
)
base-detail-input(
v-for="field in configData.snils.fields"
:field="field"
:data="medicalDataInit.snils"
)
base-detail-info(
:title="configData.policy.title"
:height="configData.policy.height"
:data="medicalDataInit.policy"
)
base-detail-input(
v-for="field in configData.policy.fields"
:field="field"
:data="medicalDataInit.policy"
)
base-detail-info(
:title="configData.policy_organization.title"
:height="configData.policy_organization.height"
:data="medicalDataInit.policy_organization"
)
base-detail-input(
v-for="field in configData.policy_organization.fields"
:field="field"
:data="medicalDataInit.policy_organization"
)
.flex.flex-col.gap-4
base-detail-info(:title="configData.additional.title" :height="configData.additional.height")
base-detail-info(:title="configData.agreement_form.title" :height="configData.agreement_form.height")
base-detail-info(
:title="configData.additional.title"
:height="configData.additional.height"
:data="medicalDataInit.additional"
)
base-detail-input(
v-for="field in configData.additional.fields"
:field="field"
:data="medicalDataInit.additional"
)
base-detail-info(
:title="configData.agreement_form.title"
:height="configData.agreement_form.height"
)
</template>
<script>
import BaseDetailInput from "@/components/base/BaseDetailInput.vue";
import BaseDetailInfo from "@/components/base/BaseDetailInfo.vue";
import { medicalDetailConfig } from "@/pages/medicalCard/utils/medicalConfig";
import { fetchWrapper } from "@/shared/fetchWrapper";
@@ -22,11 +89,45 @@ import BaseInput from "@/components/base/BaseInput.vue";
import ClientDetailInput from "@/pages/clients/components/ClientDetailInput.vue";
export default {
name: "MedicalCardWrapper",
components: { ClientDetailInput, BaseInput, BaseDetailInfo },
components: { ClientDetailInput, BaseInput, BaseDetailInfo, BaseDetailInput },
data() {
return {
configData: medicalDetailConfig,
medicalDataInit: {},
medicalDataInit: {
identity_document: {
number_series: null,
issued_by_org: null,
issued_by_org_code: null,
issued_by_date: null,
},
registration_address: {
registration_address: null,
},
temporary_address: {
temporary_address: null,
},
snils: {
insurance_number: null,
},
policy: {
series: null,
number: null,
},
policy_organization: {
policy_organization: null,
},
additional: {
name_confidant: null,
phone_confidant: null,
},
benefit_code: {
benefit_code: null,
},
agreement_form: {
agreement: null,
agreement_date: null,
},
},
};
},
methods: {
@@ -40,6 +141,7 @@ export default {
identity_document: {
...pass,
number_series: `${pass.series} ${pass.number}`,
issued_by_date: new Date(pass.issued_by_date),
},
registration_address: {
registration_address: data?.person?.address?.find(
@@ -66,7 +168,7 @@ export default {
: null,
phone_confidant: confidant?.contacts?.find(
(el) => el?.kind === "PHONE"
),
)?.username,
},
benefit_code: {
benefit_code: data?.benefit_code,

View File

@@ -6,105 +6,107 @@ export const medicalDetailConfig = {
{
label: "number_series",
title: "Серия и номер",
type: "input",
type: "text",
copy: true,
},
{
label: "issued_by_org",
title: "Выдан",
type: "input",
type: "textarea",
},
{
label: "issued_by_org_code",
title: "Код подразделения",
type: "input",
type: "text",
},
{
label: "issued_by_date",
title: "Дата выдачи",
type: "data",
type: "date",
},
],
},
registration_address: {
height: 130,
title: "Адреес регистрации",
height: 135,
title: "Адрес регистрации",
fields: [
{
label: "registration_address",
title: "Полный адрес",
type: "input",
type: "textarea",
},
],
},
temporary_address: {
height: 130,
title: "Адреес проживания",
height: 135,
title: "Адрес проживания",
fields: [
{
label: "temporary_address",
title: "Полный адрес",
type: "input",
type: "textarea",
},
],
},
snils: {
height: 108,
height: 135,
title: "СНИЛС",
fields: [
{
label: "insurance_number",
title: "Номер",
type: "input",
type: "text",
copy: true,
},
],
},
policy_number_series: {
height: 170,
policy: {
height: 210,
title: "ПОЛИС",
fields: [
{
label: "series",
title: "Серия",
type: "input",
type: "text",
},
{
label: "number",
title: "Номер",
type: "input",
type: "text",
},
],
},
policy_organization: {
height: 111,
height: 135,
title: "Страховая организация",
fields: [
{
label: "organization",
title: "Название",
type: "input",
type: "text",
},
],
},
additional: {
height: 202,
height: 275,
title: "Дополнительная информация",
fields: [
{
icon: "icon-person",
label: "name_confidant",
title: "Доверенное лицо",
type: "input",
type: "text",
},
{
icon: "icon-phone",
label: "phone_confidant",
title: "",
type: "input",
type: "text",
},
{
label: "benefit_code",
title: "Код категории льготы",
type: "input",
type: "text",
},
],
},