feat: refs #8725 init
This commit is contained in:
parent
7d07256591
commit
4641adbae3
|
@ -119,7 +119,9 @@ const defaultButtons = computed(() => ({
|
||||||
color: 'primary',
|
color: 'primary',
|
||||||
icon: 'save',
|
icon: 'save',
|
||||||
label: 'globals.save',
|
label: 'globals.save',
|
||||||
click: async () => await save(),
|
click: async () => {
|
||||||
|
submitForm();
|
||||||
|
},
|
||||||
type: 'submit',
|
type: 'submit',
|
||||||
},
|
},
|
||||||
reset: {
|
reset: {
|
||||||
|
@ -132,6 +134,14 @@ const defaultButtons = computed(() => ({
|
||||||
...$props.defaultButtons,
|
...$props.defaultButtons,
|
||||||
}));
|
}));
|
||||||
|
|
||||||
|
const submitForm = () => {
|
||||||
|
myForm.value.validate().then((success) => {
|
||||||
|
if (success) {
|
||||||
|
save();
|
||||||
|
}
|
||||||
|
});
|
||||||
|
};
|
||||||
|
|
||||||
onMounted(async () => {
|
onMounted(async () => {
|
||||||
nextTick(() => (componentIsRendered.value = true));
|
nextTick(() => (componentIsRendered.value = true));
|
||||||
|
|
||||||
|
@ -312,6 +322,7 @@ async function onKeyup(evt) {
|
||||||
}
|
}
|
||||||
|
|
||||||
defineExpose({
|
defineExpose({
|
||||||
|
myForm,
|
||||||
save,
|
save,
|
||||||
isLoading,
|
isLoading,
|
||||||
hasChanges,
|
hasChanges,
|
||||||
|
@ -325,7 +336,7 @@ defineExpose({
|
||||||
<QForm
|
<QForm
|
||||||
ref="myForm"
|
ref="myForm"
|
||||||
v-if="formData"
|
v-if="formData"
|
||||||
@submit.prevent
|
@submit.prevent="save"
|
||||||
@keyup.prevent="onKeyup"
|
@keyup.prevent="onKeyup"
|
||||||
@reset="reset"
|
@reset="reset"
|
||||||
class="q-pa-md"
|
class="q-pa-md"
|
||||||
|
|
|
@ -43,7 +43,7 @@ const onDataSaved = async (formData, requestResponse) => {
|
||||||
|
|
||||||
const onClick = async (saveAndContinue) => {
|
const onClick = async (saveAndContinue) => {
|
||||||
isSaveAndContinue.value = saveAndContinue;
|
isSaveAndContinue.value = saveAndContinue;
|
||||||
await formModelRef.value.save();
|
formModelRef.value.myForm.submit();
|
||||||
};
|
};
|
||||||
|
|
||||||
defineExpose({
|
defineExpose({
|
||||||
|
@ -61,6 +61,7 @@ defineExpose({
|
||||||
:default-actions="false"
|
:default-actions="false"
|
||||||
v-bind="$attrs"
|
v-bind="$attrs"
|
||||||
@on-data-saved="onDataSaved"
|
@on-data-saved="onDataSaved"
|
||||||
|
@submit.prevent
|
||||||
>
|
>
|
||||||
<template #form="{ data, validate }">
|
<template #form="{ data, validate }">
|
||||||
<span ref="closeButton" class="close-icon" v-close-popup>
|
<span ref="closeButton" class="close-icon" v-close-popup>
|
||||||
|
@ -87,7 +88,7 @@ defineExpose({
|
||||||
:flat="showSaveAndContinueBtn"
|
:flat="showSaveAndContinueBtn"
|
||||||
:label="t('globals.save')"
|
:label="t('globals.save')"
|
||||||
:title="t('globals.save')"
|
:title="t('globals.save')"
|
||||||
@click="onClick(false)"
|
type="submit"
|
||||||
color="primary"
|
color="primary"
|
||||||
class="q-ml-sm"
|
class="q-ml-sm"
|
||||||
:disabled="isLoading"
|
:disabled="isLoading"
|
||||||
|
|
|
@ -112,6 +112,7 @@ async function acceptPropagate({ isEqualizated }) {
|
||||||
v-model="data.sageTaxTypeFk"
|
v-model="data.sageTaxTypeFk"
|
||||||
data-cy="sageTaxTypeFk"
|
data-cy="sageTaxTypeFk"
|
||||||
:required="data.isTaxDataChecked"
|
:required="data.isTaxDataChecked"
|
||||||
|
:rules="[(val) => val !== null || 'Please type your age']"
|
||||||
/>
|
/>
|
||||||
<VnSelect
|
<VnSelect
|
||||||
:label="t('Sage transaction type')"
|
:label="t('Sage transaction type')"
|
||||||
|
@ -122,6 +123,7 @@ async function acceptPropagate({ isEqualizated }) {
|
||||||
data-cy="sageTransactionTypeFk"
|
data-cy="sageTransactionTypeFk"
|
||||||
v-model="data.sageTransactionTypeFk"
|
v-model="data.sageTransactionTypeFk"
|
||||||
:required="data.isTaxDataChecked"
|
:required="data.isTaxDataChecked"
|
||||||
|
:rules="[(val) => val !== null || 'Please type your age']"
|
||||||
>
|
>
|
||||||
<template #option="scope">
|
<template #option="scope">
|
||||||
<QItem v-bind="scope.itemProps">
|
<QItem v-bind="scope.itemProps">
|
||||||
|
|
Loading…
Reference in New Issue