From 68e49e2ffa654feedb21856351394295c2b676b2 Mon Sep 17 00:00:00 2001 From: pablone Date: Fri, 7 Jun 2024 07:52:50 +0200 Subject: [PATCH 1/5] fix: refs #7129 fix some issues on load and tools --- src/i18n/locale/en.yml | 12 ++++++++ src/i18n/locale/es.yml | 13 ++++++++ src/pages/Route/Card/RouteFilter.vue | 1 + src/pages/Route/RouteAutonomous.vue | 16 ++++++++-- src/pages/Route/RouteList.vue | 46 +++++++++++++++------------- src/pages/Route/RouteTickets.vue | 3 -- 6 files changed, 64 insertions(+), 27 deletions(-) diff --git a/src/i18n/locale/en.yml b/src/i18n/locale/en.yml index 95bd871aa..17a2dd860 100644 --- a/src/i18n/locale/en.yml +++ b/src/i18n/locale/en.yml @@ -979,6 +979,18 @@ route: shipped: Preparation date viewCmr: View CMR downloadCmrs: Download CMRs + columnLabels: + ID: Id + vehicle: Vehicle + description: Description + isServed: Served + worker: Worker + date: Date + started: Started + actions: Actions + agency: Agency + volume: Volume + finished: Finished supplier: pageTitles: suppliers: Suppliers diff --git a/src/i18n/locale/es.yml b/src/i18n/locale/es.yml index 0cbcc984b..56c526f8b 100644 --- a/src/i18n/locale/es.yml +++ b/src/i18n/locale/es.yml @@ -101,6 +101,7 @@ globals: zonesList: Zonas deliveryList: Días de entrega upcomingList: Próximos repartos + workers: Trabajadores created: Fecha creación worker: Trabajador now: Ahora @@ -967,6 +968,18 @@ route: shipped: Fecha preparación viewCmr: Ver CMR downloadCmrs: Descargar CMRs + columnLabels: + Id: Id + vehicle: Vehículo + description: Descripción + isServed: Servida + worker: Trabajador + date: Fecha + started: Iniciada + actions: Acciones + agency: Agencia + volume: Volumen + finished: Finalizada supplier: pageTitles: suppliers: Proveedores diff --git a/src/pages/Route/Card/RouteFilter.vue b/src/pages/Route/Card/RouteFilter.vue index 050e7c71d..f0215370f 100644 --- a/src/pages/Route/Card/RouteFilter.vue +++ b/src/pages/Route/Card/RouteFilter.vue @@ -240,4 +240,5 @@ es: From: Desde To: Hasta Served: Servida + Days Onward: Días en adelante diff --git a/src/pages/Route/RouteAutonomous.vue b/src/pages/Route/RouteAutonomous.vue index 238dce070..f34e0671f 100644 --- a/src/pages/Route/RouteAutonomous.vue +++ b/src/pages/Route/RouteAutonomous.vue @@ -38,7 +38,7 @@ const selectedRows = ref([]); const columns = computed(() => [ { name: 'ID', - label: t('ID'), + label: 'Id', field: (row) => row.routeFk, sortable: true, align: 'left', @@ -116,7 +116,11 @@ const columns = computed(() => [ const refreshKey = ref(0); -const total = computed(() => selectedRows.value.reduce((item) => item?.price || 0, 0)); +const total = ref(() => { + console.log('selectedRows.value: ', selectedRows.value); + return selectedRows.value.reduce((item) => item?.price || 0, 0); +}); +console.log('total: ', total); const openDmsUploadDialog = async () => { dmsDialog.value.rowsToCreateInvoiceIn = selectedRows.value @@ -225,6 +229,7 @@ function navigateToRouteSummary(event, row) { + {{ total }} es: diff --git a/src/pages/Route/RouteList.vue b/src/pages/Route/RouteList.vue index 3e7c14dd1..c3788eef1 100644 --- a/src/pages/Route/RouteList.vue +++ b/src/pages/Route/RouteList.vue @@ -22,18 +22,27 @@ import RouteListTicketsDialog from 'pages/Route/Card/RouteListTicketsDialog.vue' import { useQuasar } from 'quasar'; import { useArrayData } from 'composables/useArrayData'; -const stateStore = useStateStore(); const { t } = useI18n(); const { validate } = useValidator(); +const { viewSummary } = useSummaryDialog(); +const stateStore = useStateStore(); const quasar = useQuasar(); const session = useSession(); -const { viewSummary } = useSummaryDialog(); +const paginate = ref(); const visibleColumns = ref([]); const selectedRows = ref([]); +const workers = ref([]); +const agencyList = ref([]); +const vehicleList = ref([]); +const allColumnNames = ref([]); +const confirmationDialog = ref(false); +const startingDate = ref(null); +const refreshKey = ref(0); + const columns = computed(() => [ { - name: 'ID', - label: t('ID'), + name: 'Id', + label: t('Id'), field: (row) => row.id, sortable: true, align: 'center', @@ -108,14 +117,12 @@ const columns = computed(() => [ align: 'right', }, ]); + const arrayData = useArrayData('EntryLatestBuys', { url: 'Buys/latestBuysFilter', order: ['itemFk DESC'], }); -const refreshKey = ref(0); -const workers = ref([]); -const agencyList = ref([]); -const vehicleList = ref([]); + const updateRoute = async (route) => { try { return await axios.patch(`Routes/${route.id}`, route); @@ -123,9 +130,6 @@ const updateRoute = async (route) => { return err; } }; -const allColumnNames = ref([]); -const confirmationDialog = ref(false); -const startingDate = ref(null); const cloneRoutes = () => { axios.post('Routes/clone', { @@ -134,6 +138,7 @@ const cloneRoutes = () => { }); refreshKey.value++; startingDate.value = null; + paginate.value.fetch(); }; const showRouteReport = () => { @@ -153,15 +158,13 @@ const showRouteReport = () => { window.open(url, '_blank'); }; -const markAsServed = () => { - selectedRows.value.forEach((row) => { - if (row?.id) { - axios.patch(`Routes/${row?.id}`, { isOk: true }); - } +function markAsServed() { + selectedRows.value.forEach(async (row) => { + if (row?.id) await axios.patch(`Routes/${row?.id}`, { isOk: true }); }); refreshKey.value++; startingDate.value = null; -}; +} const openTicketsDialog = (id) => { if (!id) { @@ -178,11 +181,9 @@ const openTicketsDialog = (id) => { }; onMounted(async () => { - stateStore.rightDrawer = true; allColumnNames.value = columns.value.map((col) => col.name); await arrayData.fetch({ append: false }); }); -onUnmounted(() => (stateStore.rightDrawer = false)); @@ -274,7 +275,7 @@ onUnmounted(() => (stateStore.rightDrawer = false)); color="primary" class="q-mr-sm" :disable="!selectedRows?.length" - @click="markAsServed" + @click="markAsServed()" > {{ t('Mark as served') }} @@ -518,7 +519,6 @@ en: hourStarted: Started hour hourFinished: Finished hour es: - ID: ID Worker: Trabajador Agency: Agencia Vehicle: Vehículo @@ -539,4 +539,6 @@ es: Summary: Resumen Route is closed: La ruta está cerrada Route is not served: La ruta no está servida + hourStarted: Hora de inicio + hourFinished: Hora de fin diff --git a/src/pages/Route/RouteTickets.vue b/src/pages/Route/RouteTickets.vue index 0efcd6e0c..ba3e855d6 100644 --- a/src/pages/Route/RouteTickets.vue +++ b/src/pages/Route/RouteTickets.vue @@ -15,14 +15,11 @@ import VnConfirm from 'components/ui/VnConfirm.vue'; import FetchData from 'components/FetchData.vue'; import { openBuscaman } from 'src/utils/buscaman'; import SendSmsDialog from 'components/common/SendSmsDialog.vue'; -import RouteSearchbar from 'pages/Route/Card/RouteSearchbar.vue'; -import { useStateStore } from 'stores/useStateStore'; const { t } = useI18n(); const quasar = useQuasar(); const route = useRoute(); -const stateStore = useStateStore(); const selectedRows = ref([]); const columns = computed(() => [ { From 20e0c84035156d635b8e2fc55d8034aca426bcce Mon Sep 17 00:00:00 2001 From: pablone Date: Fri, 14 Jun 2024 13:10:47 +0200 Subject: [PATCH 2/5] fix: refs #7129 fix module routes --- src/i18n/locale/en.yml | 2 +- src/pages/Claim/Card/ClaimLines.vue | 2 +- src/pages/Route/Roadmap/RoadmapSummary.vue | 3 ++- src/pages/Route/RouteAutonomous.vue | 16 ++++++++++++---- src/pages/Route/RouteRoadmap.vue | 3 ++- 5 files changed, 18 insertions(+), 8 deletions(-) diff --git a/src/i18n/locale/en.yml b/src/i18n/locale/en.yml index 65a0dd3df..5f57d2707 100644 --- a/src/i18n/locale/en.yml +++ b/src/i18n/locale/en.yml @@ -992,7 +992,7 @@ route: viewCmr: View CMR downloadCmrs: Download CMRs columnLabels: - ID: Id + Id: Id vehicle: Vehicle description: Description isServed: Served diff --git a/src/pages/Claim/Card/ClaimLines.vue b/src/pages/Claim/Card/ClaimLines.vue index 52fbfca98..4f2f6daf0 100644 --- a/src/pages/Claim/Card/ClaimLines.vue +++ b/src/pages/Claim/Card/ClaimLines.vue @@ -122,7 +122,7 @@ async function fetchMana() { } async function updateDiscount({ saleFk, discount, canceller }) { - const body = { salesIds: [saleFk], newDiscount: discount }; + const body = { salesIds: [saleFk], newDiscount: discount, manaCode: 'mana' }; const claimId = claim.value.ticketFk; const query = `Tickets/${claimId}/updateDiscount`; diff --git a/src/pages/Route/Roadmap/RoadmapSummary.vue b/src/pages/Route/Roadmap/RoadmapSummary.vue index e9969c2f7..6c397bcc1 100644 --- a/src/pages/Route/Roadmap/RoadmapSummary.vue +++ b/src/pages/Route/Roadmap/RoadmapSummary.vue @@ -67,6 +67,7 @@ const filter = { }, }, ], + where: { id: entityId }, }; const openAddStopDialog = () => { @@ -84,7 +85,7 @@ const openAddStopDialog = () => {