From 232827ef48f3aecbaf401721c5e1046471f23898 Mon Sep 17 00:00:00 2001 From: jorgep Date: Thu, 28 Dec 2023 16:02:04 +0100 Subject: [PATCH 01/10] 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" />