Исправил пропадание формы при добавлении фото клиента

This commit is contained in:
megavrilinvv
2022-12-05 18:37:59 +03:00
parent 3bda654a4c
commit f76d1eec8b
3 changed files with 20 additions and 15 deletions

View File

@@ -1,5 +1,5 @@
<template lang="pug"> <template lang="pug">
.wrapper-create.flex.flex-col.fixed.right-6.bottom-6.px-4.py-7.gap-y-8(v-click-outside="closeForm") .wrapper-create.flex.flex-col.fixed.right-6.bottom-6.px-4.py-7.gap-y-8(v-click-outside="closeModal")
.icon-cancel.close.absolute.top-5.right-5.cursor-pointer(@click="closeForm") .icon-cancel.close.absolute.top-5.right-5.cursor-pointer(@click="closeForm")
span.title.text-xl.font-bold.px-4 Создание клиента span.title.text-xl.font-bold.px-4 Создание клиента
.flex.gap-x-4.h-fit.px-4 .flex.gap-x-4.h-fit.px-4
@@ -242,6 +242,9 @@ export default {
closePopup() { closePopup() {
this.showPopup = false; this.showPopup = false;
}, },
closeModal() {
!this.showModal ? this.closeForm() : null;
},
createIdentityDocument(id) { createIdentityDocument(id) {
Object.keys( Object.keys(
this.filterDataEmptyProperty(this.infoClient.identity_document.pass) this.filterDataEmptyProperty(this.infoClient.identity_document.pass)
@@ -384,14 +387,14 @@ export default {
}, },
checkFormFullness() { checkFormFullness() {
if (!this.infoClient.basic.full_name) { if (!this.infoClient.basic.full_name) {
this.addErrrorNotification( this.addErrorNotification(
"Не заполнено ФИО клиента", "Не заполнено ФИО клиента",
"Пожалуйста, заполните ФИО клиента" "Пожалуйста, заполните ФИО клиента"
); );
return false; return false;
} }
if (this.infoClient.basic.full_name.split(" ").length < 3) { if (this.infoClient.basic.full_name.split(" ").length < 3) {
this.addErrrorNotification( this.addErrorNotification(
"Некорректное ФИО клиента", "Некорректное ФИО клиента",
"Пожалуйста, введите ФИО клиента правильно" "Пожалуйста, введите ФИО клиента правильно"
); );
@@ -399,7 +402,7 @@ export default {
} }
return true; return true;
}, },
addErrrorNotification(title, message) { addErrorNotification(title, message) {
addNotification(new Date().getTime(), title, message, "error", 5000); addNotification(new Date().getTime(), title, message, "error", 5000);
}, },
addSuccessNotification() { addSuccessNotification() {

View File

@@ -326,7 +326,7 @@ export default {
async postCreateEvent(event) { async postCreateEvent(event) {
const response = await fetchWrapper.post("registry/event/create/", event); const response = await fetchWrapper.post("registry/event/create/", event);
if (response.type && response.type === "validation_error") { if (response.type && response.type === "validation_error") {
this.addErrrorNotification(response); this.addErrorNotification(response);
} else { } else {
this.addSuccessNotification("Событие успешно создано"); this.addSuccessNotification("Событие успешно создано");
this.clearForm(); this.clearForm();
@@ -338,7 +338,7 @@ export default {
event event
); );
if (response.type && response.type === "validation_error") { if (response.type && response.type === "validation_error") {
this.addErrrorNotification(response); this.addErrorNotification(response);
} else { } else {
this.addSuccessNotification("Изменения успешно сохранены"); this.addSuccessNotification("Изменения успешно сохранены");
this.clearForm(); this.clearForm();
@@ -362,7 +362,7 @@ export default {
return id; return id;
} }
}, },
addErrrorNotification(error) { addErrorNotification(error) {
addNotification( addNotification(
new Date().getTime(), new Date().getTime(),
error.errors[0].code, error.errors[0].code,

View File

@@ -12,17 +12,19 @@
.flex.flex-col.gap-y-6px .flex.flex-col.gap-y-6px
.flex.non-italic.font-semibold.text-xss Логин .flex.non-italic.font-semibold.text-xss Логин
base-input.h-12.font-medium( base-input.h-12.font-medium(
:style="{borderColor: wrongData ? this.redColor : ''}" :style="{borderColor: wrongData ? this.redColor : ''}",
v-model:value="user.username" v-model:value="user.username",
type="text" type="text",
placeholder="Введите ваш логин") placeholder="Введите ваш логин"
)
.flex.flex-col.gap-y-6px.relative .flex.flex-col.gap-y-6px.relative
.flex.non-italic.font-semibold.text-xss Пароль .flex.non-italic.font-semibold.text-xss Пароль
base-input.h-12( base-input.h-12(
:style="{borderColor: wrongData ? this.redColor : ''}" :style="{borderColor: wrongData ? this.redColor : ''}",
v-model:value="user.password" v-model:value="user.password",
:type="changeType" :type="changeType",
placeholder="Введите ваш пароль") placeholder="Введите ваш пароль"
)
img.absolute.z-10.right-4.bottom-14px.cursor-pointer(:src="changeIcon", alt="eyePassword", @click="changeView") img.absolute.z-10.right-4.bottom-14px.cursor-pointer(:src="changeIcon", alt="eyePassword", @click="changeView")
span.font-medium(:style="{color: this.redColor}", v-show="wrongData") Неверный логин или пароль span.font-medium(:style="{color: this.redColor}", v-show="wrongData") Неверный логин или пароль
.flex.items-center.gap-x-11px .flex.items-center.gap-x-11px