diff --git a/src/pages/Customer/Card/CustomerBasicData.vue b/src/pages/Customer/Card/CustomerBasicData.vue index 768c66f32..e9a349e0b 100644 --- a/src/pages/Customer/Card/CustomerBasicData.vue +++ b/src/pages/Customer/Card/CustomerBasicData.vue @@ -16,14 +16,17 @@ const { t } = useI18n(); const businessTypes = ref([]); const contactChannels = ref([]); -const handleSalesModelValue = (val) => ({ - or: [ - { id: val }, - { name: val }, - { nickname: { like: '%' + val + '%' } }, - { code: { like: `${val}%` } }, - ], -}); +const handleSalesModelValue = (val) => { + if (!val) val = ''; + return { + or: [ + { id: val }, + { name: val }, + { nickname: { like: '%' + val + '%' } }, + { code: { like: `${val}%` } }, + ], + }; +}; const exprBuilder = (param, value) => { return { diff --git a/src/pages/Customer/CustomerFilter.vue b/src/pages/Customer/CustomerFilter.vue index 96f670542..c62ec7dbb 100644 --- a/src/pages/Customer/CustomerFilter.vue +++ b/src/pages/Customer/CustomerFilter.vue @@ -12,14 +12,17 @@ defineProps({ required: true, }, }); -const handleSalesModelValue = (val) => ({ - or: [ - { id: val }, - { name: val }, - { nickname: { like: '%' + val + '%' } }, - { code: { like: `${val}%` } }, - ], -}); +const handleSalesModelValue = (val) => { + if (!val) val = ''; + return { + or: [ + { id: val }, + { name: val }, + { nickname: { like: '%' + val + '%' } }, + { code: { like: `${val}%` } }, + ], + }; +}; const exprBuilder = (param, value) => { return {