forked from verdnatura/salix-front
refs #6280 feat: handle option selected from VnLocation
This commit is contained in:
parent
b6a03e6a9f
commit
20835471a3
|
@ -98,9 +98,8 @@ function showLabel(data){
|
||||||
v-model="value"
|
v-model="value"
|
||||||
:options="postcodesOptions"
|
:options="postcodesOptions"
|
||||||
:label="t('Location')"
|
:label="t('Location')"
|
||||||
option-value="geoFk"
|
|
||||||
:option-label="showLabel"
|
:option-label="showLabel"
|
||||||
:placeholder="t('Min. 3 char')"
|
:placeholder="t('Search by postalCode or town (at least 3 characters')"
|
||||||
v-bind="$attrs"
|
v-bind="$attrs"
|
||||||
emit-value
|
emit-value
|
||||||
map-options
|
map-options
|
||||||
|
@ -138,4 +137,5 @@ function showLabel(data){
|
||||||
<i18n>
|
<i18n>
|
||||||
es:
|
es:
|
||||||
Location: Ubicación
|
Location: Ubicación
|
||||||
|
Search by postalCode or town (at least 3 characters): Buscar por código postal o nombre ( al menos 3 letras)
|
||||||
</i18n>
|
</i18n>
|
||||||
|
|
|
@ -36,9 +36,13 @@ const provincesLocationOptions = ref([]);
|
||||||
const countriesOptions = ref([]);
|
const countriesOptions = ref([]);
|
||||||
const postcodesOptions = ref([]);
|
const postcodesOptions = ref([]);
|
||||||
|
|
||||||
const onPostcodeCreated = async () => {
|
|
||||||
postcodeFetchDataRef.value.fetch();
|
function handleLocation(data, { city, postcode, provinceFk, countryFk }) {
|
||||||
};
|
data.postcode = postcode;
|
||||||
|
data.city = city;
|
||||||
|
data.provinceFk = provinceFk;
|
||||||
|
data.countryFk = countryFk;
|
||||||
|
}
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<template>
|
<template>
|
||||||
|
@ -133,9 +137,13 @@ const onPostcodeCreated = async () => {
|
||||||
<VnRow class="row q-gutter-md q-mb-md">
|
<VnRow class="row q-gutter-md q-mb-md">
|
||||||
<div class="col">
|
<div class="col">
|
||||||
<VnLocation
|
<VnLocation
|
||||||
|
:rules="validate('Worker.postcode')"
|
||||||
|
:roles-allowed-to-create="['deliveryAssistant']"
|
||||||
:options="postcodesOptions"
|
:options="postcodesOptions"
|
||||||
v-model="data.location"
|
v-model="data.location"
|
||||||
@update:model-value="(data)=> console.log(data)"
|
@update:model-value="
|
||||||
|
(location) => handleLocation(data, location)
|
||||||
|
"
|
||||||
>
|
>
|
||||||
</VnLocation>
|
</VnLocation>
|
||||||
</div>
|
</div>
|
||||||
|
|
Loading…
Reference in New Issue