WIP Изменены уведомления

This commit is contained in:
Daria Golova
2022-11-29 16:12:39 +03:00
parent 2ddeb1ffd9
commit 6036500b18
7 changed files with 95 additions and 26 deletions

View File

@@ -53,6 +53,8 @@ import FormCreateAddresses from "@/pages/clients/components/FormCreateAddresses"
import FormCreateAdditional from "@/pages/clients/components/FormCreateAdditional";
import BaseInput from "@/components/base/BaseInput";
import BaseButton from "@/components/base/BaseButton";
import TheNotificationProvider from "@/components/Notifications/TheNotificationProvider";
import { addNotification } from "@/components/Notifications/notificationContext";
export default {
name: "BaseClientFormClient",
components: {
@@ -62,6 +64,7 @@ export default {
FormCreateAddresses,
FormCreateAdditional,
BaseButton,
TheNotificationProvider,
},
props: {
closeForm: Function,
@@ -209,6 +212,7 @@ export default {
fetchWrapper.post("general/person/create/", sentData).then((result) => {
this.createIdentityDocument(result.id);
this.createAddress(result.id);
this.addSuccessNotification();
});
this.$emit("update-client");
},
@@ -283,11 +287,29 @@ export default {
},
checkFormFullness() {
if (!this.infoClient.basic.full_name) {
alert("Не заполнено ФИО клиента");
this.addErrrorNotification();
return false;
}
return true;
},
addErrrorNotification() {
addNotification(
new Date().getTime(),
"Не заполнено ФИО клиента",
"Пожалуйста, заполните ФИО клиента",
"error",
3000
);
},
addSuccessNotification() {
addNotification(
new Date().getTime(),
"Клиент успешно создан",
"",
"success",
3000
);
},
},
};
</script>