WIP Сделан переход на клиента при создании

This commit is contained in:
Daria Golova
2022-12-14 18:47:14 +03:00
parent 86d64bc771
commit e09e707ec9
3 changed files with 35 additions and 22 deletions

View File

@@ -122,13 +122,19 @@ export default {
},
methods: {
updateDataClient() {
this.clearCreatedClientName();
if (this.textSearch) this.filteredClientsCount -= 1;
else this.clientsCount -= 1;
if (this.dataClients.find(({ id }) => id === this.deletedRowId)) {
if (this.createdClientName) {
this.clearingTextSearch = true;
this.currentTablePage === 1
? this.fetchDataClients()
: (this.currentTablePage = 1);
} else {
if (this.dataClients.length === 1) this.currentTablePage -= 1;
else this.fetchDataClients();
}
}
},
saveDataClients(data) {
this.dataClients = data.results;

View File

@@ -11,13 +11,13 @@
@click="(e) => openDetailInfo(e)",
:class="{'row-overlay-color': rowOverlay}"
)
.flex.items-center.px-2(
v-show="!isOpenChange",
.dots-wrapper.flex.items-center.px-2
.relative.dots-button.icon-dots.cursor-pointer.leading-6.text-center(
v-show="!isOpenChange && !rowOverlay",
:tabindex="1",
@click="(e) => openPopup(e)",
@blur="handleUnFocusPopup"
)
.relative.dots-button.icon-dots.cursor-pointer.leading-6.text-center
clients-action-popup(
v-if="isOpenPopup",
:open-change-data="openChangeData",
@@ -25,8 +25,9 @@
@delete-client="transmitDeleteClient",
:create-medical-card="createMedicalCard"
)
.dots.flex.justify-center.items-center(v-if="!rowOverlay")
.flex.z-10(v-if="isOpenChange", class="pl-[10px]")
.flex.z-10(
v-if="isOpenChange && !rowOverlay",
)
base-button(
@click="closeChangeData",
confirm,
@@ -209,7 +210,7 @@ export default {
this.timer = null;
},
startTimer() {
this.countdown = 600;
this.countdown = 30;
this.timer = setInterval(() => {
this.changeCountdown();
}, 1000);
@@ -339,7 +340,10 @@ export default {
username: contact.username,
person_id: this.client.id,
})
.then(() => this.fetchDataClients());
.then(() => {
if (this.createdClientName) this.fetchCreatedClientData;
else this.fetchDataClients();
});
},
postUpdateContact(contact) {
fetchWrapper
@@ -348,12 +352,16 @@ export default {
username: contact.username,
person_id: this.client.id,
})
.then(() => this.fetchDataClients());
.then(() => {
if (this.createdClientName) this.fetchCreatedClientData;
else this.fetchDataClients();
});
},
postDeleteContact(contact) {
fetchWrapper
.del(`general/contact/${contact.id}/delete/`)
.then(() => this.fetchDataClients());
fetchWrapper.del(`general/contact/${contact.id}/delete/`).then(() => {
if (this.createdClientName) this.fetchCreatedClientData;
else this.fetchDataClients();
});
},
addNetwork(network) {
this.dataClient.contacts.push(network);
@@ -703,4 +711,6 @@ export default {
overflow: hidden
.closed-detail .detail
max-height: 0
.dots-wrapper
width: 36px
</style>

View File

@@ -1,7 +1,6 @@
<template lang="pug">
.flex.box-border.px-4.items-center.gap-x-3.w-full.text-sm(
.flex.box-border.px-8.pr-4.items-center.gap-x-3.w-full.text-sm(
:style="{ minWidth : width + 'px', maxWidth : width + 'px' }",
:class="{'open-change': isOpenChange}"
)
base-avatar(:size="36", :color="avatarColor", v-if="!photo") {{avatar}}
base-avatar(:size="36", v-else)
@@ -42,6 +41,4 @@ export default {
border-radius: 50%
background-color: var(--font-grey-color)
color: var(--font-dark-blue-color)
.open-change
padding-left: 36px
</style>