7806_devToTest_2332 #578
|
@ -29,9 +29,6 @@ const filter = {
|
|||
:descriptor="InvoiceInDescriptor"
|
||||
:filter-panel="InvoiceInFilter"
|
||||
search-data-key="InvoiceInList"
|
||||
search-url="InvoiceIns/filter"
|
||||
searchbar-label="Search invoice"
|
||||
searchbar-info="Search invoices in by id or supplier fiscal name"
|
||||
>
|
||||
<template #searchbar>
|
||||
<InvoiceInSearchbar />
|
||||
|
|
|
@ -20,40 +20,6 @@ const { t } = useI18n();
|
|||
|
||||
onMounted(async () => (stateStore.rightDrawer = true));
|
||||
onUnmounted(() => (stateStore.rightDrawer = false));
|
||||
const exprBuilder = (param, value) => {
|
||||
let minHour, maxHour;
|
||||
switch (param) {
|
||||
case 'issued':
|
||||
minHour = new Date(value);
|
||||
minHour.setHours(0, 0, 0, 0);
|
||||
maxHour = new Date(value);
|
||||
maxHour.setHours(23, 59, 59, 59);
|
||||
return {
|
||||
'ii.issued': {
|
||||
between: [minHour, maxHour],
|
||||
},
|
||||
};
|
||||
case 'id':
|
||||
case 'supplierFk':
|
||||
case 'supplierRef':
|
||||
case 'serialNumber':
|
||||
case 'serial':
|
||||
case 'created':
|
||||
case 'isBooked':
|
||||
return { [`ii.${param}`]: value };
|
||||
case 'account':
|
||||
case 'fi':
|
||||
return { [`s.${param}`]: value };
|
||||
case 'awbCode':
|
||||
return { 'awb.code': value };
|
||||
case 'search':
|
||||
return /^\d+$/.test(value)
|
||||
? { 'ii.id': value }
|
||||
: { 's.name': { like: `%${value}%` } };
|
||||
default:
|
||||
return { [param]: value };
|
||||
}
|
||||
};
|
||||
</script>
|
||||
|
||||
<template>
|
||||
|
@ -70,7 +36,6 @@ const exprBuilder = (param, value) => {
|
|||
url="InvoiceIns/filter"
|
||||
order="issued DESC, id DESC"
|
||||
auto-load
|
||||
:expr-builder="exprBuilder"
|
||||
>
|
||||
<template #body="{ rows }">
|
||||
<CardList
|
||||
|
|
|
@ -8,6 +8,7 @@ const { t } = useI18n();
|
|||
data-key="InvoiceInList"
|
||||
:label="t('Search invoice')"
|
||||
:info="t('Search invoices in by id or supplier fiscal name')"
|
||||
custom-route-redirect-name="invoiceInList"
|
||||
/>
|
||||
</template>
|
||||
<i18n>
|
||||
|
|
Loading…
Reference in New Issue