refactor: refs #8828 update filter logic to use boolean
gitea/salix-front/pipeline/pr-dev There was a failure building this commit Details

This commit is contained in:
Benjamin Esteve 2025-04-22 10:03:22 +02:00
parent cb76d7e93b
commit 5eeae1143c
17 changed files with 27 additions and 65 deletions

View File

@ -157,9 +157,7 @@ const selectTravel = ({ id }) => {
option-value="id"
v-model="travelFilterParams.warehouseOutFk"
:where="{
isOrigin: {
neq: 0,
},
isOrigin: true,
}"
/>
<VnSelect
@ -170,9 +168,7 @@ const selectTravel = ({ id }) => {
option-value="id"
v-model="travelFilterParams.warehouseInFk"
:where="{
isDestiny: {
neq: 0,
},
isDestiny: true,
}"
/>
<VnInputDate

View File

@ -41,9 +41,7 @@ const onDataSaved = (data) => {
@on-fetch="(data) => (warehousesOptions = data)"
auto-load
:where="{
isInventory: {
neq: 0,
},
isInventory: true,
}"
/>
<FormModelPopup

View File

@ -163,9 +163,7 @@ const entryFilterPanel = ref();
@update:model-value="searchFn()"
url="Warehouses"
:where="{
isOrigin: {
neq: 0,
},
isOrigin: true,
}"
:fields="['id', 'name']"
sort-by="name ASC"
@ -183,9 +181,7 @@ const entryFilterPanel = ref();
@update:model-value="searchFn()"
url="Warehouses"
:where="{
isDestiny: {
neq: 0,
},
isDestiny: true,
}"
:fields="['id', 'name']"
sort-by="name ASC"

View File

@ -240,9 +240,7 @@ async function getZone(options) {
url="Warehouses"
@on-fetch="(data) => (warehousesOptions = data)"
:where="{
isForTicket: {
neq: 0,
},
isForTicket: true,
}"
auto-load
/>

View File

@ -51,9 +51,7 @@ const setUserParams = (params) => {
url="Warehouses"
@on-fetch="(data) => (warehouses = data)"
:where="{
isForTicket: {
neq: 0,
},
isForTicket: true,
}"
auto-load
/>

View File

@ -52,9 +52,7 @@ onMounted(async () => await getItemPackingTypes());
url="Warehouses"
@on-fetch="(data) => (warehousesOptions = data)"
:where="{
isForTicket: {
neq: 0,
},
isForTicket: true,
}"
auto-load
/>

View File

@ -91,9 +91,7 @@ const redirectToTicketList = (_, { id }) => {
url="Warehouses"
@on-fetch="(data) => (warehousesOptions = data)"
:where="{
isForTicket: {
neq: 0,
},
isForTicket: true,
}"
order="name"
auto-load

View File

@ -85,9 +85,7 @@ const redirectToTicketList = (_, { id }) => {
url="Warehouses"
@on-fetch="(data) => (warehousesOptions = data)"
:where="{
isForTicket: {
neq: 0,
},
isForTicket: true,
}"
order="name"
auto-load

View File

@ -46,9 +46,7 @@ const groupedStates = ref([]);
@on-fetch="(data) => (warehouses = data)"
auto-load
:where="{
isForTicket: {
neq: 0,
},
isForTicket: true,
}"
/>
<VnFilterPanel

View File

@ -56,9 +56,7 @@ onMounted(async () => {
url="Warehouses"
@on-fetch="(data) => (warehousesOptions = data)"
:where="{
isForTicket: {
neq: 0,
},
isForTicket: true,
}"
auto-load
/>

View File

@ -205,9 +205,7 @@ const columns = computed(() => [
url: 'warehouses',
fields: ['id', 'name'],
where: {
isForTicket: {
neq: 0,
},
isForTicket: true,
},
},
format: (row) => row.warehouse,
@ -678,9 +676,7 @@ function setReference(data) {
hide-selected
required
:where="{
isForTicket: {
neq: 0,
},
isForTicket: true,
}"
@update:model-value="() => fetchAvailableAgencies(data)"
/>

View File

@ -103,7 +103,7 @@ const columns = computed(() => [
url: 'Warehouses',
fields: ['id', 'name'],
where: {
isForTicket: { neq: 0 },
isForTicket: true,
},
},
inWhere: true,

View File

@ -29,9 +29,7 @@ const warehousesOptionsIn = ref([]);
@on-fetch="(data) => (warehousesOptionsOut = data)"
auto-load
:where="{
isOrigin: {
neq: 0,
},
isOrigin: true,
}"
/>
<FetchData
@ -39,9 +37,7 @@ const warehousesOptionsIn = ref([]);
@on-fetch="(data) => (warehousesOptionsIn = data)"
auto-load
:where="{
isDestiny: {
neq: 0,
},
isDestiny: true,
}"
/>
<FormModel :url-update="`Travels/${route.params.id}`" model="Travel">

View File

@ -184,7 +184,7 @@ warehouses();
:label="t('extraCommunity.filter.warehouseOutFk')"
v-model="params.warehouseOutFk"
:options="
warehousesOptions.filter((option) => option.isOrigin !== 0)
warehousesOptions.filter((option) => option.isOrigin === true)
"
option-value="id"
option-label="name"
@ -200,7 +200,9 @@ warehouses();
:label="t('extraCommunity.filter.warehouseInFk')"
v-model="params.warehouseInFk"
:options="
warehousesOptions.filter((option) => option.isDestiny !== 0)
warehousesOptions.filter(
(option) => option.isDestiny === true,
)
"
option-value="id"
option-label="name"

View File

@ -82,9 +82,7 @@ const redirectToTravelBasicData = (_, { id }) => {
option-label="name"
hide-selected
:where="{
isOrigin: {
neq: 0,
},
isOrigin: true,
}"
/>
<VnSelect
@ -95,9 +93,7 @@ const redirectToTravelBasicData = (_, { id }) => {
option-label="name"
hide-selected
:where="{
isDestiny: {
neq: 0,
},
isDestiny: true,
}"
/>
</VnRow>

View File

@ -65,9 +65,7 @@ defineExpose({ states });
dense
filled
:where="{
isDestiny: {
neq: 0,
},
isDestiny: true,
}"
/>
<VnInputDate
@ -95,9 +93,7 @@ defineExpose({ states });
dense
filled
:where="{
isOrigin: {
neq: 0,
},
isOrigin: true,
}"
/>
<VnInputDate

View File

@ -99,7 +99,7 @@ const columns = computed(() => [
fields: ['id', 'name'],
optionLabel: 'name',
optionValue: 'id',
where: { isDestiny: { neq: 0 } },
where: { isDestiny: true },
},
format: (row) => row.warehouseInName,
columnField: {
@ -134,7 +134,7 @@ const columns = computed(() => [
attrs: {
url: 'warehouses',
fields: ['id', 'name'],
where: { isOrigin: { neq: 0 } },
where: { isOrigin: true },
},
format: (row) => row.warehouseOutName,
columnField: {