Merge branch 'ASTRA-81' into 'master'

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

See merge request andrusyakka/urban-couscous!373
This commit is contained in:
Vasiliy Gavrilin
2023-05-17 13:50:04 +00:00
5 changed files with 156 additions and 80 deletions

View File

@@ -1,22 +1,23 @@
<template lang="pug"> <template lang="pug">
medical-form-wrapper( medical-form-wrapper(
:title="data.title", :title="data.title",
:is-edit="list?.change", :is-edit="change",
:open-edit="openCard", :open-edit="openCard",
:cancel="closeCard", :cancel="closeCard",
:tag="fillInspection || list?.change" :tag="fillInspection || change"
) )
.protocol-body.flex.flex-col .protocol-body.flex.flex-col
.flex.items-center.gap-x-11px(:class="{'open-header': list.change || fillInspection}") .flex.items-center.gap-x-11px(:class="{'open-header': change || fillInspection}")
.flex.flex-col.gap-y-4(:class="{'changed': list.change || fillInspection}") .flex.flex-col.gap-y-4(:class="{'changed': change || fillInspection}")
.flex.flex-col.gap-y-1(:class="{'open-textarea': list.change || fillInspection}") .flex.flex-col.gap-y-1(:class="{'open-textarea': change || fillInspection}")
.tag-wrap.flex.gap-x-1.gap-y-1(v-if="!fillInspection") .tag-wrap.flex.gap-x-1.gap-y-1(v-if="!fillInspection")
.tag.flex.items-center.px-3.cursor-pointer.font-medium.text-smm( .tag.flex.items-center.px-3.cursor-pointer.font-medium.text-smm(
v-for="tag in list.tags", :key="tag.id" v-for="tag in data.results.tags", :key="tag.id"
) {{tag.label}} ) {{tag.label}}
base-input.px-3(v-if="list.change || fillInspection", type="textarea", autogrow, borderless, placeholder="Введите жалобу...") base-input.px-3(v-if="change || fillInspection", type="textarea", autogrow, borderless, placeholder="Введите жалобу...")
.wrap.gap-1.flex.flex-col(v-if="(docData.length || scanData.length) && !(list.change || fillInspection)", v-for="file in list.files") template(v-if="!(change || fillInspection)", v-for="file in data.results.files")
.title.font-semibold.text-smm.mb-2(v-if="file?.data?.length") {{file.name}} .wrap.flex.flex-col.gap-1.gap-y-3(v-if="file?.data?.length")
.title.font-semibold.text-smm.mb-2 {{file.name}}
.wrap.flex.gap-x-1.gap-y-1 .wrap.flex.gap-x-1.gap-y-1
.flex.gap-x-2.items-center.pl-2.pr-4.py-2.gap-y-3( .flex.gap-x-2.items-center.pl-2.pr-4.py-2.gap-y-3(
v-for="item in file.data" v-for="item in file.data"
@@ -24,13 +25,13 @@
) )
q-avatar(:size="checkedName(file.name) ? '24px' : '40px'", :rounded="!checkedName(file.name)") q-avatar(:size="checkedName(file.name) ? '24px' : '40px'", :rounded="!checkedName(file.name)")
img.h-10.w-10.object-cover( img.h-10.w-10.object-cover(
:src="checkedName(file.name) ? iconDictionary[item.name.substr(item.name.lastIndexOf('.') + 1)] : item.file" :src="checkedName(file.name) ? data.iconDictionary[item.name.substr(item.name.lastIndexOf('.') + 1)] : item.file"
) )
.doc-text.font-medium.text-smm(v-if="checkedName(file.name)") {{item.name}} .doc-text.font-medium.text-smm(v-if="checkedName(file.name)") {{item.name}}
.flex.flex-col.gap-y-1(v-else) .flex.flex-col.gap-y-1(v-else)
.doc-text.font-medium.text-smm {{item.name.substr(0, item.name.lastIndexOf('.'))}} .doc-text.font-medium.text-smm {{item.name.substr(0, item.name.lastIndexOf('.'))}}
.title.font-medium.text-xsx {{item.size + " Мб"}} .title.font-medium.text-xsx {{item.size + " Мб"}}
.filter.flex.flex-col.gap-y-4(v-if="list.change || fillInspection") .filter.flex.flex-col.gap-y-4(v-if="change || fillInspection")
.flex.gap-x-2 .flex.gap-x-2
base-input(placeholder="Поиск", outlined, :width="232", iconLeft) base-input(placeholder="Поиск", outlined, :width="232", iconLeft)
q-icon(name="app:icon-search", size="20px", style="color: var(--font-grey-color)") q-icon(name="app:icon-search", size="20px", style="color: var(--font-grey-color)")
@@ -46,19 +47,19 @@
:style="{width: '40px', height: '40px', color: 'var(--font-grey-color)'}", :style="{width: '40px', height: '40px', color: 'var(--font-grey-color)'}",
padding="0" padding="0"
) )
.field.flex.flex-col.overflow-y-scroll(v-if="list.complaints") .field.flex.flex-col.overflow-y-scroll
.checkbox.flex.flex-col(v-for="complaint in textSorting(list.complaints)") .checkbox.flex.flex-col(v-for="complaint in textSorting(data.results.complaints)")
.letter.flex.items-center.font-bold.justify-center {{ complaint.sym }} .letter.flex.items-center.font-bold.justify-center {{ complaint.sym }}
.line.flex.gap-x-4.h-9.items-center(v-for="name in complaint?.array") .line.flex.gap-x-4.h-9.items-center(v-for="name in complaint?.array")
q-checkbox( q-checkbox(
dense, dense,
v-model="selected", v-model="data.selected",
:val="name?.label", :val="name?.label",
:style="{border: 'none', width: '16px', height: '16px'}" :style="{border: 'none', width: '16px', height: '16px'}"
) )
.name.flex.items-center.font-medium.text-smm {{ name?.label }} .name.flex.items-center.font-medium.text-smm {{ name?.label }}
.protocol-data.flex.gap-x-20(v-if="list.change || fillInspection") .protocol-data.flex.gap-x-20(v-if="change || fillInspection")
.flex.flex-col.gap-y-3(v-for="file in list.files") .flex.flex-col.gap-y-3(v-for="file in data.results.files")
.title.text-smm.font-semibold {{file.name}} .title.text-smm.font-semibold {{file.name}}
.download.flex.relative .download.flex.relative
base-input( base-input(
@@ -82,7 +83,7 @@
) )
q-avatar(:size="checkedName(file.name) ? '24px' : '40px'", :rounded="!checkedName(file.name)") q-avatar(:size="checkedName(file.name) ? '24px' : '40px'", :rounded="!checkedName(file.name)")
img.h-10.w-10.object-cover( img.h-10.w-10.object-cover(
:src="checkedName(file.name) ? iconDictionary[item.name.substr(item.name.lastIndexOf('.') + 1)] : item.file" :src="checkedName(file.name) ? data.iconDictionary[item.name.substr(item.name.lastIndexOf('.') + 1)] : item.file"
) )
.doc-text.font-medium.text-smm(v-if="checkedName(file.name)") {{item.name}} .doc-text.font-medium.text-smm(v-if="checkedName(file.name)") {{item.name}}
.flex.flex-col.gap-y-1(v-else) .flex.flex-col.gap-y-1(v-else)
@@ -94,9 +95,6 @@
import MedicalFormWrapper from "@/pages/newMedicalCard/components/MedicalFormWrapper.vue"; import MedicalFormWrapper from "@/pages/newMedicalCard/components/MedicalFormWrapper.vue";
import BaseButton from "@/components/base/BaseButton.vue"; import BaseButton from "@/components/base/BaseButton.vue";
import BaseInput from "@/components/base/BaseInput.vue"; import BaseInput from "@/components/base/BaseInput.vue";
import pdfIcon from "@/assets/icons/pdf.svg";
import wordIcon from "@/assets/icons/word.svg";
import exelIcon from "@/assets/icons/exel.svg";
export default { export default {
name: "DataForm", name: "DataForm",
@@ -109,46 +107,9 @@ export default {
}, },
data() { data() {
return { return {
list: {
title: "Данные обследования",
change: false, change: false,
tags: [
{ id: 1, label: "Боль при приеме сладкой пищи" },
{ id: 2, label: "Жжение языка" },
{ id: 3, label: "Кровоточивость десен" },
{ id: 4, label: "Лечение у ортодонта не проводилось" },
{ id: 5, label: "Ранее зубы лечили в ЛПУ" },
{ id: 6, label: "Удаление зуба" },
],
complaints: [
{ id: 1, label: "Ранее зубы лечили в ЛПУ" },
{ id: 2, label: "Жжение языка" },
{ id: 3, label: "Кровоточивость десен" },
{ id: 4, label: "Лечение у ортодонта не проводилось" },
{ id: 5, label: "Уныние зуба" },
{ id: 6, label: "Боль при приеме сладкой пищи" },
{ id: 7, label: "Удаление зуба" },
{ id: 2, label: "Жжение языка" },
],
files: [
{ name: "Документы", data: null },
{ name: "Сканы", data: null },
],
},
selected: [],
docData: [],
scanData: [],
iconDictionary: {
doc: wordIcon,
docx: wordIcon,
xls: exelIcon,
xlsx: exelIcon,
odt: wordIcon,
pdf: pdfIcon,
},
}; };
}, },
methods: { methods: {
checkedName(e) { checkedName(e) {
return e === "Документы" ? true : false; return e === "Документы" ? true : false;
@@ -172,20 +133,23 @@ export default {
return srt; return srt;
}, },
openCard() { openCard() {
this.list.change = true; this.change = true;
}, },
closeCard() { closeCard() {
this.list.change = false; this.change = false;
}, },
addNewDoc(arr) { addNewDoc(arr) {
this.docData = [...this.docData, ...arr]; this.data.results.files.find((e) => e.name === "Документы").data = [
this.list.files.find((e) => e.name === "Документы").data = this.docData; ...arr,
];
}, },
addNewScan(arr) { addNewScan(arr) {
[...arr].forEach((file) => { [...arr].forEach((file) => {
const reader = new FileReader(); const reader = new FileReader();
reader.onload = (e) => { reader.onload = (e) => {
this.scanData.push({ this.data.results.files
.find((e) => e.name === "Сканы")
?.data.push({
file: e.target.result, file: e.target.result,
name: file.name, name: file.name,
size: (file.size / 1024 / 1024).toFixed(1), size: (file.size / 1024 / 1024).toFixed(1),
@@ -193,7 +157,6 @@ export default {
}; };
reader.readAsDataURL(file); reader.readAsDataURL(file);
}); });
this.list.files.find((e) => e.name === "Сканы").data = this.scanData;
}, },
}, },
}; };

View File

@@ -0,0 +1,63 @@
<template lang="pug">
medical-form-wrapper(
:title="data.title",
:is-edit="change",
:open-edit="openCard",
:cancel="closeCard",
)
.disease-body.flex
.flex.flex-col.gap-y-17px(v-if="fillInspection || change")
.flex.-ml-2
q-checkbox.text-smm.font-medium(v-model="data.results.checked" label="Без особенностей" size="36px")
.textarea.flex
base-input(
v-model="data.results.text",
type="textarea",
outlined,
resize="vertical",
:width="1176",
placeholder="Введите данные..."
)
.font-medium.text-smm(v-else) {{data.results?.text}}
</template>
<script>
import MedicalFormWrapper from "@/pages/newMedicalCard/components/MedicalFormWrapper.vue";
import BaseInput from "@/components/base/BaseInput.vue";
export default {
name: "DiseaseForm",
components: { MedicalFormWrapper, BaseInput },
props: {
data: Object,
fillInspection: Boolean,
inspection: Boolean,
},
data() {
return { change: false };
},
methods: {
openCard() {
this.change = true;
},
closeCard() {
this.change = false;
},
},
};
</script>
<style lang="sass" scoped>
.disease-body
background: var(--default-white)
border-radius: 4px
color: var(--font-dark-blue-color)
.q-checkbox :deep(.q-checkbox__bg)
border-radius: 4px
border: 1.5px solid var(--font-grey-color)
.textarea
box-sizing: border-box
min-height: 130px
</style>

View File

@@ -44,6 +44,7 @@
<script> <script>
import MedicalFormTag from "@/pages/newMedicalCard/components/InitialInspectionProtocol/Forms/MedicalFormTag.vue"; import MedicalFormTag from "@/pages/newMedicalCard/components/InitialInspectionProtocol/Forms/MedicalFormTag.vue";
import DataForm from "@/pages/newMedicalCard/components/InitialInspectionProtocol/Forms/DataForm.vue"; import DataForm from "@/pages/newMedicalCard/components/InitialInspectionProtocol/Forms/DataForm.vue";
import DiseaseForm from "@/pages/newMedicalCard/components/InitialInspectionProtocol/Forms/DiseaseForm.vue";
import BaseButton from "@/components/base/BaseButton.vue"; import BaseButton from "@/components/base/BaseButton.vue";
import IndexForm from "@/pages/newMedicalCard/components/InitialInspectionProtocol/Forms/IndexForm.vue"; import IndexForm from "@/pages/newMedicalCard/components/InitialInspectionProtocol/Forms/IndexForm.vue";
import ThermometryForm from "@/pages/newMedicalCard/components/InitialInspectionProtocol/Forms/ThermometryForm.vue"; import ThermometryForm from "@/pages/newMedicalCard/components/InitialInspectionProtocol/Forms/ThermometryForm.vue";
@@ -54,6 +55,7 @@ export default {
components: { components: {
MedicalFormTag, MedicalFormTag,
DataForm, DataForm,
DiseaseForm,
BaseButton, BaseButton,
IndexForm, IndexForm,
ThermometryForm, ThermometryForm,

View File

@@ -6,6 +6,9 @@ import {
ruleDateValue, ruleDateValue,
ruleOptionalFields, ruleOptionalFields,
} from "@/shared/utils/rulesInputs"; } from "@/shared/utils/rulesInputs";
import pdfIcon from "@/assets/icons/pdf.svg";
import wordIcon from "@/assets/icons/word.svg";
import exelIcon from "@/assets/icons/exel.svg";
export const baseDataForm = [ export const baseDataForm = [
{ {
@@ -670,6 +673,40 @@ export const protocolForms = [
component: "DataForm", component: "DataForm",
key: "data", key: "data",
state: "data", state: "data",
results: {
title: "Данные обследования",
tags: [
{ id: 1, label: "Боль при приеме сладкой пищи" },
{ id: 2, label: "Жжение языка" },
{ id: 3, label: "Кровоточивость десен" },
{ id: 4, label: "Лечение у ортодонта не проводилось" },
{ id: 5, label: "Ранее зубы лечили в ЛПУ" },
{ id: 6, label: "Удаление зуба" },
],
complaints: [
{ id: 1, label: "Ранее зубы лечили в ЛПУ" },
{ id: 2, label: "Жжение языка" },
{ id: 3, label: "Кровоточивость десен" },
{ id: 4, label: "Лечение у ортодонта не проводилось" },
{ id: 5, label: "Уныние зуба" },
{ id: 6, label: "Боль при приеме сладкой пищи" },
{ id: 7, label: "Удаление зуба" },
{ id: 8, label: "Кровоточивость языка" },
],
files: [
{ name: "Документы", data: [] },
{ name: "Сканы", data: [] },
],
},
selected: [],
iconDictionary: {
doc: wordIcon,
docx: wordIcon,
xls: exelIcon,
xlsx: exelIcon,
odt: wordIcon,
pdf: pdfIcon,
},
}, },
{ {
title: "Термометрия (по показаниям)", title: "Термометрия (по показаниям)",
@@ -714,4 +751,14 @@ export const protocolForms = [
], ],
}, },
}, },
{
title: "Развитие настоящего заболевания",
component: "DiseaseForm",
key: "disease",
state: "disease",
results: {
checked: false,
text: "",
},
},
]; ];

View File

@@ -34,6 +34,7 @@ module.exports = {
"7px": "7px", "7px": "7px",
"10px": "10px", "10px": "10px",
"11px": "11px", "11px": "11px",
"17px": "17px",
"30px": "30px", "30px": "30px",
"25px": "25px", "25px": "25px",
43: "43px", 43: "43px",