WIP Добавил запрос на данные медицинской карты и переход на страницу карты
This commit is contained in:
@@ -32,9 +32,8 @@
|
||||
:update-data-client="updateDataClient",
|
||||
:fetch-data-clients="fetchDataClients",
|
||||
:fetch-created-client-data="fetchCreatedClientData",
|
||||
:create-medical-card="medicalCardHandler",
|
||||
@handler-click-popup="handlerClickPopup",
|
||||
:created-client-name="createdClientName",
|
||||
@delete-client="deleteClientHandler",
|
||||
@recover-client="clearDeletedRowId",
|
||||
)
|
||||
client-table-pagination(
|
||||
@@ -115,6 +114,7 @@ export default {
|
||||
marked: [],
|
||||
dataClients: [
|
||||
{
|
||||
medical_history: [],
|
||||
initialization: true,
|
||||
},
|
||||
],
|
||||
@@ -127,6 +127,7 @@ export default {
|
||||
currentPage: 0,
|
||||
length: 0,
|
||||
},
|
||||
medicalHistory: {},
|
||||
showModal: false,
|
||||
clientId: "",
|
||||
deletedRowId: "",
|
||||
@@ -159,6 +160,9 @@ export default {
|
||||
saveDataClients(data) {
|
||||
this.dataClients = data.results;
|
||||
},
|
||||
saveDataMedicalHistory(data) {
|
||||
this.medicalHistory = data;
|
||||
},
|
||||
saveClientsCount(data) {
|
||||
if (!this.clientsCount) this.clientsCount = data.count;
|
||||
},
|
||||
@@ -253,29 +257,33 @@ export default {
|
||||
openModal() {
|
||||
this.showModal = true;
|
||||
},
|
||||
medicalCardHandler() {
|
||||
async handlerClickPopup(action, id) {
|
||||
this.modalConfig = this.modalConfig.map((el) => {
|
||||
return el.name === "medical"
|
||||
return el.name === action
|
||||
? { ...el, view: true }
|
||||
: { ...el, view: false };
|
||||
});
|
||||
this.titleModal = "Создать мед.карту";
|
||||
this.openModal();
|
||||
if (action === "delete") {
|
||||
this.clientId = id;
|
||||
this.titleModal = "Удалить клиента";
|
||||
this.openModal();
|
||||
}
|
||||
if (action === "medical") {
|
||||
if (id) {
|
||||
fetchWrapper
|
||||
.get(`medical_card/medical_history/${id}/detail/`)
|
||||
.then((res) => this.saveDataMedicalHistory(res));
|
||||
this.$router.push("medical-card");
|
||||
} else {
|
||||
this.titleModal = "Создать мед.карту";
|
||||
this.openModal();
|
||||
}
|
||||
}
|
||||
},
|
||||
createMedicalCard() {
|
||||
this.showMedicalCard = true;
|
||||
this.closeModal();
|
||||
},
|
||||
deleteClientHandler(id) {
|
||||
this.clientId = id;
|
||||
this.modalConfig = this.modalConfig.map((el) => {
|
||||
return el.name === "delete"
|
||||
? { ...el, view: true }
|
||||
: { ...el, view: false };
|
||||
});
|
||||
this.titleModal = "Удалить клиента";
|
||||
this.openModal();
|
||||
},
|
||||
writeDeletedRowId() {
|
||||
this.deletedRowId = this.clientId;
|
||||
this.closeModal();
|
||||
|
||||
Reference in New Issue
Block a user