0
0
Fork 0

perf: CustomerBasicData.salesPersonFk

This commit is contained in:
Javier Segarra 2024-09-16 13:33:07 +02:00
parent eb8690a422
commit 6ffd985575
1 changed files with 17 additions and 0 deletions

View File

@ -16,6 +16,21 @@ const { t } = useI18n();
const businessTypes = ref([]); const businessTypes = ref([]);
const contactChannels = ref([]); const contactChannels = ref([]);
const title = ref(); const title = ref();
const handleSalesModelValue = (val) => {
if (salesPersonFilter.value.and.length == 0) salesPersonFilter.value.and.push = [];
salesPersonFilter.value.and[1] = {
or: [
{ name: val },
{ nickname: { like: '%' + val + '%' } },
{ code: { like: `${val}%` } },
],
};
};
const salesPersonFilter = ref({
and: [{ active: { neq: false } }],
});
</script> </script>
<template> <template>
<FetchData <FetchData
@ -96,9 +111,11 @@ const title = ref();
:params="{ :params="{
departmentCodes: ['VT', 'shopping'], departmentCodes: ['VT', 'shopping'],
}" }"
:where="salesPersonFilter"
:fields="['id', 'nickname']" :fields="['id', 'nickname']"
sort-by="nickname ASC" sort-by="nickname ASC"
:rules="validate('client.salesPersonFk')" :rules="validate('client.salesPersonFk')"
@filter="handleSalesModelValue"
emit-value emit-value
auto-load auto-load
> >