Merge branch 'PR-3' of https://gitea.verdnatura.es/hyervoni/salix-front-mindshore into PR-3
This commit is contained in:
commit
42d41b1350
|
@ -1,8 +1,10 @@
|
||||||
<script setup>
|
<script setup>
|
||||||
import { ref } from 'vue';
|
import { onMounted, ref } from 'vue';
|
||||||
import { useI18n } from 'vue-i18n';
|
import { useI18n } from 'vue-i18n';
|
||||||
import { useRoute } from 'vue-router';
|
import { useRoute } from 'vue-router';
|
||||||
|
|
||||||
|
import axios from 'axios';
|
||||||
|
|
||||||
import FetchData from 'components/FetchData.vue';
|
import FetchData from 'components/FetchData.vue';
|
||||||
import FormModel from 'components/FormModel.vue';
|
import FormModel from 'components/FormModel.vue';
|
||||||
import VnRow from 'components/ui/VnRow.vue';
|
import VnRow from 'components/ui/VnRow.vue';
|
||||||
|
@ -17,18 +19,17 @@ const route = useRoute();
|
||||||
const payMethods = ref([]);
|
const payMethods = ref([]);
|
||||||
const bankEntitiesOptions = ref([]);
|
const bankEntitiesOptions = ref([]);
|
||||||
|
|
||||||
const onBankEntityCreated = (data) => {
|
onMounted(() => getBankEntities());
|
||||||
bankEntitiesOptions.value.push(data);
|
|
||||||
|
const getBankEntities = async () => {
|
||||||
|
const filter = { fields: ['id', 'bic', 'name'], order: 'bic ASC', limit: 30 };
|
||||||
|
const { data } = await axios.get('BankEntities', { filter });
|
||||||
|
bankEntitiesOptions.value = data;
|
||||||
};
|
};
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<template>
|
<template>
|
||||||
<fetch-data @on-fetch="(data) => (payMethods = data)" auto-load url="PayMethods" />
|
<fetch-data @on-fetch="(data) => (payMethods = data)" auto-load url="PayMethods" />
|
||||||
<FetchData
|
|
||||||
@on-fetch="(data) => (bankEntitiesOptions = data)"
|
|
||||||
auto-load
|
|
||||||
url="BankEntities"
|
|
||||||
/>
|
|
||||||
|
|
||||||
<FormModel
|
<FormModel
|
||||||
:url-update="`Clients/${route.params.id}`"
|
:url-update="`Clients/${route.params.id}`"
|
||||||
|
@ -73,9 +74,7 @@ const onBankEntityCreated = (data) => {
|
||||||
v-model="data.bankEntityFk"
|
v-model="data.bankEntityFk"
|
||||||
>
|
>
|
||||||
<template #form>
|
<template #form>
|
||||||
<CreateBankEntityForm
|
<CreateBankEntityForm @on-data-saved="getBankEntities()" />
|
||||||
@on-data-saved="onBankEntityCreated($event)"
|
|
||||||
/>
|
|
||||||
</template>
|
</template>
|
||||||
<template #option="scope">
|
<template #option="scope">
|
||||||
<QItem v-bind="scope.itemProps">
|
<QItem v-bind="scope.itemProps">
|
||||||
|
|
Loading…
Reference in New Issue