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