diff --git a/src/components/ui/VnSearchbar.vue b/src/components/ui/VnSearchbar.vue
index eca957092..99710408d 100644
--- a/src/components/ui/VnSearchbar.vue
+++ b/src/components/ui/VnSearchbar.vue
@@ -61,6 +61,10 @@ const props = defineProps({
type: Function,
default: null,
},
+ customRouteRedirectName: {
+ type: String,
+ default: '',
+ },
});
const router = useRouter();
@@ -87,8 +91,16 @@ async function search() {
});
if (!props.redirect) return;
+ if (props.customRouteRedirectName) {
+ router.push({
+ name: props.customRouteRedirectName,
+ params: { id: searchText.value },
+ });
+ return;
+ }
+
const { matched: matches } = route;
- const { path } = matches[matches.length-1];
+ const { path } = matches[matches.length - 1];
const newRoute = path.replace(':id', searchText.value);
await router.push(newRoute);
}
diff --git a/src/pages/Entry/EntryCreate.vue b/src/pages/Entry/EntryCreate.vue
index 3063845b0..80c3f609e 100644
--- a/src/pages/Entry/EntryCreate.vue
+++ b/src/pages/Entry/EntryCreate.vue
@@ -8,7 +8,9 @@ import VnRow from 'components/ui/VnRow.vue';
import VnSelectFilter from 'src/components/common/VnSelectFilter.vue';
import FetchData from 'components/FetchData.vue';
import VnSubToolbar from 'src/components/ui/VnSubToolbar.vue';
+import VnSearchbar from 'src/components/ui/VnSearchbar.vue';
+import { useStateStore } from 'stores/useStateStore';
import { useState } from 'src/composables/useState';
import { toDate } from 'src/filters';
@@ -16,6 +18,7 @@ const state = useState();
const { t } = useI18n();
const route = useRoute();
const router = useRouter();
+const stateStore = useStateStore();
const user = state.getUser();
const newEntryForm = reactive({
@@ -55,6 +58,17 @@ const redirectToEntryBasicData = (_, { id }) => {
@on-fetch="(data) => (companiesOptions = data)"
auto-load
/>
+
+
+
+
+
{
+
+
+
+
+
@@ -132,4 +143,6 @@ onMounted(async () => {
es:
Inventory entry: Es inventario
Virtual entry: Es una redada
+ Search entries: Buscar entradas
+ You can search by entry reference: Puedes buscar por referencia de la entrada
diff --git a/src/pages/Entry/EntryMain.vue b/src/pages/Entry/EntryMain.vue
index 62bbd7084..c1f2a31db 100644
--- a/src/pages/Entry/EntryMain.vue
+++ b/src/pages/Entry/EntryMain.vue
@@ -1,26 +1,12 @@
-
-
-
-
-
@@ -30,9 +16,3 @@ const { t } = useI18n();
-
-
-es:
- Search entries: Buscar entradas
- You can search by entry reference: Puedes buscar por referencia de la entrada
-