diff --git a/src/components/ui/VnSearchbar.vue b/src/components/ui/VnSearchbar.vue index 2f184fbe7..6c0809c8b 100644 --- a/src/components/ui/VnSearchbar.vue +++ b/src/components/ui/VnSearchbar.vue @@ -2,12 +2,18 @@ import { onMounted, ref } from 'vue'; import { useRouter } from 'vue-router'; import { useArrayData } from 'composables/useArrayData'; +import { route } from 'quasar/wrappers'; const props = defineProps({ dataKey: { type: String, required: true, }, + label: { + type: String, + required: false, + default: 'Search', + }, redirect: { type: Boolean, required: false, @@ -16,6 +22,7 @@ const props = defineProps({ }); const router = useRouter(); +// const route = useRoute(); const arrayData = useArrayData(props.dataKey); const store = arrayData.store; const searchText = ref(); @@ -28,20 +35,26 @@ onMounted(() => { }); async function search() { - console.log('search!'); await arrayData.apply({ params: { search: searchText.value, }, }); if (!props.redirect) return; - + console.log(route.query); const rows = store.data; - if (rows.length === 1) { const firstRow = rows[0]; router.push({ path: `/customer/${firstRow.id}` }); + } else { + router.replace({ path: `/customer` }); } + + // if (route.matched.length > 2) { + + // } else { + + // } } @@ -50,9 +63,9 @@ async function search() { + + +{ + "en": { + "ticketList": "Customer ticket list", + "invoiceOutList": "Customer invoice out list" + }, + "es": { + "ticketList": "Listado de tickets del cliente", + "invoiceOutList": "Listado de facturas del cliente" + } +} + diff --git a/src/pages/Customer/CustomerFilter.vue b/src/pages/Customer/CustomerFilter.vue index 237cc192c..dcc363487 100644 --- a/src/pages/Customer/CustomerFilter.vue +++ b/src/pages/Customer/CustomerFilter.vue @@ -1,13 +1,14 @@