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

@@ -1,9 +1,9 @@
<template lang="pug">
.notification-container.flex.justify-between(:style="{ backgroundColor: bgColor }")
.notification-content.flex.mr-16
.grid.grid-rows-2
.grid(:class="{'grid-rows': message}")
.text-white.text-xs.icon.row-span-full.flex.justify-center.items-center(:class="iconClass")
.text-white.text-base(v-if="title") {{ title }}
.text-white.text-base.font-bold(v-if="title") {{ title }}
.text-white.text-base(v-if="message") {{ message }}
.icon-cancel.cursor-pointer.text-white.opacity-50.text-sm(class="hover:opacity-100 active:opacity-75", @click="delNotification")
</template>
@@ -83,4 +83,7 @@ export default {
.grid
grid-template-columns: 24px 1fr
grid-column-gap: 8px
.grid-rows
grid-template-rows: repeat(2, auto)
grid-row-gap: 8px
</style>

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 () {