[WIP] Добавил форму недавно просмотренных медкарт, фикс стилей

This commit is contained in:
megavrilinvv
2023-07-26 16:37:47 +03:00
parent 75506acad1
commit f113e8ebf5
7 changed files with 283 additions and 54 deletions

View File

@@ -1,6 +1,6 @@
<template lang="pug"> <template lang="pug">
medcard-form-wrapper(v-if="patient", title="Пациент на приеме", title-link="Медкарта") medcard-form-wrapper(v-if="patient", title="Пациент на приеме", title-link="Медкарта")
.flex.flex-col .flex.flex-col.h-full
.header.flex.px-6.py-5.justify-between .header.flex.px-6.py-5.justify-between
.flex.text-base.font-medium.gap-x-3 .flex.text-base.font-medium.gap-x-3
img.h-14.w-14.object-cover.rounded-full(:src="patient?.avatar") img.h-14.w-14.object-cover.rounded-full(:src="patient?.avatar")
@@ -12,16 +12,15 @@
.priority.flex(:class="choiceClass(patient.priority)") .priority.flex(:class="choiceClass(patient.priority)")
.text-smm(:class="choiceColor(patient.priority)") {{choicePriority(patient.priority)}} .text-smm(:class="choiceColor(patient.priority)") {{choicePriority(patient.priority)}}
.grey-color.text-smm Приоритет .grey-color.text-smm Приоритет
.flex .flex.h-full
.data.flex.w-full.h-full(v-for="item in data") .data.flex.w-full.h-full.flex-col.px-6.py-4.gap-y-6.overflow-hidden(v-for="item in data")
.flex.flex-col.px-6.py-4.gap-y-6
.text-m.font-bold {{item.title}} .text-m.font-bold {{item.title}}
.flex.flex-col.text-smm .flex.flex-col.text-smm.overflow-hidden.relative.gap-y-1
.grey-color {{item.text1}} .grey-color {{item.firstLabel}}
.font-medium {{item.first}} .insurance.flex.font-medium {{item.firstDescription}}
.flex.flex-col.text-smm .flex.flex-col.text-smm.gap-y-1
.grey-color {{item.text2}} .grey-color {{item.secondLabel}}
.font-medium {{item.second}} .font-medium {{item.secondDescription}}
</template> </template>
<script> <script>
@@ -48,9 +47,9 @@ export default {
{ name: "Низский", id: 3, class: "low-priority" }, { name: "Низский", id: 3, class: "low-priority" },
], ],
data: [ data: [
{ title: "Запись", text1: "Дата", text2: "Время" }, { title: "Запись", firstLabel: "Дата", secondLabel: "Время" },
{ title: "Данные", text1: "Телефон", text2: "Email" }, { title: "Данные", firstLabel: "Телефон", secondLabel: "Email" },
{ title: "Страхование", text1: "Компания", text2: "Полис" }, { title: "Страхование", firstLabel: "Компания", secondLabel: "Полис" },
], ],
}; };
}, },
@@ -75,15 +74,15 @@ export default {
deep: true, deep: true,
immediate: true, immediate: true,
handler() { handler() {
this.data[0].first = moment().format("DD MMMM"); this.data[0].firstDescription = moment().format("DD MMMM");
this.data[0].second = this.data[0].secondDescription =
this.patient?.time?.from + "-" + this.patient?.time?.to; this.patient?.time?.from + "-" + this.patient?.time?.to;
this.data[1].first = this.patient?.phone; this.data[1].firstDescription = this.patient?.phone;
this.data[1].second = this.patient?.email; this.data[1].secondDescription = this.patient?.email;
this.data[2].first = this.patient?.company; this.data[2].firstDescription = this.patient?.company;
this.data[2].second = this.patient?.policy; this.data[2].secondDescription = this.patient?.policy;
}, },
}, },
}, },
@@ -101,8 +100,28 @@ export default {
.data .data
border-right: 1px solid var(--gray-scondary) border-right: 1px solid var(--gray-scondary)
&:first-child
max-width: 154px
&:last-child &:last-child
@media (max-width: 1820px)
max-width: 282px
border-right: none border-right: none
max-width: 214px
.insurance
width: 209px
overflow: hidden
&:after
content: ""
text-align: right
position: absolute
bottom: 0
right: 0
width: 72px
height: 24px
background: linear-gradient(270deg, #FFF 0%, rgba(255, 255, 255, 0.24) 50.73%, rgba(255, 255, 255, 0.00) 100%)
pointer-events: none
@media (max-width: 1820px)
width: 234px
.high-priority .high-priority
background: var(--system-color-red) background: var(--system-color-red)

View File

@@ -2,22 +2,36 @@
medcard-form-wrapper.relative( medcard-form-wrapper.relative(
title="Пациенты на сегодня", title="Пациенты на сегодня",
:quantity="patientsData.length", :quantity="patientsData.length",
:link="redirectCalendar",
title-link="Календарь" title-link="Календарь"
) )
.form-wrapper.flex.flex-col.overflow-y-auto(@scroll="scrollTo") .form-wrapper.flex.flex-col.overflow-y-auto(
.patient.flex.items-center.gap-x-6.p-4(v-for="(patient, index) in patientsData") @scroll="scrollTo",
:class="{'default-form': patientsData.length <= 3}"
)
.patient.flex.items-center.p-4.justify-between(
v-for="(patient, index) in patientsData",
:class="{'default-patient': patientsData.length <= 3}",
@click="changeView(patient.id)"
)
.flex.text-base.font-medium.gap-x-3 .flex.text-base.font-medium.gap-x-3
img.h-11.w-11.object-cover.rounded-full(:src="patient.avatar") img.h-11.w-11.object-cover.rounded-full(:src="patient.avatar")
.flex.flex-col.justify-center .flex.flex-col.justify-center.gap-y-1
.name.flex.relative {{trimName(patient.last_name, patient.first_name, patient.patronymic)}} .name.flex.relative {{trimName(patient.last_name, patient.first_name, patient.patronymic)}}
.gradient.flex.absolute
.grey-color.text-smm {{patient.birthday}} .grey-color.text-smm {{patient.birthday}}
.flex.flex-col.justify-center .flex.flex-col.justify-center.w-full(:style="{width: '140px'}")
.text-m.font-bold {{patient.time.from + " - " + patient.time.to}} .text-m.font-bold {{patient.time.from + " - " + patient.time.to}}
.grey-color.font-medium.text-smm( .grey-color.font-medium.text-smm(
:class="{'red-color': !index}" :class="{'red-color': !index}"
) {{index ? "Время посещения" : "Скоро прием" }} ) {{index ? "Время посещения" : "Скоро прием" }}
.flex .flex
q-btn.btn(
icon="app:medcard",
size="18px",
dense,
padding="8px",
style="color: var(--font-grey-color); background: var(--bg-light-grey)"
)
.gradient-name.flex.absolute(v-if="isGradient") .gradient-name.flex.absolute(v-if="isGradient")
</template> </template>
@@ -38,8 +52,12 @@ export default {
if (a.time.from < b.time.from) return -1; if (a.time.from < b.time.from) return -1;
return 0; return 0;
}) })
.filter(({ reception }) => reception === moment().format("DD.MM.YYYY")), .filter(
isGradient: true, (e) =>
e.reception === moment().format("DD.MM.YYYY") &&
e.time.from > moment().format("HH:MM")
),
isGradient: false,
}; };
}, },
methods: { methods: {
@@ -48,6 +66,20 @@ export default {
if (fullName.length > 30) return fullName.slice(0, 30); if (fullName.length > 30) return fullName.slice(0, 30);
return fullName; return fullName;
}, },
changeView(id) {
let view = [];
this.patientsData.map((e) => {
if (e.id === id) {
e.view = true;
view.push(e);
e.viewDate = moment().format("DD.MM.YYYY");
}
});
localStorage.view = JSON.stringify(view);
},
redirectCalendar() {
this.$router.push("/calendar");
},
scrollTo(event) { scrollTo(event) {
if ( if (
Math.abs( Math.abs(
@@ -74,6 +106,18 @@ export default {
.name .name
width: 272px width: 272px
&:after
content: ""
text-align: right
position: absolute
bottom: 0
right: 0
width: 72px
height: 24px
background: linear-gradient(270deg, #FFF 0%, rgba(255, 255, 255, 0.24) 50.73%, rgba(255, 255, 255, 0.00) 100%)
pointer-events: none
@media (max-width: 1820px)
width: 340px
.patient .patient
border-bottom: 1px solid var(--gray-scondary) border-bottom: 1px solid var(--gray-scondary)
@@ -82,13 +126,16 @@ export default {
&:last-child &:last-child
border-bottom: none border-bottom: none
.gradient .default-patient
background: linear-gradient(90deg, #FFF 0%, rgba(255, 255, 255, 0.24) 50.73%, rgba(255, 255, 255, 0.00) 100%) margin-right: 0px
width: 72px border-right: none
height: 24px &:last-child
right: 0 border-bottom: 1px solid var(--gray-scondary)
top: 0
transform: rotate(180deg) .default-form
margin-right: 0px
&:last-child
border-bottom: none
.gradient-name .gradient-name
background: linear-gradient(180deg, rgba(255, 255, 255, 0.00) 0%, #FFF 100%) background: linear-gradient(180deg, rgba(255, 255, 255, 0.00) 0%, #FFF 100%)
@@ -97,6 +144,11 @@ export default {
bottom: 0 bottom: 0
left: 0 left: 0
.btn
border: 1px solid var(--gray-scondary)
color: var(--font-grey-color)
background: var(--bg-light-grey)
.grey-color .grey-color
color: var(--font-grey-color) color: var(--font-grey-color)

View File

@@ -1,14 +1,141 @@
<template lang="pug"> <template lang="pug">
medcard-form-wrapper(title="Недавно просмотренные медкарты") medcard-form-wrapper(title="Недавно просмотренные медкарты")
.form-wrapper.flex.flex-col.overflow-y-auto(
@scroll="scrollTo",
:class="{'default-params': viewPatients.length <= 3}"
)
.patient.flex.items-center.p-4.justify-between(
v-for="(patient, index) in viewPatients",
:class="{'default-params': viewPatients.length <= 3}"
)
.flex.text-base.font-medium.gap-x-3
img.h-11.w-11.object-cover.rounded-full(:src="patient.avatar")
.flex.flex-col.justify-center.gap-y-1
.name.flex.relative {{trimName(patient.last_name, patient.first_name, patient.patronymic)}}
.grey-color.text-smm {{"Медкарта #" + patient.id}}
.flex.flex-col.font-medium.text-m.gap-y-1(:style="{width: '140px'}")
span {{patient.viewDate}}
.grey-color.text-smm Дата просмотра
.flex
q-btn.btn(
icon="app:medcard",
size="18px",
dense,
padding="8px",
style="color: var(--font-grey-color); background: var(--bg-light-grey)"
)
.gradient-name.flex.absolute(v-if="isGradient")
</template> </template>
<script> <script>
import MedcardFormWrapper from "@/pages/medcards/components/MedcardFormWrapper.vue"; import MedcardFormWrapper from "@/pages/medcards/components/MedcardFormWrapper.vue";
import { patientList } from "@/pages/newCalendar/utils/calendarConfig";
export default { export default {
name: "ViewedMedicalRecordsForm", name: "ViewedMedicalRecordsForm",
components: { MedcardFormWrapper }, components: { MedcardFormWrapper },
data() {
return {
viewPatients: [],
patientsData: patientList.find(({ label }) => label === "Пациенты").data,
isGradient: false,
};
},
methods: {
trimName(last, first, patronymic) {
let fullName = last + " " + first + " " + patronymic;
if (fullName.length > 30) return fullName.slice(0, 30);
return fullName;
},
scrollTo(event) {
if (
Math.abs(
event.currentTarget.scrollHeight -
event.currentTarget.clientHeight -
event.currentTarget.scrollTop
) < 1
)
return (this.isGradient = false);
this.isGradient = true;
},
},
watch: {
patientsData: {
immediate: true,
deep: true,
handler() {
if (localStorage.getItem("view"))
this.viewPatients.push(...JSON.parse(localStorage.getItem("view")));
},
},
},
}; };
</script> </script>
<style lang="sass" scoped></style> <style lang="sass" scoped>
.form-wrapper
margin-right: 8px
&::-webkit-scrollbar
width: 4px
&::-webkit-scrollbar-track:vertical
margin-top: 16px
margin-bottom: 16px
.name
width: 272px
&:after
content: ""
text-align: right
position: absolute
bottom: 0
right: 0
width: 72px
height: 24px
background: linear-gradient(270deg, #FFF 0%, rgba(255, 255, 255, 0.24) 50.73%, rgba(255, 255, 255, 0.00) 100%)
pointer-events: none
.patient
border-bottom: 1px solid var(--gray-scondary)
border-right: 1px solid var(--gray-scondary)
margin-right: 8px
&:last-child
border-bottom: none
.default-params
margin-right: 0px
border-right: none
&:last-child
border-bottom: 1px solid var(--gray-scondary)
.default-params.form-wrapper
border-right: none
margin-right: 0px
&:last-child
border-bottom: none
.btn
border: 1px solid var(--gray-scondary)
color: var(--font-grey-color)
background: var(--bg-light-grey)
.gradient
background: linear-gradient(90deg, #FFF 0%, rgba(255, 255, 255, 0.24) 50.73%, rgba(255, 255, 255, 0.00) 100%)
width: 72px
height: 24px
right: 0
top: 0
transform: rotate(180deg)
.gradient-name
background: linear-gradient(180deg, rgba(255, 255, 255, 0.00) 0%, #FFF 100%)
width: 580px
height: 43px
bottom: 0
left: 0
.grey-color
color: var(--font-grey-color)
.red-color
color: var(--system-color-red)
</style>

View File

@@ -1,5 +1,5 @@
<template lang="pug"> <template lang="pug">
.form-wrapper.flex.flex-col.w-full.rounded .wrapper.flex.flex-col.w-full.rounded
.header.flex.items-center.text-sm.font-bold.justify-between.w-full.px-6.py-5 .header.flex.items-center.text-sm.font-bold.justify-between.w-full.px-6.py-5
.left-side.flex.gap-x-2.items-center .left-side.flex.gap-x-2.items-center
span {{title}} span {{title}}
@@ -22,7 +22,7 @@ export default {
</script> </script>
<style lang="sass" scoped> <style lang="sass" scoped>
.form-wrapper .wrapper
height: 360px height: 360px
background: var(--default-white) background: var(--default-white)
color: var(--font-dark-blue-color) color: var(--font-dark-blue-color)

View File

@@ -2,7 +2,7 @@
.table-wrapper.flex.gap-x-2 .table-wrapper.flex.gap-x-2
todays-patients-form todays-patients-form
current-patient-form current-patient-form
viewed-medical-records-form viewed-medical-records-form.viev
</template> </template>
<script> <script>
@@ -20,4 +20,8 @@ export default {
}; };
</script> </script>
<style lang="sass" scoped></style> <style lang="sass" scoped>
.viev
@media (max-width: 1820px)
display: none
</style>

View File

@@ -17,6 +17,7 @@
span Создать запись span Создать запись
.flex.flex-col.gap-y-px .flex.flex-col.gap-y-px
q-expansion-item.expansion.font-bold.text-xm( q-expansion-item.expansion.font-bold.text-xm(
expand-icon="app:down-arrow",
v-for="(elem, index) in patientList", v-for="(elem, index) in patientList",
expand-separator, expand-separator,
:label="elem.label", :label="elem.label",
@@ -301,6 +302,10 @@ export default {
.expansion :deep(.q-focus-helper) .expansion :deep(.q-focus-helper)
display: none display: none
.expansion
&:deep(path)
fill: var(--font-dark-blue-color)
.person-wrapper .person-wrapper
overflow-y: auto overflow-y: auto
margin-right: -10px margin-right: -10px

View File

@@ -119,8 +119,10 @@ export const patientList = [
birthday: "28.03.1980", birthday: "28.03.1980",
avatar: personImage, avatar: personImage,
check: false, check: false,
reception: "25.07.2023", view: false,
time: { from: "12:00", to: "23:00" }, viewDate: "",
reception: "26.07.2023",
time: { from: "11:00", to: "18:00" },
priority: 1, priority: 1,
phone: "+7 (910) 6233223", phone: "+7 (910) 6233223",
email: "gaevaia@yandex.ru", email: "gaevaia@yandex.ru",
@@ -135,8 +137,10 @@ export const patientList = [
birthday: "01.03.1975", birthday: "01.03.1975",
avatar: personImage, avatar: personImage,
check: false, check: false,
reception: "25.07.2023", view: false,
time: { from: "11:00", to: "12:00" }, viewDate: "",
reception: "26.07.2023",
time: { from: "05:00", to: "06:00" },
priority: 1, priority: 1,
phone: "+7 (910) 6233223", phone: "+7 (910) 6233223",
email: "gaevaia@yandex.ru", email: "gaevaia@yandex.ru",
@@ -151,8 +155,10 @@ export const patientList = [
birthday: "13.07.1999", birthday: "13.07.1999",
avatar: personImage, avatar: personImage,
check: false, check: false,
reception: "25.07.2023", view: false,
time: { from: "14:00", to: "16:00" }, viewDate: "",
reception: "26.07.2023",
time: { from: "18:00", to: "19:00" },
priority: 1, priority: 1,
phone: "+7 (910) 6233223", phone: "+7 (910) 6233223",
email: "gaevaia@yandex.ru", email: "gaevaia@yandex.ru",
@@ -161,14 +167,16 @@ export const patientList = [
}, },
{ {
id: 3, id: 3,
first_name: "Самвел", first_name: "Самвелиуслим",
last_name: "Акопян", last_name: "Акопян",
patronymic: "Робертович", patronymic: "Робертович",
birthday: "11.11.1991", birthday: "11.11.1991",
avatar: personImage, avatar: personImage,
check: false, check: false,
reception: "27.07.2023", view: false,
time: { from: "12:00", to: "14:00" }, viewDate: "",
reception: "26.07.2023",
time: { from: "19:00", to: "20:00" },
priority: 1, priority: 1,
phone: "+7 (910) 6233223", phone: "+7 (910) 6233223",
email: "gaevaia@yandex.ru", email: "gaevaia@yandex.ru",
@@ -183,6 +191,8 @@ export const patientList = [
birthday: "12.03.1989", birthday: "12.03.1989",
avatar: personImage, avatar: personImage,
check: false, check: false,
view: false,
viewDate: "",
reception: "27.07.2023", reception: "27.07.2023",
time: { from: "11:00", to: "14:00" }, time: { from: "11:00", to: "14:00" },
priority: 1, priority: 1,
@@ -199,6 +209,8 @@ export const patientList = [
birthday: "23.07.1949", birthday: "23.07.1949",
avatar: personImage, avatar: personImage,
check: false, check: false,
view: false,
viewDate: "",
reception: "28.07.2023", reception: "28.07.2023",
time: { from: "18:00", to: "19:00" }, time: { from: "18:00", to: "19:00" },
priority: 1, priority: 1,
@@ -215,7 +227,9 @@ export const patientList = [
birthday: "12.11.1995", birthday: "12.11.1995",
avatar: personImage, avatar: personImage,
check: false, check: false,
reception: "25.07.2023", view: false,
viewDate: "",
reception: "26.07.2023",
time: { from: "16:00", to: "17:00" }, time: { from: "16:00", to: "17:00" },
priority: 0, priority: 0,
phone: "+7 (910) 6233223", phone: "+7 (910) 6233223",
@@ -231,7 +245,9 @@ export const patientList = [
birthday: "15.05.1989", birthday: "15.05.1989",
avatar: personImage, avatar: personImage,
check: false, check: false,
reception: "25.07.2023", view: false,
viewDate: "",
reception: "26.07.2023",
time: { from: "20:00", to: "21:00" }, time: { from: "20:00", to: "21:00" },
priority: 1, priority: 1,
phone: "+7 (910) 6233223", phone: "+7 (910) 6233223",
@@ -247,8 +263,10 @@ export const patientList = [
birthday: "13.07.2000", birthday: "13.07.2000",
avatar: personImage, avatar: personImage,
check: false, check: false,
reception: "31.06.2023", view: false,
time: { from: "12:00", to: "14:00" }, viewDate: "",
reception: "26.06.2023",
time: { from: "22:00", to: "23:00" },
priority: 1, priority: 1,
phone: "+7 (910) 6233223", phone: "+7 (910) 6233223",
email: "gaevaia@yandex.ru", email: "gaevaia@yandex.ru",
@@ -263,8 +281,10 @@ export const patientList = [
birthday: "12.12.1986", birthday: "12.12.1986",
avatar: personImage, avatar: personImage,
check: false, check: false,
reception: "30.07.2023", view: false,
time: { from: "12:00", to: "14:00" }, viewDate: "",
reception: "25.07.2023",
time: { from: "22:00", to: "23:00" },
priority: 1, priority: 1,
phone: "+7 (910) 6233223", phone: "+7 (910) 6233223",
email: "gaevaia@yandex.ru", email: "gaevaia@yandex.ru",
@@ -279,6 +299,8 @@ export const patientList = [
birthday: "13.03.1979", birthday: "13.03.1979",
avatar: personImage, avatar: personImage,
check: false, check: false,
view: false,
viewDate: "",
reception: "27.07.2023", reception: "27.07.2023",
time: { from: "09:00", to: "10:00" }, time: { from: "09:00", to: "10:00" },
priority: 1, priority: 1,