This commit is contained in:
megavrilinvv
2022-11-30 18:41:55 +03:00
8 changed files with 112 additions and 27 deletions

View File

@@ -89,6 +89,8 @@ import BaseButton from "@/components/base/BaseButton";
import BasePopup from "@/components/base/BasePopup";
import BaseModal from "@/components/base/BaseModal";
import addImageIcon from "@/assets/icons/photo.svg";
import TheNotificationProvider from "@/components/Notifications/TheNotificationProvider";
import { addNotification } from "@/components/Notifications/notificationContext";
export default {
name: "BaseClientFormClient",
components: {
@@ -101,6 +103,7 @@ export default {
BasePopup,
BaseModal,
addImageIcon,
TheNotificationProvider,
},
props: {
closeForm: Function,
@@ -272,6 +275,7 @@ export default {
.then((result) => {
this.createIdentityDocument(result.id);
this.createAddress(result.id);
this.addSuccessNotification();
});
this.$emit("update-client");
},
@@ -354,11 +358,29 @@ export default {
},
checkFormFullness() {
if (!this.infoClient.basic.full_name) {
alert("Не заполнено ФИО клиента");
this.addErrrorNotification();
return false;
}
return true;
},
addErrrorNotification() {
addNotification(
new Date().getTime(),
"Не заполнено ФИО клиента",
"Пожалуйста, заполните ФИО клиента",
"error",
5000
);
},
addSuccessNotification() {
addNotification(
new Date().getTime(),
"Клиент успешно создан",
"",
"success",
5000
);
},
},
watch: {
showModal: function () {