forked from verdnatura/salix-front
Compare commits
4 Commits
Author | SHA1 | Date |
---|---|---|
Javier Segarra | 791af46202 | |
Javier Segarra | 9a518ed990 | |
Javier Segarra | 26de0cf72f | |
Javier Segarra | 70dcadc57d |
|
@ -108,11 +108,11 @@ watch(
|
||||||
|
|
||||||
watch(
|
watch(
|
||||||
() => postcodeFormData.provinceFk,
|
() => postcodeFormData.provinceFk,
|
||||||
async (newProvinceFk) => {
|
async (newProvinceFk, oldValueFk) => {
|
||||||
if (Array.isArray(newProvinceFk)) {
|
if (Array.isArray(newProvinceFk)) {
|
||||||
newProvinceFk = newProvinceFk[0];
|
newProvinceFk = newProvinceFk[0];
|
||||||
}
|
}
|
||||||
if (newProvinceFk !== postcodeFormData.provinceFk) {
|
if (newProvinceFk !== oldValueFk) {
|
||||||
await townsFetchDataRef.value.fetch({
|
await townsFetchDataRef.value.fetch({
|
||||||
where: { provinceFk: newProvinceFk },
|
where: { provinceFk: newProvinceFk },
|
||||||
});
|
});
|
||||||
|
@ -147,13 +147,7 @@ async function handleCountries(data) {
|
||||||
auto-load
|
auto-load
|
||||||
url="Towns/location"
|
url="Towns/location"
|
||||||
/>
|
/>
|
||||||
<FetchData
|
|
||||||
@on-fetch="handleCountries"
|
|
||||||
:sort-by="['name ASC']"
|
|
||||||
:limit="30"
|
|
||||||
auto-load
|
|
||||||
url="Countries"
|
|
||||||
/>
|
|
||||||
<FormModelPopup
|
<FormModelPopup
|
||||||
url-create="postcodes"
|
url-create="postcodes"
|
||||||
model="postcode"
|
model="postcode"
|
||||||
|
@ -219,8 +213,10 @@ async function handleCountries(data) {
|
||||||
@on-province-created="onProvinceCreated"
|
@on-province-created="onProvinceCreated"
|
||||||
/>
|
/>
|
||||||
<VnSelect
|
<VnSelect
|
||||||
|
url="Countries"
|
||||||
|
:sort-by="['name ASC']"
|
||||||
:label="t('Country')"
|
:label="t('Country')"
|
||||||
:options="countriesOptions"
|
@update:options="handleCountries"
|
||||||
hide-selected
|
hide-selected
|
||||||
option-label="name"
|
option-label="name"
|
||||||
option-value="id"
|
option-value="id"
|
||||||
|
|
Loading…
Reference in New Issue