Merge branch '3-transition-medical-card' into 'master'
Добавил параметры роута Closes #3 See merge request astra/astra-frontend!501
This commit is contained in:
@@ -140,13 +140,9 @@ export default {
|
|||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
filterDataBenefit(text) {
|
filterDataBenefit(text) {
|
||||||
if (text.length > 1) {
|
if (text.length > 1)
|
||||||
localStorage.setItem("searchBenefit", text);
|
return this.$store.dispatch("getBenefitDataSearch", text);
|
||||||
this.$store.dispatch("getBenefitDataSearch");
|
this.$store.dispatch("getBenefitData", text);
|
||||||
} else {
|
|
||||||
this.$store.dispatch("getBenefitData");
|
|
||||||
localStorage.removeItem("searchBenefit", text);
|
|
||||||
}
|
|
||||||
},
|
},
|
||||||
removeImage(docKey, field) {
|
removeImage(docKey, field) {
|
||||||
this.basic[docKey][field] = {};
|
this.basic[docKey][field] = {};
|
||||||
|
|||||||
@@ -191,8 +191,7 @@ export default {
|
|||||||
checkChangeInput(val, key) {
|
checkChangeInput(val, key) {
|
||||||
if (key === "last_name") {
|
if (key === "last_name") {
|
||||||
if (val.length > 0) {
|
if (val.length > 0) {
|
||||||
localStorage.setItem("searchConfidant", val);
|
this.$store.dispatch("getPersonsFiltredList", val).then((res) => {
|
||||||
this.$store.dispatch("getPersonsFiltredList").then((res) => {
|
|
||||||
if (res.length > 0) {
|
if (res.length > 0) {
|
||||||
this.listPersons = res;
|
this.listPersons = res;
|
||||||
this.isOpenListConfidant = true;
|
this.isOpenListConfidant = true;
|
||||||
@@ -225,7 +224,8 @@ export default {
|
|||||||
getRequestConfidant(
|
getRequestConfidant(
|
||||||
this.confidant,
|
this.confidant,
|
||||||
initConfidantData,
|
initConfidantData,
|
||||||
this.initPerson
|
this.initPerson,
|
||||||
|
this.$route.params.id
|
||||||
).then(() => {
|
).then(() => {
|
||||||
this.$store.dispatch("getMedicalCardData");
|
this.$store.dispatch("getMedicalCardData");
|
||||||
this.isLoadingData = false;
|
this.isLoadingData = false;
|
||||||
@@ -259,9 +259,7 @@ export default {
|
|||||||
if (this.confidant.id) {
|
if (this.confidant.id) {
|
||||||
fetchWrapper
|
fetchWrapper
|
||||||
.del(
|
.del(
|
||||||
`medical_card/medical_history/${localStorage.getItem(
|
`medical_card/medical_history/${this.$route.params.id}/delete_confidant/`,
|
||||||
"medicalId"
|
|
||||||
)}/delete_confidant/`,
|
|
||||||
{
|
{
|
||||||
confidants: [
|
confidants: [
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -30,7 +30,7 @@ export default {
|
|||||||
methods: {
|
methods: {
|
||||||
removeMedicalCard() {
|
removeMedicalCard() {
|
||||||
this.changeShownRemoveModal(false);
|
this.changeShownRemoveModal(false);
|
||||||
this.$store.dispatch("removeMedicalCardData");
|
this.$store.dispatch("removeMedicalCardData", this.$route.params.id);
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -249,11 +249,7 @@ export default {
|
|||||||
!!tooth.tooth_mobility &&
|
!!tooth.tooth_mobility &&
|
||||||
!!tooth.dental_condition;
|
!!tooth.dental_condition;
|
||||||
if (isCreate) {
|
if (isCreate) {
|
||||||
requestCreateMedicalCard(
|
requestCreateMedicalCard(tooth, key, this.$route.params.id);
|
||||||
tooth,
|
|
||||||
key,
|
|
||||||
localStorage.getItem("medicalId")
|
|
||||||
);
|
|
||||||
}
|
}
|
||||||
if (
|
if (
|
||||||
toothResponse &&
|
toothResponse &&
|
||||||
@@ -273,7 +269,7 @@ export default {
|
|||||||
requestCreateMedicalCard(
|
requestCreateMedicalCard(
|
||||||
this.dentalIndications[key],
|
this.dentalIndications[key],
|
||||||
key,
|
key,
|
||||||
localStorage.getItem("medicalId")
|
this.$route.params.id
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
if (
|
if (
|
||||||
@@ -385,11 +381,7 @@ export default {
|
|||||||
},
|
},
|
||||||
async fetchDataMedicalCard() {
|
async fetchDataMedicalCard() {
|
||||||
await fetchWrapper
|
await fetchWrapper
|
||||||
.get(
|
.get(`medical_card/medical_history/${this.$route.params.id}/detail/`)
|
||||||
`medical_card/medical_history/${localStorage.getItem(
|
|
||||||
"medicalId"
|
|
||||||
)}/detail/`
|
|
||||||
)
|
|
||||||
.then((res) => this.saveDataMedical(res));
|
.then((res) => this.saveDataMedical(res));
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
|||||||
@@ -89,8 +89,8 @@ export function getRequestNote(note, initNote, personId) {
|
|||||||
return Promise.resolve();
|
return Promise.resolve();
|
||||||
}
|
}
|
||||||
|
|
||||||
export function getRequestConfidant(confidant, initConfidant, initPerson) {
|
export function getRequestConfidant(confidant, initConfidant, initPerson, id) {
|
||||||
const medicalId = localStorage.getItem("medicalId");
|
const medicalId = id;
|
||||||
const fullName = `${confidant.last_name.value} ${confidant.first_name.value} ${confidant.patronymic.value}`;
|
const fullName = `${confidant.last_name.value} ${confidant.first_name.value} ${confidant.patronymic.value}`;
|
||||||
let contacts = [];
|
let contacts = [];
|
||||||
const phone = confidant.phone.value
|
const phone = confidant.phone.value
|
||||||
|
|||||||
@@ -259,7 +259,7 @@ const getters = {
|
|||||||
state.medicalCard?.person?.contacts
|
state.medicalCard?.person?.contacts
|
||||||
?.filter((el) => el.category === "PHONE")
|
?.filter((el) => el.category === "PHONE")
|
||||||
?.map((el) => {
|
?.map((el) => {
|
||||||
el.value = el.value.slice(1);
|
el.value = el.value.length > 10 ? el.value.slice(1) : el.value;
|
||||||
return { ...el };
|
return { ...el };
|
||||||
}) || [];
|
}) || [];
|
||||||
let emails =
|
let emails =
|
||||||
@@ -443,12 +443,10 @@ const actions = {
|
|||||||
commit("setBenefitData", res.results);
|
commit("setBenefitData", res.results);
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
getBenefitDataSearch({ commit }) {
|
getBenefitDataSearch({ commit }, text) {
|
||||||
fetchWrapper
|
fetchWrapper.get(`general/benefit/?name=${text}`).then((res) => {
|
||||||
.get(`general/benefit/?name=${localStorage.getItem("searchBenefit")}`)
|
commit("setBenefitData", res.results);
|
||||||
.then((res) => {
|
});
|
||||||
commit("setBenefitData", res.results);
|
|
||||||
});
|
|
||||||
},
|
},
|
||||||
createMedicalCard(ctx, id) {
|
createMedicalCard(ctx, id) {
|
||||||
fetchWrapper.post("medical_cards", {
|
fetchWrapper.post("medical_cards", {
|
||||||
@@ -489,11 +487,9 @@ const actions = {
|
|||||||
commit("setEventsPersonData", data?.person?.id);
|
commit("setEventsPersonData", data?.person?.id);
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
getPersonsFiltredList() {
|
getPersonsFiltredList(value) {
|
||||||
return fetchWrapper
|
return fetchWrapper
|
||||||
.get(
|
.get(`general/person/?last_name=${value}`)
|
||||||
`general/person/?last_name=${localStorage.getItem("searchConfidant")}`
|
|
||||||
)
|
|
||||||
.then((res) => res.results);
|
.then((res) => res.results);
|
||||||
},
|
},
|
||||||
returnInitData({ commit }) {
|
returnInitData({ commit }) {
|
||||||
@@ -502,18 +498,11 @@ const actions = {
|
|||||||
commit("setAllergiesData");
|
commit("setAllergiesData");
|
||||||
commit("setConfidantData");
|
commit("setConfidantData");
|
||||||
},
|
},
|
||||||
removeMedicalCardData({ commit, rootState }) {
|
removeMedicalCardData({ commit, rootState }, id) {
|
||||||
fetchWrapper
|
fetchWrapper.del(`medical_card/medical_history/${id}/delete/`).then(() => {
|
||||||
.del(
|
rootState.routingHistory.back();
|
||||||
`medical_card/medical_history/${localStorage.getItem(
|
commit("setMedicalCard", {});
|
||||||
"medicalId"
|
});
|
||||||
)}/delete/`
|
|
||||||
)
|
|
||||||
.then(() => {
|
|
||||||
rootState.routingHistory.back();
|
|
||||||
commit("setMedicalCard", {});
|
|
||||||
localStorage.removeItem("medicalId");
|
|
||||||
});
|
|
||||||
},
|
},
|
||||||
createProtocol({ commit, rootGetters, state }, data) {
|
createProtocol({ commit, rootGetters, state }, data) {
|
||||||
data.employee = rootGetters.getUserData;
|
data.employee = rootGetters.getUserData;
|
||||||
|
|||||||
Reference in New Issue
Block a user