forked from verdnatura/salix-front
refs #5989 botton general
This commit is contained in:
parent
a45d477151
commit
68f370b988
|
@ -16,6 +16,34 @@ const token = session.getToken();
|
|||
const appName = 'Lilium';
|
||||
|
||||
onMounted(() => stateStore.setMounted());
|
||||
|
||||
function redirect(id) {
|
||||
const currentURL = window.location.href;
|
||||
|
||||
const salixBaseURL = 'https://salix.verdnatura.es/#!/';
|
||||
|
||||
const dashboardRegex = /\/#\/dashboard/;
|
||||
const claimRegex = /\/#\/claim\/(\d+)\/summary/;
|
||||
const invoiceOutRegex = /\/#\/invoice-out\/(\d+)\/summary/;
|
||||
|
||||
if (currentURL.match(dashboardRegex)) {
|
||||
window.location.href = salixBaseURL;
|
||||
} else if (currentURL.match(claimRegex)) {
|
||||
const claimID = currentURL.match(claimRegex)[1];
|
||||
|
||||
const redirectURL = salixBaseURL + `claim/${claimID}/summary`;
|
||||
|
||||
window.location.href = redirectURL;
|
||||
} else if (currentURL.match(invoiceOutRegex)) {
|
||||
const invoiceOutID = currentURL.match(invoiceOutRegex)[1];
|
||||
|
||||
const redirectURL = salixBaseURL + `invoice-out/${invoiceOutID}/summary`;
|
||||
|
||||
window.location.href = redirectURL;
|
||||
} else {
|
||||
window.location.href = salixBaseURL;
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<template>
|
||||
|
@ -56,6 +84,11 @@ onMounted(() => stateStore.setMounted());
|
|||
<QSpace />
|
||||
<div class="q-pl-sm q-gutter-sm row items-center no-wrap">
|
||||
<div id="actions-prepend"></div>
|
||||
<QBtn
|
||||
@click="redirect(this.$route.params.id)"
|
||||
icon="open_in_new"
|
||||
label="Ir a SALIX"
|
||||
></QBtn>
|
||||
<QBtn id="pinnedModules" icon="apps" flat dense rounded>
|
||||
<QTooltip bottom>
|
||||
{{ t('globals.pinnedModules') }}
|
||||
|
|
Loading…
Reference in New Issue