fix: routeForm
gitea/salix-front/pipeline/pr-master This commit looks good
Details
gitea/salix-front/pipeline/pr-master This commit looks good
Details
This commit is contained in:
parent
28efe4aacf
commit
7d6520fdaa
|
@ -26,9 +26,6 @@ const defaultInitialData = {
|
|||
isOk: false,
|
||||
};
|
||||
const maxDistance = ref();
|
||||
const workerList = ref([]);
|
||||
const agencyList = ref([]);
|
||||
const vehicleList = ref([]);
|
||||
|
||||
const routeFilter = {
|
||||
fields: [
|
||||
|
@ -79,30 +76,6 @@ const onSave = (data, response) => {
|
|||
</script>
|
||||
<template>
|
||||
<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
|
||||
url="RouteConfigs/findOne"
|
||||
@on-fetch="({ kmMax }) => (maxDistance = kmMax)"
|
||||
|
@ -124,12 +97,10 @@ const onSave = (data, response) => {
|
|||
<VnSelect
|
||||
:label="t('Worker')"
|
||||
v-model="data.workerFk"
|
||||
:options="workerList"
|
||||
url="Workers/search"
|
||||
sort-by="nickname ASC"
|
||||
option-value="id"
|
||||
option-label="nickname"
|
||||
emit-value
|
||||
map-options
|
||||
use-input
|
||||
:input-debounce="0"
|
||||
>
|
||||
<template #option="{ itemProps, opt }">
|
||||
|
@ -146,12 +117,10 @@ const onSave = (data, response) => {
|
|||
<VnSelect
|
||||
:label="t('Vehicle')"
|
||||
v-model="data.vehicleFk"
|
||||
:options="vehicleList"
|
||||
url="Vehicles"
|
||||
sort-by="numberPlate ASC"
|
||||
option-value="id"
|
||||
option-label="numberPlate"
|
||||
emit-value
|
||||
map-options
|
||||
use-input
|
||||
:input-debounce="0"
|
||||
/>
|
||||
</VnRow>
|
||||
|
@ -159,12 +128,10 @@ const onSave = (data, response) => {
|
|||
<VnSelect
|
||||
:label="t('Agency')"
|
||||
v-model="data.agencyModeFk"
|
||||
:options="agencyList"
|
||||
url="AgencyModes/isActive"
|
||||
sort-by="name"
|
||||
option-value="id"
|
||||
option-label="name"
|
||||
emit-value
|
||||
map-options
|
||||
use-input
|
||||
:input-debounce="0"
|
||||
/>
|
||||
<VnInputDate v-model="data.created" :label="t('Created')" />
|
||||
|
@ -178,7 +145,7 @@ const onSave = (data, response) => {
|
|||
:rules="[
|
||||
(val) =>
|
||||
val < maxDistance ||
|
||||
t('Distance must be lesser than 4000'),
|
||||
t('Distance must be lesser than') + ` ${maxDistance}`,
|
||||
]"
|
||||
clearable
|
||||
type="number"
|
||||
|
@ -227,5 +194,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}
|
||||
Distance must be lesser than: La distancia debe ser inferior a
|
||||
</i18n>
|
||||
|
|
Loading…
Reference in New Issue