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