refactor: add q-form submit

This commit is contained in:
Thanaphon Frappet 2024-12-20 17:42:50 +07:00
parent 4cdc462ded
commit ba6950769a

View file

@ -122,6 +122,7 @@ const { t, locale } = useI18n();
const ocrStore = useOcrStore(); const ocrStore = useOcrStore();
const $q = useQuasar(); const $q = useQuasar();
const openQuotation = ref<boolean>(false); const openQuotation = ref<boolean>(false);
const formMetadata = ref();
const rowsRequestList = ref<RequestData[]>([]); const rowsRequestList = ref<RequestData[]>([]);
@ -1433,6 +1434,14 @@ watch(
</template> </template>
<div class="surface-1 q-pa-md full-width"> <div class="surface-1 q-pa-md full-width">
<q-form
ref="formMetadata"
@submit="
() => {
convertDataToFormSubmit();
}
"
>
<QuotationFormMetadata <QuotationFormMetadata
class="q-mb-md" class="q-mb-md"
:readonly :readonly
@ -1460,6 +1469,7 @@ watch(
/> />
</template> </template>
</QuotationFormMetadata> </QuotationFormMetadata>
</q-form>
</div> </div>
</q-expansion-item> </q-expansion-item>
@ -2240,16 +2250,13 @@ watch(
v-if="quotationFormState.mode === 'info' && closeAble()" v-if="quotationFormState.mode === 'info' && closeAble()"
/> />
<SaveButton <SaveButton
type="submit"
v-if=" v-if="
quotationFormState.mode === 'create' || quotationFormState.mode === 'create' ||
quotationFormState.mode === 'edit' quotationFormState.mode === 'edit'
" "
@click="
() => {
convertDataToFormSubmit();
}
"
solid solid
@click="() => formMetadata.submit()"
/> />
<EditButton <EditButton
v-else v-else