diff --git a/src/components/Dialogs/PopupReason.vue b/src/components/Dialogs/PopupReason.vue index 45f546b96..9ba658c11 100644 --- a/src/components/Dialogs/PopupReason.vue +++ b/src/components/Dialogs/PopupReason.vue @@ -28,6 +28,10 @@ const props = defineProps({ textReport: { type: String, }, + isRules: { + type: Boolean, + default: true, + }, }); watch(props, () => { if (modal.value === true && props.textReport == "") { @@ -68,7 +72,7 @@ function closeModal() { outlined dense lazy-rules - :rules="[(val:string) => !!val || `กรุณากรอก${label}`]" + :rules="isRules ? [(val:string) => !!val || `กรุณากรอก${label}`] : []" v-model="reason" :label="`${label}`" /> diff --git a/src/modules/09_leave/components/05_Leave/DetailLeavePage.vue b/src/modules/09_leave/components/05_Leave/DetailLeavePage.vue index 0387976c0..9cf589651 100644 --- a/src/modules/09_leave/components/05_Leave/DetailLeavePage.vue +++ b/src/modules/09_leave/components/05_Leave/DetailLeavePage.vue @@ -63,6 +63,7 @@ const dialogTitle = ref("อนุญาต"); // Title ของ Dialog const dialogLabel = ref("เหตุผล"); // Label ของ Dialog const modalAdd = ref(false); // เปิด Modal เพิ่มผู้บังคับบัญชา const typeAdd = ref(""); // ประเภทการเพิ่ม เช่น COMMANDER, APPROVER +const isRules = ref(true); // เช็คว่ามีการกำหนดกฎของหมายความคิดเห็น /** Form รายละเอียดข้อมูล*/ const formData = reactive({ id: "", //Id การยื่นขอลา @@ -446,14 +447,17 @@ async function checkLeaveType(leaveTypeId: string, formData: FormData) { async function openModal(data: string) { if (data === "approve") { modalApprove.value = true; + isRules.value = false; dialogTitle.value = "อนุญาต"; } if (data === "UnApprove") { modalApprove.value = true; dialogTitle.value = "ไม่อนุญาต"; + isRules.value = true; } if (data === "authority") { modalApprove.value = true; + isRules.value = true; dialogTitle.value = "ความคิดเห็นของผู้บังคับบัญชา"; dialogLabel.value = "ความคิดเห็น"; } @@ -1229,7 +1233,8 @@ onMounted(async () => { v-model:modal="modalApprove" :title="dialogTitle" :label="dialogLabel" - :savaForm="clickSave" + :sava-form="clickSave" + :is-rules="isRules" />