diff --git a/src/components/CrudModel.vue b/src/components/CrudModel.vue index 1234ce123..b1c7606e6 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 f24f054a5..14005e1cc 100644 --- a/src/components/common/VnSelect.vue +++ b/src/components/common/VnSelect.vue @@ -284,9 +284,9 @@ async function onScroll({ to, direction, from, index }) { :loading="isLoading" @virtual-scroll="onScroll" > - diff --git a/src/i18n/locale/en.yml b/src/i18n/locale/en.yml index e2e0e4238..31a6931a4 100644 --- a/src/i18n/locale/en.yml +++ b/src/i18n/locale/en.yml @@ -766,7 +766,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 58ddc98ef..ccc21e225 100644 --- a/src/i18n/locale/es.yml +++ b/src/i18n/locale/es.yml @@ -760,7 +760,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/Account/Card/AccountMailForwarding.vue b/src/pages/Account/Card/AccountMailForwarding.vue index aa92e5072..30849d44a 100644 --- a/src/pages/Account/Card/AccountMailForwarding.vue +++ b/src/pages/Account/Card/AccountMailForwarding.vue @@ -41,8 +41,12 @@ const fetchAccountExistence = async () => { }; const fetchMailForwards = async () => { - const response = await axios.get(`MailForwards/${route.params.id}`); - return response.data; + try { + const response = await axios.get(`MailForwards/${route.params.id}`); + return response.data; + } catch { + return null; + } }; const deleteMailForward = async () => { diff --git a/src/pages/Item/Card/ItemTags.vue b/src/pages/Item/Card/ItemTags.vue index 461aaef4b..f4ab90d93 100644 --- a/src/pages/Item/Card/ItemTags.vue +++ b/src/pages/Item/Card/ItemTags.vue @@ -66,6 +66,7 @@ const insertTag = (rows) => { 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) + ); + }); +}