From 701f1e100f0de4d0a0a5ac4aea68686fdaf0ec66 Mon Sep 17 00:00:00 2001 From: Javier Segarra Date: Tue, 21 Nov 2023 12:50:05 +0100 Subject: [PATCH 01/27] 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/27] 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/27] 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 c43e7011a4ab887a6e7682a8f3cdd34436511317 Mon Sep 17 00:00:00 2001 From: wbuezas Date: Thu, 25 Jan 2024 08:53:24 -0300 Subject: [PATCH 04/27] WIP --- src/css/app.scss | 10 +++++ src/i18n/en/index.js | 1 + src/i18n/es/index.js | 1 + src/pages/Entry/Card/EntryBasicData.vue | 3 +- src/pages/Entry/Card/EntryBuys.vue | 47 ++++++++++++++++++++++++ src/pages/Entry/Card/EntryCard.vue | 1 + src/pages/Entry/Card/EntryDescriptor.vue | 7 ---- src/pages/Entry/Card/EntryNotes.vue | 1 + src/pages/Entry/EntryCreate.vue | 23 ++++++++---- src/pages/Entry/EntryFilter.vue | 14 +++++-- src/pages/Entry/EntryMain.vue | 1 + 11 files changed, 90 insertions(+), 19 deletions(-) diff --git a/src/css/app.scss b/src/css/app.scss index b742dae2f..e7be2ddf2 100644 --- a/src/css/app.scss +++ b/src/css/app.scss @@ -67,3 +67,13 @@ body.body--dark { .q-field.required .q-field__label:after { content: ' *'; } + +input[type='number'] { + -moz-appearance: textfield; +} +input::-webkit-outer-spin-button, +input::-webkit-inner-spin-button { + appearance: none; + -webkit-appearance: none; + -moz-appearance: none; +} diff --git a/src/i18n/en/index.js b/src/i18n/en/index.js index 1a7a4c27e..eb257e0c9 100644 --- a/src/i18n/en/index.js +++ b/src/i18n/en/index.js @@ -266,6 +266,7 @@ export default { buys: 'Buys', notes: 'Notes', log: 'Log', + create: 'Create', }, list: { newEntry: 'New entry', diff --git a/src/i18n/es/index.js b/src/i18n/es/index.js index 83de42ee0..5141fff4e 100644 --- a/src/i18n/es/index.js +++ b/src/i18n/es/index.js @@ -265,6 +265,7 @@ export default { buys: 'Compras', notes: 'Notas', log: 'Historial', + create: 'Crear', }, list: { newEntry: 'Nueva entrada', diff --git a/src/pages/Entry/Card/EntryBasicData.vue b/src/pages/Entry/Card/EntryBasicData.vue index a5565fbf6..9dc59ec21 100644 --- a/src/pages/Entry/Card/EntryBasicData.vue +++ b/src/pages/Entry/Card/EntryBasicData.vue @@ -163,8 +163,9 @@ const currenciesOptions = ref([]); :label="t('entry.basicData.observation')" type="textarea" v-model="data.observation" + :maxlength="45" + counter fill-input - autogrow /> diff --git a/src/pages/Entry/Card/EntryBuys.vue b/src/pages/Entry/Card/EntryBuys.vue index 5eee14d29..c4427c09a 100644 --- a/src/pages/Entry/Card/EntryBuys.vue +++ b/src/pages/Entry/Card/EntryBuys.vue @@ -256,6 +256,33 @@ const deleteBuys = async () => { const importBuys = () => { router.push({ name: 'EntryBuysImport' }); }; + +const toggleGroupingMode = async (buy, mode) => { + try { + const grouping = 1; + const packing = 2; + const groupingMode = mode === 'grouping' ? grouping : packing; + + const newGroupingMode = buy.groupingMode === groupingMode ? 0 : groupingMode; + + const params = { + groupingMode: newGroupingMode, + }; + + await axios.patch(`Buys/${buy.id}`, params); + buy.groupingMode = newGroupingMode; + } catch (err) { + console.error('Error toggling grouping mode'); + } +}; + +const showLockIcon = (groupingMode, mode) => { + if (mode === 'packing') { + return groupingMode === 2 ? 'lock' : 'lock_open'; + } else { + return groupingMode === 1 ? 'lock' : 'lock_open'; + } +}; - +
- - +
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 21050362c88e4e6c58f047542f020ba817a0ad4d Mon Sep 17 00:00:00 2001 From: wbuezas Date: Fri, 26 Jan 2024 16:45:45 -0300 Subject: [PATCH 06/27] Add .json filter to ImportBuys QFile --- src/pages/Entry/Card/EntryBuysImport.vue | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/pages/Entry/Card/EntryBuysImport.vue b/src/pages/Entry/Card/EntryBuysImport.vue index 50f5aeae8..386e71c84 100644 --- a/src/pages/Entry/Card/EntryBuysImport.vue +++ b/src/pages/Entry/Card/EntryBuysImport.vue @@ -198,8 +198,9 @@ const redirectToBuysView = () => {
From 7d9b34d4c5cfb29acbaae6bfb4d4e9275cc61d99 Mon Sep 17 00:00:00 2001 From: wbuezas Date: Mon, 29 Jan 2024 08:39:46 -0300 Subject: [PATCH 07/27] Latest buys WIP --- src/components/common/TableVisibleColumns.vue | 2 +- src/i18n/en/index.js | 31 ++ src/i18n/es/index.js | 31 ++ src/pages/Entry/EntryLatestBuys.vue | 303 ++++++++++++++++++ src/pages/Entry/EntryList.vue | 11 + src/pages/Entry/EntryMain.vue | 13 - src/router/modules/entry.js | 11 +- 7 files changed, 387 insertions(+), 15 deletions(-) create mode 100644 src/pages/Entry/EntryLatestBuys.vue diff --git a/src/components/common/TableVisibleColumns.vue b/src/components/common/TableVisibleColumns.vue index d9a1a2004..7aa696a07 100644 --- a/src/components/common/TableVisibleColumns.vue +++ b/src/components/common/TableVisibleColumns.vue @@ -41,7 +41,7 @@ const setUserConfigViewData = (data) => { // Importante: El name de las columnas de la tabla debe conincidir con el name de las variables que devuelve la view config formattedCols.value = $props.allColumns.map((col) => ({ name: col, - active: data[col], + active: data[col] == undefined ? true : data[col], })); emitSavedConfig(); }; diff --git a/src/i18n/en/index.js b/src/i18n/en/index.js index e9723ebb2..9c25d2b16 100644 --- a/src/i18n/en/index.js +++ b/src/i18n/en/index.js @@ -267,6 +267,7 @@ export default { notes: 'Notes', log: 'Log', create: 'Create', + latestBuys: 'Latest buys', }, list: { newEntry: 'New entry', @@ -352,6 +353,36 @@ export default { landed: 'Landed', warehouseOut: 'Warehouse Out', }, + latestBuys: { + picture: 'Picture', + itemFk: 'Item ID', + packing: 'Packing', + grouping: 'Grouping', + quantity: 'Quantity', + description: 'Description', + size: 'Size', + tags: 'Tags', + type: 'Type', + intrastat: 'Intrastat', + origin: 'Origin', + weightByPiece: 'Weight/Piece', + isActive: 'Active', + family: 'Family', + entryFk: 'Entry', + buyingValue: 'Buying value', + freightValue: 'Freight value', + comissionValue: 'Commission value', + packageValue: 'Package value', + isIgnored: 'Is ignored', + price2: 'Grouping', + price3: 'Packing', + minPrice: 'Min', + ektFk: 'Ekt', + weight: 'Weight', + packagingFk: 'Package', + packingOut: 'Package out', + landing: 'Landing', + }, }, ticket: { pageTitles: { diff --git a/src/i18n/es/index.js b/src/i18n/es/index.js index 86d56ba3e..65f555877 100644 --- a/src/i18n/es/index.js +++ b/src/i18n/es/index.js @@ -266,6 +266,7 @@ export default { notes: 'Notas', log: 'Historial', create: 'Crear', + latestBuys: 'Últimas compras', }, list: { newEntry: 'Nueva entrada', @@ -351,6 +352,36 @@ export default { landed: 'F. entrega', warehouseOut: 'Alm. salida', }, + latestBuys: { + picture: 'Foto', + itemFk: 'ID Artículo', + packing: 'Packing', + grouping: 'Grouping', + quantity: 'Cantidad', + description: 'Descripción', + size: 'Medida', + tags: 'Etiquetas', + type: 'Tipo', + intrastat: 'Intrastat', + origin: 'Origen', + weightByPiece: 'Peso (gramos)/tallo', + isActive: 'Activo', + family: 'Familia', + entryFk: 'Entrada', + buyingValue: 'Coste', + freightValue: 'Porte', + comissionValue: 'Comisión', + packageValue: 'Embalaje', + isIgnored: 'Ignorado', + price2: 'Grouping', + price3: 'Packing', + minPrice: 'Min', + ektFk: 'Ekt', + weight: 'Peso', + packagingFk: 'Embalaje', + packingOut: 'Embalaje envíos', + landing: 'Llegada', + }, }, ticket: { pageTitles: { diff --git a/src/pages/Entry/EntryLatestBuys.vue b/src/pages/Entry/EntryLatestBuys.vue new file mode 100644 index 000000000..d60723403 --- /dev/null +++ b/src/pages/Entry/EntryLatestBuys.vue @@ -0,0 +1,303 @@ + + + + + +es: + diff --git a/src/pages/Entry/EntryList.vue b/src/pages/Entry/EntryList.vue index 0cf707efa..8bbab74db 100644 --- a/src/pages/Entry/EntryList.vue +++ b/src/pages/Entry/EntryList.vue @@ -9,6 +9,7 @@ import VnLv from 'src/components/ui/VnLv.vue'; import CardList from 'src/components/ui/CardList.vue'; import EntrySummaryDialog from './Card/EntrySummaryDialog.vue'; import EntryFilter from './EntryFilter.vue'; +import VnSearchbar from 'src/components/ui/VnSearchbar.vue'; import { useStateStore } from 'stores/useStateStore'; import { toDate } from 'src/filters/index'; @@ -41,6 +42,16 @@ onMounted(async () => {