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

View File

@ -482,7 +482,7 @@ export default {
cmr: {
list: {
total: 'Total registros',
cmrFk: 'Id cmr',
cmrFk: 'Id CMR',
hasCmrDms: 'Adjuntado en gestdoc',
true: 'Sí',
false: 'No',
@ -490,6 +490,8 @@ export default {
country: 'País',
clientFk: 'Id cliente',
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 { 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();
@ -54,10 +56,18 @@ const columns = computed(() => [
sortable: true,
headerStyle: 'padding-left: 33px',
},
{
name: 'icons',
align: 'center',
field: (row) => row.cmrFk,
},
]);
function getProjectUrl() {
return new URL(window.location).origin;
}
function getCmrLink(cmrFk) {
return `${getProjectUrl()}/api/Routes/${cmrFk}/cmr?access_token=${token}`;
}
</script>
<template>
<div class="column items-center">
@ -82,16 +92,6 @@ function getProjectUrl() {
<template #top>
{{ `${t('route.cmr.list.total')}: ${rows.length}` }}
</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 }">
<QTd align="center">
<QBadge
@ -104,6 +104,44 @@ function getProjectUrl() {
/>
</QTd>
</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>
</template>
</VnPaginate>