From a5ea940dd887b8f540e283c70db99aa0a4a42538 Mon Sep 17 00:00:00 2001 From: Javier Segarra Date: Fri, 13 Sep 2024 09:23:15 +0200 Subject: [PATCH 01/36] fix: Customer module find salesPersons out of first get --- src/pages/Customer/Card/CustomerBasicData.vue | 1 - src/pages/Customer/CustomerList.vue | 1 - 2 files changed, 2 deletions(-) diff --git a/src/pages/Customer/Card/CustomerBasicData.vue b/src/pages/Customer/Card/CustomerBasicData.vue index 91d9edc05..adbd476b0 100644 --- a/src/pages/Customer/Card/CustomerBasicData.vue +++ b/src/pages/Customer/Card/CustomerBasicData.vue @@ -99,7 +99,6 @@ const title = ref(); :fields="['id', 'nickname']" sort-by="nickname ASC" :rules="validate('client.salesPersonFk')" - :use-like="false" emit-value auto-load > diff --git a/src/pages/Customer/CustomerList.vue b/src/pages/Customer/CustomerList.vue index f6758bf4e..270acdb89 100644 --- a/src/pages/Customer/CustomerList.vue +++ b/src/pages/Customer/CustomerList.vue @@ -425,7 +425,6 @@ function handleLocation(data, location) { }" :fields="['id', 'nickname']" sort-by="nickname ASC" - :use-like="false" emit-value auto-load > From d384894bf0faed5627933188f2bb9270bcfefecc Mon Sep 17 00:00:00 2001 From: Javier Segarra Date: Mon, 16 Sep 2024 10:29:36 +0000 Subject: [PATCH 02/36] fix: rule --- src/pages/Customer/Card/CustomerBasicData.vue | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/pages/Customer/Card/CustomerBasicData.vue b/src/pages/Customer/Card/CustomerBasicData.vue index adbd476b0..bf2bf4b19 100644 --- a/src/pages/Customer/Card/CustomerBasicData.vue +++ b/src/pages/Customer/Card/CustomerBasicData.vue @@ -34,7 +34,7 @@ const title = ref(); Date: Mon, 16 Sep 2024 10:30:04 +0000 Subject: [PATCH 03/36] fix: remove promise execution --- src/pages/Customer/components/CustomerChangePassword.vue | 1 - 1 file changed, 1 deletion(-) diff --git a/src/pages/Customer/components/CustomerChangePassword.vue b/src/pages/Customer/components/CustomerChangePassword.vue index 1bfc5e103..d92a10c5c 100644 --- a/src/pages/Customer/components/CustomerChangePassword.vue +++ b/src/pages/Customer/components/CustomerChangePassword.vue @@ -46,7 +46,6 @@ const onSubmit = async () => { }; try { await axios.patch(`Clients/${$props.id}/setPassword`, payload); - await $props.promise(); } catch (error) { notify('errors.create', 'negative'); } finally { From 6ffd985575ad24c3b2c3fcacbfe78f618725a0a6 Mon Sep 17 00:00:00 2001 From: Javier Segarra Date: Mon, 16 Sep 2024 13:33:07 +0200 Subject: [PATCH 04/36] perf: CustomerBasicData.salesPersonFk --- src/pages/Customer/Card/CustomerBasicData.vue | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/src/pages/Customer/Card/CustomerBasicData.vue b/src/pages/Customer/Card/CustomerBasicData.vue index bf2bf4b19..cdd9e68b2 100644 --- a/src/pages/Customer/Card/CustomerBasicData.vue +++ b/src/pages/Customer/Card/CustomerBasicData.vue @@ -16,6 +16,21 @@ const { t } = useI18n(); const businessTypes = ref([]); const contactChannels = ref([]); const title = ref(); +const handleSalesModelValue = (val) => { + if (salesPersonFilter.value.and.length == 0) salesPersonFilter.value.and.push = []; + + salesPersonFilter.value.and[1] = { + or: [ + { name: val }, + { nickname: { like: '%' + val + '%' } }, + { code: { like: `${val}%` } }, + ], + }; +}; + +const salesPersonFilter = ref({ + and: [{ active: { neq: false } }], +});