[WIP] Добавил уведомление об ошибке
This commit is contained in:
@@ -59,7 +59,7 @@
|
|||||||
v-click-outside="closePopup",
|
v-click-outside="closePopup",
|
||||||
:width="485"
|
: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")
|
transition(name="section", mode="out-in")
|
||||||
.flex.justify-center.items-center(
|
.flex.justify-center.items-center(
|
||||||
v-if="sectionDataPresence",
|
v-if="sectionDataPresence",
|
||||||
@@ -126,7 +126,12 @@
|
|||||||
.flex.flex-col.gap-y-4(v-if="section === 'addresses' && isChange")
|
.flex.flex-col.gap-y-4(v-if="section === 'addresses' && isChange")
|
||||||
client-detail-section-address(:dope-address="dopeAddress")
|
client-detail-section-address(:dope-address="dopeAddress")
|
||||||
.flex.flex-col.gap-y-2(v-if="section === 'additional' && isChange")
|
.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(
|
client-detail-input.text-sm.w-max-fit(
|
||||||
:style="{fontWeight:key === 'numba'&&600}",
|
:style="{fontWeight:key === 'numba'&&600}",
|
||||||
v-model:value="sectionInfo[key].description",
|
v-model:value="sectionInfo[key].description",
|
||||||
@@ -261,6 +266,7 @@ export default {
|
|||||||
this.isOpenAddDoc = true;
|
this.isOpenAddDoc = true;
|
||||||
} else if (this.section === "additional") {
|
} else if (this.section === "additional") {
|
||||||
this.isNotes = true;
|
this.isNotes = true;
|
||||||
|
this.isOpenAddingWrap = true;
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
changeOpenAddDoc() {
|
changeOpenAddDoc() {
|
||||||
@@ -324,7 +330,6 @@ export default {
|
|||||||
if (this.section === "additional") {
|
if (this.section === "additional") {
|
||||||
if (!this.sectionInfo[0]?.id) {
|
if (!this.sectionInfo[0]?.id) {
|
||||||
this.isNotes = false;
|
this.isNotes = false;
|
||||||
this.createNote();
|
|
||||||
} else {
|
} else {
|
||||||
this.updateNotes();
|
this.updateNotes();
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -628,21 +628,36 @@ export default {
|
|||||||
});
|
});
|
||||||
},
|
},
|
||||||
postCreateNote(title, description) {
|
postCreateNote(title, description) {
|
||||||
fetchWrapper
|
if (!title || !description) {
|
||||||
.post("general/note/create/", {
|
this.addErrorNotification(
|
||||||
person_id: this.id,
|
"Ошибка создания дополнительных данных",
|
||||||
title: title,
|
"Все поля должны быть заполнены"
|
||||||
description: description,
|
);
|
||||||
})
|
} else
|
||||||
.then(() => this.fetchClientDetail(this.id));
|
fetchWrapper
|
||||||
|
.post("general/note/create/", {
|
||||||
|
person_id: this.id,
|
||||||
|
title: title,
|
||||||
|
description: description,
|
||||||
|
})
|
||||||
|
.then(() => this.fetchClientDetail(this.id));
|
||||||
},
|
},
|
||||||
postUpdateNotes() {
|
postUpdateNotes() {
|
||||||
fetchWrapper
|
this.dataNotes.forEach((e) => {
|
||||||
.post(`general/note/${this.dataNotes[0].id}/update/`, {
|
if (!e.title || !e.description) {
|
||||||
title: this.dataNotes[0].title,
|
this.addErrorNotification(
|
||||||
description: this.dataNotes[0].description,
|
"Ошибка изменения дополнительных данных",
|
||||||
})
|
"Поля не могут быть пустыми"
|
||||||
.then(() => this.fetchClientDetail(this.id));
|
);
|
||||||
|
this.fetchClientDetail(this.id);
|
||||||
|
} else
|
||||||
|
fetchWrapper
|
||||||
|
.post(`general/note/${e.id}/update/`, {
|
||||||
|
title: e.title,
|
||||||
|
description: e.description,
|
||||||
|
})
|
||||||
|
.then(() => this.fetchClientDetail(this.id));
|
||||||
|
});
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user