From 4effba1580c4afa70c1fe2c01e3685a0b8e5b420 Mon Sep 17 00:00:00 2001 From: wbuezas Date: Mon, 24 Jun 2024 16:38:41 -0300 Subject: [PATCH 01/87] Ticket dms --- src/i18n/locale/en.yml | 1 + src/i18n/locale/es.yml | 1 + src/pages/Ticket/Card/TicketDms.vue | 13 +++++++++++++ src/router/modules/ticket.js | 11 ++++++++++- 4 files changed, 25 insertions(+), 1 deletion(-) create mode 100644 src/pages/Ticket/Card/TicketDms.vue diff --git a/src/i18n/locale/en.yml b/src/i18n/locale/en.yml index b3a85eefa..63d5f630a 100644 --- a/src/i18n/locale/en.yml +++ b/src/i18n/locale/en.yml @@ -443,6 +443,7 @@ ticket: sms: Sms notes: Notes sale: Sale + dms: File management list: nickname: Nickname state: State diff --git a/src/i18n/locale/es.yml b/src/i18n/locale/es.yml index d03ee9d5c..92b77a351 100644 --- a/src/i18n/locale/es.yml +++ b/src/i18n/locale/es.yml @@ -441,6 +441,7 @@ ticket: sms: Sms notes: Notas sale: Lineas del pedido + dms: Gestión documental list: nickname: Alias state: Estado diff --git a/src/pages/Ticket/Card/TicketDms.vue b/src/pages/Ticket/Card/TicketDms.vue new file mode 100644 index 000000000..ae44fb795 --- /dev/null +++ b/src/pages/Ticket/Card/TicketDms.vue @@ -0,0 +1,13 @@ + + diff --git a/src/router/modules/ticket.js b/src/router/modules/ticket.js index 6cb7291dc..05e323d50 100644 --- a/src/router/modules/ticket.js +++ b/src/router/modules/ticket.js @@ -12,7 +12,7 @@ export default { redirect: { name: 'TicketMain' }, menus: { main: ['TicketList'], - card: ['TicketBoxing', 'TicketSms', 'TicketSale'], + card: ['TicketBoxing', 'TicketSms', 'TicketSale', 'TicketDms'], }, children: [ { @@ -93,6 +93,15 @@ export default { }, component: () => import('src/pages/Ticket/Card/TicketSms.vue'), }, + { + path: 'dms', + name: 'TicketDms', + meta: { + title: 'dms', + icon: 'cloud_upload', + }, + component: () => import('src/pages/Ticket/Card/TicketDms.vue'), + }, ], }, ], From c500dd6346479852457472558403e5bdfcf6a1d1 Mon Sep 17 00:00:00 2001 From: wbuezas Date: Mon, 24 Jun 2024 16:58:26 -0300 Subject: [PATCH 02/87] Add allow import feature in VnDmsList --- src/components/common/VnDmsImportForm.vue | 81 +++++++++++++++++++++++ src/components/common/VnDmsList.vue | 12 ++++ src/pages/Ticket/Card/TicketDms.vue | 1 + 3 files changed, 94 insertions(+) create mode 100644 src/components/common/VnDmsImportForm.vue diff --git a/src/components/common/VnDmsImportForm.vue b/src/components/common/VnDmsImportForm.vue new file mode 100644 index 000000000..b31197bbc --- /dev/null +++ b/src/components/common/VnDmsImportForm.vue @@ -0,0 +1,81 @@ + + + + + +es: + Select document id: Introduzca id de gestion documental + Document: Documento + The document indentifier can't be empty: El número de documento no puede estar vacío + diff --git a/src/components/common/VnDmsList.vue b/src/components/common/VnDmsList.vue index 769ba9959..0576ba266 100644 --- a/src/components/common/VnDmsList.vue +++ b/src/components/common/VnDmsList.vue @@ -3,6 +3,7 @@ import { ref, computed } from 'vue'; import { useI18n } from 'vue-i18n'; import { useRoute } from 'vue-router'; import { useQuasar, QCheckbox, QBtn, QInput } from 'quasar'; +import VnDmsImportForm from 'src/components/common/VnDmsImportForm.vue'; import axios from 'axios'; import VnPaginate from 'components/ui/VnPaginate.vue'; @@ -18,6 +19,7 @@ const { t } = useI18n(); const rows = ref(); const dmsRef = ref(); const formDialog = ref({}); +const showImportDialog = ref(false); const $props = defineProps({ model: { @@ -45,6 +47,10 @@ const $props = defineProps({ type: String, required: true, }, + allowImport: { + type: Boolean, + default: false, + }, }); const dmsFilter = { @@ -373,9 +379,15 @@ function shouldRenderButton(button, isExternal = false) { :description="$props.description" /> + + + + + + From 4a01f1d930b750c82b7ed6979b28a3aa2ad589c4 Mon Sep 17 00:00:00 2001 From: Javier Segarra Date: Thu, 4 Jul 2024 10:40:11 +0200 Subject: [PATCH 11/87] perf: cleancode --- src/pages/Ticket/Card/TicketSaleTracking.vue | 66 +++++++------------- 1 file changed, 23 insertions(+), 43 deletions(-) diff --git a/src/pages/Ticket/Card/TicketSaleTracking.vue b/src/pages/Ticket/Card/TicketSaleTracking.vue index 823fe762f..858a35e61 100644 --- a/src/pages/Ticket/Card/TicketSaleTracking.vue +++ b/src/pages/Ticket/Card/TicketSaleTracking.vue @@ -246,9 +246,9 @@ const saleTrackingNew = async (sale, stateCode, isChecked) => { try { const params = { saleFk: sale.saleFk, - isChecked: isChecked, + isChecked, quantity: sale.quantity, - stateCode: stateCode, + stateCode, }; await axios.post(`SaleTrackings/new`, params); notify(t('globals.dataSaved'), 'positive'); @@ -257,10 +257,10 @@ const saleTrackingNew = async (sale, stateCode, isChecked) => { } }; -const saleTrackingDel = async (sale, stateCode) => { +const saleTrackingDel = async ({ saleFk }, stateCode) => { try { const params = { - saleFk: sale.saleFk, + saleFk, stateCodes: [stateCode], }; await axios.post(`SaleTrackings/delete`, params); @@ -284,14 +284,8 @@ const clickSaleGroupDetail = async (sale) => { const clickPreviousSelected = (sale) => { try { - if (!sale.isPreviousSelected) { - saleTrackingNew(sale, 'PREVIOUS_PREPARATION', false); - sale.isPreviousSelected = true; - } else { - saleTrackingDel(sale, 'PREVIOUS_PREPARATION'); - sale.isPreviousSelected = false; - sale.isPrevious = false; - } + qCheckBoxController(sale, 'isPreviousSelected'); + if (!sale.isPreviousSelected) sale.isPrevious = false; } catch (error) { console.error(error); } @@ -299,41 +293,28 @@ const clickPreviousSelected = (sale) => { const clickPrevious = (sale) => { try { - if (!sale.isPrevious) { - saleTrackingNew(sale, 'PREVIOUS_PREPARATION', true); - sale.isPrevious = true; - sale.isPreviousSelected = true; - } else { - saleTrackingNew(sale, 'PREVIOUS_PREPARATION', false); - sale.isPrevious = false; - } + qCheckBoxController(sale, 'isPrevious'); + if (sale.isPrevious) sale.isPreviousSelected = true; } catch (error) { console.error(error); } }; -const clickPrepared = (sale) => { +const qCheckBoxController = (sale, action) => { + const STATE_CODES = { + isControled: 'CHECKED', + isPrepared: 'PREPARED', + isPrevious: 'PREVIOUS_PREPARATION', + isPreviousSelected: 'PREVIOUS_PREPARATION', + }; + const stateCode = STATE_CODES[action]; try { - if (!sale.isPrepared) { - saleTrackingNew(sale, 'PREPARED', true); - sale.isPrepared = true; + if (!sale[action]) { + saleTrackingNew(sale, stateCode, true); + sale[action] = true; } else { - saleTrackingDel(sale, 'PREPARED'); - sale.isPrepared = false; - } - } catch (error) { - console.error(error); - } -}; - -const clickControled = (sale) => { - try { - if (!sale.isControled) { - saleTrackingNew(sale, 'CHECKED', true); - sale.isControled = true; - } else { - saleTrackingDel(sale, 'CHECKED'); - sale.isControled = false; + saleTrackingDel(sale, stateCode); + sale[action] = false; } } catch (error) { console.error(error); @@ -403,7 +384,7 @@ const clickControled = (sale) => { color="warning" class="warning" :toggle-indeterminate="false" - @update:model-value="clickPrepared(row)" + @update:model-value="qCheckBoxController(row, 'isPrepared')" > {{ t('ticketSaleTracking.prepared') }} @@ -413,9 +394,8 @@ const clickControled = (sale) => { :model-value="!!row.isControled" color="yellow" class="yellow" - style="stroke: red" :toggle-indeterminate="false" - @update:model-value="clickControled(row)" + @update:model-value="qCheckBoxController(row, 'isControled')" > {{ t('ticketSaleTracking.checked') }} From 0adbd3e6d24c6efab9ab108cf42c606b0ee8d66b Mon Sep 17 00:00:00 2001 From: wbuezas Date: Fri, 5 Jul 2024 11:29:06 -0300 Subject: [PATCH 12/87] Ticket advance filter --- src/composables/useArrayData.js | 18 ++- src/pages/Ticket/TicketAdvance.vue | 19 ++- src/pages/Ticket/TicketAdvanceFilter.vue | 172 +++++++++++++++++++++++ 3 files changed, 200 insertions(+), 9 deletions(-) create mode 100644 src/pages/Ticket/TicketAdvanceFilter.vue diff --git a/src/composables/useArrayData.js b/src/composables/useArrayData.js index 0fcbbbb48..d1d708f9b 100644 --- a/src/composables/useArrayData.js +++ b/src/composables/useArrayData.js @@ -177,10 +177,20 @@ export function useArrayData(key = useRoute().meta.moduleName, userOptions) { delete store.userParams[param]; delete params[param]; if (store.filter?.where) { - const key = Object.keys(exprBuilder ? exprBuilder(param) : param); - if (key[0]) delete store.filter.where[key[0]]; - if (Object.keys(store.filter.where).length === 0) { - delete store.filter.where; + let key; + if (exprBuilder) { + const result = exprBuilder(param); + if (result !== undefined && result !== null) + key = Object.keys(result); + } else { + if (typeof param === 'object' && param !== null) + key = Object.keys(param); + } + if (key && key[0]) { + delete store.filter.where[key[0]]; + if (Object.keys(store.filter.where).length === 0) { + delete store.filter.where; + } } } } diff --git a/src/pages/Ticket/TicketAdvance.vue b/src/pages/Ticket/TicketAdvance.vue index 8b0a426dd..bb9a8c8a8 100644 --- a/src/pages/Ticket/TicketAdvance.vue +++ b/src/pages/Ticket/TicketAdvance.vue @@ -9,6 +9,8 @@ import TicketDescriptorProxy from 'src/pages/Ticket/Card/TicketDescriptorProxy.v import VnSubToolbar from 'src/components/ui/VnSubToolbar.vue'; import VnSearchbar from 'src/components/ui/VnSearchbar.vue'; import VnProgress from 'src/components/common/VnProgressModal.vue'; +import RightMenu from 'src/components/common/RightMenu.vue'; +import TicketAdvanceFilter from './TicketAdvanceFilter.vue'; import { dashIfEmpty, toCurrency } from 'src/filters'; import { useVnConfirm } from 'composables/useVnConfirm'; @@ -42,9 +44,9 @@ const exprBuilder = (param, value) => { case 'notMovableLines': case 'futureZoneFk': return { [param]: value }; - case 'ipt': + case 'iptColFilter': return { ipt: { like: `%${value}%` } }; - case 'futureIpt': + case 'futureIptColFilter': return { futureIpt: { like: `%${value}%` } }; } }; @@ -55,6 +57,7 @@ const arrayData = useArrayData('AdvanceTickets', { url: 'Tickets/getTicketsAdvance', userParams: userParams, exprBuilder: exprBuilder, + limit: 0, }); const { store } = arrayData; const tickets = computed(() => @@ -110,7 +113,7 @@ const ticketColumns = computed(() => [ sortable: true, columnFilter: { component: VnSelect, - filterParamKey: 'ipt', + filterParamKey: 'iptColFilter', type: 'select', filterValue: null, event: getInputEvents, @@ -194,7 +197,7 @@ const ticketColumns = computed(() => [ sortable: true, columnFilter: { component: VnSelect, - filterParamKey: 'futureIpt', + filterParamKey: 'futureIptColFilter', type: 'select', filterValue: null, event: getInputEvents, @@ -451,7 +454,8 @@ onMounted(async () => { userParams.dateFuture = tomorrow; userParams.dateToAdvance = today; userParams.warehouseFk = user.value.warehouseFk; - await arrayData.addFilter({ userParams }); + const filter = { limit: 0 }; + await arrayData.addFilter({ filter, userParams }); }); @@ -521,6 +525,11 @@ onMounted(async () => { + + + +import { ref } from 'vue'; +import { useI18n } from 'vue-i18n'; + +import FetchData from 'components/FetchData.vue'; +import VnFilterPanel from 'src/components/ui/VnFilterPanel.vue'; +import VnSelect from 'components/common/VnSelect.vue'; +import VnInputDate from 'src/components/common/VnInputDate.vue'; + +import axios from 'axios'; +import { onMounted } from 'vue'; + +const { t } = useI18n(); +const props = defineProps({ + dataKey: { + type: String, + required: true, + }, + exprBuilder: { + type: Function, + default: null, + }, +}); + +const warehousesOptions = ref([]); +const itemPackingTypes = ref([]); + +const getItemPackingTypes = async () => { + try { + const filter = { + where: { isActive: true }, + }; + const { data } = await axios.get('ItemPackingTypes', { + params: { filter: JSON.stringify(filter) }, + }); + itemPackingTypes.value = data.map((ipt) => ({ + description: t(ipt.description), + code: ipt.code, + })); + } catch (error) { + console.error(error); + } +}; + +onMounted(async () => await getItemPackingTypes()); + + + + + +en: + iptInfo: IPT + params: + dateFuture: Origin date + dateToAdvance: Destination date + futureIpt: Origin IPT + ipt: Destination IPT + itemPackingTypes: 100% movable + warehouseFk: Warehouse +es: + Horizontal: Horizontal + Vertical: Vertical + iptInfo: Encajado + params: + dateFuture: Origin date + dateToAdvance: Destination date + futureIpt: Origin IPT + ipt: Destination IPT + itemPackingTypes: 100% movable + warehouseFk: Warehouse + From 1cfa2edc01ec031dfc8a7749428df7f5ce17b4a9 Mon Sep 17 00:00:00 2001 From: Javier Segarra Date: Fri, 5 Jul 2024 21:18:41 +0200 Subject: [PATCH 13/87] fix: i18n --- src/pages/Ticket/TicketAdvanceFilter.vue | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/src/pages/Ticket/TicketAdvanceFilter.vue b/src/pages/Ticket/TicketAdvanceFilter.vue index beb321538..7b95595a4 100644 --- a/src/pages/Ticket/TicketAdvanceFilter.vue +++ b/src/pages/Ticket/TicketAdvanceFilter.vue @@ -163,10 +163,10 @@ es: Vertical: Vertical iptInfo: Encajado params: - dateFuture: Origin date - dateToAdvance: Destination date - futureIpt: Origin IPT - ipt: Destination IPT - itemPackingTypes: 100% movable - warehouseFk: Warehouse + dateFuture: fecha origen + dateToAdvance: Fecha destino + futureIpt: IPT Origen + ipt: IPT destino + itemPackingTypes: 100% movible + warehouseFk: Almacén From 7393e51a940bb7a80aff2d92fb66c344acfe0e2b Mon Sep 17 00:00:00 2001 From: Javier Segarra Date: Mon, 8 Jul 2024 12:41:00 +0200 Subject: [PATCH 14/87] fix: when param not exists --- src/pages/Ticket/TicketAdvanceFilter.vue | 1 + 1 file changed, 1 insertion(+) diff --git a/src/pages/Ticket/TicketAdvanceFilter.vue b/src/pages/Ticket/TicketAdvanceFilter.vue index 7b95595a4..c4548763a 100644 --- a/src/pages/Ticket/TicketAdvanceFilter.vue +++ b/src/pages/Ticket/TicketAdvanceFilter.vue @@ -124,6 +124,7 @@ onMounted(async () => await getItemPackingTypes()); :label="t('params.itemPackingTypes')" v-model="params.itemPackingTypes" toggle-indeterminate + :false-value="null" @update:model-value="searchFn()" /> From e70adce488fccb4077e2d51dcd9907472d00bef0 Mon Sep 17 00:00:00 2001 From: Jon Date: Mon, 8 Jul 2024 13:15:14 +0200 Subject: [PATCH 15/87] feat: refs #7323 fix descriptors, added VnTable and minor changes --- src/components/ui/CardDescriptor.vue | 2 +- src/components/ui/QCalendarMonthWrapper.vue | 10 +- .../Department/Card/DepartmentDescriptor.vue | 6 +- src/pages/Entry/Card/EntryDescriptor.vue | 1 - .../InvoiceOut/Card/InvoiceOutDescriptor.vue | 2 +- src/pages/Route/Card/RouteDescriptor.vue | 1 - .../Shelving/Card/ShelvingDescriptor.vue | 1 - src/pages/Travel/Card/TravelDescriptor.vue | 1 - src/pages/Worker/Card/WorkerDescriptor.vue | 34 ++++- src/pages/Worker/Card/WorkerTimeControl.vue | 2 +- src/pages/Worker/Card/WorkerTimeForm.vue | 10 +- src/pages/Worker/WorkerList.vue | 141 +++++++++--------- src/pages/Worker/locale/en.yml | 5 + src/pages/Worker/locale/es.yml | 5 + src/pages/Zone/Card/ZoneDescriptor.vue | 1 - 15 files changed, 132 insertions(+), 90 deletions(-) diff --git a/src/components/ui/CardDescriptor.vue b/src/components/ui/CardDescriptor.vue index 2bb5234ad..480cf3afb 100644 --- a/src/components/ui/CardDescriptor.vue +++ b/src/components/ui/CardDescriptor.vue @@ -115,7 +115,7 @@ const toModule = computed(() => :icon="iconModule" color="white" class="link" - :to="toModule" + :to="$attrs['to-module'] ?? toModule" > {{ t('globals.goToModuleIndex') }} diff --git a/src/components/ui/QCalendarMonthWrapper.vue b/src/components/ui/QCalendarMonthWrapper.vue index bced893fe..ed3b32509 100644 --- a/src/components/ui/QCalendarMonthWrapper.vue +++ b/src/components/ui/QCalendarMonthWrapper.vue @@ -52,8 +52,8 @@ const containerClasses = computed(() => { --calendar-border-current: #84d0e2 2px solid; --calendar-current-color-dark: #84d0e2; // Colores de fondo del calendario en dark mode - --calendar-outside-background-dark: #222; - --calendar-background-dark: #222; + --calendar-outside-background-dark: var(--vn-section-color); + --calendar-background-dark: var(--vn-section-color); } // Clases para modificar el color de fecha seleccionada en componente QCalendarMonth @@ -68,10 +68,11 @@ const containerClasses = computed(() => { .q-calendar-month__head--weekday { // Transforma los nombres de los días de la semana a mayúsculas text-transform: capitalize; + color: var(--vn-label-color); } .transparent-background { - --calendar-background-dark: transparent; + // --calendar-background-dark: transparent; --calendar-background: transparent; --calendar-outside-background-dark: transparent; } @@ -124,6 +125,7 @@ const containerClasses = computed(() => { height: 32px; display: flex; justify-content: center; + color: var(--vn-label-color); } .q-calendar__button--bordered { @@ -147,7 +149,7 @@ const containerClasses = computed(() => { .q-calendar-month__head--workweek, .q-calendar-month__head--weekday.q-calendar__center.q-calendar__ellipsis { text-transform: capitalize; - color: $color-font-secondary; + color: var(--vn-label-color); font-weight: bold; font-size: 0.8rem; text-align: center; diff --git a/src/pages/Department/Card/DepartmentDescriptor.vue b/src/pages/Department/Card/DepartmentDescriptor.vue index b49f5f9e2..e914f6af6 100644 --- a/src/pages/Department/Card/DepartmentDescriptor.vue +++ b/src/pages/Department/Card/DepartmentDescriptor.vue @@ -24,7 +24,7 @@ const $props = defineProps({ const route = useRoute(); const router = useRouter(); - +const DepartmentDescriptorRef = ref(); const { t } = useI18n(); const { notify } = useNotify(); @@ -55,18 +55,20 @@ const { openConfirmationModal } = useVnConfirm();