From 5e087d9e3a45b971aad9430d5da76df3249ffdb9 Mon Sep 17 00:00:00 2001 From: jorgep Date: Tue, 4 Mar 2025 12:26:01 +0100 Subject: [PATCH 1/7] feat(SupplierList): refs #8718 add province filter column to supplier list --- src/pages/Supplier/SupplierList.vue | 28 ++++++++++++++++------------ 1 file changed, 16 insertions(+), 12 deletions(-) diff --git a/src/pages/Supplier/SupplierList.vue b/src/pages/Supplier/SupplierList.vue index c9625518f..87b1e13bc 100644 --- a/src/pages/Supplier/SupplierList.vue +++ b/src/pages/Supplier/SupplierList.vue @@ -120,6 +120,21 @@ const columns = computed(() => [ ], }, ]); + +const filterColumns = computed(() => { + const copy = [...columns.value]; + copy.splice(copy.length - 1, 0, { + align: 'left', + label: t('globals.params.provinceFk'), + name: 'provinceFk', + options: provincesOptions.value, + columnFilter: { + component: 'select', + }, + }); + + return copy; +}); From 110b6ef548059664e99200713d7dc65d78118406 Mon Sep 17 00:00:00 2001 From: jorgep Date: Tue, 4 Mar 2025 14:28:05 +0100 Subject: [PATCH 2/7] refactor(VnAccountNumber): refs #8718 simplify model handling and input management --- src/components/common/VnAccountNumber.vue | 87 +++++-------------- src/components/common/VnInput.vue | 4 +- .../Supplier/Card/SupplierFiscalData.vue | 5 +- 3 files changed, 24 insertions(+), 72 deletions(-) diff --git a/src/components/common/VnAccountNumber.vue b/src/components/common/VnAccountNumber.vue index c4fa78674..3955da74c 100644 --- a/src/components/common/VnAccountNumber.vue +++ b/src/components/common/VnAccountNumber.vue @@ -1,12 +1,9 @@ - diff --git a/src/components/common/VnInput.vue b/src/components/common/VnInput.vue index aeb4a31fd..fb607f0cf 100644 --- a/src/components/common/VnInput.vue +++ b/src/components/common/VnInput.vue @@ -83,7 +83,7 @@ const mixinRules = [ requiredFieldRule, ...($attrs.rules ?? []), (val) => { - const { maxlength } = vnInputRef.value; + const maxlength = $props.maxlength; if (maxlength && +val.length > maxlength) return t(`maxLength`, { value: maxlength }); const { min, max } = vnInputRef.value.$attrs; @@ -108,7 +108,7 @@ const handleInsertMode = (e) => { e.preventDefault(); const input = e.target; const cursorPos = input.selectionStart; - const { maxlength } = vnInputRef.value; + const maxlength = $props.maxlength; let currentValue = value.value; if (!currentValue) currentValue = e.key; const newValue = e.key; diff --git a/src/pages/Supplier/Card/SupplierFiscalData.vue b/src/pages/Supplier/Card/SupplierFiscalData.vue index ecee5b76b..4293bd41a 100644 --- a/src/pages/Supplier/Card/SupplierFiscalData.vue +++ b/src/pages/Supplier/Card/SupplierFiscalData.vue @@ -108,7 +108,6 @@ function handleLocation(data, location) { From 5195e7bafc423d459fc22c0b21325c0407a72d0e Mon Sep 17 00:00:00 2001 From: jorgep Date: Tue, 4 Mar 2025 15:02:03 +0100 Subject: [PATCH 3/7] feat(SupplierList): refs #8718 add nickname alias to localization and update column filter --- src/i18n/locale/en.yml | 1 + src/i18n/locale/es.yml | 1 + src/pages/Supplier/SupplierList.vue | 3 +-- 3 files changed, 3 insertions(+), 2 deletions(-) diff --git a/src/i18n/locale/en.yml b/src/i18n/locale/en.yml index 5b667555e..d7187371e 100644 --- a/src/i18n/locale/en.yml +++ b/src/i18n/locale/en.yml @@ -369,6 +369,7 @@ globals: countryFk: Country countryCodeFk: Country companyFk: Company + nickname: Alias model: Model fuel: Fuel active: Active diff --git a/src/i18n/locale/es.yml b/src/i18n/locale/es.yml index c42696e4c..ea71595cd 100644 --- a/src/i18n/locale/es.yml +++ b/src/i18n/locale/es.yml @@ -370,6 +370,7 @@ globals: countryFk: País countryCodeFk: País companyFk: Empresa + nickname: Alias errors: statusUnauthorized: Acceso denegado statusInternalServerError: Ha ocurrido un error interno del servidor diff --git a/src/pages/Supplier/SupplierList.vue b/src/pages/Supplier/SupplierList.vue index 87b1e13bc..d1d437a19 100644 --- a/src/pages/Supplier/SupplierList.vue +++ b/src/pages/Supplier/SupplierList.vue @@ -4,7 +4,6 @@ import { useI18n } from 'vue-i18n'; import VnTable from 'components/VnTable/VnTable.vue'; import VnSection from 'src/components/common/VnSection.vue'; import VnInput from 'src/components/common/VnInput.vue'; -import VnSelect from 'src/components/common/VnSelect.vue'; import FetchData from 'src/components/FetchData.vue'; import { useSummaryDialog } from 'src/composables/useSummaryDialog'; import SupplierSummary from './Card/SupplierSummary.vue'; @@ -53,7 +52,7 @@ const columns = computed(() => [ label: t('globals.alias'), name: 'alias', columnFilter: { - name: 'search', + name: 'nickname', }, cardVisible: true, }, From d4a18e584693d3b7a7e221feb4b34d70d8934abc Mon Sep 17 00:00:00 2001 From: jorgep Date: Tue, 4 Mar 2025 16:08:20 +0100 Subject: [PATCH 4/7] refactor(VnAccountNumber): refs #8718 update input handling and improve test descriptions --- src/components/common/VnAccountNumber.vue | 1 - src/components/common/VnInput.vue | 2 +- .../vnComponent/VnAccountNumber.spec.js | 68 +++++++++++-------- 3 files changed, 41 insertions(+), 30 deletions(-) diff --git a/src/components/common/VnAccountNumber.vue b/src/components/common/VnAccountNumber.vue index 3955da74c..56add7329 100644 --- a/src/components/common/VnAccountNumber.vue +++ b/src/components/common/VnAccountNumber.vue @@ -29,7 +29,6 @@ async function handleUpdateModel(val) { diff --git a/src/components/common/VnInput.vue b/src/components/common/VnInput.vue index fb607f0cf..9e13f5351 100644 --- a/src/components/common/VnInput.vue +++ b/src/components/common/VnInput.vue @@ -143,7 +143,7 @@ const handleUppercase = () => { :rules="mixinRules" :lazy-rules="true" hide-bottom-space - :data-cy="$attrs.dataCy ?? $attrs.label + '_input'" + :data-cy="$attrs['data-cy'] ?? $attrs.label + '_input'" >