forked from verdnatura/salix-front
Actualizar src/components/CreateNewPostcodeForm.vue
This commit is contained in:
parent
48fdc9e624
commit
70dcadc57d
|
@ -108,11 +108,11 @@ watch(
|
|||
|
||||
watch(
|
||||
() => postcodeFormData.provinceFk,
|
||||
async (newProvinceFk) => {
|
||||
async (newProvinceFk, oldValueFk) => {
|
||||
if (Array.isArray(newProvinceFk)) {
|
||||
newProvinceFk = newProvinceFk[0];
|
||||
}
|
||||
if (newProvinceFk !== postcodeFormData.provinceFk) {
|
||||
if (newProvinceFk !== oldValueFk) {
|
||||
await townsFetchDataRef.value.fetch({
|
||||
where: { provinceFk: newProvinceFk },
|
||||
});
|
||||
|
@ -147,13 +147,7 @@ async function handleCountries(data) {
|
|||
auto-load
|
||||
url="Towns/location"
|
||||
/>
|
||||
<FetchData
|
||||
@on-fetch="handleCountries"
|
||||
:sort-by="['name ASC']"
|
||||
:limit="30"
|
||||
auto-load
|
||||
url="Countries"
|
||||
/>
|
||||
|
||||
<FormModelPopup
|
||||
url-create="postcodes"
|
||||
model="postcode"
|
||||
|
@ -219,8 +213,11 @@ async function handleCountries(data) {
|
|||
@on-province-created="onProvinceCreated"
|
||||
/>
|
||||
<VnSelect
|
||||
url="Countries"
|
||||
:limit="30"
|
||||
:sort-by="['name ASC']"
|
||||
:label="t('Country')"
|
||||
:options="countriesOptions"
|
||||
@update:options="handleCountries"
|
||||
hide-selected
|
||||
option-label="name"
|
||||
option-value="id"
|
||||
|
|
Loading…
Reference in New Issue