Merge branch 'ASTRA-46' into 'master'
Resolve ASTRA-46 See merge request andrusyakka/urban-couscous!306
This commit is contained in:
@@ -61,3 +61,4 @@
|
|||||||
--bg-disable-grey-color: #f0f0f0
|
--bg-disable-grey-color: #f0f0f0
|
||||||
--bg-grey-color: rgba(37, 40, 80, 0.15)
|
--bg-grey-color: rgba(37, 40, 80, 0.15)
|
||||||
--bg-aqua-blue: #55c5e8
|
--bg-aqua-blue: #55c5e8
|
||||||
|
|
||||||
|
|||||||
@@ -0,0 +1,118 @@
|
|||||||
|
<template lang="pug">
|
||||||
|
medical-form-wrapper(
|
||||||
|
title="Страховка",
|
||||||
|
:is-edit="isEdit",
|
||||||
|
:open-edit="openEdit",
|
||||||
|
:cancel="cancelEdit"
|
||||||
|
)
|
||||||
|
.form-wrap.gap-24.w-full
|
||||||
|
.data-section.flex.flex-col.gap-4(v-for="insurance in insuranceConfig")
|
||||||
|
.font-semibold.text-sm.whitespace-nowrap {{insurance.insuranceLabel}}
|
||||||
|
.flex.w-full.justify-between.items-center.gap-4(v-for="field in insurance.fields")
|
||||||
|
.label-field.font-sm.text-sm.whitespace-nowrap {{`${field.label} :`}}
|
||||||
|
.avatar-field.flex.gap-3.items-center.h-10.w-10(v-if="field.type === 'photo'")
|
||||||
|
img.avatar.object-cover(
|
||||||
|
v-if="basic[insurance.insuranceKey][field.key]",
|
||||||
|
:src="basic[insurance.insuranceKey][field.key]",
|
||||||
|
alt="AV"
|
||||||
|
)
|
||||||
|
.replace-photo.font-medium.text-base.cursor-pointer(
|
||||||
|
v-if="isEdit"
|
||||||
|
) {{ basic[insurance.insuranceKey][field.key] ? "Заменить фото" : "Добавить фото"}}
|
||||||
|
.flex.flex-col.relative(v-else)
|
||||||
|
base-input(
|
||||||
|
v-model="basic[insurance.insuranceKey][field?.key]",
|
||||||
|
@update:model-value="checkChangeInput",
|
||||||
|
:disabled="!isEdit",
|
||||||
|
:standout="!isEdit",
|
||||||
|
:outlined="isEdit",
|
||||||
|
:type="field.type",
|
||||||
|
:width="300",
|
||||||
|
text-color="black"
|
||||||
|
)
|
||||||
|
.flex.font-medium.text-smm.absolute.top-10(
|
||||||
|
v-if="basic?.benefit[insurance?.discount]",
|
||||||
|
:style="{color: 'var(--font-grey-color)'}"
|
||||||
|
)
|
||||||
|
span Процент скидки:
|
||||||
|
span(
|
||||||
|
:style="{color: 'var(--font-dark-blue-color)'}"
|
||||||
|
) {{"\xa0" + basic?.benefit[insurance?.discount] + "%"}}
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<script>
|
||||||
|
import { baseInsuranceForm } from "@/pages/newMedicalCard/utils/medicalConfig";
|
||||||
|
import { mapGetters, mapState } from "vuex";
|
||||||
|
import MedicalFormWrapper from "@/pages/newMedicalCard/components/MedicalFormWrapper.vue";
|
||||||
|
import BaseAvatar from "@/components/base/BaseAvatar.vue";
|
||||||
|
import BaseInput from "@/components/base/BaseInput.vue";
|
||||||
|
|
||||||
|
export default {
|
||||||
|
name: "InsuranceForm",
|
||||||
|
components: { MedicalFormWrapper, BaseAvatar, BaseInput },
|
||||||
|
data() {
|
||||||
|
return {
|
||||||
|
insuranceConfig: baseInsuranceForm,
|
||||||
|
isCheckChange: false,
|
||||||
|
isEdit: false,
|
||||||
|
};
|
||||||
|
},
|
||||||
|
computed: {
|
||||||
|
...mapGetters({
|
||||||
|
url: "getUrl",
|
||||||
|
initDataBasic: "getBasicData",
|
||||||
|
}),
|
||||||
|
...mapState({
|
||||||
|
basic: (state) => state.medical.basicData,
|
||||||
|
}),
|
||||||
|
},
|
||||||
|
methods: {
|
||||||
|
checkChangeInput() {
|
||||||
|
let initData = JSON.stringify(this.initDataBasic);
|
||||||
|
let changeData = JSON.stringify(this.basic);
|
||||||
|
if (initData !== changeData) {
|
||||||
|
this.isCheckChange = true;
|
||||||
|
} else {
|
||||||
|
this.isCheckChange = false;
|
||||||
|
}
|
||||||
|
},
|
||||||
|
cancelEdit() {
|
||||||
|
this.isEdit = false;
|
||||||
|
},
|
||||||
|
openEdit() {
|
||||||
|
this.isEdit = true;
|
||||||
|
},
|
||||||
|
},
|
||||||
|
};
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<style lang="sass" scoped>
|
||||||
|
.select
|
||||||
|
width: 324px
|
||||||
|
|
||||||
|
.avatar-field
|
||||||
|
min-width: 324px
|
||||||
|
|
||||||
|
.avatar
|
||||||
|
height: 100%
|
||||||
|
|
||||||
|
.replace-photo
|
||||||
|
color: var(--btn-blue-color)
|
||||||
|
|
||||||
|
.input
|
||||||
|
color: purple
|
||||||
|
|
||||||
|
.form-wrap
|
||||||
|
display: grid
|
||||||
|
grid-template-columns: repeat(3, 1fr)
|
||||||
|
grid-template-rows: repeat(1, 1fr)
|
||||||
|
@media(max-width: 1900px)
|
||||||
|
grid-template-columns: repeat(2, 1fr)
|
||||||
|
grid-template-rows: repeat(2, 1fr)
|
||||||
|
@media(max-width: 1320px)
|
||||||
|
grid-template-columns: repeat(1, 1fr)
|
||||||
|
grid-template-rows: repeat(3, 1fr)
|
||||||
|
|
||||||
|
.label-field
|
||||||
|
color: var(--font-grey-color)
|
||||||
|
</style>
|
||||||
@@ -2,14 +2,17 @@
|
|||||||
.flex.flex-col.gap-y-2.wrapper
|
.flex.flex-col.gap-y-2.wrapper
|
||||||
basic-data-form
|
basic-data-form
|
||||||
documents-form
|
documents-form
|
||||||
|
insurance-form
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
import BasicDataForm from "@/pages/newMedicalCard/components/BasicDataForms/BasicDataForm.vue";
|
import BasicDataForm from "@/pages/newMedicalCard/components/BasicDataForms/BasicDataForm.vue";
|
||||||
import DocumentsForm from "@/pages/newMedicalCard/components/BasicDataForms/DocumentsForm.vue";
|
import DocumentsForm from "@/pages/newMedicalCard/components/BasicDataForms/DocumentsForm.vue";
|
||||||
|
import InsuranceForm from "@/pages/newMedicalCard/components/BasicDataForms/InsuranceForm.vue";
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
name: "MedicalBasicDataWrapper",
|
name: "MedicalBasicDataWrapper",
|
||||||
components: { BasicDataForm, DocumentsForm },
|
components: { BasicDataForm, DocumentsForm, InsuranceForm },
|
||||||
};
|
};
|
||||||
</script>
|
</script>
|
||||||
<style lang="sass" scoped>
|
<style lang="sass" scoped>
|
||||||
|
|||||||
@@ -180,6 +180,67 @@ export const baseInfoMenu = [
|
|||||||
},
|
},
|
||||||
];
|
];
|
||||||
|
|
||||||
|
export const baseInsuranceForm = [
|
||||||
|
{
|
||||||
|
insuranceLabel: "ДМС",
|
||||||
|
insuranceKey: "insuranceDMS",
|
||||||
|
fields: [
|
||||||
|
{
|
||||||
|
key: "series",
|
||||||
|
label: "Серия",
|
||||||
|
type: "text",
|
||||||
|
},
|
||||||
|
{
|
||||||
|
key: "number",
|
||||||
|
label: "Номер",
|
||||||
|
type: "text",
|
||||||
|
},
|
||||||
|
{
|
||||||
|
key: "photo",
|
||||||
|
label: "Фото ДМС",
|
||||||
|
type: "photo",
|
||||||
|
},
|
||||||
|
],
|
||||||
|
},
|
||||||
|
{
|
||||||
|
insuranceLabel: "ОМС",
|
||||||
|
insuranceKey: "insuranceOMS",
|
||||||
|
fields: [
|
||||||
|
{
|
||||||
|
key: "series",
|
||||||
|
label: "Серия",
|
||||||
|
type: "text",
|
||||||
|
},
|
||||||
|
{
|
||||||
|
key: "number",
|
||||||
|
label: "Номер",
|
||||||
|
type: "text",
|
||||||
|
},
|
||||||
|
{
|
||||||
|
key: "photo",
|
||||||
|
label: "Фото ОМС",
|
||||||
|
type: "photo",
|
||||||
|
},
|
||||||
|
],
|
||||||
|
},
|
||||||
|
{
|
||||||
|
insuranceLabel: "Категория льготы",
|
||||||
|
insuranceKey: "benefit",
|
||||||
|
discount: "discount",
|
||||||
|
fields: [
|
||||||
|
{
|
||||||
|
key: "name",
|
||||||
|
label: "Категория",
|
||||||
|
type: "select",
|
||||||
|
},
|
||||||
|
{
|
||||||
|
key: "photo",
|
||||||
|
label: "Документы",
|
||||||
|
type: "photo",
|
||||||
|
},
|
||||||
|
],
|
||||||
|
},
|
||||||
|
];
|
||||||
export const routesDictionary = {
|
export const routesDictionary = {
|
||||||
"/clients": "Клиенты",
|
"/clients": "Клиенты",
|
||||||
"/calendar": "Календарь",
|
"/calendar": "Календарь",
|
||||||
|
|||||||
@@ -26,6 +26,21 @@ const state = () => ({
|
|||||||
house_number: null,
|
house_number: null,
|
||||||
apartment_number: null,
|
apartment_number: null,
|
||||||
},
|
},
|
||||||
|
insuranceDMS: {
|
||||||
|
series: null,
|
||||||
|
number: null,
|
||||||
|
photo: null,
|
||||||
|
},
|
||||||
|
insuranceOMS: {
|
||||||
|
series: null,
|
||||||
|
number: null,
|
||||||
|
photo: null,
|
||||||
|
},
|
||||||
|
benefit: {
|
||||||
|
name: null,
|
||||||
|
discount: null,
|
||||||
|
photo: null,
|
||||||
|
},
|
||||||
},
|
},
|
||||||
avatar: "",
|
avatar: "",
|
||||||
});
|
});
|
||||||
@@ -73,6 +88,31 @@ const getters = {
|
|||||||
apartment_number: residenceAddress?.apartment_number,
|
apartment_number: residenceAddress?.apartment_number,
|
||||||
id: residenceAddress?.id,
|
id: residenceAddress?.id,
|
||||||
},
|
},
|
||||||
|
insuranceDMS: {
|
||||||
|
series: person?.insurance_policy?.find((e) => e.title === "DMS")
|
||||||
|
?.series,
|
||||||
|
number: person.insurance_policy.find((e) => e.title === "DMS")?.number,
|
||||||
|
photo: person.insurance_policy.find((e) => e.title === "DMS")?.photo
|
||||||
|
? rootState.getUrl +
|
||||||
|
person.insurance_policy.find((e) => e.title === "DMS")?.photo
|
||||||
|
: null,
|
||||||
|
},
|
||||||
|
insuranceOMS: {
|
||||||
|
series: person?.insurance_policy?.find((e) => e.title === "OMS")
|
||||||
|
?.series,
|
||||||
|
number: person.insurance_policy.find((e) => e.title === "OMS")?.number,
|
||||||
|
photo: person.insurance_policy.find((e) => e.title === "OMS")?.photo
|
||||||
|
? rootState.getUrl +
|
||||||
|
person.insurance_policy.find((e) => e.title === "OMS")?.photo
|
||||||
|
: null,
|
||||||
|
},
|
||||||
|
benefit: {
|
||||||
|
name: person?.benefit?.name,
|
||||||
|
discount: person?.benefit?.discount,
|
||||||
|
photo: person?.photo_benefit
|
||||||
|
? rootState.getUrl + person.photo_benefit
|
||||||
|
: null,
|
||||||
|
},
|
||||||
};
|
};
|
||||||
},
|
},
|
||||||
getAvatar(state) {
|
getAvatar(state) {
|
||||||
|
|||||||
Reference in New Issue
Block a user