forked from verdnatura/salix-front
refactor: refs #7353 ease logic
This commit is contained in:
parent
a8fc5a8d73
commit
ed2167e199
|
@ -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>
|
||||
|
|
Loading…
Reference in New Issue