Merge branch 'ASTRA-79' into 'master'
WIP Добавил обновление пустых и заполненных данных Первичного осмотра See merge request andrusyakka/urban-couscous!377
This commit is contained in:
@@ -108,7 +108,9 @@ export default {
|
||||
if (!this.fillInspection) this.modelValue = value;
|
||||
},
|
||||
},
|
||||
fillInspection(value) {
|
||||
fillInspection: {
|
||||
immediate: true,
|
||||
handler(value) {
|
||||
if (value) {
|
||||
this.isEdit = true;
|
||||
this.modelValue = null;
|
||||
@@ -118,6 +120,7 @@ export default {
|
||||
}
|
||||
},
|
||||
},
|
||||
},
|
||||
};
|
||||
</script>
|
||||
|
||||
|
||||
@@ -1,5 +1,11 @@
|
||||
<template lang="pug">
|
||||
medical-form-wrapper(:title="data.title", :is-edit="isEdit", :open-edit="openEdit", :cancel="cancelEdit")
|
||||
medical-form-wrapper(
|
||||
:title="data.title",
|
||||
:is-edit="isEdit",
|
||||
:open-edit="openEdit",
|
||||
:buttonsPresence="!fillInspection",
|
||||
:cancel="cancelEdit"
|
||||
)
|
||||
.thermometry-wrapper.grid.gap-x-20.gap-y-5
|
||||
.flex.flex-col.gap-y-4.items-start(v-if="isEdit" v-for="(dataValue, key) in protocol[data.key]")
|
||||
span.font-semibold.text-smm(v-if="data.key === 'thermometry'") {{ data.config[key].title }}
|
||||
@@ -65,12 +71,14 @@ import BaseInput from "@/components/base/BaseInput.vue";
|
||||
import BaseInputNumber from "@/components/base/BaseInputNumber.vue";
|
||||
import { thermometryResultsMap } from "@/pages/newMedicalCard/utils/medicalConfig";
|
||||
import { mapState } from "vuex";
|
||||
import { mapActions } from "vuex";
|
||||
|
||||
export default {
|
||||
name: "ThermometryForm",
|
||||
components: { MedicalFormWrapper, BaseInput, BaseInputNumber },
|
||||
props: {
|
||||
data: Object,
|
||||
fillInspection: Boolean,
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
@@ -84,13 +92,36 @@ export default {
|
||||
}),
|
||||
},
|
||||
methods: {
|
||||
...mapActions({
|
||||
getProtocolData: "getProtocolData",
|
||||
}),
|
||||
openEdit() {
|
||||
this.isEdit = true;
|
||||
},
|
||||
cancelEdit() {
|
||||
this.getProtocolData({
|
||||
key: this.data.key,
|
||||
});
|
||||
this.isEdit = false;
|
||||
},
|
||||
},
|
||||
watch: {
|
||||
fillInspection: {
|
||||
immediate: true,
|
||||
handler(value) {
|
||||
if (value) {
|
||||
this.isEdit = true;
|
||||
} else {
|
||||
this.isEdit = false;
|
||||
}
|
||||
},
|
||||
},
|
||||
},
|
||||
mounted() {
|
||||
if (this.fillInspection) {
|
||||
this.isEdit = true;
|
||||
}
|
||||
},
|
||||
};
|
||||
</script>
|
||||
|
||||
|
||||
@@ -7,6 +7,7 @@
|
||||
<script>
|
||||
import MedicalProtocolsList from "@/pages/newMedicalCard/components/InitialInspectionProtocol/MedicalProtocolsList.vue";
|
||||
import MedicalProtocolsInspection from "@/pages/newMedicalCard/components/InitialInspectionProtocol/MedicalProtocolsInspection.vue";
|
||||
import { mapActions } from "vuex";
|
||||
export default {
|
||||
name: "MedicalProtocolsWrapper",
|
||||
components: { MedicalProtocolsList, MedicalProtocolsInspection },
|
||||
@@ -17,13 +18,22 @@ export default {
|
||||
};
|
||||
},
|
||||
methods: {
|
||||
...mapActions({
|
||||
getProtocolData: "getProtocolData",
|
||||
}),
|
||||
openInspection() {
|
||||
this.inspection = true;
|
||||
this.fillInspection = false;
|
||||
this.getProtocolData({
|
||||
fillInspection: false,
|
||||
});
|
||||
},
|
||||
createInspection() {
|
||||
this.fillInspection = true;
|
||||
this.inspection = false;
|
||||
this.getProtocolData({
|
||||
fillInspection: true,
|
||||
});
|
||||
},
|
||||
},
|
||||
};
|
||||
|
||||
@@ -126,29 +126,7 @@ const state = () => ({
|
||||
status: "filled",
|
||||
},
|
||||
],
|
||||
protocolData: {
|
||||
bite: "distal bite",
|
||||
hygieneIndex: 2,
|
||||
KPUIndex: 6.1,
|
||||
thermometry: {
|
||||
cold: {
|
||||
value: 22,
|
||||
result: "Реакция нормальная",
|
||||
},
|
||||
heat: {
|
||||
value: 50,
|
||||
result: "Повышенная чувствительность",
|
||||
},
|
||||
},
|
||||
tonometry: {
|
||||
pulse: {
|
||||
value: 84,
|
||||
},
|
||||
pressure: {
|
||||
value: 120,
|
||||
},
|
||||
},
|
||||
},
|
||||
protocolData: null,
|
||||
});
|
||||
|
||||
const getters = {
|
||||
@@ -301,6 +279,56 @@ const getters = {
|
||||
let firstName = state?.medicalCard?.person?.first_name;
|
||||
return lastName?.[0] + firstName?.[0];
|
||||
},
|
||||
getProtocolData() {
|
||||
return {
|
||||
bite: "distal bite",
|
||||
hygieneIndex: 2,
|
||||
KPUIndex: 6.1,
|
||||
thermometry: {
|
||||
cold: {
|
||||
value: 22,
|
||||
result: "Реакция нормальная",
|
||||
},
|
||||
heat: {
|
||||
value: 50,
|
||||
result: "Повышенная чувствительность",
|
||||
},
|
||||
},
|
||||
tonometry: {
|
||||
pulse: {
|
||||
value: 84,
|
||||
},
|
||||
pressure: {
|
||||
value: 120,
|
||||
},
|
||||
},
|
||||
};
|
||||
},
|
||||
getInitProtocol() {
|
||||
return {
|
||||
bite: null,
|
||||
hygieneIndex: null,
|
||||
KPUIndex: null,
|
||||
thermometry: {
|
||||
cold: {
|
||||
value: null,
|
||||
result: null,
|
||||
},
|
||||
heat: {
|
||||
value: null,
|
||||
result: null,
|
||||
},
|
||||
},
|
||||
tonometry: {
|
||||
pulse: {
|
||||
value: null,
|
||||
},
|
||||
pressure: {
|
||||
value: null,
|
||||
},
|
||||
},
|
||||
};
|
||||
},
|
||||
};
|
||||
|
||||
const actions = {
|
||||
@@ -364,6 +392,9 @@ const actions = {
|
||||
data.id = state.protocolsList.length + 1;
|
||||
commit("setProtocolsList", data);
|
||||
},
|
||||
getProtocolData({ commit }, props) {
|
||||
commit("setProtocolData", props);
|
||||
},
|
||||
};
|
||||
|
||||
const mutations = {
|
||||
@@ -396,6 +427,19 @@ const mutations = {
|
||||
setProtocolsList(state, data) {
|
||||
state.protocolsList = [...state.protocolsList, data];
|
||||
},
|
||||
setProtocolData(state, props) {
|
||||
if (props?.key) {
|
||||
state.protocolData[props.key] = {
|
||||
...JSON.parse(JSON.stringify(this.getters.getProtocolData[props.key])),
|
||||
};
|
||||
} else {
|
||||
if (props.fillInspection) {
|
||||
state.protocolData = this.getters.getInitProtocol;
|
||||
} else {
|
||||
state.protocolData = this.getters.getProtocolData;
|
||||
}
|
||||
}
|
||||
},
|
||||
};
|
||||
|
||||
export default {
|
||||
|
||||
Reference in New Issue
Block a user