WIP Добавил обновление пустых и заполненных данных Первичного осмотра

This commit is contained in:
DwCay
2023-05-18 17:26:51 +03:00
parent f94a010596
commit d232e71f0d
4 changed files with 120 additions and 32 deletions

View File

@@ -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 {