From c43e7011a4ab887a6e7682a8f3cdd34436511317 Mon Sep 17 00:00:00 2001 From: wbuezas Date: Thu, 25 Jan 2024 08:53:24 -0300 Subject: [PATCH 01/22] 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 03/22] 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 04/22] 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 () => {