165 lines
4.9 KiB
Vue
165 lines
4.9 KiB
Vue
<script setup>
|
|
import { useI18n } from 'vue-i18n';
|
|
import { ref } from 'vue';
|
|
import FetchData from 'components/FetchData.vue';
|
|
import FormModel from 'src/components/FormModel.vue';
|
|
import VnRow from 'components/ui/VnRow.vue';
|
|
import VnInput from 'src/components/common/VnInput.vue';
|
|
import VnInputTime from 'src/components/common/VnInputTime.vue';
|
|
import VnSelect from 'src/components/common/VnSelect.vue';
|
|
|
|
const { t } = useI18n();
|
|
const addresses = ref([]);
|
|
|
|
const setFilteredAddresses = (data) => {
|
|
addresses.value = data.map(({ address }) => address);
|
|
};
|
|
</script>
|
|
|
|
<template>
|
|
<FetchData
|
|
url="RoadmapAddresses"
|
|
:filter="{
|
|
include: { relation: 'address' },
|
|
}"
|
|
auto-load
|
|
@on-fetch="setFilteredAddresses"
|
|
/>
|
|
<FormModel auto-load model="Zone">
|
|
<template #form="{ data, validate }">
|
|
<VnRow>
|
|
<VnInput
|
|
:label="t('Name')"
|
|
clearable
|
|
v-model="data.name"
|
|
data-cy="ZoneBasicDataName"
|
|
:required="true"
|
|
/>
|
|
</VnRow>
|
|
<VnRow>
|
|
<VnSelect
|
|
v-model="data.agencyModeFk"
|
|
:rules="validate('zone.agencyModeFk')"
|
|
url="AgencyModes/isActive"
|
|
:fields="['id', 'name']"
|
|
:label="t('Agency')"
|
|
emit-value
|
|
map-options
|
|
use-input
|
|
hide-bottom-space
|
|
sort-by="name"
|
|
/>
|
|
<VnInput
|
|
class="mw-10"
|
|
v-model="data.itemMaxSize"
|
|
:label="t('Max m³')"
|
|
clearable
|
|
type="number"
|
|
min="0"
|
|
/>
|
|
<VnInput
|
|
class="mw-10"
|
|
v-model="data.m3Max"
|
|
:label="t('Maximum m³')"
|
|
clearable
|
|
type="number"
|
|
min="0"
|
|
/>
|
|
|
|
<VnInput
|
|
class="mw-10"
|
|
v-model="data.itemMaxLength"
|
|
:label="t('Max length m³')"
|
|
clearable
|
|
type="number"
|
|
min="0"
|
|
/>
|
|
</VnRow>
|
|
<VnRow>
|
|
<VnInput
|
|
v-model="data.travelingDays"
|
|
:label="t('Traveling days')"
|
|
clearable
|
|
type="number"
|
|
min="0"
|
|
/>
|
|
<VnInputTime v-model="data.hour" :label="t('Closing')" :required="true" />
|
|
</VnRow>
|
|
<VnRow>
|
|
<VnInput
|
|
v-model="data.price"
|
|
:label="t('Price')"
|
|
type="number"
|
|
min="0"
|
|
:required="true"
|
|
clearable
|
|
data-cy="ZoneBasicDataPrice"
|
|
/>
|
|
<VnInput
|
|
v-model="data.priceOptimum"
|
|
:label="t('Price optimum')"
|
|
type="number"
|
|
min="0"
|
|
:required="true"
|
|
clearable
|
|
/>
|
|
</VnRow>
|
|
<VnRow>
|
|
<VnInput
|
|
v-model="data.bonus"
|
|
:label="t('Bonus')"
|
|
type="number"
|
|
min="0"
|
|
clearable
|
|
/>
|
|
<VnSelect
|
|
:label="t('Distribution point')"
|
|
v-model="data.addressFk"
|
|
option-value="id"
|
|
option-label="nickname"
|
|
:options="addresses"
|
|
:fields="['id', 'nickname']"
|
|
sort-by="nickname ASC"
|
|
hide-selected
|
|
map-options
|
|
:rules="validate('data.addressFk')"
|
|
/>
|
|
</VnRow>
|
|
<VnRow>
|
|
<VnInput
|
|
v-model="data.inflation"
|
|
:label="t('Inflation')"
|
|
type="number"
|
|
clearable
|
|
/>
|
|
<QCheckbox
|
|
v-model="data.isVolumetric"
|
|
:label="t('Volumetric')"
|
|
:toggle-indeterminate="false"
|
|
/>
|
|
</VnRow>
|
|
</template>
|
|
</FormModel>
|
|
</template>
|
|
<style lang="scss" scoped>
|
|
.mw-10 {
|
|
max-width: 10vw;
|
|
}
|
|
</style>
|
|
<i18n>
|
|
es:
|
|
Name: Nombre
|
|
Agency: Agencia
|
|
Max m³: Medida máxima
|
|
Maximum m³: M³ maximo
|
|
Traveling days: Dias de viaje
|
|
Closing: Cierre
|
|
Price: Precio
|
|
Price optimum: Precio óptimo
|
|
Bonus: Bonificación
|
|
Inflation: Inflación
|
|
Volumetric: Volumétrico
|
|
Max length m³: Medida máxima tumbado
|
|
Distribution point: Punto de distribución
|
|
</i18n>
|