forked from verdnatura/salix-front
feat: AccountDescriptorMenu
This commit is contained in:
parent
474e2c3a48
commit
bbd51c5773
|
@ -12,57 +12,84 @@ const $props = defineProps({
|
|||
required: true,
|
||||
},
|
||||
});
|
||||
import { useVnConfirm } from 'composables/useVnConfirm';
|
||||
|
||||
const { t } = useI18n();
|
||||
const { openReport } = usePrintService();
|
||||
const { openConfirmationModal } = useVnConfirm();
|
||||
|
||||
const account = ref($props.account);
|
||||
|
||||
function setPassword() {
|
||||
const id = account.value.id;
|
||||
openReport(`Accounts/${id}/account-pickup-pdf`, {
|
||||
recipientId: account.value.clientFk,
|
||||
});
|
||||
}
|
||||
function disableAccount() {
|
||||
const id = account.value.id;
|
||||
openReport(`Accounts/${id}/account-pickup-pdf`, {
|
||||
recipientId: account.value.clientFk,
|
||||
});
|
||||
}
|
||||
function disableUser() {
|
||||
const id = account.value.id;
|
||||
openReport(`Accounts/${id}/account-pickup-pdf`, {
|
||||
recipientId: account.value.clientFk,
|
||||
});
|
||||
}
|
||||
function sync() {
|
||||
const id = account.value.id;
|
||||
openReport(`Accounts/${id}/account-pickup-pdf`, {
|
||||
recipientId: account.value.clientFk,
|
||||
});
|
||||
}
|
||||
</script>
|
||||
<template>
|
||||
<QItem v-ripple clickable @click="setPassword(entity)">
|
||||
<QItem
|
||||
v-ripple
|
||||
clickable
|
||||
@click="
|
||||
openConfirmationModal(
|
||||
t('Confirm deletion'),
|
||||
t('Are you sure...TODO'),
|
||||
setPassword
|
||||
)
|
||||
"
|
||||
>
|
||||
<QItemSection>{{ t('account.card.actions.setPassword') }}</QItemSection>
|
||||
</QItem>
|
||||
<QItem v-ripple clickable @click="disableAccount(entity)">
|
||||
<QItemSection>{{ t('account.card.actions.disableAccount') }}</QItemSection>
|
||||
<QItem
|
||||
v-ripple
|
||||
clickable
|
||||
@click="
|
||||
openConfirmationModal(
|
||||
t('account.card.actions.disableAccount.title'),
|
||||
t('account.card.actions.disableAccount.subtitle'),
|
||||
disableAccount
|
||||
)
|
||||
"
|
||||
>
|
||||
<QItemSection>{{ t('account.card.actions.disableAccount.name') }}</QItemSection>
|
||||
</QItem>
|
||||
<QItem v-ripple clickable @click="disableUser(entity)">
|
||||
<QItemSection>{{ t('account.card.actions.disableUser') }}</QItemSection>
|
||||
<QItem
|
||||
v-ripple
|
||||
clickable
|
||||
@click="
|
||||
openConfirmationModal(
|
||||
t('account.card.actions.disableUser.title'),
|
||||
t('account.card.actions.disableUser.title'),
|
||||
actiondisableUser
|
||||
)
|
||||
"
|
||||
>
|
||||
<QItemSection>{{ t('account.card.actions.disableUser.name') }}</QItemSection>
|
||||
</QItem>
|
||||
<QItem v-ripple clickable @click="sync(entity)">
|
||||
<QItemSection>{{ t('account.card.actions.sync') }}</QItemSection>
|
||||
<QItem
|
||||
v-ripple
|
||||
clickable
|
||||
@click="
|
||||
openConfirmationModal(
|
||||
t('account.card.actions.sync.title'),
|
||||
t('account.card.actions.sync.subtitle'),
|
||||
sync
|
||||
)
|
||||
"
|
||||
>
|
||||
<QItemSection>{{ t('account.card.actions.sync.name') }}</QItemSection>
|
||||
</QItem>
|
||||
|
||||
<QSeparator />
|
||||
<QItem @click="confirmRemove()" v-ripple clickable>
|
||||
<QItem
|
||||
@click="
|
||||
openConfirmationModal(
|
||||
t('account.card.actions.delete.title'),
|
||||
t('account.card.actions.delete.subTitle'),
|
||||
removeAccount
|
||||
)
|
||||
"
|
||||
v-ripple
|
||||
clickable
|
||||
>
|
||||
<QItemSection avatar>
|
||||
<QIcon name="delete" />
|
||||
</QItemSection>
|
||||
<QItemSection>{{ t('account.card.actions.delete') }}</QItemSection>
|
||||
<QItemSection>{{ t('account.card.actions.delete.name') }}</QItemSection>
|
||||
</QItem>
|
||||
</template>
|
||||
|
||||
|
|
|
@ -18,8 +18,12 @@ account:
|
|||
nickname: Usuario
|
||||
role: Rol
|
||||
actions:
|
||||
setPassword: Se password
|
||||
disableAccount: Disable account
|
||||
setPassword: Set password
|
||||
|
||||
disableAccount:
|
||||
name: Disable account
|
||||
title: La cuenta será deshabilitada
|
||||
subtitle: ¿Seguro que quieres continuar?
|
||||
disableUser: Disable user
|
||||
sync: Sync
|
||||
delete: Delete
|
||||
|
|
|
@ -19,10 +19,22 @@ account:
|
|||
role: Rol
|
||||
actions:
|
||||
setPassword: Establecer contraseña
|
||||
disableAccount: Deshabilitar cuenta
|
||||
disableUser: Desactivar usuario
|
||||
sync: Sincronizar
|
||||
delete: Eliminar
|
||||
disableAccount:
|
||||
name: Deshabilitar cuenta
|
||||
title: La cuenta será deshabilitada
|
||||
subtitle: ¿Seguro que quieres continuar?
|
||||
disableUser:
|
||||
name: Desactivar usuario
|
||||
title: El usuario será deshabilitado
|
||||
subtitle: ¿Seguro que quieres continuar?
|
||||
sync:
|
||||
name: Sincronizar
|
||||
title: El usuario será sincronizado
|
||||
subtitle: ¿Seguro que quieres continuar?
|
||||
delete:
|
||||
name: Eliminar
|
||||
title: El usuario será eliminado
|
||||
subtitle: ¿Seguro que quieres continuar?
|
||||
|
||||
search: Buscar usuario
|
||||
role:
|
||||
|
|
Loading…
Reference in New Issue