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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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