forked from verdnatura/salix-front
Merge pull request '6820-changeKmroute' (!395) from 6820-changeKmroute into dev
Reviewed-on: verdnatura/salix-front#395 Reviewed-by: Alex Moreno <alexm@verdnatura.es>
This commit is contained in:
commit
1a4d8bb0c0
|
@ -28,7 +28,7 @@ const defaultInitialData = {
|
|||
workerFk: null,
|
||||
isOk: false,
|
||||
};
|
||||
|
||||
const maxDistance = ref();
|
||||
const workerList = ref([]);
|
||||
const agencyList = ref([]);
|
||||
const vehicleList = ref([]);
|
||||
|
@ -81,12 +81,7 @@ const onSave = (data, response) => {
|
|||
};
|
||||
</script>
|
||||
<template>
|
||||
<VnSubToolbar />
|
||||
<template v-if="stateStore.isHeaderMounted()">
|
||||
<Teleport to="#searchbar">
|
||||
<RouteSearchbar />
|
||||
</Teleport>
|
||||
</template>
|
||||
<VnSubToolbar v-if="isNew" />
|
||||
<FetchData
|
||||
url="Workers/search"
|
||||
:filter="{ fields: ['id', 'nickname'] }"
|
||||
|
@ -111,6 +106,12 @@ const onSave = (data, response) => {
|
|||
@on-fetch="(data) => (vehicleList = data)"
|
||||
auto-load
|
||||
/>
|
||||
<FetchData
|
||||
url="RouteConfigs/findOne"
|
||||
@on-fetch="({ kmMax }) => (maxDistance = kmMax)"
|
||||
auto-load
|
||||
sort-by="id ASC"
|
||||
/>
|
||||
<FormModel
|
||||
:url="isNew ? null : `Routes/${route.params?.id}`"
|
||||
:url-create="isNew ? 'Routes' : null"
|
||||
|
@ -174,7 +175,17 @@ const onSave = (data, response) => {
|
|||
<template v-if="!isNew">
|
||||
<VnRow class="row q-gutter-md q-mb-md">
|
||||
<VnInput v-model="data.kmStart" :label="t('Km Start')" clearable />
|
||||
<VnInput v-model="data.kmEnd" :label="t('Km End')" clearable />
|
||||
<QInput
|
||||
v-model.number="data.kmEnd"
|
||||
:label="t('Km End')"
|
||||
:rules="[
|
||||
(val) =>
|
||||
val < maxDistance ||
|
||||
t('Distance must be lesser than 4000'),
|
||||
]"
|
||||
clearable
|
||||
type="number"
|
||||
/>
|
||||
</VnRow>
|
||||
<VnRow class="row q-gutter-md q-mb-md">
|
||||
<VnInputTime
|
||||
|
@ -221,4 +232,5 @@ es:
|
|||
Description: Descripción
|
||||
Is served: Se ha servido
|
||||
Created: Creado
|
||||
Distance must be lesser than {maxDistance}: La distancia debe ser inferior a {maxDistance}
|
||||
</i18n>
|
||||
|
|
|
@ -222,11 +222,6 @@ const openSmsDialog = async () => {
|
|||
</script>
|
||||
|
||||
<template>
|
||||
<template v-if="stateStore.isHeaderMounted()">
|
||||
<Teleport to="#searchbar">
|
||||
<RouteSearchbar />
|
||||
</Teleport>
|
||||
</template>
|
||||
<FetchData
|
||||
@on-fetch="(data) => (routeEntity = data)"
|
||||
auto-load
|
||||
|
|
Loading…
Reference in New Issue