From 22ff04e498b577316e87bd572fd488f1e870cb07 Mon Sep 17 00:00:00 2001 From: megavrilinvv Date: Mon, 5 Dec 2022 16:47:38 +0300 Subject: [PATCH] =?UTF-8?q?=D0=98=D1=81=D0=BF=D1=80=D0=B0=D0=B2=D0=B8?= =?UTF-8?q?=D0=BB=20=D1=80=D0=B5=D0=B4=D0=B0=D0=BA=D1=82=D0=B8=D1=80=D0=BE?= =?UTF-8?q?=D0=B2=D0=B0=D0=BD=D0=B8=D0=B5=20=D0=BF=D1=80=D0=B8=D0=BE=D1=80?= =?UTF-8?q?=D0=B8=D1=82=D0=B5=D1=82=D0=B0,=20=D0=B2=D0=BE=D0=B7=D1=80?= =?UTF-8?q?=D0=B0=D1=81=D1=82=D0=B0,=20=D1=82=D0=B5=D0=BB=D0=B5=D1=84?= =?UTF-8?q?=D0=BE=D0=BD=D0=B0=20=D0=BA=D0=BB=D0=B8=D0=B5=D0=BD=D1=82=D0=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../clients/components/ClientsTableRow.vue | 20 +++++++++++++------ .../components/cells/TableCellBodyPhone.vue | 14 +++++++++++-- .../cells/TableCellBodyPriority.vue | 17 ++++++++++------ 3 files changed, 37 insertions(+), 14 deletions(-) diff --git a/src/pages/clients/components/ClientsTableRow.vue b/src/pages/clients/components/ClientsTableRow.vue index 692e61f..0137cc1 100644 --- a/src/pages/clients/components/ClientsTableRow.vue +++ b/src/pages/clients/components/ClientsTableRow.vue @@ -37,7 +37,7 @@ ) table-cell-body-priority( v-if="!rowOverlay", - :value="dataClient.priority", + :value="dataClient", :choose-priority="choosePriority", :is-open-change="isOpenChange", :width="columnBody.find(el => el.name === 'priority').width" @@ -207,11 +207,19 @@ export default { } }, postUpdateClient() { - fetchWrapper.post(`general/person/${this.client.id}/update/`, { - full_name: this.dataClient.fullName, - birth_date: this.dataClient.age, - priority: this.dataClient.priority, - }); + let foundElement = this.prioritySettings.settings.find( + (el) => el.text === this.dataClient.priority + ); + let data = {}; + if (this.dataClient.age) { + data.birth_date = this.dataClient.age; + } + if ( + this.dataClient.priority !== this.client.priority && + this.dataClient.priority + ) { + data.priority = foundElement.priority; + } }, postContactsClient() { let contacts = [...this.dataClient.contacts]; diff --git a/src/pages/clients/components/cells/TableCellBodyPhone.vue b/src/pages/clients/components/cells/TableCellBodyPhone.vue index d103605..2b49c62 100644 --- a/src/pages/clients/components/cells/TableCellBodyPhone.vue +++ b/src/pages/clients/components/cells/TableCellBodyPhone.vue @@ -1,11 +1,20 @@ diff --git a/src/pages/clients/components/cells/TableCellBodyPriority.vue b/src/pages/clients/components/cells/TableCellBodyPriority.vue index 6c0f4ce..ce80425 100644 --- a/src/pages/clients/components/cells/TableCellBodyPriority.vue +++ b/src/pages/clients/components/cells/TableCellBodyPriority.vue @@ -1,10 +1,10 @@