diff --git a/src/modules/05_leave/componenst/Forms/06_OrdinationForm.vue b/src/modules/05_leave/componenst/Forms/06_OrdinationForm.vue index edbce20..16ebbee 100644 --- a/src/modules/05_leave/componenst/Forms/06_OrdinationForm.vue +++ b/src/modules/05_leave/componenst/Forms/06_OrdinationForm.vue @@ -1,12 +1,17 @@ + + -
- เคยบวชหรือไม่ +
+
+ + + + + + + + + + + +
+ +
เคยบวชหรือไม่
+
สถานที่บวช
@@ -365,6 +380,7 @@ function onSubmit() { +
- + -
- สถานที่จำพรรษา -
+ +
สถานที่จำพรรษา
+ + +
+ + + +
+
@@ -451,7 +485,9 @@ function onSubmit() {
+ +
import { reactive, ref } from "vue"; import { useCounterMixin } from "@/stores/mixin"; -import type { FormRef07 } from "@/modules/05_leave/interface/request/AddAbsence"; import { useQuasar } from "quasar"; +import type { FormRef07 } from "@/modules/05_leave/interface/request/AddAbsence"; + const $q = useQuasar(); const mixin = useCounterMixin(); const { date2Thai, dialogConfirm } = mixin; + const edit = ref(true); +const files = ref(null); + +/** ตัวแปร ref สำหรับแสดง validate */ +const fileRef = ref(null); +const writeatRef = ref(null); +const governmentRef = ref(null); +const dateLeaveStartRef = ref(null); +const dateLeaveEndRef = ref(null); + +/** รับ props มาจากหน้าหลัก */ const props = defineProps({ data: { type: Array, @@ -17,7 +29,8 @@ const props = defineProps({ default: () => "", }, }); -const files = ref(null); + +/** ข้อมูล v-model ของฟอร์ม */ const formData = reactive({ writeat: "", government: new Date(), @@ -28,12 +41,7 @@ const formData = reactive({ file: null, }); -const fileRef = ref(null); -const writeatRef = ref(null); -const governmentRef = ref(null); -const dateLeaveStartRef = ref(null); -const dateLeaveEndRef = ref(null); - +/** maping ref เข้าตัวแปรเพื่อเตรียมตรวจสอบ */ const formRef: FormRef07 = { file: fileRef, writeat: writeatRef, @@ -42,9 +50,9 @@ const formRef: FormRef07 = { dateLeaveEnd: dateLeaveEndRef, }; +/** ฟังชั่นตรวจสอบความถูกต้องก่อน บันทึก */ function onValidate() { const hasError = []; - for (const key in formRef) { if (Object.prototype.hasOwnProperty.call(formRef, key)) { const property = formRef[key]; @@ -58,6 +66,8 @@ function onValidate() { onSubmit(); } } + +/** ฟังชั่น บันทึก */ function onSubmit() { dialogConfirm( $q, @@ -88,6 +98,7 @@ function onSubmit() { label="เขียนที่" :rules="[(val) => !!val || `${'เขียนที่'}`]" /> +
+ + -
- เคยไปประกอบพิธีฮัจย์หรือไม่ -
+
เคยไปประกอบพิธีฮัจย์หรือไม่
+ +