From f02468d7fdba21cf69fc1956e8003253bc32cece Mon Sep 17 00:00:00 2001 From: AnandaTon Date: Mon, 20 Nov 2023 18:01:01 +0700 Subject: [PATCH] =?UTF-8?q?=E0=B9=81=E0=B8=81=E0=B9=89=20Ui=20=E0=B8=9F?= =?UTF-8?q?=E0=B8=AD=E0=B8=A3=E0=B9=8C=E0=B8=A1=20=E0=B9=80=E0=B8=9E?= =?UTF-8?q?=E0=B8=B4=E0=B9=88=E0=B8=A1=20function=20=E0=B8=95=E0=B9=88?= =?UTF-8?q?=E0=B8=B2=E0=B8=87=E0=B9=86?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../05_leave/componenst/Forms/01_SickForm.vue | 44 +++++----- .../05_leave/componenst/Forms/03_Birth.vue | 83 +++++++++---------- .../componenst/Forms/04_HelpWifeBirthForm.vue | 83 +++++++++---------- .../componenst/Forms/05_VacationForm.vue | 83 +++++++++---------- .../componenst/Forms/06_OrdinationForm.vue | 28 +++++-- .../05_leave/componenst/Forms/07_HajjForm.vue | 16 ++-- .../componenst/Forms/08_MilitaryForm.vue | 16 ++-- .../componenst/Forms/09_StudyForm.vue | 8 +- .../componenst/Forms/10_TrainForm.vue | 6 +- .../Forms/11_WorkInternationalForm.vue | 6 +- .../componenst/Forms/12_FollowSpouseForm.vue | 60 +++++++++----- .../Forms/13_RehabilitationForm.vue | 6 +- .../05_leave/componenst/addAbsence.vue | 4 +- src/modules/05_leave/views/AddPage.vue | 8 +- 14 files changed, 241 insertions(+), 210 deletions(-) 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" >