refs #5995 Improved external CMR
gitea/salix-front/pipeline/head This commit looks good Details

This commit is contained in:
Guillermo Bonet 2023-08-30 12:53:18 +02:00
parent 7348d36be4
commit 6786ac97e4
3 changed files with 54 additions and 12 deletions

View File

@ -482,7 +482,7 @@ export default {
cmr: { cmr: {
list: { list: {
total: 'Total records', total: 'Total records',
cmrFk: 'Cmr id', cmrFk: 'CMR id',
hasCmrDms: `Attached in gestdoc`, hasCmrDms: `Attached in gestdoc`,
true: 'Yes', true: 'Yes',
false: 'No', false: 'No',
@ -490,6 +490,8 @@ export default {
country: 'Country', country: 'Country',
clientFk: 'Client id', clientFk: 'Client id',
shipped: 'Preparation date', shipped: 'Preparation date',
viewCmr: 'View CMR',
downloadCmr: 'Download CMR',
}, },
}, },
}, },

View File

@ -482,7 +482,7 @@ export default {
cmr: { cmr: {
list: { list: {
total: 'Total registros', total: 'Total registros',
cmrFk: 'Id cmr', cmrFk: 'Id CMR',
hasCmrDms: 'Adjuntado en gestdoc', hasCmrDms: 'Adjuntado en gestdoc',
true: 'Sí', true: 'Sí',
false: 'No', false: 'No',
@ -490,6 +490,8 @@ export default {
country: 'País', country: 'País',
clientFk: 'Id cliente', clientFk: 'Id cliente',
shipped: 'Fecha preparación', shipped: 'Fecha preparación',
viewCmr: 'Ver CMR',
downloadCmr: 'Descargar CMR',
}, },
}, },
}, },

View File

@ -6,6 +6,8 @@ import VnPaginate from 'components/ui/VnPaginate.vue';
import { useSession } from 'src/composables/useSession'; import { useSession } from 'src/composables/useSession';
import { toDate } from 'filters/index'; import { toDate } from 'filters/index';
import CmrFilter from './CmrFilter.vue'; 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 stateStore = useStateStore();
const { t } = useI18n(); const { t } = useI18n();
@ -54,10 +56,18 @@ const columns = computed(() => [
sortable: true, sortable: true,
headerStyle: 'padding-left: 33px', headerStyle: 'padding-left: 33px',
}, },
{
name: 'icons',
align: 'center',
field: (row) => row.cmrFk,
},
]); ]);
function getProjectUrl() { function getProjectUrl() {
return new URL(window.location).origin; return new URL(window.location).origin;
} }
function getCmrLink(cmrFk) {
return `${getProjectUrl()}/api/Routes/${cmrFk}/cmr?access_token=${token}`;
}
</script> </script>
<template> <template>
<div class="column items-center"> <div class="column items-center">
@ -82,16 +92,6 @@ function getProjectUrl() {
<template #top> <template #top>
{{ `${t('route.cmr.list.total')}: ${rows.length}` }} {{ `${t('route.cmr.list.total')}: ${rows.length}` }}
</template> </template>
<template #body-cell-cmrFk="{ value }">
<QTd align="right" class="text-primary">
<a
:href="`${getProjectUrl()}/api/Routes/${value}/cmr?access_token=${token}`"
target="_blank"
>
<span class="text-primary">{{ value }}</span>
</a>
</QTd>
</template>
<template #body-cell-hasCmrDms="{ value }"> <template #body-cell-hasCmrDms="{ value }">
<QTd align="center"> <QTd align="center">
<QBadge <QBadge
@ -104,6 +104,44 @@ function getProjectUrl() {
/> />
</QTd> </QTd>
</template> </template>
<template #body-cell-ticketFk="{ value }">
<QTd align="right" class="text-primary">
<span class="text-primary link">{{ value }}</span>
<TicketDescriptorProxy :id="value" />
</QTd>
</template>
<template #body-cell-clientFk="{ value }">
<QTd align="right" class="text-primary">
<span class="text-primary link">{{ value }}</span>
<CustomerDescriptorProxy :id="value" />
</QTd>
</template>
<template #body-cell-icons="{ value }">
<QTd align="center">
<a :href="getCmrLink(value)" target="_blank">
<QIcon
name="visibility"
color="primary"
size="2em"
class="q-mr-sm q-ml-sm"
/>
<QTooltip>
{{ t('route.cmr.list.viewCmr') }}
</QTooltip>
</a>
<a :href="getCmrLink(value)" download>
<QIcon
name="cloud_download"
color="primary"
size="2em"
class="q-mr-sm q-ml-sm"
/>
<QTooltip>
{{ t('route.cmr.list.downloadCmr') }}
</QTooltip>
</a>
</QTd>
</template>
</QTable> </QTable>
</template> </template>
</VnPaginate> </VnPaginate>