diff --git a/src/components/Notifications/NotificationItem.vue b/src/components/Notifications/NotificationItem.vue
index ca2f851..37d610b 100644
--- a/src/components/Notifications/NotificationItem.vue
+++ b/src/components/Notifications/NotificationItem.vue
@@ -1,7 +1,7 @@
.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(v-if="message") {{ message }}
@@ -83,4 +83,6 @@ export default {
.grid
grid-template-columns: 24px 1fr
grid-column-gap: 8px
+.grid-rows
+ grid-template-rows: repeat(2, auto)
diff --git a/src/components/base/BaseClientFormCreate.vue b/src/components/base/BaseClientFormCreate.vue
index 637ff11..644903b 100644
--- a/src/components/base/BaseClientFormCreate.vue
+++ b/src/components/base/BaseClientFormCreate.vue
@@ -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
+ );
+ },
},
};
diff --git a/src/pages/calendar/components/CalendarFormAddEvent.vue b/src/pages/calendar/components/CalendarFormAddEvent.vue
index c836248..3bd08d6 100644
--- a/src/pages/calendar/components/CalendarFormAddEvent.vue
+++ b/src/pages/calendar/components/CalendarFormAddEvent.vue
@@ -63,6 +63,8 @@
diff --git a/src/pages/clients/components/ClientsTable.vue b/src/pages/clients/components/ClientsTable.vue
index a855968..ea34078 100644
--- a/src/pages/clients/components/ClientsTable.vue
+++ b/src/pages/clients/components/ClientsTable.vue
@@ -16,12 +16,12 @@
:check="selectedCheck",
:client="client",
:fetch-data-clients="fetchDataClients",
- :current-year="currentYear"
+ :current-year="currentYear",
+ @update-clients="updateDataClient"
)
client-table-pagination(
- v-if="pageCount > 1"
- :length="pageCount",
- :current-page="currentTablePage",
+ v-if="paginationInfo.length > 1"
+ :pagination-info="paginationInfo"
@previous-page="switchPreviousPage",
@next-page="switchNextPage",
@set-current-page="changeCurrentTablePage"
@@ -62,6 +62,10 @@ export default {
limit: 4,
count: 0,
textSearch: "",
+ paginationInfo: {
+ currentPage: 0,
+ length: 0,
+ },
};
},
computed: {
@@ -70,6 +74,10 @@ export default {
},
},
methods: {
+ updateDataClient() {
+ if (this.dataClients.length === 1) this.currentTablePage -= 1;
+ else this.fetchDataClients();
+ },
saveDataClients(data) {
this.dataClients = data.results;
this.count = data.count;
@@ -98,6 +106,10 @@ export default {
);
}
this.saveDataClients(response);
+ this.paginationInfo = {
+ currentPage: this.currentTablePage,
+ length: this.pageCount,
+ };
},
selectedCheck(e) {
if (e.target.id === "checkbox") {
diff --git a/src/pages/clients/components/ClientsTableRow.vue b/src/pages/clients/components/ClientsTableRow.vue
index 814ae6e..081ac04 100644
--- a/src/pages/clients/components/ClientsTableRow.vue
+++ b/src/pages/clients/components/ClientsTableRow.vue
@@ -64,6 +64,7 @@
clients-action-popup(
v-if="isOpenPopup",
:open-change-data="openChangeData"
+ :delete-client="deleteClient"
)
client-detail-info-wrapper(
v-if="isOpenDetailInfo"
@@ -270,6 +271,11 @@ export default {
openChangeData() {
this.isOpenChange = true;
},
+ async deleteClient() {
+ await fetchWrapper.del(`general/person/${this.dataClient.id}/delete/`);
+ this.handleUnFocusPopup();
+ this.$emit("update-clients");
+ },
fetchClientDetail(id) {
fetchWrapper
.get(`general/person/${id}/detail/`)