0
0
Fork 0

refs #7172 fix vnSelectFilter

This commit is contained in:
Carlos Satorres 2024-04-10 14:16:20 +02:00
parent f60670cb87
commit 904f647a5b
1 changed files with 1 additions and 46 deletions

View File

@ -36,8 +36,6 @@ const claimFilter = {
],
};
const workers = ref([]);
const workersCopy = ref([]);
const claimStates = ref([]);
const claimStatesCopy = ref([]);
const workersOptions = ref([]);
@ -47,25 +45,6 @@ function setClaimStates(data) {
claimStatesCopy.value = data;
}
const workerFilter = {
options: workers,
filterFn: (options, value) => {
const search = value.toLowerCase();
if (value === '') return workersCopy.value;
return options.value.filter((row) => {
const id = row.id;
const name = row.name.toLowerCase();
const idMatches = id == search;
const nameMatches = name.indexOf(search) > -1;
return idMatches || nameMatches;
});
},
};
const statesFilter = {
options: claimStates,
filterFn: (options, value) => {
@ -87,7 +66,6 @@ const statesFilter = {
:filter="{ where: { role: 'salesPerson' } }"
@on-fetch="(data) => (workersOptions = data)"
auto-load
limit="30"
/>
<FetchData url="ClaimStates" @on-fetch="setClaimStates" auto-load />
<FormModel
@ -115,29 +93,6 @@ const statesFilter = {
</VnRow>
<VnRow class="row q-gutter-md q-mb-md">
<div class="col">
<!-- <QSelect
v-model="data.workerFk"
:options="workers"
option-value="id"
option-label="name"
emit-value
:label="t('claim.basicData.assignedTo')"
map-options
use-input
@filter="(value, update) => filter(value, update, workerFilter)"
:rules="validate('claim.claimStateFk')"
:input-debounce="0"
>
<template #before>
<QAvatar color="orange">
<QImg
v-if="data.workerFk"
:src="`/api/Images/user/160x160/${data.workerFk}/download?access_token=${token}`"
spinner-color="white"
/>
</QAvatar>
</template>
</QSelect> -->
<VnSelectFilter
:label="t('claim.basicData.assignedTo')"
v-model="data.workerFk"
@ -146,7 +101,7 @@ const statesFilter = {
option-label="name"
emit-value
auto-load
@filter="(value, update) => filter(value, update, workerFilter)"
:virtual-scroll-slice-size="workersOptions.length"
:rules="validate('claim.claimStateFk')"
>
<template #before>