From f2006663b732bf70908254362624e4e08078fce1 Mon Sep 17 00:00:00 2001 From: carlossa Date: Wed, 10 Jan 2024 14:29:01 +0100 Subject: [PATCH 01/91] refs #6664 popup --- src/components/ui/VnConfirm.vue | 13 ++++++++++--- src/pages/Claim/Card/ClaimAction.vue | 16 +++++++++++----- 2 files changed, 21 insertions(+), 8 deletions(-) diff --git a/src/components/ui/VnConfirm.vue b/src/components/ui/VnConfirm.vue index f8715f685..c6650a28f 100644 --- a/src/components/ui/VnConfirm.vue +++ b/src/components/ui/VnConfirm.vue @@ -2,6 +2,7 @@ import { ref } from 'vue'; import { useDialogPluginComponent } from 'quasar'; import { useI18n } from 'vue-i18n'; +import { onMounted } from 'vue'; const { t } = useI18n(); @@ -28,6 +29,7 @@ const props = defineProps({ required: false, default: null, }, + callbackFn: Function, }); defineEmits(['confirm', ...useDialogPluginComponent.emits]); @@ -37,12 +39,17 @@ const { dialogRef, onDialogOK } = useDialogPluginComponent(); const title = props.title || t('Confirm'); const message = props.message || t('Are you sure you want to continue?'); const isLoading = ref(false); - +onMounted(() => { + if (props.callbackFn) props.callbackFn(); +}); async function confirm() { + let html = null; + html = document.getElementById(props.data.inputId); isLoading.value = true; if (props.promise) { try { - await props.promise(props.data); + if (html) await props.promise({ ...props.data, return: html.value }); + else await props.promise(props.data); } finally { isLoading.value = false; } @@ -66,7 +73,7 @@ async function confirm() { - + [ { @@ -140,22 +141,27 @@ async function regularizeClaim() { component: VnConfirm, componentProps: { title: t('confirmGreuges'), - message: t('confirmGreugesMessage'), + message: ` + + `, + data: { inputId: 'multiplicatorValue' }, + promise: onUpdateGreugeAccept, }, }) .onOk(async () => await onUpdateGreugeAccept()); } } -async function onUpdateGreugeAccept() { +async function onUpdateGreugeAccept({ return: multiplicatorValue }) { const greugeTypeFreightId = ( await axios.get(`GreugeTypes/findOne`, { filter: { where: { code: 'freightPickUp' } }, }) ).data.id; - const freightPickUpPrice = (await axios.get(`GreugeConfigs/findOne`)).data - .freightPickUpPrice; - + const freightPickUpPrice = + (await axios.get(`GreugeConfigs/findOne`)).data.freightPickUpPrice * + +multiplicatorValue; + console.log(freightPickUpPrice); await axios.post(`Greuges`, { clientFk: claim.value.clientFk, description: `${t('ClaimGreugeDescription')} ${claimId}`.toUpperCase(), From b36cdbf7214376bfc6d3d99e1b96c1f89723ec65 Mon Sep 17 00:00:00 2001 From: carlossa Date: Thu, 11 Jan 2024 08:33:57 +0100 Subject: [PATCH 02/91] refs #6664 scss --- src/components/ui/VnConfirm.vue | 2 +- src/pages/Claim/Card/ClaimAction.vue | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/components/ui/VnConfirm.vue b/src/components/ui/VnConfirm.vue index c6650a28f..0ce18cadb 100644 --- a/src/components/ui/VnConfirm.vue +++ b/src/components/ui/VnConfirm.vue @@ -72,7 +72,7 @@ async function confirm() { - + diff --git a/src/pages/Claim/Card/ClaimAction.vue b/src/pages/Claim/Card/ClaimAction.vue index f3dd0b952..76f76903c 100644 --- a/src/pages/Claim/Card/ClaimAction.vue +++ b/src/pages/Claim/Card/ClaimAction.vue @@ -142,7 +142,7 @@ async function regularizeClaim() { componentProps: { title: t('confirmGreuges'), message: ` - + `, data: { inputId: 'multiplicatorValue' }, promise: onUpdateGreugeAccept, From 810dd81b34669426630453370dde37ec00beaa4f Mon Sep 17 00:00:00 2001 From: Javier Segarra Date: Fri, 12 Jan 2024 09:58:12 +0100 Subject: [PATCH 03/91] refs #6280 feat VnLocation approach --- src/components/common/VnLocation.vue | 179 +++++++++++++++++++++++++++ 1 file changed, 179 insertions(+) create mode 100644 src/components/common/VnLocation.vue diff --git a/src/components/common/VnLocation.vue b/src/components/common/VnLocation.vue new file mode 100644 index 000000000..70e818ade --- /dev/null +++ b/src/components/common/VnLocation.vue @@ -0,0 +1,179 @@ + + + + + + +es: + Location: Ubicación + From 68ba851e6e9f5c2b5a7e47b3b33df2b8ce1fddf3 Mon Sep 17 00:00:00 2001 From: Javier Segarra Date: Fri, 12 Jan 2024 09:58:24 +0100 Subject: [PATCH 04/91] refs #6280 feat use VnLocation in CustomerCreate --- src/pages/Customer/CustomerCreate.vue | 96 ++------------------------- 1 file changed, 7 insertions(+), 89 deletions(-) diff --git a/src/pages/Customer/CustomerCreate.vue b/src/pages/Customer/CustomerCreate.vue index cfaef0855..f6ac6a165 100644 --- a/src/pages/Customer/CustomerCreate.vue +++ b/src/pages/Customer/CustomerCreate.vue @@ -2,12 +2,11 @@ import { reactive, ref } from 'vue'; import { useI18n } from 'vue-i18n'; -import CustomerCreateNewPostcode from 'src/components/CreateNewPostcodeForm.vue'; import FetchData from 'components/FetchData.vue'; import FormModel from 'components/FormModel.vue'; import VnRow from 'components/ui/VnRow.vue'; import VnSelectFilter from 'src/components/common/VnSelectFilter.vue'; -import VnSelectCreate from 'src/components/common/VnSelectCreate.vue'; +import VnLocation from 'src/components/common/VnLocation.vue'; import VnSubToolbar from 'src/components/ui/VnSubToolbar.vue'; const { t } = useI18n(); @@ -133,96 +132,15 @@ const onPostcodeCreated = async () => {
- - - - -
-
- - - - -
-
- -
- - - -
-
- + v-model="data.location" + @update:model-value="(data)=> console.log(data)" + > +
+
From 67d4471f42eb2d125103ad42f8c65d3e44e4fe70 Mon Sep 17 00:00:00 2001 From: Javier Segarra Date: Fri, 12 Jan 2024 10:57:50 +0100 Subject: [PATCH 05/91] refs #6280 feat: improve VnLocation --- src/components/common/VnLocation.vue | 7 +++-- src/components/common/VnSelectFilter.vue | 38 ++++++++++++++++++++++-- 2 files changed, 41 insertions(+), 4 deletions(-) diff --git a/src/components/common/VnLocation.vue b/src/components/common/VnLocation.vue index 70e818ade..3a296e168 100644 --- a/src/components/common/VnLocation.vue +++ b/src/components/common/VnLocation.vue @@ -135,16 +135,19 @@ function showLabel(data){ auto-load url="Countries" /> + [], + }, + filterRules: { + type: [Array, Function], default: () => [], }, isClearable: { @@ -47,16 +51,46 @@ function setOptions(data) { myOptions.value = JSON.parse(JSON.stringify(data)); myOptionsOriginal.value = JSON.parse(JSON.stringify(data)); } +function deepFind(obj, path) { + var paths = path.split('.') + , current = obj + , i; + + for (i = 0; i < paths.length; ++i) { + if (current[paths[i]] == undefined) { + return undefined; + } else { + current = current[paths[i]]; + } + } + return current; +} setOptions(options.value); const filter = (val, options) => { const search = val.toString().toLowerCase(); if (!search) return options; + if($props.filterRules.length) { + const passSomeRule = $props.filterRules.some((rule) => { + if(typeof rule === 'object') return true + const cond = eval(rule) + return cond; + }); + if(!passSomeRule) return options + } return options.filter((row) => { if ($props.filterOptions.length) { return $props.filterOptions.some((prop) => { - const propValue = String(row[prop]).toLowerCase(); + const passRules = $props.filterRules + .filter(rule=>typeof rule === 'object') + .every(rule=>{ + const propExists = Object.keys(rule).includes(prop); + if(!propExists) return false; + return eval(prop.concat(rule[prop])) + }); + const propValue = String(deepFind(row,prop)).toLowerCase(); + if(passRules) return propValue.includes(search); }); } From 4b3ca3bbd97872f8c8935f0ec30ee3d442f14788 Mon Sep 17 00:00:00 2001 From: Javier Segarra Date: Fri, 12 Jan 2024 11:27:54 +0100 Subject: [PATCH 06/91] refs #6280 feat: return geoFk VnLocation --- src/components/common/VnLocation.vue | 51 +++--------------------- src/components/common/VnSelectFilter.vue | 9 ----- 2 files changed, 5 insertions(+), 55 deletions(-) diff --git a/src/components/common/VnLocation.vue b/src/components/common/VnLocation.vue index 3a296e168..5c41144ac 100644 --- a/src/components/common/VnLocation.vue +++ b/src/components/common/VnLocation.vue @@ -2,7 +2,6 @@ import { ref, toRefs, computed, watch } from 'vue'; import CreateNewPostcode from 'src/components/CreateNewPostcodeForm.vue'; import VnSelectCreate from 'components/common/VnSelectCreate.vue'; -import VnSelectFilter from 'components/common/VnSelectFilter.vue'; import FetchData from 'components/FetchData.vue'; const emit = defineEmits(['update:modelValue', 'update:options']); import { useI18n } from 'vue-i18n'; @@ -44,14 +43,10 @@ const $props = defineProps({ default: true, }, }); -const locationsRef = ref(); -const locationsRefFilter = ref({ fields: ['code', 'nickname'], limit: 30 }); -const { optionLabel, optionValue, options } = toRefs($props); +const { options } = toRefs($props); const myOptions = ref([]); const myOptionsOriginal = ref([]); -const vnSelectRef = ref(); -const showForm = ref(false); const value = computed({ get() { @@ -67,42 +62,6 @@ function setOptions(data) { myOptionsOriginal.value = JSON.parse(JSON.stringify(data)); } setOptions(options.value); -const filter = (val, options) => { - const search = val.toString().toLowerCase(); - - if (!search) return options; - // if (!search.length < 2) return options; - - return options -}; - -const filterHandler = (val, update) => { - update( - () => { - // if (val.length>2) - myOptions.value = filter(val, myOptionsOriginal.value); - }, - (ref) => { - if (val !== '' && ref.options.length > 0) { - ref.setOptionIndex(-1); - ref.moveOptionSelection(1, true); - } - } - ); -}; - -function locationFilter(val) { - let where = { limit: 30 }; - let params = {}; - let key = 'nickname'; - - if (new RegExp(/\d/g).test(val)) { - key = 'id'; - } - params = { [key]: { like: `%${val}%` } }; - where = Object.assign(where, params); - locationsRef.value.fetch({ where }); -} watch(options, (newValue) => { setOptions(newValue); }); @@ -135,19 +94,19 @@ function showLabel(data){ auto-load url="Countries" /> - { if (!search) return options; if($props.filterRules.length) { const passSomeRule = $props.filterRules.some((rule) => { - if(typeof rule === 'object') return true const cond = eval(rule) return cond; }); @@ -82,15 +81,7 @@ const filter = (val, options) => { return options.filter((row) => { if ($props.filterOptions.length) { return $props.filterOptions.some((prop) => { - const passRules = $props.filterRules - .filter(rule=>typeof rule === 'object') - .every(rule=>{ - const propExists = Object.keys(rule).includes(prop); - if(!propExists) return false; - return eval(prop.concat(rule[prop])) - }); const propValue = String(deepFind(row,prop)).toLowerCase(); - if(passRules) return propValue.includes(search); }); } From 20835471a3a1c392b080f51295e0bf49c92a71cf Mon Sep 17 00:00:00 2001 From: Javier Segarra Date: Mon, 15 Jan 2024 09:14:42 +0100 Subject: [PATCH 07/91] refs #6280 feat: handle option selected from VnLocation --- src/components/common/VnLocation.vue | 4 ++-- src/pages/Customer/CustomerCreate.vue | 18 +++++++++++++----- 2 files changed, 15 insertions(+), 7 deletions(-) diff --git a/src/components/common/VnLocation.vue b/src/components/common/VnLocation.vue index 5c41144ac..e91c78430 100644 --- a/src/components/common/VnLocation.vue +++ b/src/components/common/VnLocation.vue @@ -98,9 +98,8 @@ function showLabel(data){ v-model="value" :options="postcodesOptions" :label="t('Location')" - option-value="geoFk" :option-label="showLabel" - :placeholder="t('Min. 3 char')" + :placeholder="t('Search by postalCode or town (at least 3 characters')" v-bind="$attrs" emit-value map-options @@ -138,4 +137,5 @@ function showLabel(data){ es: Location: Ubicación + Search by postalCode or town (at least 3 characters): Buscar por código postal o nombre ( al menos 3 letras) diff --git a/src/pages/Customer/CustomerCreate.vue b/src/pages/Customer/CustomerCreate.vue index f6ac6a165..3afda7fac 100644 --- a/src/pages/Customer/CustomerCreate.vue +++ b/src/pages/Customer/CustomerCreate.vue @@ -36,9 +36,13 @@ const provincesLocationOptions = ref([]); const countriesOptions = ref([]); const postcodesOptions = ref([]); -const onPostcodeCreated = async () => { - postcodeFetchDataRef.value.fetch(); -}; + +function handleLocation(data, { city, postcode, provinceFk, countryFk }) { + data.postcode = postcode; + data.city = city; + data.provinceFk = provinceFk; + data.countryFk = countryFk; +} - - en: params: diff --git a/src/pages/Customer/ExtendedList/CustomerExtendedListFilter.vue b/src/pages/Customer/ExtendedList/CustomerExtendedListFilter.vue index 46b4e1e7b..df898e7c1 100644 --- a/src/pages/Customer/ExtendedList/CustomerExtendedListFilter.vue +++ b/src/pages/Customer/ExtendedList/CustomerExtendedListFilter.vue @@ -145,27 +145,26 @@ const shouldRenderColumn = (colName) => {
- - es: Social name: Razón social diff --git a/src/pages/Customer/Notifications/CustomerNotificationsFilter.vue b/src/pages/Customer/Notifications/CustomerNotificationsFilter.vue index 650158278..957abb7a3 100644 --- a/src/pages/Customer/Notifications/CustomerNotificationsFilter.vue +++ b/src/pages/Customer/Notifications/CustomerNotificationsFilter.vue @@ -36,91 +36,80 @@ const clients = ref(); - - en: params: diff --git a/src/pages/Customer/Payments/CustomerPaymentsFilter.vue b/src/pages/Customer/Payments/CustomerPaymentsFilter.vue index a19b35a20..74ea2c203 100644 --- a/src/pages/Customer/Payments/CustomerPaymentsFilter.vue +++ b/src/pages/Customer/Payments/CustomerPaymentsFilter.vue @@ -27,71 +27,60 @@ function isValidNumber(value) { diff --git a/src/pages/Entry/EntryFilter.vue b/src/pages/Entry/EntryFilter.vue index 59ce06a00..f137b05e8 100644 --- a/src/pages/Entry/EntryFilter.vue +++ b/src/pages/Entry/EntryFilter.vue @@ -54,151 +54,149 @@ const suppliersOptions = ref([]); diff --git a/src/pages/InvoiceIn/InvoiceInFilter.vue b/src/pages/InvoiceIn/InvoiceInFilter.vue index f8198d237..dec798906 100644 --- a/src/pages/InvoiceIn/InvoiceInFilter.vue +++ b/src/pages/InvoiceIn/InvoiceInFilter.vue @@ -36,55 +36,121 @@ const suppliersRef = ref(); - - en: params: diff --git a/src/pages/InvoiceOut/InvoiceOutFilter.vue b/src/pages/InvoiceOut/InvoiceOutFilter.vue index 124ea00d1..f8a430b51 100644 --- a/src/pages/InvoiceOut/InvoiceOutFilter.vue +++ b/src/pages/InvoiceOut/InvoiceOutFilter.vue @@ -41,95 +41,89 @@ function setWorkers(data) { diff --git a/src/pages/InvoiceOut/InvoiceOutNegativeBasesFilter.vue b/src/pages/InvoiceOut/InvoiceOutNegativeBasesFilter.vue index 028246aeb..3adfa1d13 100644 --- a/src/pages/InvoiceOut/InvoiceOutNegativeBasesFilter.vue +++ b/src/pages/InvoiceOut/InvoiceOutNegativeBasesFilter.vue @@ -27,87 +27,83 @@ const props = defineProps({ - - en: params: diff --git a/src/pages/Order/Card/OrderCatalogFilter.vue b/src/pages/Order/Card/OrderCatalogFilter.vue index c325a9b05..760c48726 100644 --- a/src/pages/Order/Card/OrderCatalogFilter.vue +++ b/src/pages/Order/Card/OrderCatalogFilter.vue @@ -219,183 +219,181 @@ const getCategoryClass = (category, params) => { diff --git a/src/pages/Order/Card/OrderFilter.vue b/src/pages/Order/Card/OrderFilter.vue index b49f0b115..62bfe0e02 100644 --- a/src/pages/Order/Card/OrderFilter.vue +++ b/src/pages/Order/Card/OrderFilter.vue @@ -59,162 +59,152 @@ const sourceList = ref(null); - - en: params: diff --git a/src/pages/Route/Card/RouteFilter.vue b/src/pages/Route/Card/RouteFilter.vue index 45580d913..4be1981ab 100644 --- a/src/pages/Route/Card/RouteFilter.vue +++ b/src/pages/Route/Card/RouteFilter.vue @@ -61,144 +61,142 @@ const warehouseList = ref([]); diff --git a/src/pages/Route/Cmr/CmrFilter.vue b/src/pages/Route/Cmr/CmrFilter.vue index a5bf5513b..553f19431 100644 --- a/src/pages/Route/Cmr/CmrFilter.vue +++ b/src/pages/Route/Cmr/CmrFilter.vue @@ -28,103 +28,101 @@ const countries = ref(); diff --git a/src/pages/Shelving/Card/ShelvingFilter.vue b/src/pages/Shelving/Card/ShelvingFilter.vue index 423402f89..6767f6d97 100644 --- a/src/pages/Shelving/Card/ShelvingFilter.vue +++ b/src/pages/Shelving/Card/ShelvingFilter.vue @@ -41,7 +41,11 @@ function setParkings(data) { @on-fetch="setWorkers" auto-load /> - + diff --git a/src/pages/Ticket/TicketFilter.vue b/src/pages/Ticket/TicketFilter.vue index b0b584257..7b74117bb 100644 --- a/src/pages/Ticket/TicketFilter.vue +++ b/src/pages/Ticket/TicketFilter.vue @@ -56,66 +56,138 @@ const warehouses = ref(); diff --git a/src/pages/Travel/ExtraCommunityFilter.vue b/src/pages/Travel/ExtraCommunityFilter.vue index 260b0fb42..cac8e093d 100644 --- a/src/pages/Travel/ExtraCommunityFilter.vue +++ b/src/pages/Travel/ExtraCommunityFilter.vue @@ -66,158 +66,149 @@ const decrement = (paramsObj, key) => { - es: Search claim: Buscar reclamación diff --git a/src/pages/Claim/ClaimRmaList.vue b/src/pages/Claim/ClaimRmaList.vue index 3774932e3..b906e32fa 100644 --- a/src/pages/Claim/ClaimRmaList.vue +++ b/src/pages/Claim/ClaimRmaList.vue @@ -84,7 +84,7 @@ async function remove({ id }) { -
+
{ -
+
{ - - es: Search customer: Buscar cliente diff --git a/src/pages/Customer/Payments/CustomerPayments.vue b/src/pages/Customer/Payments/CustomerPayments.vue index de774e63e..eedaaf137 100644 --- a/src/pages/Customer/Payments/CustomerPayments.vue +++ b/src/pages/Customer/Payments/CustomerPayments.vue @@ -122,7 +122,7 @@ function stateColor(row) { -
+
.customer-payments { - .card-list { - width: 100%; - max-width: 60em; - - .q-table--dense .q-table th:first-child { - padding-left: 0; - } - td { - max-width: 130px; - overflow: hidden; - text-overflow: ellipsis; - } + .q-table--dense .q-table th:first-child { + padding-left: 0; + } + td { + max-width: 130px; + overflow: hidden; + text-overflow: ellipsis; } } diff --git a/src/pages/Entry/EntryList.vue b/src/pages/Entry/EntryList.vue index 40747178c..0cf707efa 100644 --- a/src/pages/Entry/EntryList.vue +++ b/src/pages/Entry/EntryList.vue @@ -47,7 +47,7 @@ onMounted(async () => { -
+
{ - - es: Search entries: Buscar entradas diff --git a/src/pages/InvoiceIn/InvoiceInList.vue b/src/pages/InvoiceIn/InvoiceInList.vue index bf791c10e..2f508ec34 100644 --- a/src/pages/InvoiceIn/InvoiceInList.vue +++ b/src/pages/InvoiceIn/InvoiceInList.vue @@ -71,7 +71,7 @@ function viewSummary(id) { -
+
- - es: Search invoice: Buscar factura emitida diff --git a/src/pages/InvoiceOut/InvoiceOutList.vue b/src/pages/InvoiceOut/InvoiceOutList.vue index 292fa2e0a..36d1d3aad 100644 --- a/src/pages/InvoiceOut/InvoiceOutList.vue +++ b/src/pages/InvoiceOut/InvoiceOutList.vue @@ -181,7 +181,7 @@ const downloadCsv = () => {
-
+
{ - - en: searchInvoice: Search issued invoice diff --git a/src/pages/Order/OrderCatalog.vue b/src/pages/Order/OrderCatalog.vue index 55f5e7da1..21442d10d 100644 --- a/src/pages/Order/OrderCatalog.vue +++ b/src/pages/Order/OrderCatalog.vue @@ -1,7 +1,7 @@ @@ -70,7 +70,7 @@ function extractTags(items) { -
+
diff --git a/src/pages/Order/OrderVolume.vue b/src/pages/Order/OrderVolume.vue index 4f4c269f6..5bb106edc 100644 --- a/src/pages/Order/OrderVolume.vue +++ b/src/pages/Order/OrderVolume.vue @@ -35,7 +35,7 @@ const loadVolumes = async (rows) => { auto-load /> -
+
{ } diff --git a/src/pages/Supplier/Card/SupplierAddresses.vue b/src/pages/Supplier/Card/SupplierAddresses.vue index df7cff932..c6b08075f 100644 --- a/src/pages/Supplier/Card/SupplierAddresses.vue +++ b/src/pages/Supplier/Card/SupplierAddresses.vue @@ -47,7 +47,7 @@ const redirectToUpdateView = (addressData) => { - - diff --git a/src/pages/Supplier/SupplierList.vue b/src/pages/Supplier/SupplierList.vue index ea7bc3cb0..d504e127a 100644 --- a/src/pages/Supplier/SupplierList.vue +++ b/src/pages/Supplier/SupplierList.vue @@ -44,7 +44,7 @@ const viewSummary = (id) => { -
+
- - en: Search suppliers: Search suppliers diff --git a/src/pages/Ticket/TicketList.vue b/src/pages/Ticket/TicketList.vue index 9186eb6ad..6f57ad0b9 100644 --- a/src/pages/Ticket/TicketList.vue +++ b/src/pages/Ticket/TicketList.vue @@ -74,7 +74,7 @@ function viewSummary(id) { -
+
- - es: Search ticket: Buscar ticket diff --git a/src/pages/Travel/TravelList.vue b/src/pages/Travel/TravelList.vue index 889f096aa..dbbdaca93 100644 --- a/src/pages/Travel/TravelList.vue +++ b/src/pages/Travel/TravelList.vue @@ -56,7 +56,7 @@ onMounted(async () => { -
+
{ - - en: addEntry: Add entry diff --git a/src/pages/Wagon/Type/WagonTypeList.vue b/src/pages/Wagon/Type/WagonTypeList.vue index 8e4ace744..a7c713039 100644 --- a/src/pages/Wagon/Type/WagonTypeList.vue +++ b/src/pages/Wagon/Type/WagonTypeList.vue @@ -42,7 +42,7 @@ async function remove(row) { - - diff --git a/src/pages/Wagon/WagonList.vue b/src/pages/Wagon/WagonList.vue index 77d9da0bf..18417f433 100644 --- a/src/pages/Wagon/WagonList.vue +++ b/src/pages/Wagon/WagonList.vue @@ -48,7 +48,7 @@ async function remove(row) { - - diff --git a/src/pages/Worker/WorkerList.vue b/src/pages/Worker/WorkerList.vue index e7e86d16e..0e9868a04 100644 --- a/src/pages/Worker/WorkerList.vue +++ b/src/pages/Worker/WorkerList.vue @@ -64,7 +64,7 @@ const redirectToCreateView = () => { -
+
{ - - es: Search worker: Buscar trabajador From 5ebeb7fe472c9bca7b29e9460732341716d40c84 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Javier=20Segarra=20Mart=C3=ADnez?= Date: Tue, 23 Jan 2024 23:23:51 +0100 Subject: [PATCH 37/91] refs #6280 perf locationFilter --- src/components/common/VnLocation.vue | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/components/common/VnLocation.vue b/src/components/common/VnLocation.vue index ee879a62c..674784849 100644 --- a/src/components/common/VnLocation.vue +++ b/src/components/common/VnLocation.vue @@ -72,8 +72,8 @@ onMounted(() => { locationFilter() }) function locationFilter(search) { - let where = { search }; - postcodesRef.value.fetch({ where, limit: 30}); + let args = { filter:{limit: 30}, search}; + postcodesRef.value.fetch({args}); } function handleFetch( data) { postcodesOptions.value = data; From 45dc9c355f4ab6342a82bb8e597a81cea2b96318 Mon Sep 17 00:00:00 2001 From: Javier Segarra Date: Wed, 24 Jan 2024 08:30:09 +0100 Subject: [PATCH 38/91] refs #6280 perf: improve component --- src/components/common/VnLocation.vue | 15 ++++++---- src/pages/Customer/CustomerCreate.vue | 7 +++-- src/pages/Worker/WorkerCreate.vue | 7 +++-- test/cypress/integration/VnLocation.spec.js | 32 +++++++++++++++++++++ 4 files changed, 49 insertions(+), 12 deletions(-) create mode 100644 test/cypress/integration/VnLocation.spec.js diff --git a/src/components/common/VnLocation.vue b/src/components/common/VnLocation.vue index 674784849..a7a58e2b8 100644 --- a/src/components/common/VnLocation.vue +++ b/src/components/common/VnLocation.vue @@ -54,11 +54,16 @@ const value = computed({ }, }); +onMounted(() => { + locationFilter() +}); + function setOptions(data) { myOptions.value = JSON.parse(JSON.stringify(data)); myOptionsOriginal.value = JSON.parse(JSON.stringify(data)); } setOptions(options.value); + watch(options, (newValue) => { setOptions(newValue); }); @@ -67,17 +72,15 @@ function showLabel(data) { return `${data.code} - ${data.town}(${data.province}), ${data.country}`; } - -onMounted(() => { - locationFilter() -}) function locationFilter(search) { - let args = { filter:{limit: 30}, search}; - postcodesRef.value.fetch({args}); + let where = { search }; + postcodesRef.value.fetch({filter:{ where}, limit: 30}); } + function handleFetch( data) { postcodesOptions.value = data; } + async function onPostcodeCreated(){ locationFilter() }; diff --git a/src/pages/Customer/CustomerCreate.vue b/src/pages/Customer/CustomerCreate.vue index 4ce4b4520..800279326 100644 --- a/src/pages/Customer/CustomerCreate.vue +++ b/src/pages/Customer/CustomerCreate.vue @@ -33,9 +33,10 @@ const businessTypesOptions = ref([]); const postcodesOptions = ref([]); -function handleLocation(data, { city, postcode, provinceFk, countryFk }) { - data.postcode = postcode; - data.city = city; +function handleLocation(data, location ) { + const { town, code, provinceFk, countryFk } = location ?? {} + data.postcode = code; + data.city = town; data.provinceFk = provinceFk; data.countryFk = countryFk; } diff --git a/src/pages/Worker/WorkerCreate.vue b/src/pages/Worker/WorkerCreate.vue index 490fd2086..3ded85584 100644 --- a/src/pages/Worker/WorkerCreate.vue +++ b/src/pages/Worker/WorkerCreate.vue @@ -57,9 +57,10 @@ const onBankEntityCreated = (data) => { }; -function handleLocation(data, { city, postcode, provinceFk, countryFk }) { - data.postcode = postcode; - data.city = city; +function handleLocation(data, location ) { + const { town, postcode: code, provinceFk, countryFk } = location ?? {} + data.postcode = code; + data.city = town; data.provinceFk = provinceFk; data.countryFk = countryFk; } diff --git a/test/cypress/integration/VnLocation.spec.js b/test/cypress/integration/VnLocation.spec.js new file mode 100644 index 000000000..20b18700f --- /dev/null +++ b/test/cypress/integration/VnLocation.spec.js @@ -0,0 +1,32 @@ +const inputLocation = ':nth-child(3) > :nth-child(1) > .q-field > .q-field__inner > .q-field__control'; +const locationOptions ='[role="listbox"] > div.q-virtual-scroll__content > .q-item' +describe('VnLocation', () => { + beforeEach(() => { + cy.viewport(1280, 720); + cy.login('developer'); + cy.visit('/#/worker/create'); + cy.waitForElement('.q-card'); + }); + + // it('Show all options', function() { + // cy.get(inputLocation).click(); + // cy.get(locationOptions).should('have.length',5) + // // cy.get(':nth-child(3) > :nth-child(1) > .q-field > .q-field__inner > .q-field__control > :nth-child(2) > .q-icon').click() + // }); + + // it('input filter location as "al"', function() { + // cy.get(inputLocation).click(); + // cy.get(inputLocation).clear(); + // cy.get(inputLocation).type('al'); + // cy.get(locationOptions).should('have.length',3); + // }); + it('input filter location as "ecuador"', function() { + cy.get(inputLocation).click(); + cy.get(inputLocation).clear(); + cy.get(inputLocation).type('ecuador'); + cy.get(locationOptions).should('have.length',1); + cy.get(`${locationOptions}:nth-child(1)`).click(); + cy.get(':nth-child(3) > :nth-child(1) > .q-field > .q-field__inner > .q-field__control > :nth-child(2) > .q-icon').click(); + + }); +}) From 8f870f8d6714dbbfcfc2bb76b35c6fb30f545d80 Mon Sep 17 00:00:00 2001 From: carlossa Date: Wed, 24 Jan 2024 08:43:50 +0100 Subject: [PATCH 39/91] refs #6677 dataRef --- src/components/common/VnSelectFilter.vue | 17 +++++++++++++++++ .../InvoiceIn/Card/InvoiceInBasicData.vue | 19 ++++++++----------- 2 files changed, 25 insertions(+), 11 deletions(-) diff --git a/src/components/common/VnSelectFilter.vue b/src/components/common/VnSelectFilter.vue index 244fb50bb..a50ce1236 100644 --- a/src/components/common/VnSelectFilter.vue +++ b/src/components/common/VnSelectFilter.vue @@ -1,6 +1,8 @@