diff --git a/src/modules/05_leave/componenst/Forms/01_SickForm.vue b/src/modules/05_leave/componenst/Forms/01_SickForm.vue index 9a85ca6..e341e8c 100644 --- a/src/modules/05_leave/componenst/Forms/01_SickForm.vue +++ b/src/modules/05_leave/componenst/Forms/01_SickForm.vue @@ -1,10 +1,12 @@ @@ -173,7 +184,7 @@ function onValidate() { borderless :enableTimePicker="false" week-start="0" - :readonly="!edit" + :readonly="isReadOnly" > - +
+

+ เป็นเวลา + {{ calculateDurationYmd(formData.startLeaveDate, formData.endLeaveDate) }} +

+
@@ -302,7 +306,7 @@ function onValidate() {
- +
diff --git a/src/modules/05_leave/componenst/Forms/03_Birth.vue b/src/modules/05_leave/componenst/Forms/03_Birth.vue index 77b774b..e3ad3d7 100644 --- a/src/modules/05_leave/componenst/Forms/03_Birth.vue +++ b/src/modules/05_leave/componenst/Forms/03_Birth.vue @@ -4,7 +4,7 @@ import type { FormData, FormRef } from "@/modules/05_leave/interface/request/Bir import { useCounterMixin } from "@/stores/mixin" const mixin = useCounterMixin() -const { date2Thai } = mixin +const { date2Thai, calculateDurationYmd } = mixin const edit = ref(true) /** รับ props มาจากหน้าหลัก */ @@ -20,7 +20,7 @@ const props = defineProps({ }) /** ข้อมูล v-model ของฟอร์ม */ -const formData = reactive({ +const formData = reactive({ leaveNo: "", startLeaveDate: null, endLeaveDate: null, @@ -192,48 +192,43 @@ function onValidate() { - - - - - +
+

+ เป็นเวลา + {{ calculateDurationYmd(formData.startLeaveDate, formData.endLeaveDate) }} +

+
+
+
+ + +
+
- +
diff --git a/src/modules/05_leave/componenst/Forms/04_HelpWifeBirthForm.vue b/src/modules/05_leave/componenst/Forms/04_HelpWifeBirthForm.vue index e1878af..3bb8379 100644 --- a/src/modules/05_leave/componenst/Forms/04_HelpWifeBirthForm.vue +++ b/src/modules/05_leave/componenst/Forms/04_HelpWifeBirthForm.vue @@ -4,7 +4,7 @@ import type { FormData, FormRef } from "@/modules/05_leave/interface/request/Hel import { useCounterMixin } from "@/stores/mixin" const mixin = useCounterMixin() -const { date2Thai } = mixin +const { date2Thai, calculateDurationYmd } = mixin const edit = ref(true) /** รับ props มาจากหน้าหลัก */ @@ -20,7 +20,7 @@ const props = defineProps({ }) /** ข้อมูล v-model ของฟอร์ม */ -const formData = reactive({ +const formData = reactive({ leaveNo: "", wifeName: "", brithDate: null, @@ -214,19 +214,12 @@ function onValidate() {
- +
+

+ เป็นเวลา + {{ calculateDurationYmd(formData.startLeaveDate, formData.endLeaveDate) }} +

+
+
+
+ - - - - + +
+
- +
diff --git a/src/modules/05_leave/componenst/Forms/05_VacationForm.vue b/src/modules/05_leave/componenst/Forms/05_VacationForm.vue index 5799a45..698d501 100644 --- a/src/modules/05_leave/componenst/Forms/05_VacationForm.vue +++ b/src/modules/05_leave/componenst/Forms/05_VacationForm.vue @@ -4,7 +4,7 @@ import type { FormData, FormRef } from "@/modules/05_leave/interface/request/Vac import { useCounterMixin } from "@/stores/mixin" const mixin = useCounterMixin() -const { date2Thai } = mixin +const { date2Thai, calculateDurationYmd } = mixin const edit = ref(true) /** รับ props มาจากหน้าหลัก */ @@ -20,7 +20,7 @@ const props = defineProps({ }) /** ข้อมูล v-model ของฟอร์ม */ -const formData = reactive({ +const formData = reactive({ leaveNo: "", halfDay: "day", lastYearVacation: "", @@ -230,48 +230,43 @@ function onValidate() {
- - - - - +
+

+ เป็นเวลา + {{ calculateDurationYmd(formData.startLeaveDate, formData.endLeaveDate) }} +

+
+
+
+ + +
+
- +
diff --git a/src/modules/05_leave/componenst/Forms/06_OrdinationForm.vue b/src/modules/05_leave/componenst/Forms/06_OrdinationForm.vue index 13ab6e8..df5d253 100644 --- a/src/modules/05_leave/componenst/Forms/06_OrdinationForm.vue +++ b/src/modules/05_leave/componenst/Forms/06_OrdinationForm.vue @@ -6,7 +6,7 @@ import type { FormRef06 } from "@/modules/05_leave/interface/request/AddAbsence" const $q = useQuasar() const mixin = useCounterMixin() -const { date2Thai, dialogConfirm } = mixin +const { date2Thai, dialogConfirm, calculateDurationYmd } = mixin const edit = ref(true) const files = ref(null) @@ -96,9 +96,10 @@ function onSubmit() { console.log(formData) props.onSubmit() }, - "ยืนยันการบันทึกข้อมูล", - "ต้องการยืนยันการบันทึกข้อมูลนี้หรือไม่ ?" + "ยืนยันการยื่นใบลา", + "ต้องการยืนยันการยื่นใบลานี้ใช่หรือไม่ ?" ) + console.log("tese") } @@ -175,8 +176,12 @@ function onSubmit() { - - +
+

+ เป็นเวลา + {{ calculateDurationYmd(formData.dateLeaveStart, formData.dateLeaveEnd) }} +

+
+
@@ -398,7 +414,7 @@ function onSubmit() {
- +
diff --git a/src/modules/05_leave/componenst/Forms/07_HajjForm.vue b/src/modules/05_leave/componenst/Forms/07_HajjForm.vue index aa625aa..b939449 100644 --- a/src/modules/05_leave/componenst/Forms/07_HajjForm.vue +++ b/src/modules/05_leave/componenst/Forms/07_HajjForm.vue @@ -6,7 +6,7 @@ import type { FormRef07 } from "@/modules/05_leave/interface/request/AddAbsence" const $q = useQuasar() const mixin = useCounterMixin() -const { date2Thai, dialogConfirm } = mixin +const { date2Thai, dialogConfirm, calculateDurationYmd } = mixin const edit = ref(true) const files = ref(null) @@ -73,8 +73,8 @@ function onSubmit() { console.log(formData) props.onSubmit() }, - "ยืนยันการบันทึกข้อมูล", - "ต้องการยืนยันการบันทึกข้อมูลนี้หรือไม่ ?" + "ยืนยันการยื่นใบลา", + "ต้องการยืนยันการยื่นใบลานี้ใช่หรือไม่ ?" ) } @@ -171,8 +171,12 @@ function onSubmit() { - - +
+

+ เป็นเวลา + {{ calculateDurationYmd(formData.dateLeaveStart, formData.dateLeaveEnd) }} +

+
- +
diff --git a/src/modules/05_leave/componenst/Forms/08_MilitaryForm.vue b/src/modules/05_leave/componenst/Forms/08_MilitaryForm.vue index 53c7149..f1faf28 100644 --- a/src/modules/05_leave/componenst/Forms/08_MilitaryForm.vue +++ b/src/modules/05_leave/componenst/Forms/08_MilitaryForm.vue @@ -6,7 +6,7 @@ import type { FormRef08 } from "@/modules/05_leave/interface/request/AddAbsence" const $q = useQuasar() const mixin = useCounterMixin() -const { date2Thai, dialogConfirm } = mixin +const { date2Thai, dialogConfirm, calculateDurationYmd } = mixin const edit = ref(true) const files = ref(null) @@ -85,8 +85,8 @@ function onSubmit() { console.log(formData) props.onSubmit() }, - "ยืนยันการบันทึกข้อมูล", - "ต้องการยืนยันการบันทึกข้อมูลนี้หรือไม่ ?" + "ยืนยันการยื่นใบลา", + "ต้องการยืนยันการยื่นใบลานี้ใช่หรือไม่ ?" ) } @@ -163,8 +163,12 @@ function onSubmit() {
- - +
+

+ เป็นเวลา + {{ calculateDurationYmd(formData.dateLeaveStart, formData.dateLeaveEnd) }} +

+
- +
diff --git a/src/modules/05_leave/componenst/Forms/09_StudyForm.vue b/src/modules/05_leave/componenst/Forms/09_StudyForm.vue index 1f82a77..a8aa21b 100644 --- a/src/modules/05_leave/componenst/Forms/09_StudyForm.vue +++ b/src/modules/05_leave/componenst/Forms/09_StudyForm.vue @@ -100,8 +100,8 @@ function onSubmit() { console.log(formData) props.onSubmit() }, - "ยืนยันการบันทึกข้อมูล", - "ต้องการยืนยันการบันทึกข้อมูลนี้หรือไม่ ?" + "ยืนยันการยื่นใบลา", + "ต้องการยืนยันการยื่นใบลานี้ใช่หรือไม่ ?" ) } @@ -201,7 +201,7 @@ const formattedSalary = computed(() => {

- ระยะเวลา + เป็นเวลา {{ calculateDurationYmd(formData.dateLeaveStart, formData.dateLeaveEnd) }}

@@ -422,7 +422,7 @@ const formattedSalary = computed(() => {
- +
diff --git a/src/modules/05_leave/componenst/Forms/10_TrainForm.vue b/src/modules/05_leave/componenst/Forms/10_TrainForm.vue index 5f399de..a64900a 100644 --- a/src/modules/05_leave/componenst/Forms/10_TrainForm.vue +++ b/src/modules/05_leave/componenst/Forms/10_TrainForm.vue @@ -95,8 +95,8 @@ function onSubmit() { console.log(formData) props.onSubmit() }, - "ยืนยันการบันทึกข้อมูล", - "ต้องการยืนยันการบันทึกข้อมูลนี้หรือไม่ ?" + "ยืนยันการยื่นใบลา", + "ต้องการยืนยันการยื่นใบลานี้ใช่หรือไม่ ?" ) } /** @@ -393,7 +393,7 @@ const formattedSalary = computed(() => {
- +
diff --git a/src/modules/05_leave/componenst/Forms/11_WorkInternationalForm.vue b/src/modules/05_leave/componenst/Forms/11_WorkInternationalForm.vue index c712fba..167dd86 100644 --- a/src/modules/05_leave/componenst/Forms/11_WorkInternationalForm.vue +++ b/src/modules/05_leave/componenst/Forms/11_WorkInternationalForm.vue @@ -96,8 +96,8 @@ function onSubmit() { console.log("savefile อัปโหลด", filesUpload.value) } }, - !isSave.value ? "ยืนยันการบันทึกข้อมูล" : "ยืนยันการอัพโหลดไฟล์", - !isSave.value ? "ต้องการยืนยันการบันทึกข้อมูลนี้หรือไม่ ?" : "ต้องการยืนยันการอัพโหลดไฟล์นี้หรือไม่ ?" + !isSave.value ? "ยืนยันการยื่นใบลา" : "ยืนยันการอัพโหลดไฟล์", + !isSave.value ? "ต้องการยืนยันการยื่นใบลานี้ใช่หรือไม่ ?" : "ต้องการยืนยันการอัพโหลดไฟล์นี้หรือไม่ ?" ) } @@ -302,7 +302,7 @@ function onSubmit() {
- +
diff --git a/src/modules/05_leave/componenst/Forms/12_FollowSpouseForm.vue b/src/modules/05_leave/componenst/Forms/12_FollowSpouseForm.vue index 7890ab4..387534d 100644 --- a/src/modules/05_leave/componenst/Forms/12_FollowSpouseForm.vue +++ b/src/modules/05_leave/componenst/Forms/12_FollowSpouseForm.vue @@ -4,7 +4,7 @@ import type { FormData, FormRef } from "@/modules/05_leave/interface/request/Fol import { useCounterMixin } from "@/stores/mixin" const mixin = useCounterMixin() -const { date2Thai, arabicNumberToText } = mixin +const { date2Thai, arabicNumberToText, calculateDurationYmd } = mixin const edit = ref(true) /** รับ props มาจากหน้าหลัก */ @@ -20,7 +20,7 @@ const props = defineProps({ }) /** ข้อมูล v-model ของฟอร์ม */ -const formData = reactive({ +const formData = reactive({ leaveNo: "", startLeaveDate: null, endLeaveDate: null, @@ -35,7 +35,7 @@ const formData = reactive({ followHistoryTime: "", followHistoryStart: null, followHistoryEnd: null, - leaveDetail: "", //รายละเอียดการลา + leaveDetail: "ในกรณีลาติดต่อกับครั้งก่อน รวมทั้งนี้ด้วย เป็นเวลา ...ปี, ...เดือน, ...วัน", //รายละเอียดการลา file: [], //เอกสารปะกอบ }) @@ -118,6 +118,26 @@ function onValidate() { props.onSubmit() } } + +/** + * function check ว่าถ้ามีค่ามาเเล้วจะเป็น readonly + */ +const isReadOnly = ref(true) +watch(formData.followHistoryCountry, newVal => { + isReadOnly.value = !!newVal +}) + +watch(formData.followHistoryTime, newVal => { + isReadOnly.value = !!newVal +}) + +watch(formData.followHistoryStart, newVal => { + isReadOnly.value = !!newVal +}) + +watch(formData.followHistoryEnd, newVal => { + isReadOnly.value = !!newVal +}) - -
+
+

+ มีกำหนด + {{ calculateDurationYmd(formData.startLeaveDate, formData.endLeaveDate) }} +

+
+
@@ -324,7 +337,7 @@ function onValidate() { borderless :enableTimePicker="false" week-start="0" - :readonly="!edit" + :readonly="isReadOnly" >