[WIP] Добавил фильтр зубной формулы
This commit is contained in:
@@ -63,7 +63,7 @@
|
|||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
import { getFiiledConditions } from "@/pages/newMedicalCard/utils/gettersObjects";
|
import { getFilledConditions } from "@/pages/newMedicalCard/utils/gettersObjects";
|
||||||
import { toothConditions } from "@/pages/newMedicalCard/utils/medicalConfig";
|
import { toothConditions } from "@/pages/newMedicalCard/utils/medicalConfig";
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
@@ -72,7 +72,7 @@ export default {
|
|||||||
return {
|
return {
|
||||||
isOpenInfoSelected: false,
|
isOpenInfoSelected: false,
|
||||||
listSelected: [],
|
listSelected: [],
|
||||||
getFiiledConditions,
|
getFilledConditions,
|
||||||
toothConditions,
|
toothConditions,
|
||||||
};
|
};
|
||||||
},
|
},
|
||||||
@@ -83,14 +83,9 @@ export default {
|
|||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
updateConditions() {
|
updateConditions() {
|
||||||
let arraySelected = [...this.getFiiledConditions(this.data)];
|
let arraySelected = [...this.getFilledConditions(this.data)];
|
||||||
if (this.data.general)
|
|
||||||
arraySelected.unshift({
|
|
||||||
value: this.data.general,
|
|
||||||
type: "general",
|
|
||||||
});
|
|
||||||
this.listSelected = [...arraySelected];
|
|
||||||
if (arraySelected.length) {
|
if (arraySelected.length) {
|
||||||
|
this.listSelected = [...arraySelected];
|
||||||
this.isOpenInfoSelected = true;
|
this.isOpenInfoSelected = true;
|
||||||
} else {
|
} else {
|
||||||
this.isOpenInfoSelected = false;
|
this.isOpenInfoSelected = false;
|
||||||
|
|||||||
@@ -0,0 +1,91 @@
|
|||||||
|
<template lang="pug">
|
||||||
|
.flex.w-full.gap-x-10px
|
||||||
|
.filter-block.w-full.flex-col.flex.rounded(
|
||||||
|
v-for="filter in formulaFilterMap"
|
||||||
|
)
|
||||||
|
.flex.block-filter.h-30px(v-for="value in filter")
|
||||||
|
.border-right.width-cell.flex.justify-center.items-center
|
||||||
|
q-checkbox(
|
||||||
|
dense,
|
||||||
|
v-model="filterResult",
|
||||||
|
@update:model-value="() => updateFilter(value)",
|
||||||
|
:val="value",
|
||||||
|
checked-icon="check_box",
|
||||||
|
unchecked-icon="check_box_outline_blank",
|
||||||
|
)
|
||||||
|
.border-right.width-cell.flex.justify-center.items-center
|
||||||
|
span.text-smm.font-medium(
|
||||||
|
v-if="value !== 'Все'"
|
||||||
|
:style="{'color': 'var(--font-grey-color)'}"
|
||||||
|
) {{value}}
|
||||||
|
.border-right.flex.items-center.pl-3.w-full(:style="{'minWidth': '190px'}")
|
||||||
|
span.text-smm.font-medium {{toothConditions[value] || value}}
|
||||||
|
.width-cell.flex.w-8.justify-center.items-center
|
||||||
|
span.text-smm.font-medium {{getCountConditions[value] || "-"}}
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<script>
|
||||||
|
import {
|
||||||
|
toothConditions,
|
||||||
|
formulaFilterMap,
|
||||||
|
} from "@/pages/newMedicalCard/utils/medicalConfig";
|
||||||
|
import { getFilledConditions } from "@/pages/newMedicalCard/utils/gettersObjects";
|
||||||
|
|
||||||
|
export default {
|
||||||
|
name: "FormulaFilter",
|
||||||
|
data() {
|
||||||
|
return {
|
||||||
|
toothConditions,
|
||||||
|
formulaFilterMap,
|
||||||
|
getFilledConditions,
|
||||||
|
filterResult: ["Все"],
|
||||||
|
};
|
||||||
|
},
|
||||||
|
props: {
|
||||||
|
data: Object,
|
||||||
|
},
|
||||||
|
methods: {
|
||||||
|
updateFilter(value) {
|
||||||
|
if (value === "Все" || !this.filterResult.length) {
|
||||||
|
this.filterResult = ["Все"];
|
||||||
|
} else {
|
||||||
|
this.filterResult = [
|
||||||
|
...this.filterResult.filter((item) => item !== "Все"),
|
||||||
|
];
|
||||||
|
}
|
||||||
|
},
|
||||||
|
},
|
||||||
|
computed: {
|
||||||
|
getCountConditions() {
|
||||||
|
let conditions = {};
|
||||||
|
Object.keys(this.toothConditions).forEach((key) => {
|
||||||
|
conditions[key] = 0;
|
||||||
|
});
|
||||||
|
Object.keys(this.data.formula)
|
||||||
|
.map((key) => ({
|
||||||
|
firstCondition: getFilledConditions(
|
||||||
|
this.data.formula[key].dental_condition
|
||||||
|
)
|
||||||
|
.map((item) => item.value)
|
||||||
|
.flat()[0],
|
||||||
|
key: key,
|
||||||
|
}))
|
||||||
|
.forEach((el) => {
|
||||||
|
if (el.firstCondition) {
|
||||||
|
conditions[el.firstCondition] += 1;
|
||||||
|
}
|
||||||
|
});
|
||||||
|
return conditions;
|
||||||
|
},
|
||||||
|
},
|
||||||
|
};
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<style lang="sass" scoped>
|
||||||
|
.filter-block
|
||||||
|
border: 1px solid var(--border-light-grey-color)
|
||||||
|
.border-right
|
||||||
|
border-right: 1px solid var(--border-light-grey-color)
|
||||||
|
.width-cell
|
||||||
|
min-width: 32px
|
||||||
|
</style>
|
||||||
@@ -6,8 +6,8 @@
|
|||||||
)
|
)
|
||||||
.flex.flex-col.p-4.gap-15px.text-smm.font-medium
|
.flex.flex-col.p-4.gap-15px.text-smm.font-medium
|
||||||
.general.w-full.flex.justify-start.pb-15px
|
.general.w-full.flex.justify-start.pb-15px
|
||||||
span.opacity-60(:style="{'color': 'var(--font-dark-blue-color)'}") {{`${general} – ${config[general]}`}}
|
span.opacity-60(:style="{'color': 'var(--font-dark-blue-color)'}") {{`${conditions[0]} – ${config[conditions[0]]}`}}
|
||||||
span(v-for="condition in conditions") {{`${condition} – ${config[condition]}`}}
|
span(v-for="condition in conditions.slice(1)") {{`${condition} – ${config[condition]}`}}
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
@@ -17,7 +17,6 @@ export default {
|
|||||||
name: "ToothConditionsInfo",
|
name: "ToothConditionsInfo",
|
||||||
props: {
|
props: {
|
||||||
config: Object,
|
config: Object,
|
||||||
general: String,
|
|
||||||
conditions: Array,
|
conditions: Array,
|
||||||
modelValue: Boolean,
|
modelValue: Boolean,
|
||||||
hideEvent: Function,
|
hideEvent: Function,
|
||||||
|
|||||||
@@ -33,17 +33,16 @@
|
|||||||
v-if="rowKey === 'dental_condition' && !isEditCondition",
|
v-if="rowKey === 'dental_condition' && !isEditCondition",
|
||||||
:class="{'cell-info': isEdit}"
|
:class="{'cell-info': isEdit}"
|
||||||
)
|
)
|
||||||
span.text-smm.font-medium {{ value[rowKey].general }}
|
span.text-smm.font-medium {{getFilledConditions(value[rowKey]).map((el) => el.value).flat()[0]}}
|
||||||
.conditions.flex.justify-center.items-center.w-27px.h-6.rounded.cursor-pointer(
|
.conditions.flex.justify-center.items-center.w-27px.h-6.rounded.cursor-pointer(
|
||||||
v-if="getFiiledConditions(value[rowKey]).length",
|
v-if="getFilledConditions(value[rowKey]).map((el) => el.value).flat().length-1 > 0",
|
||||||
@click="()=>openConditionsInfo()",
|
@click="()=>openConditionsInfo()",
|
||||||
:class="{'active': isOpenConditionsInfo}"
|
:class="{'active': isOpenConditionsInfo}"
|
||||||
)
|
)
|
||||||
span.text-xsx.font-medium {{`+${getFiiledConditions(value[rowKey]).length}`}}
|
span.text-xsx.font-medium {{`+${getFilledConditions(value[rowKey]).map((el) => el.value).flat().length - 1}`}}
|
||||||
tooth-conditions-info(
|
tooth-conditions-info(
|
||||||
v-model="isOpenConditionsInfo",
|
v-model="isOpenConditionsInfo",
|
||||||
:general="value[rowKey].general",
|
:conditions="getFilledConditions(value[rowKey]).map((el) => el.value).flat()"
|
||||||
:conditions="getFiiledConditions(value[rowKey]).map((el) => el.value).flat()"
|
|
||||||
:config="conditionConfig"
|
:config="conditionConfig"
|
||||||
)
|
)
|
||||||
span.text-smm.font-medium(
|
span.text-smm.font-medium(
|
||||||
@@ -84,7 +83,7 @@
|
|||||||
import DentalConditionForm from "@/pages/newMedicalCard/components/InitialInspectionProtocol/Forms/ToothFormula/DentalConditionForm.vue";
|
import DentalConditionForm from "@/pages/newMedicalCard/components/InitialInspectionProtocol/Forms/ToothFormula/DentalConditionForm.vue";
|
||||||
import ToothLowSvg from "@/pages/newMedicalCard/components/InitialInspectionProtocol/Forms/ToothFormula/ToothLowSvg.vue";
|
import ToothLowSvg from "@/pages/newMedicalCard/components/InitialInspectionProtocol/Forms/ToothFormula/ToothLowSvg.vue";
|
||||||
import ToothConditionsInfo from "@/pages/newMedicalCard/components/InitialInspectionProtocol/Forms/ToothFormula/ToothConditionsInfo.vue";
|
import ToothConditionsInfo from "@/pages/newMedicalCard/components/InitialInspectionProtocol/Forms/ToothFormula/ToothConditionsInfo.vue";
|
||||||
import { getFiiledConditions } from "@/pages/newMedicalCard/utils/gettersObjects";
|
import { getFilledConditions } from "@/pages/newMedicalCard/utils/gettersObjects";
|
||||||
import {
|
import {
|
||||||
toothConditions,
|
toothConditions,
|
||||||
toothMobility,
|
toothMobility,
|
||||||
@@ -100,7 +99,7 @@ export default {
|
|||||||
isOpenConditionsInfo: false,
|
isOpenConditionsInfo: false,
|
||||||
mobilityConfig: toothMobility,
|
mobilityConfig: toothMobility,
|
||||||
conditionConfig: toothConditions,
|
conditionConfig: toothConditions,
|
||||||
getFiiledConditions,
|
getFilledConditions,
|
||||||
};
|
};
|
||||||
},
|
},
|
||||||
mixins: [v_model],
|
mixins: [v_model],
|
||||||
|
|||||||
@@ -26,6 +26,7 @@
|
|||||||
:form-config="data.conditionsForm",
|
:form-config="data.conditionsForm",
|
||||||
:is-edit="isEdit"
|
:is-edit="isEdit"
|
||||||
)
|
)
|
||||||
|
formula-filter(:data="protocol[data.state]")
|
||||||
template(v-slot:right-corner)
|
template(v-slot:right-corner)
|
||||||
.flex.flex-toogle.h-10.p-1.rounded(:style="{'backgroundColor': 'var(--bg-light-grey)'}")
|
.flex.flex-toogle.h-10.p-1.rounded(:style="{'backgroundColor': 'var(--bg-light-grey)'}")
|
||||||
q-btn.w-12.h-full.rounded(
|
q-btn.w-12.h-full.rounded(
|
||||||
@@ -43,6 +44,7 @@
|
|||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
|
import FormulaFilter from "@/pages/newMedicalCard/components/InitialInspectionProtocol/Forms/ToothFormula/FormulaFilter.vue";
|
||||||
import MedicalFormWrapper from "@/pages/newMedicalCard/components/MedicalFormWrapper.vue";
|
import MedicalFormWrapper from "@/pages/newMedicalCard/components/MedicalFormWrapper.vue";
|
||||||
import ToothFormulaTable from "@/pages/newMedicalCard/components/InitialInspectionProtocol/Forms/ToothFormula/ToothFormulaTable.vue";
|
import ToothFormulaTable from "@/pages/newMedicalCard/components/InitialInspectionProtocol/Forms/ToothFormula/ToothFormulaTable.vue";
|
||||||
import teeth from "@/assets/icons/teeth.svg";
|
import teeth from "@/assets/icons/teeth.svg";
|
||||||
@@ -51,11 +53,12 @@ import { mapState } from "vuex";
|
|||||||
|
|
||||||
export default {
|
export default {
|
||||||
name: "ToothFormulaForm",
|
name: "ToothFormulaForm",
|
||||||
components: { MedicalFormWrapper, ToothFormulaTable },
|
components: { MedicalFormWrapper, ToothFormulaTable, FormulaFilter },
|
||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
teeth,
|
teeth,
|
||||||
teeth_2,
|
teeth_2,
|
||||||
|
filter: ["Все"],
|
||||||
isEdit: false,
|
isEdit: false,
|
||||||
component: false,
|
component: false,
|
||||||
viewToothFormula: true,
|
viewToothFormula: true,
|
||||||
|
|||||||
@@ -55,7 +55,8 @@ export function getConfidantObject(data) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
export const getFiiledConditions = (condition) => {
|
export const getFilledConditions = (condition) => {
|
||||||
|
let filledConditions = [];
|
||||||
let crown = Object.keys(condition.crown)
|
let crown = Object.keys(condition.crown)
|
||||||
.map((key) => ({
|
.map((key) => ({
|
||||||
value: condition.crown[key],
|
value: condition.crown[key],
|
||||||
@@ -70,5 +71,11 @@ export const getFiiledConditions = (condition) => {
|
|||||||
part: key,
|
part: key,
|
||||||
}))
|
}))
|
||||||
.filter((el) => el.value.length);
|
.filter((el) => el.value.length);
|
||||||
return [...crown, ...root];
|
filledConditions = [...crown, ...root];
|
||||||
|
if (condition.general)
|
||||||
|
filledConditions.unshift({
|
||||||
|
value: condition.general,
|
||||||
|
type: "general",
|
||||||
|
});
|
||||||
|
return filledConditions;
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -586,6 +586,13 @@ export const toothMobility = [
|
|||||||
{ id: 4, label: "IV" },
|
{ id: 4, label: "IV" },
|
||||||
];
|
];
|
||||||
|
|
||||||
|
export const formulaFilterMap = [
|
||||||
|
["Все", "К", "П"],
|
||||||
|
["Д", "Пл", "ИК"],
|
||||||
|
["ИЗ", "В", "И"],
|
||||||
|
["КЗ", "О", "Пт"],
|
||||||
|
];
|
||||||
|
|
||||||
export const protocolForms = [
|
export const protocolForms = [
|
||||||
{
|
{
|
||||||
title: "Жалобы",
|
title: "Жалобы",
|
||||||
|
|||||||
Reference in New Issue
Block a user