0
0
Fork 0

Merge branch 'master' into 7129-fixFilter

This commit is contained in:
Alex Moreno 2024-08-06 12:56:32 +00:00
commit 3f5a8218d0
6 changed files with 23 additions and 44 deletions

View File

@ -23,6 +23,7 @@ const props = defineProps({
searchCustomRouteRedirect: { type: String, default: undefined }, searchCustomRouteRedirect: { type: String, default: undefined },
searchRedirect: { type: Boolean, default: true }, searchRedirect: { type: Boolean, default: true },
searchMakeFetch: { type: Boolean, default: true }, searchMakeFetch: { type: Boolean, default: true },
searchUrlQuery: { type: String, default: undefined },
}); });
const stateStore = useStateStore(); const stateStore = useStateStore();
@ -70,6 +71,7 @@ if (props.baseUrl) {
:url="props.searchUrl" :url="props.searchUrl"
:label="props.searchbarLabel" :label="props.searchbarLabel"
:info="props.searchbarInfo" :info="props.searchbarInfo"
:search-url="props.searchUrlQuery"
:custom-route-redirect-name="searchCustomRouteRedirect" :custom-route-redirect-name="searchCustomRouteRedirect"
:redirect="searchRedirect" :redirect="searchRedirect"
/> />

View File

@ -67,6 +67,10 @@ const props = defineProps({
type: Boolean, type: Boolean,
default: true, default: true,
}, },
searchUrl: {
type: String,
default: 'params',
},
}); });
const searchText = ref(''); const searchText = ref('');

View File

@ -26,9 +26,6 @@ const defaultInitialData = {
isOk: false, isOk: false,
}; };
const maxDistance = ref(); const maxDistance = ref();
const workerList = ref([]);
const agencyList = ref([]);
const vehicleList = ref([]);
const routeFilter = { const routeFilter = {
fields: [ fields: [
@ -79,30 +76,6 @@ const onSave = (data, response) => {
</script> </script>
<template> <template>
<VnSubToolbar v-if="isNew" /> <VnSubToolbar v-if="isNew" />
<FetchData
url="Workers/search"
:filter="{ fields: ['id', 'nickname'] }"
sort-by="nickname ASC"
limit="30"
@on-fetch="(data) => (workerList = data)"
auto-load
/>
<FetchData
url="AgencyModes/isActive"
:filter="{ fields: ['id', 'name'] }"
sort-by="name"
limit="30"
@on-fetch="(data) => (agencyList = data)"
auto-load
/>
<FetchData
url="Vehicles"
:filter="{ fields: ['id', 'numberPlate'] }"
sort-by="numberPlate ASC"
limit="30"
@on-fetch="(data) => (vehicleList = data)"
auto-load
/>
<FetchData <FetchData
url="RouteConfigs/findOne" url="RouteConfigs/findOne"
@on-fetch="({ kmMax }) => (maxDistance = kmMax)" @on-fetch="({ kmMax }) => (maxDistance = kmMax)"
@ -124,12 +97,10 @@ const onSave = (data, response) => {
<VnSelect <VnSelect
:label="t('Worker')" :label="t('Worker')"
v-model="data.workerFk" v-model="data.workerFk"
:options="workerList" url="Workers/search"
sort-by="nickname ASC"
option-value="id" option-value="id"
option-label="nickname" option-label="nickname"
emit-value
map-options
use-input
:input-debounce="0" :input-debounce="0"
> >
<template #option="{ itemProps, opt }"> <template #option="{ itemProps, opt }">
@ -146,12 +117,10 @@ const onSave = (data, response) => {
<VnSelect <VnSelect
:label="t('Vehicle')" :label="t('Vehicle')"
v-model="data.vehicleFk" v-model="data.vehicleFk"
:options="vehicleList" url="Vehicles"
sort-by="numberPlate ASC"
option-value="id" option-value="id"
option-label="numberPlate" option-label="numberPlate"
emit-value
map-options
use-input
:input-debounce="0" :input-debounce="0"
/> />
</VnRow> </VnRow>
@ -159,12 +128,10 @@ const onSave = (data, response) => {
<VnSelect <VnSelect
:label="t('Agency')" :label="t('Agency')"
v-model="data.agencyModeFk" v-model="data.agencyModeFk"
:options="agencyList" url="AgencyModes/isActive"
sort-by="name"
option-value="id" option-value="id"
option-label="name" option-label="name"
emit-value
map-options
use-input
:input-debounce="0" :input-debounce="0"
/> />
<VnInputDate v-model="data.created" :label="t('Created')" /> <VnInputDate v-model="data.created" :label="t('Created')" />
@ -178,7 +145,7 @@ const onSave = (data, response) => {
:rules="[ :rules="[
(val) => (val) =>
val < maxDistance || val < maxDistance ||
t('Distance must be lesser than 4000'), t('Distance must be lesser than', { maxDistance }),
]" ]"
clearable clearable
type="number" type="number"
@ -227,5 +194,7 @@ es:
Description: Descripción Description: Descripción
Is served: Se ha servido Is served: Se ha servido
Created: Creado Created: Creado
Distance must be lesser than {maxDistance}: La distancia debe ser inferior a {maxDistance} Distance must be lesser than: La distancia debe ser inferior a {maxDistance}
en:
Distance must be lesser than: Distance must be lesser than {maxDistance}
</i18n> </i18n>

View File

@ -301,6 +301,7 @@ const openSmsDialog = async () => {
data-key="RouteTicketList" data-key="RouteTicketList"
url="Routes/getTickets" url="Routes/getTickets"
:filter="{ id: route.params.id }" :filter="{ id: route.params.id }"
:limit="0"
:order="['priority ASC']" :order="['priority ASC']"
auto-load auto-load
@on-fetch="(data) => (ticketList = data)" @on-fetch="(data) => (ticketList = data)"

View File

@ -12,5 +12,6 @@ import SupplierListFilter from '../SupplierListFilter.vue';
search-data-key="SupplierList" search-data-key="SupplierList"
search-url="Suppliers/filter" search-url="Suppliers/filter"
searchbar-label="Search suppliers" searchbar-label="Search suppliers"
search-url-query="table"
/> />
</template> </template>

View File

@ -19,9 +19,6 @@ const columns = computed(() => [
label: t('supplier.list.tableVisibleColumns.name'), label: t('supplier.list.tableVisibleColumns.name'),
name: 'socialName', name: 'socialName',
create: true, create: true,
columnCreate: {
component: 'input',
},
columnFilter: { columnFilter: {
name: 'search', name: 'search',
}, },
@ -93,6 +90,11 @@ const columns = computed(() => [
title: t('Create Supplier'), title: t('Create Supplier'),
onDataSaved: ({ id }) => tableRef.redirect(id), onDataSaved: ({ id }) => tableRef.redirect(id),
formInitialData: {}, formInitialData: {},
mapper: (data) => {
data.name = data.socialName;
delete data.socialName;
return data;
},
}" }"
order="id ASC" order="id ASC"
:columns="columns" :columns="columns"