From 701f1e100f0de4d0a0a5ac4aea68686fdaf0ec66 Mon Sep 17 00:00:00 2001 From: Javier Segarra Date: Tue, 21 Nov 2023 12:50:05 +0100 Subject: [PATCH 01/86] 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 02/86] 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 03/86] 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 04/86] 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" /> + + + + {{ t('New consignee') }} + + diff --git a/src/components/common/VnSelectCreate.vue b/src/components/common/VnSelectDialog.vue similarity index 80% rename from src/components/common/VnSelectCreate.vue rename to src/components/common/VnSelectDialog.vue index bdc3f5cc8..2ec3d1b1a 100644 --- a/src/components/common/VnSelectCreate.vue +++ b/src/components/common/VnSelectDialog.vue @@ -20,6 +20,10 @@ const $props = defineProps({ type: Array, default: () => ['developer'], }, + actionIcon: { + type: String, + default: 'add', + }, }); const role = useRole(); @@ -48,9 +52,9 @@ const toggleForm = () => { diff --git a/src/i18n/en/index.js b/src/i18n/en/index.js index eb257e0c9..e9723ebb2 100644 --- a/src/i18n/en/index.js +++ b/src/i18n/en/index.js @@ -322,6 +322,12 @@ export default { booked: 'Booked', raid: 'Raid', excludedFromAvailable: 'Inventory', + agency: 'Agency', + warehouseOut: 'Warehouse Out', + warehouseIn: 'Warehouse In', + shipped: 'Shipped', + landed: 'Landed', + id: 'ID', }, buys: { groupingPrice: 'Grouping price', diff --git a/src/i18n/es/index.js b/src/i18n/es/index.js index 5141fff4e..86d56ba3e 100644 --- a/src/i18n/es/index.js +++ b/src/i18n/es/index.js @@ -321,6 +321,12 @@ export default { booked: 'Asentado', raid: 'Redada', excludedFromAvailable: 'Inventario', + agency: 'Agencia', + warehouseOut: 'Alm. salida', + warehouseIn: 'Alm. entrada', + shipped: 'F. envío', + landed: 'F. entrega', + id: 'ID', }, buys: { groupingPrice: 'Precio grouping', diff --git a/src/pages/Customer/Card/CustomerBillingData.vue b/src/pages/Customer/Card/CustomerBillingData.vue index a455e6db2..94f089f7b 100644 --- a/src/pages/Customer/Card/CustomerBillingData.vue +++ b/src/pages/Customer/Card/CustomerBillingData.vue @@ -10,7 +10,7 @@ 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 VnSelectCreate from 'src/components/common/VnSelectCreate.vue'; +import VnSelectDialog from 'src/components/common/VnSelectDialog.vue'; import CreateBankEntityForm from 'src/components/CreateBankEntityForm.vue'; const { t } = useI18n(); @@ -63,7 +63,7 @@ const getBankEntities = async () => {
- { - +
diff --git a/src/pages/Customer/Card/CustomerFiscalData.vue b/src/pages/Customer/Card/CustomerFiscalData.vue index 0edcc3c07..e5cdcb22a 100644 --- a/src/pages/Customer/Card/CustomerFiscalData.vue +++ b/src/pages/Customer/Card/CustomerFiscalData.vue @@ -9,7 +9,7 @@ import VnRow from 'components/ui/VnRow.vue'; import VnInput from 'src/components/common/VnInput.vue'; import VnSelectFilter from 'src/components/common/VnSelectFilter.vue'; import CustomerCreateNewPostcode from 'src/components/CreateNewPostcodeForm.vue'; -import VnSelectCreate from 'src/components/common/VnSelectCreate.vue'; +import VnSelectDialog from 'src/components/common/VnSelectDialog.vue'; const { t } = useI18n(); const route = useRoute(); @@ -114,7 +114,7 @@ const onPostcodeCreated = async ({ code, provinceFk, townFk, countryFk }, formDa
- - +
- - +
diff --git a/src/pages/Customer/components/CustomerConsigneeCreate.vue b/src/pages/Customer/components/CustomerConsigneeCreate.vue index 92ce47bf2..7bc6c2e88 100644 --- a/src/pages/Customer/components/CustomerConsigneeCreate.vue +++ b/src/pages/Customer/components/CustomerConsigneeCreate.vue @@ -10,7 +10,7 @@ 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 VnSelectCreate from 'src/components/common/VnSelectCreate.vue'; +import VnSelectDialog from 'src/components/common/VnSelectDialog.vue'; import CustomerCreateNewPostcode from 'src/components/CreateNewPostcodeForm.vue'; import CustomsNewCustomsAgent from 'src/pages/Customer/components/CustomerNewCustomsAgent.vue'; @@ -113,7 +113,7 @@ const toCustomerConsignees = () => {
- { - +
@@ -223,7 +223,7 @@ const toCustomerConsignees = () => { />
- { - +
diff --git a/src/pages/Customer/components/CustomerConsigneeEdit.vue b/src/pages/Customer/components/CustomerConsigneeEdit.vue index 43649c58e..98996e479 100644 --- a/src/pages/Customer/components/CustomerConsigneeEdit.vue +++ b/src/pages/Customer/components/CustomerConsigneeEdit.vue @@ -10,7 +10,7 @@ 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 VnSelectCreate from 'src/components/common/VnSelectCreate.vue'; +import VnSelectDialog from 'src/components/common/VnSelectDialog.vue'; import CustomerCreateNewPostcode from 'src/components/CreateNewPostcodeForm.vue'; import CustomsNewCustomsAgent from 'src/pages/Customer/components/CustomerNewCustomsAgent.vue'; @@ -168,7 +168,7 @@ const onDataSaved = () => {
- { - +
@@ -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 12/86] 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 ed926189dde3128c6a90d66254030a7a840a4f7f Mon Sep 17 00:00:00 2001 From: carlosfonseca Date: Fri, 26 Jan 2024 10:47:36 -0500 Subject: [PATCH 13/86] Correcciones solicitadas en la revision del pr --- src/pages/Customer/Card/CustomerBalance.vue | 64 +++++++++---------- .../components/CustomerNewPayment.vue | 2 +- 2 files changed, 33 insertions(+), 33 deletions(-) diff --git a/src/pages/Customer/Card/CustomerBalance.vue b/src/pages/Customer/Card/CustomerBalance.vue index 5d296881f..184667d6e 100644 --- a/src/pages/Customer/Card/CustomerBalance.vue +++ b/src/pages/Customer/Card/CustomerBalance.vue @@ -1,9 +1,8 @@ -{ - "en": { - "deleteShelving": "Delete Shelving" - }, - "es": { - "deleteShelving": "Eliminar carro" - } -} +es: + Confirm deletion: Confirmar eliminación + Are you sure you want to delete this shelving?: ¿Seguro que quieres eliminar este carro? + Delete Shelving: Eliminar carro diff --git a/src/pages/Shelving/Card/ShelvingFilter.vue b/src/pages/Shelving/Card/ShelvingFilter.vue index 423402f89..d4ec41e15 100644 --- a/src/pages/Shelving/Card/ShelvingFilter.vue +++ b/src/pages/Shelving/Card/ShelvingFilter.vue @@ -112,9 +112,11 @@ en: parkingFk: Parking userFk: Worker isRecyclable: Recyclable + search: Search es: params: parkingFk: Parking userFk: Trabajador isRecyclable: Reciclable + search: Contiene diff --git a/src/pages/Shelving/Card/ShelvingSearchbar.vue b/src/pages/Shelving/Card/ShelvingSearchbar.vue index 89a4de01e..829d7719c 100644 --- a/src/pages/Shelving/Card/ShelvingSearchbar.vue +++ b/src/pages/Shelving/Card/ShelvingSearchbar.vue @@ -7,12 +7,12 @@ const { t } = useI18n(); - es: Search shelving: Buscar carros diff --git a/src/pages/Shelving/Card/ShelvingSummary.vue b/src/pages/Shelving/Card/ShelvingSummary.vue index f1f914385..5f93c4a02 100644 --- a/src/pages/Shelving/Card/ShelvingSummary.vue +++ b/src/pages/Shelving/Card/ShelvingSummary.vue @@ -24,7 +24,7 @@ const hideRightDrawer = () => { if (!isDialog) { stateStore.rightDrawer = false; } -} +}; onMounted(hideRightDrawer); onUnmounted(hideRightDrawer); const filter = { @@ -69,9 +69,13 @@ const filter = {