diff --git a/src/boot/qformMixin.js b/src/boot/qformMixin.js index 97d80c670..cb31391b3 100644 --- a/src/boot/qformMixin.js +++ b/src/boot/qformMixin.js @@ -9,19 +9,19 @@ export default { if (!form) return; try { const inputsFormCard = form.querySelectorAll( - `input:not([disabled]):not([type="checkbox"])` + `input:not([disabled]):not([type="checkbox"])`, ); if (inputsFormCard.length) { focusFirstInput(inputsFormCard[0]); } const textareas = document.querySelectorAll( - 'textarea:not([disabled]), [contenteditable]:not([disabled])' + 'textarea:not([disabled]), [contenteditable]:not([disabled])', ); if (textareas.length) { focusFirstInput(textareas[textareas.length - 1]); } const inputs = document.querySelectorAll( - 'form#formModel input:not([disabled]):not([type="checkbox"])' + 'form#formModel input:not([disabled]):not([type="checkbox"])', ); const input = inputs[0]; if (!input) return; diff --git a/src/components/FormModel.vue b/src/components/FormModel.vue index 59141d374..5a59f301e 100644 --- a/src/components/FormModel.vue +++ b/src/components/FormModel.vue @@ -113,7 +113,7 @@ const defaultButtons = computed(() => ({ color: 'primary', icon: 'save', label: 'globals.save', - click: () => myForm.value.submit(), + click: () => myForm.value.onSubmit(false), type: 'submit', }, reset: { @@ -207,7 +207,8 @@ async function fetch() { } } -async function save() { +async function save(prevent = false) { + if (prevent) return; if ($props.observeFormChanges && !hasChanges.value) return notify('globals.noChanges', 'negative'); @@ -293,7 +294,7 @@ defineExpose({ -import { ref, computed, onMounted } from 'vue'; +import { ref, computed } from 'vue'; import { useI18n } from 'vue-i18n'; import FormModel from 'components/FormModel.vue'; @@ -70,37 +70,39 @@ defineExpose({ v-close-popup z-max @click=" - () => { - isSaveAndContinue = false; - emit('onDataCanceled'); - } + isSaveAndContinue = false; + emit('onDataCanceled'); " /> diff --git a/src/pages/Customer/components/CustomerNewPayment.vue b/src/pages/Customer/components/CustomerNewPayment.vue index c2c38b55a..7f45cd7db 100644 --- a/src/pages/Customer/components/CustomerNewPayment.vue +++ b/src/pages/Customer/components/CustomerNewPayment.vue @@ -84,7 +84,7 @@ function setPaymentType(accounting) { viewReceipt.value = isCash.value; if (accountingType.value.daysInFuture) initialData.payed.setDate( - initialData.payed.getDate() + accountingType.value.daysInFuture + initialData.payed.getDate() + accountingType.value.daysInFuture, ); maxAmount.value = accountingType.value && accountingType.value.maxAmount; diff --git a/test/cypress/integration/invoiceIn/invoiceInBasicData.spec.js b/test/cypress/integration/invoiceIn/invoiceInBasicData.spec.js index c6bcc37c1..11ca1bb59 100644 --- a/test/cypress/integration/invoiceIn/invoiceInBasicData.spec.js +++ b/test/cypress/integration/invoiceIn/invoiceInBasicData.spec.js @@ -49,7 +49,7 @@ describe('InvoiceInBasicData', () => { 'test/cypress/fixtures/image.jpg', { force: true, - } + }, ); cy.get('[data-cy="FormModelPopup_save"]').click(); cy.checkNotification('Data saved'); diff --git a/test/cypress/integration/wagon/wagonType/wagonTypeCreate.spec.js b/test/cypress/integration/wagon/wagonType/wagonTypeCreate.spec.js index 343c1c127..2cd43984a 100644 --- a/test/cypress/integration/wagon/wagonType/wagonTypeCreate.spec.js +++ b/test/cypress/integration/wagon/wagonType/wagonTypeCreate.spec.js @@ -9,7 +9,7 @@ describe('WagonTypeCreate', () => { it('should create a new wagon type and then delete it', () => { cy.get('.q-page-sticky > div > .q-btn').click(); cy.get('input').first().type('Example for testing'); - cy.get('button[type="submit"]').click(); + cy.get('[data-cy="FormModelPopup_save"]').click(); cy.get('[title="Remove"] > .q-btn__content > .q-icon').first().click(); }); });