forked from verdnatura/salix-front
fix(customerDescription): fix action buttons
This commit is contained in:
parent
b5ea6b70c5
commit
5e88004e79
|
@ -108,6 +108,8 @@ const CrudModelRef = ref({});
|
|||
const showForm = ref(false);
|
||||
const splittedColumns = ref({ columns: [] });
|
||||
const columnsVisibilitySkiped = ref();
|
||||
const createForm = ref();
|
||||
|
||||
const tableModes = [
|
||||
{
|
||||
icon: 'view_column',
|
||||
|
@ -139,6 +141,14 @@ onMounted(() => {
|
|||
.map((c) => c.name),
|
||||
...['tableActions'],
|
||||
];
|
||||
createForm.value = $props.create;
|
||||
if ($props.create && route?.query?.createForm) {
|
||||
showForm.value = true;
|
||||
createForm.value = {
|
||||
...createForm.value,
|
||||
...{ formInitialData: JSON.parse(route?.query?.createForm) },
|
||||
};
|
||||
}
|
||||
});
|
||||
|
||||
watch(
|
||||
|
@ -158,7 +168,7 @@ function setUserParams(watchedParams) {
|
|||
if (!watchedParams) return;
|
||||
|
||||
if (typeof watchedParams == 'string') watchedParams = JSON.parse(watchedParams);
|
||||
const filter = JSON.parse(watchedParams?.filter);
|
||||
const filter = JSON.parse(watchedParams?.filter ?? '{}');
|
||||
const where = filter?.where;
|
||||
const order = filter?.order;
|
||||
|
||||
|
@ -598,14 +608,14 @@ defineExpose({
|
|||
<QPageSticky v-if="create" :offset="[20, 20]" style="z-index: 2">
|
||||
<QBtn @click="showForm = !showForm" color="primary" fab icon="add" />
|
||||
<QTooltip>
|
||||
{{ create.title }}
|
||||
{{ createForm.title }}
|
||||
</QTooltip>
|
||||
</QPageSticky>
|
||||
<QDialog v-model="showForm" transition-show="scale" transition-hide="scale">
|
||||
<FormModelPopup
|
||||
v-bind="create"
|
||||
v-bind="createForm"
|
||||
:model="$attrs['data-key'] + 'Create'"
|
||||
@on-data-saved="(_, res) => create.onDataSaved(res)"
|
||||
@on-data-saved="(_, res) => createForm.onDataSaved(res)"
|
||||
>
|
||||
<template #form-inputs="{ data }">
|
||||
<div class="grid-create">
|
||||
|
|
|
@ -139,7 +139,7 @@ const setData = (entity) => (data.value = useCardDescription(entity?.name, entit
|
|||
<QBtn
|
||||
:to="{
|
||||
name: 'TicketList',
|
||||
query: { params: JSON.stringify({ clientFk: entity.id }) },
|
||||
query: { table: JSON.stringify({ clientFk: entity.id }) },
|
||||
}"
|
||||
size="md"
|
||||
icon="vn:ticket"
|
||||
|
@ -150,7 +150,7 @@ const setData = (entity) => (data.value = useCardDescription(entity?.name, entit
|
|||
<QBtn
|
||||
:to="{
|
||||
name: 'InvoiceOutList',
|
||||
query: { params: JSON.stringify({ clientFk: entity.id }) },
|
||||
query: { table: JSON.stringify({ clientFk: entity.id }) },
|
||||
}"
|
||||
size="md"
|
||||
icon="vn:invoice-out"
|
||||
|
@ -161,7 +161,7 @@ const setData = (entity) => (data.value = useCardDescription(entity?.name, entit
|
|||
<QBtn
|
||||
:to="{
|
||||
name: 'OrderCreate',
|
||||
query: { clientFk: entity.id },
|
||||
query: { clientId: entity.id },
|
||||
}"
|
||||
size="md"
|
||||
icon="vn:basketadd"
|
||||
|
@ -169,8 +169,19 @@ const setData = (entity) => (data.value = useCardDescription(entity?.name, entit
|
|||
>
|
||||
<QTooltip>{{ t('New order') }}</QTooltip>
|
||||
</QBtn>
|
||||
<QBtn size="md" icon="face" color="primary">
|
||||
<!-- TODO:: Redirigir a la vista de usuario cuando exista -->
|
||||
<QBtn
|
||||
:to="{
|
||||
name: 'AccountList',
|
||||
query: {
|
||||
table: JSON.stringify({
|
||||
filter: { where: { id: entity.id } },
|
||||
}),
|
||||
},
|
||||
}"
|
||||
size="md"
|
||||
icon="face"
|
||||
color="primary"
|
||||
>
|
||||
<QTooltip>{{ t('Go to user') }}</QTooltip>
|
||||
</QBtn>
|
||||
</QCardActions>
|
||||
|
|
|
@ -64,7 +64,7 @@ const columns = computed(() => [
|
|||
},
|
||||
{
|
||||
align: 'left',
|
||||
name: 'clientSocialName',
|
||||
name: 'clientFk',
|
||||
label: t('invoiceOutModule.customer'),
|
||||
cardVisible: true,
|
||||
component: 'select',
|
||||
|
@ -215,7 +215,7 @@ watchEffect(selectedRows);
|
|||
selection: 'multiple',
|
||||
}"
|
||||
>
|
||||
<template #column-clientSocialName="{ row }">
|
||||
<template #column-clientFk="{ row }">
|
||||
<span class="link" @click.stop>
|
||||
{{ row.clientSocialName }}
|
||||
<CustomerDescriptorProxy :id="row.clientFk" />
|
||||
|
|
Loading…
Reference in New Issue