WIP Добавил обновление пустых и заполненных данных Первичного осмотра
This commit is contained in:
@@ -108,14 +108,17 @@ export default {
|
||||
if (!this.fillInspection) this.modelValue = value;
|
||||
},
|
||||
},
|
||||
fillInspection(value) {
|
||||
if (value) {
|
||||
this.isEdit = true;
|
||||
this.modelValue = null;
|
||||
} else {
|
||||
this.isEdit = false;
|
||||
this.modelValue = this.state;
|
||||
}
|
||||
fillInspection: {
|
||||
immediate: true,
|
||||
handler(value) {
|
||||
if (value) {
|
||||
this.isEdit = true;
|
||||
this.modelValue = null;
|
||||
} else {
|
||||
this.isEdit = false;
|
||||
this.modelValue = this.state;
|
||||
}
|
||||
},
|
||||
},
|
||||
},
|
||||
};
|
||||
|
||||
@@ -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,
|
||||
});
|
||||
},
|
||||
},
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user