Merge branch 'ASTRA-121' into 'master'

Resolve ASTRA-121

See merge request andrusyakka/urban-couscous!451
This commit is contained in:
Vasiliy Gavrilin
2023-06-28 15:00:09 +00:00
6 changed files with 128 additions and 31 deletions

View File

@@ -107,6 +107,12 @@ export default {
}, },
}, },
watch: { watch: {
modelValue: {
immediate: true,
handler(value) {
this.protocolData[this.data.state] = value;
},
},
state: { state: {
immediate: true, immediate: true,
handler(value) { handler(value) {

View File

@@ -48,8 +48,10 @@
) )
.name.flex.items-center.font-medium.text-smm {{ name }} .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(@click="showModal = true", color="primary", dense, padding="4px 12px")
q-icon(name="app:icon-plus", size="17px") q-icon(name="app:icon-plus", size="17px")
base-modal(v-model="showModal", title="Создание тега")
tag-creation-form
.flex(v-if="data.title === 'Осмотр полости рта' && (fillInspection || change)", :style="{color: 'var(--btn-blue-color)'}") .flex(v-if="data.title === 'Осмотр полости рта' && (fillInspection || change)", :style="{color: 'var(--btn-blue-color)'}")
q-btn(no-caps, flat padding="2px 4px") q-btn(no-caps, flat padding="2px 4px")
q-icon(left, name="app:plus", size="11px") q-icon(left, name="app:plus", size="11px")
@@ -60,15 +62,24 @@
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 MedicalFormWrapper from "@/pages/newMedicalCard/components/MedicalFormWrapper.vue"; import MedicalFormWrapper from "@/pages/newMedicalCard/components/MedicalFormWrapper.vue";
import TagCreationForm from "@/pages/newMedicalCard/components/InitialInspectionProtocol/Forms/TagCreationForm.vue";
import { mapState } from "vuex"; import { mapState } from "vuex";
import BaseModal from "@/components/base/BaseModal.vue";
export default { export default {
name: "MedicalFormTag", name: "MedicalFormTag",
components: { BaseButton, BaseInput, MedicalFormWrapper }, components: {
BaseButton,
BaseInput,
MedicalFormWrapper,
TagCreationForm,
BaseModal,
},
props: { data: Object, abc: Array, fillInspection: Boolean }, props: { data: Object, abc: Array, fillInspection: Boolean },
data() { data() {
return { return {
change: false, change: false,
showModal: false,
}; };
}, },
computed: { computed: {

View File

@@ -0,0 +1,48 @@
<template lang="pug">
.wrapper.flex.flex-col
.flex.flex-col
.buttons-group.flex
q-btn(
color="primary",
outline,
size="16px",
no-caps,
label="Отмена",
:style="{width: '100%', height: '40px'}",
padding="10px 24px"
)
q-btn(
color="primary",
size="16px",
no-caps,
label="Создать"
:style="{width: '100%', height: '40px'}",
padding="10px 24px"
)
</template>
<script>
export default {
name: "TagCreationForm",
data() {
return {
model: null,
options: [
{ label: "Какая-то категория 1" },
{ label: "Какая-то категория 2" },
{ label: "Какая-то категория 3" },
{ label: "Какая-то категория 4" },
],
};
},
};
</script>
<style lang="sass" scoped>
.buttons-group
padding: 16px 168px 0px 32px
border-top: 1px solid var(--border-light-grey-color)
margin-left: -40px
margin-right: -40px
column-gap: 7px
</style>

View File

@@ -43,7 +43,9 @@ import MainFactorsForm from "@/pages/newMedicalCard/components/InitialInspection
import ToothFormulaForm from "@/pages/newMedicalCard/components/InitialInspectionProtocol/Forms/ToothFormula/ToothFormulaForm.vue"; import ToothFormulaForm from "@/pages/newMedicalCard/components/InitialInspectionProtocol/Forms/ToothFormula/ToothFormulaForm.vue";
import { protocolForms } from "@/pages/newMedicalCard/utils/medicalConfig.js"; import { protocolForms } from "@/pages/newMedicalCard/utils/medicalConfig.js";
import ClinicalForm from "./Forms/ClinicalForm.vue"; import ClinicalForm from "./Forms/ClinicalForm.vue";
import { mapGetters, mapState } from "vuex"; import { mapState } from "vuex";
import { removeEmptyFields } from "@/shared/utils/changesObjects";
import toothFormula from "@/store/modules/toothFormula";
export default { export default {
name: "MedicalProtocolsInspection", name: "MedicalProtocolsInspection",
@@ -60,6 +62,7 @@ export default {
props: { inspection: Boolean, fillInspection: Boolean }, props: { inspection: Boolean, fillInspection: Boolean },
data() { data() {
return { return {
initToothFormula: toothFormula.stateInit,
percent: 0, percent: 0,
protocolForms: protocolForms, protocolForms: protocolForms,
list: [ list: [
@@ -107,34 +110,64 @@ export default {
...mapState({ ...mapState({
protocolData: (state) => state.medical.protocolData, protocolData: (state) => state.medical.protocolData,
}), }),
...mapGetters({
protocolDataGet: "getInitProtocol",
}),
}, },
methods: { methods: {
interestСalculation() { setPercent(data, sum) {
const getTypeOf = (obj) => { switch (data) {
return {}.toString.call(obj).slice(8, -1); case "KPUIndex":
}; case "bite":
let sum = 0; case "hygieneIndex":
for (let a in this.protocolData) { if (this.protocolData[data]) sum += 1;
if ( break;
Array.isArray(this.protocolData[a]) && case "anamnesis":
this.protocolData[a].length > 0 case "cavity":
) case "clinical":
sum += 1; case "complaints":
case "illnesses":
if (this.protocolData[a] && typeof this.protocolData[a] === "string") case "inspection":
sum += 1; case "medications":
case "survey":
if ( if (this.protocolData[data].length) sum += 1;
getTypeOf(this.protocolData[a]) === "Object" && break;
Object.keys(this.protocolData[a]).length case "data": {
) if (this.protocolData[data].complaints.length) sum += 0.5;
sum += 1; this.protocolData[data].files.forEach((e) => {
if (e.data.length) sum += 0.25;
});
break;
}
case "disease":
case "preliminary":
if (this.protocolData[data].text || this.protocolData[data].change)
sum += 1;
break;
case "thermometry": {
let obj = removeEmptyFields(this.protocolData[data]);
for (let el in obj) {
if (obj[el].result) sum += 0.25;
if (obj[el].value) sum += 0.25;
}
break;
}
case "tonometry": {
let obj = removeEmptyFields(this.protocolData[data]);
for (let el in obj) if (obj[el].value) sum += 0.5;
break;
}
case "toothFormula":
if (
JSON.stringify(this.initToothFormula) !==
JSON.stringify(this.protocolData[data])
)
sum += 1;
break;
} }
sum = Math.ceil(17 / sum); return sum;
this.percent = sum > 1 ? sum * 10 : sum * 100; },
interestСalculation() {
let sum = 0;
for (let data in this.protocolData) sum = this.setPercent(data, sum);
this.percent = Math.round((100 * Math.round(sum)) / 17);
}, },
}, },
watch: { watch: {

View File

@@ -753,7 +753,6 @@ export const protocolForms = [
"Киста в глазу", "Киста в глазу",
"Красные пятна на языке", "Красные пятна на языке",
"Фингал под глазом", "Фингал под глазом",
"Гематома на щеке",
], ],
}, },
}, },

View File

@@ -374,7 +374,7 @@ const getters = {
}, },
toothFormula: { toothFormula: {
lacticBite: toothFormula.state.lacticBite, lacticBite: toothFormula.state.lacticBite,
formula: toothFormula.state.formula, formula: JSON.parse(JSON.stringify(toothFormula.state.formula)),
}, },
data: { data: {
complaints: [ complaints: [
@@ -427,7 +427,7 @@ const getters = {
preliminary: { text: null }, preliminary: { text: null },
toothFormula: { toothFormula: {
lacticBite: toothFormula.stateInit.lacticBite, lacticBite: toothFormula.stateInit.lacticBite,
formula: toothFormula.stateInit.formula, formula: JSON.parse(JSON.stringify(toothFormula.stateInit.formula)),
}, },
data: { data: {
complaints: [], complaints: [],