From 701f1e100f0de4d0a0a5ac4aea68686fdaf0ec66 Mon Sep 17 00:00:00 2001 From: Javier Segarra Date: Tue, 21 Nov 2023 12:50:05 +0100 Subject: [PATCH 001/172] refs #5858 feat: add catch when patch FormModel --- src/components/FormModel.vue | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/src/components/FormModel.vue b/src/components/FormModel.vue index e8a9e4c17..f8daea34e 100644 --- a/src/components/FormModel.vue +++ b/src/components/FormModel.vue @@ -80,7 +80,13 @@ async function save() { }); } isLoading.value = true; - await axios.patch($props.urlUpdate || $props.url, formData.value); + try { + await axios.patch($props.urlUpdate || $props.url, formData.value); + } catch (err) { + if (err) { + isLoading.value = false; + } + } originalData.value = JSON.parse(JSON.stringify(formData.value)); hasChanges.value = false; From 333050b6a78b07921ce583266d73bd6704099d64 Mon Sep 17 00:00:00 2001 From: Javier Segarra Date: Wed, 22 Nov 2023 07:12:34 +0100 Subject: [PATCH 002/172] refs #5858 feat: add format validation --- src/composables/useValidator.js | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/src/composables/useValidator.js b/src/composables/useValidator.js index bc48332a2..625f20911 100644 --- a/src/composables/useValidator.js +++ b/src/composables/useValidator.js @@ -37,6 +37,15 @@ export function useValidator() { const { t } = useI18n(); const validations = function (validation) { return { + format: (value) =>{ + const {allowNull, with: format, allowBlank} = validation; + const message = t(validation.message) || validation.message; + if(!allowBlank && value ==='') return message + if(!allowNull && value === null) return message + + const isValid = new RegExp(format).test(value) + if(!isValid) return message + }, presence: (value) => { let message = `Value can't be empty`; if (validation.message) From 4ccb11997e51ed17830dcae7349d9db9a03be9d2 Mon Sep 17 00:00:00 2001 From: Javier Segarra Date: Fri, 22 Dec 2023 10:32:57 +0100 Subject: [PATCH 003/172] refs #5878 lint: eslint --- src/composables/useValidator.js | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/src/composables/useValidator.js b/src/composables/useValidator.js index 364d11391..5ad96ea1b 100644 --- a/src/composables/useValidator.js +++ b/src/composables/useValidator.js @@ -30,14 +30,14 @@ export function useValidator() { const { t } = useI18n(); const validations = function (validation) { return { - format: (value) =>{ - const {allowNull, with: format, allowBlank} = validation; + format: (value) => { + const { allowNull, with: format, allowBlank } = validation; const message = t(validation.message) || validation.message; - if(!allowBlank && value ==='') return message - if(!allowNull && value === null) return message + if (!allowBlank && value === '') return message; + if (!allowNull && value === null) return message; - const isValid = new RegExp(format).test(value) - if(!isValid) return message + const isValid = new RegExp(format).test(value); + if (!isValid) return message; }, presence: (value) => { let message = `Value can't be empty`; From 232827ef48f3aecbaf401721c5e1046471f23898 Mon Sep 17 00:00:00 2001 From: jorgep Date: Thu, 28 Dec 2023 16:02:04 +0100 Subject: [PATCH 004/172] WIP: corrective section created: refs #4466 --- src/components/CrudModel.vue | 10 +- src/components/LeftMenu.vue | 2 +- src/components/common/VnSelectFilter.vue | 2 +- src/i18n/en/index.js | 5 + src/i18n/es/index.js | 5 + .../InvoiceIn/Card/InvoiceInBasicData.vue | 3 +- src/pages/InvoiceIn/Card/InvoiceInCard.vue | 20 +- .../InvoiceIn/Card/InvoiceInCorrective.vue | 160 +++++++++++ .../InvoiceIn/Card/InvoiceInDescriptor.vue | 252 +++++++++++++++++- src/router/modules/invoiceIn.js | 30 +++ 10 files changed, 460 insertions(+), 29 deletions(-) create mode 100644 src/pages/InvoiceIn/Card/InvoiceInCorrective.vue diff --git a/src/components/CrudModel.vue b/src/components/CrudModel.vue index 75353a35a..dcffc1a28 100644 --- a/src/components/CrudModel.vue +++ b/src/components/CrudModel.vue @@ -76,8 +76,13 @@ defineExpose({ reset, hasChanges, saveChanges, + getFormData, }); +function getFormData() { + return formData.value; +} + async function fetch(data) { if (data && Array.isArray(data)) { let $index = 0; @@ -196,12 +201,13 @@ function getChanges() { const creates = []; const pk = $props.primaryKey; - for (const [i, row] of formData.value.entries()) { + console.log(pk, row); if (!row[pk]) { creates.push(row); } else if (originalData.value) { const data = getDifferences(originalData.value[i], row); + console.log(data); if (!isEmpty(data)) { updates.push({ data, @@ -211,7 +217,7 @@ function getChanges() { } } const changes = { updates, creates }; - + console.log('ddd', changes); for (let prop in changes) { if (changes[prop].length === 0) changes[prop] = undefined; } diff --git a/src/components/LeftMenu.vue b/src/components/LeftMenu.vue index 2eac97c65..253f3c161 100644 --- a/src/components/LeftMenu.vue +++ b/src/components/LeftMenu.vue @@ -50,7 +50,7 @@ function addChildren(module, route, parent) { const matches = findMatches(mainMenus, route); for (const child of matches) { - navigation.addMenuItem(module, child, parent); + if (!child.meta.hidden) navigation.addMenuItem(module, child, parent); } } } diff --git a/src/components/common/VnSelectFilter.vue b/src/components/common/VnSelectFilter.vue index 568da613f..35cb72cf2 100644 --- a/src/components/common/VnSelectFilter.vue +++ b/src/components/common/VnSelectFilter.vue @@ -102,7 +102,7 @@ const value = computed({ name="close" @click.stop="value = null" class="cursor-pointer" - size="18px" + size="xs" /> - - 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 044/172] 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 045/172] 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 046/172] 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 @@ - +
@@ -278,7 +278,7 @@ const onDataSaved = () => { />
- { - +
diff --git a/src/pages/Entry/Card/EntryBasicData.vue b/src/pages/Entry/Card/EntryBasicData.vue index 9dc59ec21..a98a1227f 100644 --- a/src/pages/Entry/Card/EntryBasicData.vue +++ b/src/pages/Entry/Card/EntryBasicData.vue @@ -8,6 +8,8 @@ import FormModel from 'components/FormModel.vue'; import VnRow from 'components/ui/VnRow.vue'; import VnInput from 'src/components/common/VnInput.vue'; import VnSelectFilter from 'src/components/common/VnSelectFilter.vue'; +import VnSelectDialog from 'src/components/common/VnSelectDialog.vue'; +import FilterTravelForm from 'src/components/FilterTravelForm.vue'; import { toDate } from 'src/filters'; @@ -18,6 +20,10 @@ const suppliersOptions = ref([]); const travelsOptions = ref([]); const companiesOptions = ref([]); const currenciesOptions = ref([]); + +const onFilterTravelSelected = (formData, id) => { + formData.travelFk = id; +}; - +
diff --git a/src/pages/Worker/WorkerCreate.vue b/src/pages/Worker/WorkerCreate.vue index 5cc3993ea..0883995e6 100644 --- a/src/pages/Worker/WorkerCreate.vue +++ b/src/pages/Worker/WorkerCreate.vue @@ -7,7 +7,7 @@ import FormModel from 'components/FormModel.vue'; import VnRow from 'components/ui/VnRow.vue'; import VnInputDate from 'components/common/VnInputDate.vue'; import VnSelectFilter from 'src/components/common/VnSelectFilter.vue'; -import VnSelectCreate from 'src/components/common/VnSelectCreate.vue'; +import VnSelectDialog from 'src/components/common/VnSelectDialog.vue'; import CreateBankEntityForm from 'src/components/CreateBankEntityForm.vue'; import CustomerCreateNewPostcode from 'src/components/CreateNewPostcodeForm.vue'; import VnInput from 'src/components/common/VnInput.vue'; @@ -184,7 +184,7 @@ onMounted(async () => {
- { - +
{ :rules="validate('Worker.iban')" />
- { - +
From b8a56391228a063af726c87c4313a28e1aab5909 Mon Sep 17 00:00:00 2001 From: carlosfonseca Date: Thu, 25 Jan 2024 17:29:24 -0500 Subject: [PATCH 057/172] Se crea tarjeta de historial --- src/pages/Customer/Card/CustomerBalance.vue | 3 +- src/pages/Customer/Card/CustomerLog.vue | 252 +++++++++++++++++- src/pages/Customer/Card/CustomerNotes.vue | 34 +++ .../Customer/Card/CustomerRecoveries.vue | 33 +++ 4 files changed, 319 insertions(+), 3 deletions(-) diff --git a/src/pages/Customer/Card/CustomerBalance.vue b/src/pages/Customer/Card/CustomerBalance.vue index 5d296881f..65c260a02 100644 --- a/src/pages/Customer/Card/CustomerBalance.vue +++ b/src/pages/Customer/Card/CustomerBalance.vue @@ -146,6 +146,7 @@ onBeforeMount(() => { }); const getData = () => { + stateStore.rightDrawer = true; getReceipts(); getClientRisks(); }; @@ -158,7 +159,6 @@ const getReceipts = async () => { }; const { data } = await axios.get('Receipts/filter', { params }); rows.value = data; - stateStore.rightDrawer = true; }; const getClientRisks = async () => { @@ -170,7 +170,6 @@ const getClientRisks = async () => { params: { filter: JSON.stringify(filter) }, }); clientRisks.value = data; - console.log(clientRisks.value[0].amount); }; const showNewPaymentDialog = () => { diff --git a/src/pages/Customer/Card/CustomerLog.vue b/src/pages/Customer/Card/CustomerLog.vue index fe59bf2dc..4d0a0c838 100644 --- a/src/pages/Customer/Card/CustomerLog.vue +++ b/src/pages/Customer/Card/CustomerLog.vue @@ -1,3 +1,253 @@ + + + + +es: + Search: Buscar + Search by id or concept: xxx + Entity: Entidad + All: Todo + User: Usuario + System: Sistema + Changes: Cambios + Search by changes: xxx + Creates: Crea + Edits: Modifica + Deletes: Elimina + Accesses: Accede + Date: Fecha + To: Hasta + Quit filter: Quitar filtro + diff --git a/src/pages/Customer/Card/CustomerNotes.vue b/src/pages/Customer/Card/CustomerNotes.vue index 0909758f3..95c3befe8 100644 --- a/src/pages/Customer/Card/CustomerNotes.vue +++ b/src/pages/Customer/Card/CustomerNotes.vue @@ -6,6 +6,40 @@ import { date } from 'quasar'; import VnPaginate from 'src/components/ui/VnPaginate.vue'; +const response = { + fields: [ + 'id', + 'originFk', + 'userFk', + 'action', + 'changedModel', + 'oldInstance', + 'newInstance', + 'creationDate', + 'changedModel', + 'changedModelId', + 'changedModelValue', + 'description', + ], + include: [ + { + relation: 'user', + scope: { + fields: ['nickname', 'name', 'image'], + include: { relation: 'worker', scope: { fields: ['id'] } }, + }, + }, + ], + order: ['creationDate DESC', 'id DESC'], + limit: 20, + where: { + and: [ + { originFk: '1' }, + { userFk: { neq: null } }, + { action: { inq: ['insert', 'update', 'delete', 'select'] } }, + ], + }, +}; const { t } = useI18n(); const route = useRoute(); const router = useRouter(); diff --git a/src/pages/Customer/Card/CustomerRecoveries.vue b/src/pages/Customer/Card/CustomerRecoveries.vue index 7247145f2..df5c7f6e2 100644 --- a/src/pages/Customer/Card/CustomerRecoveries.vue +++ b/src/pages/Customer/Card/CustomerRecoveries.vue @@ -11,6 +11,39 @@ import { toCurrency } from 'src/filters'; import WorkerDescriptorProxy from 'src/pages/Worker/Card/WorkerDescriptorProxy.vue'; +const response = { + fields: [ + 'id', + 'originFk', + 'userFk', + 'action', + 'changedModel', + 'oldInstance', + 'newInstance', + 'creationDate', + 'changedModel', + 'changedModelId', + 'changedModelValue', + 'description', + ], + include: [ + { + relation: 'user', + scope: { + fields: ['nickname', 'name', 'image'], + include: { relation: 'worker', scope: { fields: ['id'] } }, + }, + }, + ], + order: ['creationDate DESC', 'id DESC'], + limit: 20, + where: { + and: [ + { originFk: '1' }, + { action: { inq: ['insert', 'update', 'delete', 'select'] } }, + ], + }, +}; const { t } = useI18n(); const route = useRoute(); const router = useRouter(); From 9f9835b7ab8d1a1d21945c82ff94ae2eb7e33352 Mon Sep 17 00:00:00 2001 From: JAVIER SEGARRA MARTINEZ Date: Fri, 26 Jan 2024 07:56:41 +0000 Subject: [PATCH 058/172] refs #6280: remove related code to filter-rules --- src/components/common/VnSelectFilter.vue | 15 ++------------- 1 file changed, 2 insertions(+), 13 deletions(-) diff --git a/src/components/common/VnSelectFilter.vue b/src/components/common/VnSelectFilter.vue index a7ac4a7cd..7f10f5efe 100644 --- a/src/components/common/VnSelectFilter.vue +++ b/src/components/common/VnSelectFilter.vue @@ -12,15 +12,11 @@ const $props = defineProps({ default: () => [], }, optionLabel: { - type: [String, Function], + type: [String], default: '', }, filterOptions: { - type: [Array, Function], - default: () => [], - }, - filterRules: { - type: [Array, Function], + type: [Array], default: () => [], }, isClearable: { @@ -57,13 +53,6 @@ const filter = (val, options) => { const search = val.toString().toLowerCase(); if (!search) return options; - if($props.filterRules.length) { - const passSomeRule = $props.filterRules.some((rule) => { - const cond = eval(rule) - return cond; - }); - if(!passSomeRule) return options - } return options.filter((row) => { if ($props.filterOptions.length) { From c731b5b9893bc5443cb8b48c106c19a049f3fcc4 Mon Sep 17 00:00:00 2001 From: JAVIER SEGARRA MARTINEZ Date: Fri, 26 Jan 2024 08:04:08 +0000 Subject: [PATCH 059/172] refs #6280: replace function event --- src/components/common/VnLocation.vue | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/src/components/common/VnLocation.vue b/src/components/common/VnLocation.vue index a7a58e2b8..0b30faaa7 100644 --- a/src/components/common/VnLocation.vue +++ b/src/components/common/VnLocation.vue @@ -81,9 +81,6 @@ function handleFetch( data) { postcodesOptions.value = data; } -async function onPostcodeCreated(){ - locationFilter() -}; s