diff --git a/src/i18n/en/index.js b/src/i18n/en/index.js index 285fb778f..bbc28cc6d 100644 --- a/src/i18n/en/index.js +++ b/src/i18n/en/index.js @@ -38,13 +38,14 @@ export default { rowAdded: 'Row added', rowRemoved: 'Row removed', pleaseWait: 'Please wait...', - noPinnedModules: 'You have dont have any pinned modules', + noPinnedModules: `You don't have any pinned modules`, summary: { basicData: 'Basic data', }, today: 'Today', yesterday: 'Yesterday', dateFormat: 'en-GB', + noSelectedRows: `You don't have any line selected`, }, errors: { statusUnauthorized: 'Access denied', @@ -491,15 +492,18 @@ export default { }, cmr: { list: { - total: 'Total records', - cmrFk: 'Cmr id', + results: 'results', + cmrFk: 'CMR id', hasCmrDms: `Attached in gestdoc`, true: 'Yes', false: 'No', ticketFk: 'Ticketd id', + routeFk: 'Route id', country: 'Country', clientFk: 'Client id', shipped: 'Preparation date', + viewCmr: 'View CMR', + downloadCmrs: 'Download CMRs', }, }, }, diff --git a/src/i18n/es/index.js b/src/i18n/es/index.js index 97001eab8..abf406e20 100644 --- a/src/i18n/es/index.js +++ b/src/i18n/es/index.js @@ -45,6 +45,7 @@ export default { today: 'Hoy', yesterday: 'Ayer', dateFormat: 'es-ES', + noSelectedRows: `No tienes ninguna línea seleccionada`, }, errors: { statusUnauthorized: 'Acceso denegado', @@ -491,15 +492,18 @@ export default { }, cmr: { list: { - total: 'Total registros', - cmrFk: 'Id cmr', + results: 'resultados', + cmrFk: 'Id CMR', hasCmrDms: 'Adjuntado en gestdoc', true: 'Sí', false: 'No', ticketFk: 'Id ticket', + routeFk: 'Id ruta', country: 'País', clientFk: 'Id cliente', shipped: 'Fecha preparación', + viewCmr: 'Ver CMR', + downloadCmrs: 'Descargar CMRs', }, }, }, diff --git a/src/pages/Route/Cmr/CmrFilter.vue b/src/pages/Route/Cmr/CmrFilter.vue index eeb111304..b8948652a 100644 --- a/src/pages/Route/Cmr/CmrFilter.vue +++ b/src/pages/Route/Cmr/CmrFilter.vue @@ -28,7 +28,11 @@ const countries = ref(); - + @@ -46,7 +50,11 @@ const countries = ref(); - + @@ -55,7 +63,24 @@ const countries = ref(); - + + + + + + + + @@ -78,9 +103,9 @@ const countries = ref(); emit-value map-options > - + @@ -99,7 +124,9 @@ const countries = ref(); transition-hide="rotate" > -
+
import { computed, ref } from 'vue'; import { useI18n } from 'vue-i18n'; +import { Notify } from 'quasar'; import { useStateStore } from 'stores/useStateStore'; import VnPaginate from 'components/ui/VnPaginate.vue'; import { useSession } from 'src/composables/useSession'; import { toDate } from 'filters/index'; import CmrFilter from './CmrFilter.vue'; +import TicketDescriptorProxy from 'pages/Ticket/Card/TicketDescriptorProxy.vue'; +import CustomerDescriptorProxy from 'pages/Customer/Card/CustomerDescriptorProxy.vue'; const stateStore = useStateStore(); const { t } = useI18n(); const session = useSession(); const token = session.getToken(); +const selected = ref([]); const columns = computed(() => [ { @@ -33,6 +37,12 @@ const columns = computed(() => [ field: (row) => row.ticketFk, sortable: true, }, + { + name: 'routeFkFk', + label: t('route.cmr.list.routeFk'), + field: (row) => row.routeFk, + sortable: true, + }, { name: 'clientFk', label: t('route.cmr.list.clientFk'), @@ -54,10 +64,31 @@ const columns = computed(() => [ sortable: true, headerStyle: 'padding-left: 33px', }, + { + name: 'icons', + align: 'center', + field: (row) => row.cmrFk, + }, ]); -function getProjectUrl() { +function getApiUrl() { return new URL(window.location).origin; } +function getCmrUrl(value) { + return `${getApiUrl()}/api/Routes/${value}/cmr?access_token=${token}`; +} +function downloadPdfs() { + if (!selected.value.length) { + Notify.create({ + message: t('globals.noSelectedRows'), + type: 'warning', + }); + return; + } + let cmrs = []; + for (let value of selected.value) cmrs.push(value.cmrFk); + // prettier-ignore + return window.open(`${getApiUrl()}/api/Routes/downloadCmrsZip?ids=${cmrs.join(',')}&access_token=${token}`); +}
+ + + + + {{ t('route.cmr.list.downloadCmrs') }} +
@@ -120,7 +181,7 @@ function getProjectUrl() { .list { padding-top: 15px; padding-bottom: 15px; - max-width: 900px; + max-width: 1000px; width: 100%; } .grid-style-transition {