fix: minor bug
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
930265d790
commit
c706ac42af
|
@ -159,9 +159,10 @@ onMounted(async () => {
|
||||||
const query = JSON.parse(route.query?.createForm);
|
const query = JSON.parse(route.query?.createForm);
|
||||||
formInitialData.value = query;
|
formInitialData.value = query;
|
||||||
await onClientSelected({ ...formInitialData.value, clientId: query?.clientFk });
|
await onClientSelected({ ...formInitialData.value, clientId: query?.clientFk });
|
||||||
} else {
|
} else if (route.query?.table) {
|
||||||
const query = JSON.parse(route.query?.table);
|
const query = JSON.parse(route.query?.table);
|
||||||
await onClientSelected({ clientId: query?.clientFk });
|
const clientId = query?.clientFk;
|
||||||
|
if (clientId) await onClientSelected({ clientId });
|
||||||
}
|
}
|
||||||
if (tableRef.value) tableRef.value.create.formInitialData = formInitialData.value;
|
if (tableRef.value) tableRef.value.create.formInitialData = formInitialData.value;
|
||||||
});
|
});
|
||||||
|
@ -171,7 +172,7 @@ watch(
|
||||||
async (newValue) => {
|
async (newValue) => {
|
||||||
if (newValue) {
|
if (newValue) {
|
||||||
const clientId = +JSON.parse(newValue)?.clientFk;
|
const clientId = +JSON.parse(newValue)?.clientFk;
|
||||||
await onClientSelected({ clientId });
|
if (clientId) await onClientSelected({ clientId });
|
||||||
if (tableRef.value)
|
if (tableRef.value)
|
||||||
tableRef.value.create.formInitialData = formInitialData.value;
|
tableRef.value.create.formInitialData = formInitialData.value;
|
||||||
}
|
}
|
||||||
|
|
|
@ -263,15 +263,8 @@ const columns = computed(() => [
|
||||||
]);
|
]);
|
||||||
const onClientSelected = async (formData) => {
|
const onClientSelected = async (formData) => {
|
||||||
resetAgenciesSelector(formData);
|
resetAgenciesSelector(formData);
|
||||||
// await fetchClient(formData);
|
|
||||||
await fetchAddresses(formData);
|
await fetchAddresses(formData);
|
||||||
};
|
};
|
||||||
const fetchClient = async (formData) => {
|
|
||||||
const response = await getClient(formData.clientId);
|
|
||||||
if (!response) return;
|
|
||||||
const [client] = response.data;
|
|
||||||
selectedClient.value = client;
|
|
||||||
};
|
|
||||||
|
|
||||||
const fetchAddresses = async (formData) => {
|
const fetchAddresses = async (formData) => {
|
||||||
const { data } = await getAddresses(formData.clientId);
|
const { data } = await getAddresses(formData.clientId);
|
||||||
|
|
Loading…
Reference in New Issue