forked from verdnatura/salix-front
refactor: refs #7825 modified worker list form to fill the field when a bank entity is created
This commit is contained in:
parent
c78e816f0c
commit
4b9588c189
|
@ -93,6 +93,11 @@ onBeforeMount(async () => {
|
||||||
).data?.payMethodFk;
|
).data?.payMethodFk;
|
||||||
});
|
});
|
||||||
|
|
||||||
|
const handleNewBankEntity = (response, formData) => {
|
||||||
|
bankEntitiesOptions.value = [...bankEntitiesOptions.value, response];
|
||||||
|
formData.bankEntityFk = response.id;
|
||||||
|
};
|
||||||
|
|
||||||
function handleLocation(data, location) {
|
function handleLocation(data, location) {
|
||||||
const { town, code, provinceFk, countryFk } = location ?? {};
|
const { town, code, provinceFk, countryFk } = location ?? {};
|
||||||
data.postcode = code;
|
data.postcode = code;
|
||||||
|
@ -319,7 +324,10 @@ async function autofillBic(worker) {
|
||||||
>
|
>
|
||||||
<template #form>
|
<template #form>
|
||||||
<CreateBankEntityForm
|
<CreateBankEntityForm
|
||||||
@on-data-saved="(data) => bankEntitiesOptions.push(data)"
|
@on-data-saved="
|
||||||
|
(_, requestResponse) =>
|
||||||
|
handleNewBankEntity(requestResponse, data)
|
||||||
|
"
|
||||||
/>
|
/>
|
||||||
</template>
|
</template>
|
||||||
<template #option="scope">
|
<template #option="scope">
|
||||||
|
|
Loading…
Reference in New Issue