fix: jsegarra proposal
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
3695b76fbd
commit
85716cac19
|
@ -171,8 +171,8 @@ watch(
|
||||||
() => route.query.table,
|
() => route.query.table,
|
||||||
async (newValue) => {
|
async (newValue) => {
|
||||||
if (newValue) {
|
if (newValue) {
|
||||||
const clientId = +JSON.parse(newValue)?.clientFk;
|
const clientFk = +JSON.parse(newValue)?.clientFk;
|
||||||
if (clientId) await onClientSelected({ clientId });
|
if (clientFk) await onClientSelected({ clientFk });
|
||||||
if (tableRef.value)
|
if (tableRef.value)
|
||||||
tableRef.value.create.formInitialData = formInitialData.value;
|
tableRef.value.create.formInitialData = formInitialData.value;
|
||||||
}
|
}
|
||||||
|
@ -180,13 +180,13 @@ watch(
|
||||||
{ immediate: true },
|
{ immediate: true },
|
||||||
);
|
);
|
||||||
|
|
||||||
async function onClientSelected({ clientId: id }, formData = {}) {
|
async function onClientSelected({ clientFk }, formData = {}) {
|
||||||
const { data } = await getAddresses(id);
|
const { data } = await getAddresses(clientFk);
|
||||||
addressOptions.value = data;
|
addressOptions.value = data;
|
||||||
formData.defaultAddressFk = data[0].client.defaultAddressFk;
|
formData.defaultAddressFk = data[0].client.defaultAddressFk;
|
||||||
formData.addressId = formData.defaultAddressFk;
|
formData.addressId = formData.defaultAddressFk;
|
||||||
|
|
||||||
formInitialData.value = { addressId: formData.addressId, clientFk: id };
|
formInitialData.value = { addressId: formData.addressId, clientFk };
|
||||||
await fetchAgencies(formData);
|
await fetchAgencies(formData);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -271,7 +271,9 @@ const getDateColor = (date) => {
|
||||||
:include="{ relation: 'addresses' }"
|
:include="{ relation: 'addresses' }"
|
||||||
v-model="data.clientFk"
|
v-model="data.clientFk"
|
||||||
:label="t('module.customer')"
|
:label="t('module.customer')"
|
||||||
@update:model-value="(id) => onClientSelected(id, data)"
|
@update:model-value="
|
||||||
|
(id) => onClientSelected({ clientFk: id }, data)
|
||||||
|
"
|
||||||
>
|
>
|
||||||
<template #option="scope">
|
<template #option="scope">
|
||||||
<QItem v-bind="scope.itemProps">
|
<QItem v-bind="scope.itemProps">
|
||||||
|
|
Loading…
Reference in New Issue