diff --git a/src/components/CrudModel.vue b/src/components/CrudModel.vue index f0e31af26..e992334b5 100644 --- a/src/components/CrudModel.vue +++ b/src/components/CrudModel.vue @@ -176,14 +176,13 @@ async function saveChanges(data) { const changes = data || getChanges(); try { await axios.post($props.saveUrl || $props.url + '/crud', changes); - } catch (e) { - return (isLoading.value = false); + } finally { + isLoading.value = false; } originalData.value = JSON.parse(JSON.stringify(formData.value)); if (changes.creates?.length) await vnPaginateRef.value.fetch(); hasChanges.value = false; - isLoading.value = false; emit('saveChanges', data); quasar.notify({ type: 'positive', diff --git a/src/components/common/VnSelect.vue b/src/components/common/VnSelect.vue index 571faad64..cd8716194 100644 --- a/src/components/common/VnSelect.vue +++ b/src/components/common/VnSelect.vue @@ -308,9 +308,9 @@ function handleKeyDown(event) { @virtual-scroll="onScroll" :data-cy="$attrs.dataCy ?? $attrs.label + '_select'" > - diff --git a/src/i18n/locale/en.yml b/src/i18n/locale/en.yml index a823a57d4..ecfa2c8fe 100644 --- a/src/i18n/locale/en.yml +++ b/src/i18n/locale/en.yml @@ -768,7 +768,7 @@ travel: thermographs: Thermographs hb: HB basicData: - daysInForward: Days in forward + daysInForward: Automatic movement (Raid) isRaid: Raid thermographs: temperature: Temperature diff --git a/src/i18n/locale/es.yml b/src/i18n/locale/es.yml index 1a075dc50..def0b0696 100644 --- a/src/i18n/locale/es.yml +++ b/src/i18n/locale/es.yml @@ -762,7 +762,7 @@ travel: thermographs: Termógrafos hb: HB basicData: - daysInForward: Días redada + daysInForward: Desplazamiento automatico (redada) isRaid: Redada thermographs: temperature: Temperatura diff --git a/src/pages/Supplier/Card/SupplierAccounts.vue b/src/pages/Supplier/Card/SupplierAccounts.vue index 428ab05c2..c2934830a 100644 --- a/src/pages/Supplier/Card/SupplierAccounts.vue +++ b/src/pages/Supplier/Card/SupplierAccounts.vue @@ -24,13 +24,14 @@ const supplier = ref(null); const supplierAccountRef = ref(null); const wireTransferFk = ref(null); const bankEntitiesOptions = ref([]); +const filteredBankEntitiesOptions = ref([]); const onBankEntityCreated = async (dataSaved, rowData) => { await bankEntitiesRef.value.fetch(); rowData.bankEntityFk = dataSaved.id; }; -const onChangesSaved = () => { +const onChangesSaved = async () => { if (supplier.value.payMethodFk !== wireTransferFk.value) quasar .dialog({ @@ -55,12 +56,35 @@ const setWireTransfer = async () => { await axios.patch(`Suppliers/${route.params.id}`, params); notify('globals.dataSaved', 'positive'); }; + +function findBankFk(value, row) { + row.bankEntityFk = null; + if (!value) return; + + const bankEntityFk = bankEntitiesOptions.value.find((b) => b.id == value.slice(4, 8)); + if (bankEntityFk) row.bankEntityFk = bankEntityFk.id; +} + +function bankEntityFilter(val, update) { + update(() => { + const needle = val.toLowerCase(); + filteredBankEntitiesOptions.value = bankEntitiesOptions.value.filter( + (bank) => + bank.bic.toLowerCase().startsWith(needle) || + bank.name.toLowerCase().includes(needle) + ); + }); +}