fix: refs #7133 handleSalesModelValue function to handle empty input
gitea/salix-front/pipeline/pr-dev This commit looks good Details

This commit is contained in:
Jorge Penadés 2024-12-19 12:15:46 +01:00
parent 9e686f6a25
commit 5125b57663
2 changed files with 22 additions and 16 deletions

View File

@ -16,14 +16,17 @@ const { t } = useI18n();
const businessTypes = ref([]); const businessTypes = ref([]);
const contactChannels = ref([]); const contactChannels = ref([]);
const handleSalesModelValue = (val) => ({ const handleSalesModelValue = (val) => {
or: [ if (!val) val = '';
{ id: val }, return {
{ name: val }, or: [
{ nickname: { like: '%' + val + '%' } }, { id: val },
{ code: { like: `${val}%` } }, { name: val },
], { nickname: { like: '%' + val + '%' } },
}); { code: { like: `${val}%` } },
],
};
};
const exprBuilder = (param, value) => { const exprBuilder = (param, value) => {
return { return {

View File

@ -12,14 +12,17 @@ defineProps({
required: true, required: true,
}, },
}); });
const handleSalesModelValue = (val) => ({ const handleSalesModelValue = (val) => {
or: [ if (!val) val = '';
{ id: val }, return {
{ name: val }, or: [
{ nickname: { like: '%' + val + '%' } }, { id: val },
{ code: { like: `${val}%` } }, { name: val },
], { nickname: { like: '%' + val + '%' } },
}); { code: { like: `${val}%` } },
],
};
};
const exprBuilder = (param, value) => { const exprBuilder = (param, value) => {
return { return {