Merge branch 'ASTRA-102' into 'master'

[WIP] Добавил адаптив на форму пациентов

See merge request andrusyakka/urban-couscous!404
This commit is contained in:
Vasiliy Gavrilin
2023-06-02 14:10:06 +00:00
3 changed files with 108 additions and 73 deletions

View File

@@ -1,6 +1,6 @@
<template lang="pug"> <template lang="pug">
.w-full.flex.gap-x-2 .w-full.flex.gap-x-2
calendar-open-sidebar(:class="{'close': !isOpen, 'active': isOpen}" :open-sidebar="openSidebar") calendar-open-sidebar.close(:class="{'active': isOpen}", :open-sidebar="openSidebar")
calendar-sidebar.-ml-2(v-if="!isOpen", :open-sidebar="openSidebar") calendar-sidebar.-ml-2(v-if="!isOpen", :open-sidebar="openSidebar")
calendar-wrapper calendar-wrapper
</template> </template>

View File

@@ -1,6 +1,5 @@
<template lang="pug"> <template lang="pug">
.flex.flex-col.gap-y-1 .flex.flex-col.gap-y-1
.item.flex.flex-col
.form.flex.items-center.justify-end.py-4.pr-4.rounded-t .form.flex.items-center.justify-end.py-4.pr-4.rounded-t
q-btn.rotate-180( q-btn.rotate-180(
@click="openSidebar", @click="openSidebar",
@@ -19,10 +18,12 @@
:style="{width: '100%', height: '40px'}", :style="{width: '100%', height: '40px'}",
padding="0" padding="0"
) )
.flex.flex-col.gap-y-1(v-for="elem in patientList") .flex.flex-col.gap-y-1
q-expansion-item.expansion.font-bold.text-xm( q-expansion-item.expansion.font-bold.text-xm(
expand-separator v-for="(elem, index) in patientList",
expand-separator,
:label="elem.label", :label="elem.label",
@click="choiceForm(elem.choice, index)",
:class="{'patient': elem.label === 'Пациенты'}" :class="{'patient': elem.label === 'Пациенты'}"
) )
.select.flex.flex-col.font-medium.text-smm.px-4( .select.flex.flex-col.font-medium.text-smm.px-4(
@@ -32,7 +33,7 @@
.status.flex.items-center.gap-x-1.px-2 .status.flex.items-center.gap-x-1.px-2
img(:src="item.icon") img(:src="item.icon")
span {{item.name}} span {{item.name}}
.flex.flex-col.p-4.pb-0(v-else) .flex.flex-col.p-4.pb-0(:class="choiceState()", v-else)
.flex.h-8.w-full.items-center.justify-between .flex.h-8.w-full.items-center.justify-between
base-input( base-input(
v-model="foundPerson", v-model="foundPerson",
@@ -55,7 +56,6 @@
:style="{width: '32px', height: '32px'}", :style="{width: '32px', height: '32px'}",
padding="0" padding="0"
) )
.flex.flex-col
.flex.items-center.justify-between.font-medium.text-smm.h-10.py-2.cursor-pointer( .flex.items-center.justify-between.font-medium.text-smm.h-10.py-2.cursor-pointer(
@click="checkAll(elem.data)" @click="checkAll(elem.data)"
) )
@@ -96,6 +96,22 @@ export default {
}; };
}, },
methods: { methods: {
choiceState() {
let num = 0;
this.patientList.forEach((e) => {
if (e.choice) num += 1;
});
return {
one: num === 1,
two: num === 2,
three: num === 3,
};
},
choiceForm(choice, idx) {
if (choice)
return (this.patientList.find((e) => e.id === idx).choice = false);
this.patientList.find((e) => e.id === idx).choice = true;
},
trimOwnerName(lastName, firstName, patronymic) { trimOwnerName(lastName, firstName, patronymic) {
let checkedFirstName = firstName !== null ? firstName[0] + "." : ""; let checkedFirstName = firstName !== null ? firstName[0] + "." : "";
let checkedPatronymic = patronymic !== null ? patronymic[0] + "." : ""; let checkedPatronymic = patronymic !== null ? patronymic[0] + "." : "";
@@ -138,12 +154,22 @@ export default {
</script> </script>
<style lang="sass" scoped> <style lang="sass" scoped>
.one
max-height: calc(100vh - 394px)
.two
max-height: calc(100vh - 498px)
.three
max-height: calc(100vh - 632px)
.form .form
background: var(--default-white) background: var(--default-white)
width: 100% width: 100%
height: 72px height: 72px
.expansion .expansion
height: 54px
background: var(--default-white) background: var(--default-white)
border-radius: 4px border-radius: 4px
color: var(--font-dark-blue-color) color: var(--font-dark-blue-color)
@@ -162,6 +188,7 @@ export default {
.q-expansion-item .q-expansion-item
border-radius: 0 border-radius: 0
height: 100%
.q-expansion-item :deep(.q-separator) .q-expansion-item :deep(.q-separator)
display: none display: none
@@ -187,15 +214,17 @@ export default {
.text .text
color: var(--font-grey-color) color: var(--font-grey-color)
.q-expansion-item :deep(.q-item)
height: 54px
.person-wrapper .person-wrapper
height: 272px
overflow-y: auto overflow-y: auto
margin-right: -10px margin-right: -10px
&::-webkit-scrollbar &::-webkit-scrollbar
width: 4px width: 4px
&::-webkit-scrollbar-track:vertical &::-webkit-scrollbar-track:vertical
margin-top: -26px margin-top: -26px
margin-bottom: 8px margin-bottom: 26px
.person .person
height: 56px height: 56px

View File

@@ -10,23 +10,28 @@ import not_filled from "@/assets/icons/medcard_not_filled.svg";
export const patientList = [ export const patientList = [
{ {
label: "Статус приема", label: "Статус приема",
id: 0,
data: [ data: [
{ name: "Не принят", icon: not_accepted }, { name: "Не принят", icon: not_accepted },
{ name: "Принят", icon: accepted }, { name: "Принят", icon: accepted },
{ name: "Отказ", icon: rejected }, { name: "Отказ", icon: rejected },
{ name: "На приеме", icon: reception }, { name: "На приеме", icon: reception },
], ],
choice: false,
}, },
{ {
label: "Первичная медкарта", label: "Первичная медкарта",
id: 1,
data: [ data: [
{ name: "Не заполнена", icon: not_filled }, { name: "Не заполнена", icon: not_filled },
{ name: "Частично заполнена", icon: partially_filled }, { name: "Частично заполнена", icon: partially_filled },
{ name: "Заполнена", icon: filled }, { name: "Заполнена", icon: filled },
], ],
choice: false,
}, },
{ {
label: "Пациенты", label: "Пациенты",
id: 2,
data: [ data: [
{ {
id: 0, id: 0,
@@ -128,5 +133,6 @@ export const patientList = [
check: false, check: false,
}, },
], ],
choice: false,
}, },
]; ];