[WIP] Добавил уведомление об ошибке

This commit is contained in:
megavrilinvv
2022-12-16 18:53:41 +03:00
parent cb1fcd9818
commit 838b971dad
2 changed files with 36 additions and 16 deletions

View File

@@ -59,7 +59,7 @@
v-click-outside="closePopup",
:width="485"
)
table-create-note(create-note="createNote", :close-popup="closePopup")
table-create-note(:create-note="createNote", :close-popup="closePopup")
transition(name="section", mode="out-in")
.flex.justify-center.items-center(
v-if="sectionDataPresence",
@@ -126,7 +126,12 @@
.flex.flex-col.gap-y-4(v-if="section === 'addresses' && isChange")
client-detail-section-address(:dope-address="dopeAddress")
.flex.flex-col.gap-y-2(v-if="section === 'additional' && isChange")
.title-section.text-xxs.font-semibold {{item.title}}
//- .title-section.text-xxs.font-semibold {{item.title}}
client-detail-input.text-sm.w-max-fit(
:style="{fontWeight:key === 'numba'&&600}",
v-model:value="sectionInfo[key].title",
placeholder="Заголовок"
)
client-detail-input.text-sm.w-max-fit(
:style="{fontWeight:key === 'numba'&&600}",
v-model:value="sectionInfo[key].description",
@@ -261,6 +266,7 @@ export default {
this.isOpenAddDoc = true;
} else if (this.section === "additional") {
this.isNotes = true;
this.isOpenAddingWrap = true;
}
},
changeOpenAddDoc() {
@@ -324,7 +330,6 @@ export default {
if (this.section === "additional") {
if (!this.sectionInfo[0]?.id) {
this.isNotes = false;
this.createNote();
} else {
this.updateNotes();
}

View File

@@ -628,6 +628,12 @@ export default {
});
},
postCreateNote(title, description) {
if (!title || !description) {
this.addErrorNotification(
"Ошибка создания дополнительных данных",
"Все поля должны быть заполнены"
);
} else
fetchWrapper
.post("general/note/create/", {
person_id: this.id,
@@ -637,12 +643,21 @@ export default {
.then(() => this.fetchClientDetail(this.id));
},
postUpdateNotes() {
this.dataNotes.forEach((e) => {
if (!e.title || !e.description) {
this.addErrorNotification(
"Ошибка изменения дополнительных данных",
"Поля не могут быть пустыми"
);
this.fetchClientDetail(this.id);
} else
fetchWrapper
.post(`general/note/${this.dataNotes[0].id}/update/`, {
title: this.dataNotes[0].title,
description: this.dataNotes[0].description,
.post(`general/note/${e.id}/update/`, {
title: e.title,
description: e.description,
})
.then(() => this.fetchClientDetail(this.id));
});
},
},