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: {
list: {
total: 'Total {0} records',
cmrFk: 'Cmr id',
hasCmrDms: `Attached in gestdoc`,
true: 'Yes',

View File

@ -125,3 +125,23 @@ const countries = ref();
</template>
</VnFilterPanel>
</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 { useSession } from 'src/composables/useSession';
import { toDate } from 'filters/index';
import { getUrl } from 'composables/getUrl';
import CmrFilter from './CmrFilter.vue';
const stateStore = useStateStore();
@ -26,6 +25,7 @@ const columns = computed(() => [
field: (row) => row.hasCmrDms,
align: 'center',
sortable: true,
headerStyle: 'padding-left: 35px',
},
{
name: 'ticketFk',
@ -52,16 +52,15 @@ const columns = computed(() => [
field: (row) => toDate(row.shipped),
align: 'center',
sortable: true,
headerStyle: 'padding-left: 33px',
},
]);
async function openCmr(cmrFk) {
const salixUrl = (await getUrl(`Routes/${cmrFk}/cmr`)).replace('#!/', 'api/')
window.open(`${salixUrl.replace('#!/', 'api/')}?access_token=${session.getToken()}`);
function getProjectUrl() {
return ((new URL(window.location)).origin);
};
</script>
<template>
<div class="column items-center">
{{ console.log(location) }}
<div class="list">
<VnPaginate
data-key="CmrList"
@ -85,14 +84,19 @@ async function openCmr(cmrFk) {
</template>
<template #body-cell-cmrFk="{ value }">
<QTd align="right" class="text-primary">
<RouterLink class="text-primary" :to="`${window.location}/api/Routes/${value}/cmr?access_token=${token}`">
<span>{{ value }}</span>
</RouterLink>
<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 :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>
</template>
</QTable>
@ -124,5 +128,3 @@ async function openCmr(cmrFk) {
background-color: $negative;
}
</style>