feat: move buttons to DescriptorMenu
gitea/salix-front/pipeline/pr-master This commit looks good Details

This commit is contained in:
Javier Segarra 2024-11-14 11:17:46 +01:00
parent 6919eeefc5
commit de2a926058
3 changed files with 49 additions and 13 deletions

View File

@ -303,11 +303,3 @@ const toModule = computed(() =>
} }
} }
</style> </style>
<style lang="scss">
.q-card__actions {
.q-btn--rectangle {
padding: 0 5px;
}
justify-content: center;
}
</style>

View File

@ -154,7 +154,7 @@ const debtWarning = computed(() => {
</QCardActions> </QCardActions>
</template> </template>
<template #actions="{ entity }"> <template #actions="{ entity }">
<QCardActions class="flex justify-center" style="padding-inline: 0"> <QCardActions class="flex justify-center">
<QBtn <QBtn
:to="{ :to="{
name: 'TicketList', name: 'TicketList',
@ -172,7 +172,7 @@ const debtWarning = computed(() => {
> >
<QTooltip>{{ t('Customer ticket list') }}</QTooltip> <QTooltip>{{ t('Customer ticket list') }}</QTooltip>
</QBtn> </QBtn>
<QBtn <!-- <QBtn
:to="{ :to="{
name: 'TicketList', name: 'TicketList',
query: { query: {
@ -192,7 +192,7 @@ const debtWarning = computed(() => {
icon="vn:ticketAdd" icon="vn:ticketAdd"
> >
<QTooltip>{{ t('New ticket') }}</QTooltip> <QTooltip>{{ t('New ticket') }}</QTooltip>
</QBtn> </QBtn> -->
<QBtn <QBtn
:to="{ :to="{
name: 'InvoiceOutList', name: 'InvoiceOutList',
@ -204,7 +204,7 @@ const debtWarning = computed(() => {
> >
<QTooltip>{{ t('Customer invoice out list') }}</QTooltip> <QTooltip>{{ t('Customer invoice out list') }}</QTooltip>
</QBtn> </QBtn>
<QBtn <!-- <QBtn
:to="{ :to="{
name: 'OrderList', name: 'OrderList',
query: { query: {
@ -223,7 +223,7 @@ const debtWarning = computed(() => {
color="primary" color="primary"
> >
<QTooltip>{{ t('New order') }}</QTooltip> <QTooltip>{{ t('New order') }}</QTooltip>
</QBtn> </QBtn> -->
<QBtn <QBtn
:to="{ :to="{
name: 'AccountSummary', name: 'AccountSummary',

View File

@ -40,9 +40,53 @@ const sendSms = async (payload) => {
notify(error.message, 'positive'); notify(error.message, 'positive');
} }
}; };
const openTicketCreateForm = () => {
const query = {
table: {
clientFk: $props.customer.id,
},
createForm: {
clientId: $props.customer.id,
addressId: $props.customer.defaultAddressFk,
},
};
openWindow('ticket', query);
};
const openOrderCreateForm = () => {
const query = {
table: {
clientFk: $props.customer.id,
},
createForm: {
clientFk: $props.customer.id,
addressId: $props.customer.defaultAddressFk,
},
};
openWindow('order', query);
};
const openWindow = (type, { createForm, table }) => {
window.open(
`/#/${type}/list?createForm=${JSON.stringify(createForm)}&table=${JSON.stringify(
table
)}`,
'_blank'
);
};
</script> </script>
<template> <template>
<QItem v-ripple clickable @click="openTicketCreateForm()">
<QItemSection>
{{ t('globals.pageTitles.createTicket') }}
</QItemSection>
</QItem>
<QItem v-ripple clickable @click="openOrderCreateForm()">
<QItemSection>
{{ t('globals.pageTitles.createOrder') }}
</QItemSection>
</QItem>
<QItem v-ripple clickable> <QItem v-ripple clickable>
<QItemSection @click="showSmsDialog()">{{ t('Send SMS') }}</QItemSection> <QItemSection @click="showSmsDialog()">{{ t('Send SMS') }}</QItemSection>
</QItem> </QItem>