refs #5995 Href to lilium api link
gitea/salix-front/pipeline/head This commit looks good Details

This commit is contained in:
Guillermo Bonet 2023-08-10 07:49:57 +02:00
parent 446cebc53d
commit 58372ef9e8
3 changed files with 43 additions and 20 deletions

View File

@ -453,6 +453,7 @@ export default {
}, },
cmr: { cmr: {
list: { list: {
total: 'Total {0} records',
cmrFk: 'Cmr id', cmrFk: 'Cmr id',
hasCmrDms: `Attached in gestdoc`, hasCmrDms: `Attached in gestdoc`,
true: 'Yes', true: 'Yes',

View File

@ -124,4 +124,24 @@ const countries = ref();
</QList> </QList>
</template> </template>
</VnFilterPanel> </VnFilterPanel>
</template> </template>
<i18n>
en:
params:
cmrFk: Cmr id,
hasCmrDms: Attached in gestdoc,
ticketFk: Ticketd id,
country: Country,
clientFk: Client id,
shipped: Preparation date,
es:
params:
cmrFk: Id cmr,
hasCmrDms: Adjuntado en gestdoc,
ticketFk: Id ticket,
country: País,
clientFk: Id cliente,
shipped: Fecha preparación,
</i18n>

View File

@ -5,7 +5,6 @@ import { useStateStore } from 'stores/useStateStore';
import VnPaginate from 'components/ui/VnPaginate.vue'; 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 { getUrl } from 'composables/getUrl';
import CmrFilter from './CmrFilter.vue'; import CmrFilter from './CmrFilter.vue';
const stateStore = useStateStore(); const stateStore = useStateStore();
@ -26,6 +25,7 @@ const columns = computed(() => [
field: (row) => row.hasCmrDms, field: (row) => row.hasCmrDms,
align: 'center', align: 'center',
sortable: true, sortable: true,
headerStyle: 'padding-left: 35px',
}, },
{ {
name: 'ticketFk', name: 'ticketFk',
@ -52,16 +52,15 @@ const columns = computed(() => [
field: (row) => toDate(row.shipped), field: (row) => toDate(row.shipped),
align: 'center', align: 'center',
sortable: true, sortable: true,
headerStyle: 'padding-left: 33px',
}, },
]); ]);
async function openCmr(cmrFk) { function getProjectUrl() {
const salixUrl = (await getUrl(`Routes/${cmrFk}/cmr`)).replace('#!/', 'api/') return ((new URL(window.location)).origin);
window.open(`${salixUrl.replace('#!/', 'api/')}?access_token=${session.getToken()}`);
}; };
</script> </script>
<template> <template>
<div class="column items-center"> <div class="column items-center">
{{ console.log(location) }}
<div class="list"> <div class="list">
<VnPaginate <VnPaginate
data-key="CmrList" data-key="CmrList"
@ -72,27 +71,32 @@ async function openCmr(cmrFk) {
> >
<template #body="{ rows }"> <template #body="{ rows }">
<QTable <QTable
:columns="columns" :columns="columns"
:rows="rows" :rows="rows"
:dense="$q.screen.lt.md" :dense="$q.screen.lt.md"
:pagination="{ rowsPerPage: null }" :pagination="{ rowsPerPage: null }"
hide-pagination hide-pagination
:grid="$q.screen.lt.md" :grid="$q.screen.lt.md"
auto-load auto-load
> >
<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 }"> <template #body-cell-cmrFk="{ value }">
<QTd align="right" class="text-primary"> <QTd align="right" class="text-primary">
<RouterLink class="text-primary" :to="`${window.location}/api/Routes/${value}/cmr?access_token=${token}`"> <a :href="`${getProjectUrl()}/api/Routes/${value}/cmr?access_token=${token}`" target="_blank">
<span>{{ value }}</span> <span class="text-primary">{{ value }}</span>
</RouterLink> </a>
</QTd> </QTd>
</template> </template>
<template #body-cell-hasCmrDms="{ value }"> <template #body-cell-hasCmrDms="{ value }">
<QTd align="center"> <QTd align="center">
<QBadge :id="(value) ? 'true' : 'false'" :label="(value) ? t('route.cmr.list.true') : t('route.cmr.list.false')"/> <QBadge
:id="(value) ? 'true' : 'false'"
:label="(value)
? t('route.cmr.list.true')
: t('route.cmr.list.false')"
/>
</QTd> </QTd>
</template> </template>
</QTable> </QTable>
@ -123,6 +127,4 @@ async function openCmr(cmrFk) {
#false { #false {
background-color: $negative; background-color: $negative;
} }
</style> </style>