WIP Сделала проверку текущей даты
This commit is contained in:
@@ -91,6 +91,7 @@ import BaseModal from "@/components/base/BaseModal";
|
|||||||
import addImageIcon from "@/assets/icons/photo.svg";
|
import addImageIcon from "@/assets/icons/photo.svg";
|
||||||
import TheNotificationProvider from "@/components/Notifications/TheNotificationProvider";
|
import TheNotificationProvider from "@/components/Notifications/TheNotificationProvider";
|
||||||
import { addNotification } from "@/components/Notifications/notificationContext";
|
import { addNotification } from "@/components/Notifications/notificationContext";
|
||||||
|
import * as moment from "moment";
|
||||||
export default {
|
export default {
|
||||||
name: "BaseClientFormClient",
|
name: "BaseClientFormClient",
|
||||||
components: {
|
components: {
|
||||||
@@ -246,7 +247,39 @@ export default {
|
|||||||
!this.showModal ? this.closeForm() : null;
|
!this.showModal ? this.closeForm() : null;
|
||||||
},
|
},
|
||||||
createIdentityDocument(id) {
|
createIdentityDocument(id) {
|
||||||
Object.keys(
|
let filteredData = Object.keys(
|
||||||
|
this.filterDataEmptyProperty(this.infoClient.identity_document.pass)
|
||||||
|
);
|
||||||
|
console.log(
|
||||||
|
moment(this.infoClient.identity_document.pass.issued_by_date).isAfter(
|
||||||
|
moment().format("YYYY-MM-DD")
|
||||||
|
)
|
||||||
|
);
|
||||||
|
if (filteredData.length > 0) {
|
||||||
|
if (filteredData.length !== 4)
|
||||||
|
this.addErrorNotification(
|
||||||
|
"Паспортные данные заполнены не полностью",
|
||||||
|
"Паспортные данные не будут записаны в профиль клиента"
|
||||||
|
);
|
||||||
|
else if (
|
||||||
|
moment(this.infoClient.identity_document.pass.issued_by_date).isAfter(
|
||||||
|
moment().format("YYYY-MM-DD")
|
||||||
|
)
|
||||||
|
) {
|
||||||
|
this.addErrorNotification(
|
||||||
|
"Некорректная дата выдачи паспорта",
|
||||||
|
"Паспортные данные не будут записаны в профиль клиента"
|
||||||
|
);
|
||||||
|
} else
|
||||||
|
fetchWrapper.post("general/identity_document/create/", {
|
||||||
|
...this.filterDataEmptyProperty(
|
||||||
|
this.infoClient.identity_document.pass
|
||||||
|
),
|
||||||
|
person_id: id,
|
||||||
|
kind: "Паспорт",
|
||||||
|
});
|
||||||
|
}
|
||||||
|
/*bject.keys(
|
||||||
this.filterDataEmptyProperty(this.infoClient.identity_document.pass)
|
this.filterDataEmptyProperty(this.infoClient.identity_document.pass)
|
||||||
).length > 0 &&
|
).length > 0 &&
|
||||||
fetchWrapper.post("general/identity_document/create/", {
|
fetchWrapper.post("general/identity_document/create/", {
|
||||||
@@ -255,7 +288,7 @@ export default {
|
|||||||
),
|
),
|
||||||
person_id: id,
|
person_id: id,
|
||||||
kind: "Паспорт",
|
kind: "Паспорт",
|
||||||
});
|
});*/
|
||||||
},
|
},
|
||||||
createAddress(id) {
|
createAddress(id) {
|
||||||
Object.keys(this.filterDataEmptyProperty(this.infoClient.addresses))
|
Object.keys(this.filterDataEmptyProperty(this.infoClient.addresses))
|
||||||
|
|||||||
@@ -206,7 +206,11 @@ export default {
|
|||||||
this.textSearch = "";
|
this.textSearch = "";
|
||||||
this.clearingTextSearch = true;
|
this.clearingTextSearch = true;
|
||||||
this.clientsCount += 1;
|
this.clientsCount += 1;
|
||||||
|
if (
|
||||||
|
this.currentTablePage !== this.calculatePageCount(this.clientsCount)
|
||||||
|
)
|
||||||
this.currentTablePage = this.calculatePageCount(this.clientsCount);
|
this.currentTablePage = this.calculatePageCount(this.clientsCount);
|
||||||
|
else this.fetchDataClients();
|
||||||
this.$emit("reset-updated-clients");
|
this.$emit("reset-updated-clients");
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|||||||
Reference in New Issue
Block a user