รายการเงินเดือน =>ปรับ validate

This commit is contained in:
DESKTOP-1R2VSQH\Lenovo ThinkPad E490 2024-02-29 15:00:30 +07:00
parent 9fb2a155fa
commit df58602563
3 changed files with 7 additions and 3 deletions

View file

@ -1,4 +1,5 @@
<script setup lang="ts">
import { ref } from "vue";
import { useQuasar } from "quasar";
import http from "@/plugins/http";
import config from "@/app.config";
@ -24,9 +25,13 @@ const props = defineProps({
},
});
const amountRef = ref<any>();
/** ฟังก์ชั่นสำหรับ validate ฟอร์ม */
function validateForm() {
onSubmit();
if (amountRef.value.validate()) {
onSubmit();
}
}
/** function ปืด Popup */
@ -73,6 +78,7 @@ function onSubmit() {
<q-card-section class="scroll" style="max-height: 70vh">
<div class="q-gutter-y-sm">
<q-input
ref="amountRef"
dense
outlined
v-model="amount"

View file

@ -34,7 +34,6 @@ const isReadonly = ref<boolean>(false); // อ่านได้อย่าง
/*** ฟังก์ชั่นสำหรับ validate ฟอร์ม */
function validateForm() {
groupRef.value.validate();
if (groupRef.value.validate()) {
onSubmit();
}

View file

@ -47,7 +47,6 @@ const typeRangeOps = computed(() => {
/*** ฟังก์ชั่นสำหรับ validate ฟอร์ม */
function validateForm() {
typeRef.value.validate();
if (typeRef.value.validate()) {
onSubmit();
}