diff --git a/src/modules/14_KPI/views/report.vue b/src/modules/14_KPI/views/report.vue index bda3917fa..b08829015 100644 --- a/src/modules/14_KPI/views/report.vue +++ b/src/modules/14_KPI/views/report.vue @@ -333,6 +333,8 @@ const formFilter = reactive({ const maxPage = ref(1); const total = ref(0); +const roundRef = ref(null); + const rowsPerson = ref([]); const columns = ref([ { @@ -398,8 +400,17 @@ const columns = ref([ * function เปิด popup เลือกราชชื่อ */ function onClickModal() { - modal.value = true; - fetchListPerson(); + if (typeReport.value === "KPI8") { + roundRef.value.validate(); + + if (!roundRef.value.hasError) { + modal.value = true; + fetchListPerson(); + } + } else { + modal.value = true; + fetchListPerson(); + } } /** @@ -592,11 +603,13 @@ onMounted(() => { { map-options :disable="roundOp.length === 0" @update:model-value="changOption(typeReport)" + lazy-rules + :rules=" + typeReport === 'KPI8' + ? [(val) => !!val || 'กรุณาเลือกรอบการประเมิน'] + : [] + " />