diff --git a/src/i18n/locale/en.yml b/src/i18n/locale/en.yml index a6065e451..8048b0365 100644 --- a/src/i18n/locale/en.yml +++ b/src/i18n/locale/en.yml @@ -209,7 +209,7 @@ globals: roadmap: Roadmap stops: Stops routes: Routes - cmrsList: CMRs + cmrsList: CMR RouteList: List routeCreate: New route RouteRoadmap: Roadmaps diff --git a/src/i18n/locale/es.yml b/src/i18n/locale/es.yml index 6f01f7dd1..08f110111 100644 --- a/src/i18n/locale/es.yml +++ b/src/i18n/locale/es.yml @@ -213,7 +213,7 @@ globals: roadmap: Troncales stops: Paradas routes: Rutas - cmrsList: CMRs + cmrsList: CMR RouteList: Listado routeCreate: Nueva ruta RouteRoadmap: Troncales diff --git a/src/pages/Route/Cmr/CmrBasicData.vue b/src/pages/Route/Cmr/CmrBasicData.vue new file mode 100644 index 000000000..eeefaca2c --- /dev/null +++ b/src/pages/Route/Cmr/CmrBasicData.vue @@ -0,0 +1,113 @@ + + + (supplierList = data)" + /> + + + + + + + + + + + + + + + + + {{ opt.id }} - {{ opt.nickname }} + + + + + + + + + + + + + + + + + + +es: + Roadmap: Troncal + ETD date: Fecha ETD + ETD hour: Hora ETD + Tractor plate: Matrícula tractora + Trailer plate: Matrícula remolque + Carrier: Transportista + Price: Precio + Driver name: Nombre del conductor + Phone: Teléfono + Observations: Observaciones + diff --git a/src/pages/Route/Cmr/CmrSummary.vue b/src/pages/Route/Cmr/CmrSummary.vue new file mode 100644 index 000000000..17c3c6a54 --- /dev/null +++ b/src/pages/Route/Cmr/CmrSummary.vue @@ -0,0 +1,156 @@ + + + + + + + + + + + + {{ `${entity?.id} - ${entity?.name}` }} + + + + + + + + {{ dashIfEmpty(entity?.supplier?.nickname) }} + + + + + + + + + + + {{ dashIfEmpty(entity?.phone) }} + + + + + + + + + + + + + + + + +es: + Carrier: Transportista + Tractor Plate: Matrícula tractora + Trailer Plate: Matrícula remolque + Phone: Teléfono + Worker: Trabajador + Observations: Observaciones + Stops: Paradas + Address: Dirección + Go to stops: Ir a paradas + Add stop: Añadir parada + diff --git a/src/pages/Route/Cmr/CmrList.vue b/src/pages/Route/RouteCmr.vue similarity index 65% rename from src/pages/Route/Cmr/CmrList.vue rename to src/pages/Route/RouteCmr.vue index ede271960..199028778 100644 --- a/src/pages/Route/Cmr/CmrList.vue +++ b/src/pages/Route/RouteCmr.vue @@ -3,18 +3,21 @@ import { onBeforeMount, onMounted, computed, ref } from 'vue'; import { useI18n } from 'vue-i18n'; import { Notify } from 'quasar'; import { useSession } from 'src/composables/useSession'; -import { toDateHourMin } from 'filters/index'; import { useStateStore } from 'src/stores/useStateStore'; import axios from 'axios'; import TicketDescriptorProxy from 'pages/Ticket/Card/TicketDescriptorProxy.vue'; import CustomerDescriptorProxy from 'pages/Customer/Card/CustomerDescriptorProxy.vue'; +import { toDateTimeFormat } from 'src/filters/date.js'; +import { toDate } from 'src/filters'; +import VnSearchbar from 'components/ui/VnSearchbar.vue'; import VnSubToolbar from 'src/components/ui/VnSubToolbar.vue'; import VnTable from 'components/VnTable/VnTable.vue'; const { t } = useI18n(); const { getTokenMultimedia } = useSession(); +const tableRef = ref(0); const token = getTokenMultimedia(); const state = useStateStore(); const warehouses = ref([]); @@ -30,66 +33,53 @@ const columns = computed(() => [ isId: true, }, { - align: 'center', - name: 'hasCmrDms', - label: t('route.cmr.list.hasCmrDms'), - component: 'checkbox', - cardVisible: true, - }, - { - align: 'left', - label: t('route.cmr.list.ticketFk'), - name: 'ticketFk', - }, - { - align: 'left', - label: t('route.cmr.list.routeFk'), - name: 'routeFk', - }, - { - align: 'left', - label: t('route.cmr.list.clientFk'), - name: 'clientFk', - }, - { - align: 'right', - label: t('route.cmr.list.country'), - name: 'countryFk', + label: t('route.cmr.list.sender'), + name: 'sender', + component: 'select', cardVisible: true, attrs: { - url: 'countries', - fields: ['id', 'name'], - optionLabel: 'name', - optionValue: 'id', + url: 'companies', + fields: ['code'], + optionLabel: 'code', + optionFilterValue: 'code', }, columnFilter: { inWhere: true, - component: 'select', }, - format: ({ countryName }) => countryName, + create: true, }, { - align: 'right', - label: t('route.cmr.list.shipped'), - name: 'shipped', - cardVisible: true, + name: 'loadingPlace', + label: t('route.cmr.list.loadingPlace'), + create: true, + }, + { + label: t('route.cmr.list.deliveryPlace'), + name: 'deliveryPlace', + }, + { + label: t('route.cmr.list.carrier'), + name: 'carrier', + }, + { + label: t('route.cmr.list.loadingDate'), + name: 'loadingDate', columnFilter: { component: 'date', - inWhere: true, }, - format: ({ shipped }) => toDateHourMin(shipped), + format: ({ loadingDate }) => toDateTimeFormat(loadingDate), }, { - align: 'right', - name: 'warehouseFk', - label: t('globals.warehouse'), + label: t('route.cmr.list.landingDate'), + name: 'landingDate', columnFilter: { - component: 'select', + component: 'date', }, - attrs: { - options: warehouses.value, - }, - format: ({ warehouseName }) => warehouseName, + format: ({ landingDate }) => toDate(landingDate), + }, + { + label: t('route.cmr.list.truckPlate'), + name: 'truckPlate', }, { align: 'center', @@ -116,7 +106,7 @@ function getApiUrl() { return new URL(window.location).origin; } function getCmrUrl(value) { - return `${getApiUrl()}/api/Routes/${value}/cmr?access_token=${token}`; + return `${getApiUrl()}/api/Cmrs/${value}/print?access_token=${token}`; } function downloadPdfs() { if (!selectedRows.value.length) { @@ -129,28 +119,35 @@ function downloadPdfs() { let cmrs = []; for (let value of selectedRows.value) cmrs.push(value.cmrFk); // prettier-ignore - return window.open(`${getApiUrl()}/api/Routes/downloadCmrsZip?ids=${cmrs.join(',')}&access_token=${token}`); + return window.open(`${getApiUrl()}/api/Cmrs/downloadZip?ids=${cmrs.join(',')}&access_token=${token}`); } + - {{ t('route.cmr.list.downloadCmrs') }} + {{ t('route.cmr.list.download') }} diff --git a/src/pages/Route/locale/en.yml b/src/pages/Route/locale/en.yml index d113fda67..079859858 100644 --- a/src/pages/Route/locale/en.yml +++ b/src/pages/Route/locale/en.yml @@ -25,15 +25,21 @@ route: Route is not served: Route is not served cmr: list: + searchCmr: Search cmr + youCanSearch: You can search by id results: results - cmrFk: CMR id - hasCmrDms: Attached in gestdoc - 'true': 'Yes' - 'false': 'No' + cmrFk: Id + sender: Sender + loadingPlace: Loading place + deliveryPlace: Delivery place + carrier: Carrier + loadingDate: Loading date + landingDate: Landing date + truckPlate: Truck plate ticketFk: Ticketd id routeFk: Route id - country: Country clientFk: Client id shipped: Preparation date viewCmr: View CMR - downloadCmrs: Download CMRs + download: Download as pdf + createCmr: Create CMR diff --git a/src/pages/Route/locale/es.yml b/src/pages/Route/locale/es.yml index a6ba4f370..c24e1c28b 100644 --- a/src/pages/Route/locale/es.yml +++ b/src/pages/Route/locale/es.yml @@ -25,15 +25,21 @@ route: Route is not served: La ruta no está servida cmr: list: + searchCmr: Buscar cmr + youCanSearch: Puedes buscar por id results: resultados - cmrFk: Id CMR - hasCmrDms: Gestdoc - 'true': Sí - 'false': 'No' + cmrFk: Id + sender: Remitente + loadingPlace: Lugar de carga + deliveryPlace: Lugar de entrega + carrier: Transportista + loadingDate: Fecha de carga + landingDate: Fecha de descarga + truckPlate: Matrícula ticketFk: Id ticket routeFk: Id ruta - country: País clientFk: Id cliente shipped: Fecha preparación viewCmr: Ver CMR - downloadCmrs: Descargar CMRs + download: Descargar como pdf + createCmr: Crear CMR diff --git a/src/router/modules/cmr.js b/src/router/modules/cmr.js new file mode 100644 index 000000000..d6a49e751 --- /dev/null +++ b/src/router/modules/cmr.js @@ -0,0 +1,44 @@ +import { RouterView } from 'vue-router'; + +export default { + path: '/route/cmr', + name: 'Cmr', + meta: { + title: 'Cmr', + icon: 'description', + moduleName: 'Cmr', + }, + component: RouterView, + redirect: { name: 'RouteMain' }, + menus: { + card: ['CmrBasicData'], + }, + children: [ + { + name: 'RouteCmrCard', + path: ':id', + component: () => import('src/pages/Route/Cmr/CmrCard.vue'), + redirect: { name: 'CmrSummary' }, + children: [ + { + name: 'CmrSummary', + path: 'summary', + meta: { + title: 'summary', + icon: 'open_in_new', + }, + component: () => import('pages/Route/Cmr/CmrSummary.vue'), + }, + { + name: 'CmrBasicData', + path: 'basic-data', + meta: { + title: 'basicData', + icon: 'vn:settings', + }, + component: () => import('pages/Route/Cmr/CmrBasicData.vue'), + }, + ], + }, + ], +}; diff --git a/src/router/modules/route.js b/src/router/modules/route.js index 9a7b16df3..44dff3a98 100644 --- a/src/router/modules/route.js +++ b/src/router/modules/route.js @@ -78,9 +78,9 @@ export default { name: 'CmrList', meta: { title: 'cmrsList', - icon: 'fact_check', + icon: 'description', }, - component: () => import('src/pages/Route/Cmr/CmrList.vue'), + component: () => import('src/pages/Route/RouteCmr.vue'), }, { path: '/agency',