Merge branch 'ASTRA-121' into 'master'

[WIP] Фикс отображения чекбоксов на форме создания осмотра, исправил...

See merge request andrusyakka/urban-couscous!448
This commit is contained in:
Vasiliy Gavrilin
2023-06-27 15:18:54 +00:00
6 changed files with 122 additions and 104 deletions

View File

@@ -11,13 +11,13 @@
.flex.items-center.gap-x-11px(:class="{'open-header': change || fillInspection}") .flex.items-center.gap-x-11px(:class="{'open-header': change || fillInspection}")
.flex.flex-col.gap-y-4(:class="{'changed': change || fillInspection}") .flex.flex-col.gap-y-4(:class="{'changed': change || fillInspection}")
.flex.flex-col.gap-y-1(:class="{'open-textarea': 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
.tag.flex.items-center.px-3.font-medium.text-smm( .tag.flex.items-center.px-3.font-medium.text-smm(
:class="{'pointer': fillInspection || change}" :class="{'pointer': fillInspection || change}"
v-for="tag in data.results.tags", :key="tag.id" v-for="tag in protocolData[data.state].complaints", :key="tag.id"
) {{tag.label}} ) {{ tag }}
base-input.px-3(v-if="change || fillInspection", type="textarea", autogrow, borderless, placeholder="Введите данные...") base-input.px-3(v-if="change || fillInspection", type="textarea", autogrow, borderless, placeholder="Введите данные...")
template(v-if="!(change || fillInspection)", v-for="file in data.results.files") template(v-if="!(change || fillInspection)", v-for="file in protocolData[data.state].files")
.wrap.flex.flex-col.gap-1.gap-y-3(v-if="file?.data?.length") .wrap.flex.flex-col.gap-1.gap-y-3(v-if="file?.data?.length")
.title.font-semibold.text-smm.mb-2 {{file.name}} .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
@@ -50,21 +50,21 @@
padding="0" padding="0"
) )
.field.flex.flex-col.overflow-y-scroll .field.flex.flex-col.overflow-y-scroll
.checkbox.flex.flex-col(v-for="complaint in textSorting(data.results.complaints)") .checkbox.flex.flex-col(v-for="complaint in textSorting(data.results.tags)")
.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="protocolData[data.state].complaints",
:val="name?.label", :val="name",
: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 }}
.flex.h-10.w-10.absolute.right-4.bottom-4 .flex.h-10.w-10.absolute.right-4.bottom-4
q-btn(color="primary", dense, padding="4px 12px") q-btn(color="primary", dense, padding="4px 12px")
q-icon(name="app:icon-plus", size="17px") q-icon(name="app:icon-plus", size="17px")
.flex.gap-x-20.w-full(v-if="change || fillInspection") .flex.gap-x-20.w-full(v-if="change || fillInspection")
.flex.flex-col.gap-y-3.w-full(v-for="file in data.results.files") .flex.flex-col.gap-y-3.w-full(v-for="file in protocolData[data.state].files")
.title.text-smm.font-semibold {{file.name}} .title.text-smm.font-semibold {{file.name}}
.download.flex.relative.w-full .download.flex.relative.w-full
base-input.w-full( base-input.w-full(
@@ -99,6 +99,7 @@
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 { mapState } from "vuex";
export default { export default {
name: "DataForm", name: "DataForm",
@@ -112,9 +113,13 @@ export default {
data() { data() {
return { return {
change: false, change: false,
selected: [],
}; };
}, },
computed: {
...mapState({
protocolData: (state) => state.medical.protocolData,
}),
},
methods: { methods: {
checkedName(e) { checkedName(e) {
return e === "Документы" ? true : false; return e === "Документы" ? true : false;
@@ -123,19 +128,21 @@ export default {
return name === "Документы" ? this.addNewDoc(e) : this.addNewScan(e); return name === "Документы" ? this.addNewDoc(e) : this.addNewScan(e);
}, },
textSorting(arr) { textSorting(arr) {
let srt = []; let sortArr = [];
this.abc.forEach((letter) => { this.abc.forEach((letter) => {
arr.forEach((str) => { arr.forEach((str) => {
let finded = srt.find((obj) => obj.sym === letter); let finded = sortArr.find((obj) => obj.sym === letter);
if (str.label[0] === letter) { if (str[0] === letter) {
if (!finded) { if (!finded) {
srt.push({ sym: letter, array: [{ label: str.label }] }); sortArr.push({
} else if (finded.sym === letter) sym: letter,
finded.array.push({ label: str.label }); array: [str],
});
} else if (finded.sym === letter) finded.array.push(str);
} }
}); });
}); });
return srt; return sortArr;
}, },
openCard() { openCard() {
this.change = true; this.change = true;
@@ -150,8 +157,12 @@ export default {
doc[0]?.name.substr(doc[0].name.lastIndexOf(".") + 1) doc[0]?.name.substr(doc[0].name.lastIndexOf(".") + 1)
] ]
) )
this.data.results.files.find((e) => e.name === "Документы").data = [ this.protocolData[this.data.state].files.find(
...this.data.results.files.find((e) => e.name === "Документы").data, (e) => e.name === "Документы"
).data = [
...this.protocolData[this.data.state].files.find(
(e) => e.name === "Документы"
).data,
...arr, ...arr,
]; ];
}, },
@@ -161,7 +172,7 @@ export default {
[...arr].forEach((file) => { [...arr].forEach((file) => {
const reader = new FileReader(); const reader = new FileReader();
reader.onload = (e) => { reader.onload = (e) => {
this.data.results.files this.protocolData[this.data.state].files
.find((e) => e.name === "Сканы") .find((e) => e.name === "Сканы")
?.data.push({ ?.data.push({
file: e.target.result, file: e.target.result,
@@ -172,17 +183,6 @@ export default {
reader.readAsDataURL(file); reader.readAsDataURL(file);
}); });
}, },
checkSelected() {
this.data.results.tags.forEach((com) => {
this.data.results.complaints.forEach((tag) => {
if (
tag.label === com.label &&
!this.selected.find((e) => e.label === com.label)
)
this.selected.push(tag.label);
});
});
},
}, },
watch: { watch: {
fillInspection: { fillInspection: {
@@ -190,14 +190,13 @@ export default {
handler(newVal) { handler(newVal) {
if (newVal) { if (newVal) {
this.change = false; this.change = false;
this.data.results.files.forEach((e) => (e.data = [])); this.protocolData[this.data.state].files.forEach(
(e) => (e.data = [])
);
} }
}, },
}, },
}, },
mounted() {
this.checkSelected();
},
}; };
</script> </script>

View File

@@ -10,16 +10,20 @@
.disease-body.flex .disease-body.flex
.flex.flex-col.gap-y-17px.w-full(v-if="fillInspection || change") .flex.flex-col.gap-y-17px.w-full(v-if="fillInspection || change")
.flex.-ml-2(v-if="data.key === 'disease'") .flex.-ml-2(v-if="data.key === 'disease'")
q-checkbox.text-smm.font-medium(v-model="data.results.checked" label="Без особенностей" size="36px") q-checkbox.text-smm.font-medium(
v-model="protocolData[data.state].checked",
label="Без особенностей",
size="36px"
)
.textarea.flex.w-full .textarea.flex.w-full
base-input.w-full( base-input.w-full(
v-model="modelValue", v-model="protocolData[data.state].text",
type="textarea", type="textarea",
outlined, outlined,
resize="vertical", resize="vertical",
placeholder="Введите данные..." placeholder="Введите данные..."
) )
.font-medium.text-smm(v-else) {{displayedValue}} .font-medium.text-smm(v-else) {{protocolData[data.state]?.text}}
</template> </template>
<script> <script>
@@ -35,29 +39,12 @@ export default {
fillInspection: Boolean, fillInspection: Boolean,
}, },
data() { data() {
return { change: false, modelValue: null }; return { change: false };
}, },
computed: { computed: {
...mapState({ ...mapState({
protocolData: (state) => state.medical.protocolData, protocolData: (state) => state.medical.protocolData,
}), }),
state() {
return this.protocolData[this.data.state];
},
findedListItem() {
if (this.data.results?.text && this.modelValue)
return this.data.results?.text === this.modelValue;
return null;
},
reference() {
if (this.findedListItem && this.findedListItem?.text)
return this.findedListItem?.text;
return this.data.results?.text;
},
displayedValue() {
if (this.findedListItem?.text) return this.findedListItem?.text;
return this.modelValue;
},
}, },
methods: { methods: {
openCard() { openCard() {
@@ -68,29 +55,15 @@ export default {
}, },
}, },
watch: { watch: {
state: {
immediate: true,
handler(value) {
if (!this.fillInspection) this.modelValue = value;
},
},
fillInspection: { fillInspection: {
immediate: true, immediate: true,
handler(newVal) { handler(newVal) {
if (newVal) { if (newVal) {
this.change = false; this.change = false;
this.modelValue = null; this.protocolData[this.data.state].text = null;
} else {
this.modelValue = this.state;
} }
}, },
}, },
modelValue: {
immediate: true,
handler(value) {
this.protocolData[this.data.state] = value;
},
},
}, },
}; };
</script> </script>

View File

@@ -9,7 +9,7 @@
.protocol-body.flex.flex-col .protocol-body.flex.flex-col
.flex.gap-x-4(:style="{height: change || fillInspection ? '300px' : ''}") .flex.gap-x-4(:style="{height: change || fillInspection ? '300px' : ''}")
.flex.flex-col.gap-y-1.overflow-y-auto(:class="{'open-textarea': change || fillInspection}") .flex.flex-col.gap-y-1.overflow-y-auto(: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
.tag.flex.items-center.px-3.text-smm( .tag.flex.items-center.px-3.text-smm(
v-for="tag in protocolData[data.state]", v-for="tag in protocolData[data.state]",
:key="tag.id" :key="tag.id"
@@ -39,7 +39,7 @@
.field.flex.flex-col.overflow-y-scroll(v-if="data.results.tags") .field.flex.flex-col.overflow-y-scroll(v-if="data.results.tags")
.checkbox.flex.flex-col(v-for="complaint in textSorting(data.results.tags)") .checkbox.flex.flex-col(v-for="complaint in textSorting(data.results.tags)")
.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(:key="name.id", 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="protocolData[data.state]", v-model="protocolData[data.state]",

View File

@@ -29,7 +29,7 @@
base-button.text-base.font-semibold(outlined, :size="40") Отменить base-button.text-base.font-semibold(outlined, :size="40") Отменить
base-button.text-base.font-semibold(:size="40") Сохранить base-button.text-base.font-semibold(:size="40") Сохранить
.flex.items-center.gap-x-3(:style="{color: 'var(--font-grey-color)'}") .flex.items-center.gap-x-3(:style="{color: 'var(--font-grey-color)'}")
.flex.font-semibold.text-7xl 0% .flex.font-semibold.text-7xl {{ percent + "%" }}
.flex.font-medium.text-smm.w-20 заполнение осмотра .flex.font-medium.text-smm.w-20 заполнение осмотра
</template> </template>
@@ -60,6 +60,7 @@ export default {
props: { inspection: Boolean, fillInspection: Boolean }, props: { inspection: Boolean, fillInspection: Boolean },
data() { data() {
return { return {
percent: 0,
protocolForms: protocolForms, protocolForms: protocolForms,
list: [ list: [
{ {
@@ -110,6 +111,41 @@ export default {
protocolDataGet: "getInitProtocol", protocolDataGet: "getInitProtocol",
}), }),
}, },
methods: {
interestСalculation() {
const getTypeOf = (obj) => {
return {}.toString.call(obj).slice(8, -1);
};
let sum = 0;
for (let a in this.protocolData) {
if (
Array.isArray(this.protocolData[a]) &&
this.protocolData[a].length > 0
)
sum += 1;
if (this.protocolData[a] && typeof this.protocolData[a] === "string")
sum += 1;
if (
getTypeOf(this.protocolData[a]) === "Object" &&
Object.keys(this.protocolData[a]).length
)
sum += 1;
}
sum = Math.ceil(17 / sum);
this.percent = sum > 1 ? sum * 10 : sum * 100;
},
},
watch: {
protocolData: {
deep: true,
immediate: true,
handler() {
this.interestСalculation();
},
},
},
}; };
</script> </script>

View File

@@ -1229,10 +1229,10 @@ export const protocolForms = [
state: "survey", state: "survey",
results: { results: {
tags: [ tags: [
{ id: 1, label: "Общий анализ крови" }, "Общий анализ крови",
{ id: 2, label: "Консультация узкого специалиста" }, "Консультация узкого специалиста",
{ id: 3, label: "2 искусственных зуба" }, "2 искусственных зуба",
{ id: 4, label: "Биохимический анализ крови" }, "Биохимический анализ крови",
], ],
}, },
}, },
@@ -1243,28 +1243,15 @@ export const protocolForms = [
state: "data", state: "data",
results: { results: {
tags: [ 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: "Кровоточивость языка" },
],
files: [
{ name: "Документы", data: [] },
{ name: "Сканы", data: [] },
], ],
}, },
selected: [],
iconDictionary: { iconDictionary: {
doc: wordIcon, doc: wordIcon,
docx: wordIcon, docx: wordIcon,

View File

@@ -346,9 +346,11 @@ const getters = {
bite: "distal bite", bite: "distal bite",
hygieneIndex: 2, hygieneIndex: 2,
KPUIndex: 6.1, KPUIndex: 6.1,
disease: disease: {
"Пациенту 20 лет. Неделю назад металлокерамический мостовидный протез с опорами на зубы 4.3 и 4.6 зафиксирован на временный цемент. Во время ортопедического лечения интактные зубы 4.3 и 4.6 были препарированы под местной анестезией, после препарирования зубы были защищены временным пластмассовым мостовидным протезом, боли в это время пациент не ощущал. Ноющая боль появилась на второй день после фиксации металлокерамического зубного протеза на временный цемент, интенсивность боли постепенно нарастает, усиливается от холодного. Пациент точно указывает, что боль локализуется в области зуба 4.3", checked: false,
preliminary: "Средний кариес 36-го зуба (II класс по Блэку)", text: "Пациенту 20 лет. Неделю назад металлокерамический мостовидный протез с опорами на зубы 4.3 и 4.6 зафиксирован на временный цемент. Во время ортопедического лечения интактные зубы 4.3 и 4.6 были препарированы под местной анестезией, после препарирования зубы были защищены временным пластмассовым мостовидным протезом, боли в это время пациент не ощущал. Ноющая боль появилась на второй день после фиксации металлокерамического зубного протеза на временный цемент, интенсивность боли постепенно нарастает, усиливается от холодного. Пациент точно указывает, что боль локализуется в области зуба 4.3",
},
preliminary: { text: "Средний кариес 36-го зуба (II класс по Блэку)" },
thermometry: { thermometry: {
cold: { cold: {
value: 22, value: 22,
@@ -371,6 +373,20 @@ const getters = {
lacticBite: toothFormula.state.lacticBite, lacticBite: toothFormula.state.lacticBite,
formula: toothFormula.state.formula, formula: toothFormula.state.formula,
}, },
data: {
complaints: [
"Боль при приеме сладкой пищи",
"Жжение языка",
"Кровоточивость десен",
"Лечение у ортодонта не проводилось",
"Ранее зубы лечили в ЛПУ",
"Удаление зуба",
],
files: [
{ name: "Документы", data: [] },
{ name: "Сканы", data: [] },
],
},
clinical: [{ id: 0, label: "В00.09", text: "Простой герпес" }], clinical: [{ id: 0, label: "В00.09", text: "Простой герпес" }],
}; };
}, },
@@ -404,12 +420,19 @@ const getters = {
value: null, value: null,
}, },
}, },
disease: null, disease: { checked: false, text: null },
preliminary: null, preliminary: { text: null },
toothFormula: { toothFormula: {
lacticBite: toothFormula.stateInit.lacticBite, lacticBite: toothFormula.stateInit.lacticBite,
formula: toothFormula.stateInit.formula, formula: toothFormula.stateInit.formula,
}, },
data: {
complaints: [],
files: [
{ name: "Документы", data: [] },
{ name: "Сканы", data: [] },
],
},
clinical: [], clinical: [],
}; };
}, },