diff --git a/src/components/common/VnSelect.vue b/src/components/common/VnSelect.vue
index b06542f28..b24d38c97 100644
--- a/src/components/common/VnSelect.vue
+++ b/src/components/common/VnSelect.vue
@@ -213,9 +213,12 @@ function filter(val, options) {
}
function matchesSearch(val, search) {
- return /^\d+$/.test(search) ? val.startsWith(search) : val.includes(search);
+ return isDigit(search) ? val.startsWith(search) : val.includes(search);
}
+function isDigit(val) {
+ return /^\d+$/.test(val);
+}
async function fetchFilter(val) {
if (!$props.url) return;
@@ -284,7 +287,9 @@ function nullishToTrue(value) {
return value ?? true;
}
-const getVal = (val) => ($props.useLike ? { like: `%${val}%` } : val);
+function getVal(val) {
+ return $props.useLike ? { like: isDigit(val) ? `${val}%` : `%${val}%` } : val;
+}
async function onScroll({ to, direction, from, index }) {
const lastIndex = myOptions.value.length - 1;
diff --git a/src/components/common/VnSelectSupplier.vue b/src/components/common/VnSelectSupplier.vue
index f86db4f2d..5a821456e 100644
--- a/src/components/common/VnSelectSupplier.vue
+++ b/src/components/common/VnSelectSupplier.vue
@@ -1,9 +1,7 @@
@@ -11,10 +9,11 @@ const url = 'Suppliers';
:label="$t('globals.supplier')"
v-bind="$attrs"
v-model="model"
- :url="url"
+ url="Suppliers"
option-value="id"
option-label="nickname"
:fields="['id', 'name', 'nickname', 'nif']"
+ :filter-options="['id', 'name', 'nickname', 'nif']"
sort-by="name ASC"
>