fix: fix create bankEntity
gitea/salix-front/pipeline/pr-master This commit looks good Details

This commit is contained in:
Carlos Satorres 2024-11-20 09:22:50 +01:00
parent ff272ab6c3
commit 2806c94fdb
2 changed files with 6 additions and 10 deletions

View File

@ -9,8 +9,6 @@ import VnRow from 'components/ui/VnRow.vue';
import FormModelPopup from './FormModelPopup.vue'; import FormModelPopup from './FormModelPopup.vue';
import { useState } from 'src/composables/useState'; import { useState } from 'src/composables/useState';
defineProps({ showEntityField: { type: Boolean, default: true } });
const emit = defineEmits(['onDataSaved']); const emit = defineEmits(['onDataSaved']);
const { t } = useI18n(); const { t } = useI18n();
const bicInputRef = ref(null); const bicInputRef = ref(null);
@ -22,13 +20,8 @@ const bankEntityFormData = reactive({
name: null, name: null,
bic: null, bic: null,
countryFk: customer.value?.countryFk, countryFk: customer.value?.countryFk,
id: null,
}); });
const countriesFilter = {
fields: ['id', 'name', 'code'],
};
const countriesOptions = ref([]); const countriesOptions = ref([]);
const onDataSaved = (...args) => { const onDataSaved = (...args) => {
@ -44,7 +37,6 @@ onMounted(async () => {
<template> <template>
<FetchData <FetchData
url="Countries" url="Countries"
:filter="countriesFilter"
auto-load auto-load
@on-fetch="(data) => (countriesOptions = data)" @on-fetch="(data) => (countriesOptions = data)"
/> />
@ -85,7 +77,12 @@ onMounted(async () => {
:rules="validate('bankEntity.countryFk')" :rules="validate('bankEntity.countryFk')"
/> />
</div> </div>
<div v-if="showEntityField" class="col"> <div
v-if="
countriesOptions.find((c) => c.id === data.countryFk).code == 'ES'
"
class="col"
>
<VnInput <VnInput
:label="t('id')" :label="t('id')"
v-model="data.id" v-model="data.id"

View File

@ -126,7 +126,6 @@ const setWireTransfer = async () => {
(_, requestResponse) => (_, requestResponse) =>
onBankEntityCreated(requestResponse, row) onBankEntityCreated(requestResponse, row)
" "
:show-entity-field="false"
/> />
</template> </template>
<template #option="scope"> <template #option="scope">