0
0
Fork 0

refactor: refs #7353 ease logic

This commit is contained in:
Jorge Penadés 2024-09-02 09:30:15 +02:00
parent a8fc5a8d73
commit ed2167e199
1 changed files with 11 additions and 17 deletions

View File

@ -18,17 +18,13 @@ const filter = computed(() => {
const obj = {}; const obj = {};
const formatFrom = setHours(from.value, 'from'); const formatFrom = setHours(from.value, 'from');
const formatTo = setHours(to.value, 'to'); const formatTo = setHours(to.value, 'to');
let stamp;
if (!formatFrom && formatTo) if (!formatFrom && formatTo) stamp = { lte: formatTo };
Object.assign(obj, { where: { 'v.stamp': { lte: formatTo } } }); else if (formatFrom && !formatTo) stamp = { gte: formatFrom };
else if (formatFrom && !formatTo) else if (formatFrom && formatTo) stamp = { between: [formatFrom, formatTo] };
Object.assign(obj, { where: { 'v.stamp': { gte: formatFrom } } });
else if (formatFrom && formatTo)
Object.assign(obj, {
where: { 'v.stamp': { between: [formatFrom, formatTo] } },
});
return obj; return Object.assign(obj, { where: { 'v.stamp': stamp } });
}); });
function exprBuilder(param, value) { function exprBuilder(param, value) {
@ -84,6 +80,7 @@ const columns = computed(() => [
useLike: false, useLike: false,
}, },
}, },
columnClass: 'no-padding',
}, },
{ {
label: t('salesClientsTable.client'), label: t('salesClientsTable.client'),
@ -102,6 +99,7 @@ const columns = computed(() => [
sortBy: 'name ASC', sortBy: 'name ASC',
}, },
}, },
columnClass: 'no-padding',
}, },
]); ]);
</script> </script>
@ -131,16 +129,12 @@ const columns = computed(() => [
</VnRow> </VnRow>
</template> </template>
<template #column-salesPersonFk="{ row }"> <template #column-salesPersonFk="{ row }">
<QTd class="no-padding"> <span class="link" :title="row.salesPerson" v-text="row.salesPerson" />
<span class="link" :title="row.salesPerson" v-text="row.salesPerson" /> <WorkerDescriptorProxy :id="row.salesPersonFk" dense />
<WorkerDescriptorProxy :id="row.salesPersonFk" dense />
</QTd>
</template> </template>
<template #column-clientFk="{ row }"> <template #column-clientFk="{ row }">
<QTd class="no-padding"> <span class="link" :title="row.clientName" v-text="row.clientName" />
<span class="link" :title="row.clientName" v-text="row.clientName" /> <CustomerDescriptorProxy :id="row.clientFk" />
<CustomerDescriptorProxy :id="row.clientFk" />
</QTd>
</template> </template>
</VnTable> </VnTable>
</template> </template>