From db069e0ff995f5c9b3cb4ac20d0278dba5274dd4 Mon Sep 17 00:00:00 2001 From: "DESKTOP-1R2VSQH\\Lenovo ThinkPad E490" Date: Wed, 11 Dec 2024 14:34:26 +0700 Subject: [PATCH] =?UTF-8?q?fix=20=E0=B8=A3=E0=B8=B2=E0=B8=A2=E0=B8=81?= =?UTF-8?q?=E0=B8=B2=E0=B8=A3=E0=B8=82=E0=B9=89=E0=B8=B2=E0=B8=A3=E0=B8=B2?= =?UTF-8?q?=E0=B8=8A=E0=B8=81=E0=B8=B2=E0=B8=A3=20=E0=B8=AF=20=E0=B8=97?= =?UTF-8?q?=E0=B8=B5=E0=B9=88=E0=B9=84=E0=B8=94=E0=B9=89=E0=B8=A3=E0=B8=B1?= =?UTF-8?q?=E0=B8=9A=E0=B8=97=E0=B8=B8=E0=B8=99=E0=B8=81=E0=B8=B2=E0=B8=A3?= =?UTF-8?q?=E0=B8=A8=E0=B8=B6=E0=B8=81=E0=B8=A9=E0=B8=B2/=E0=B8=9D?= =?UTF-8?q?=E0=B8=B6=E0=B8=81=E0=B8=AD=E0=B8=9A=E0=B8=A3=E0=B8=A1?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../components/scholarship/DetailView.vue | 3 + .../15_development/views/Scholarship.vue | 67 ++++++++++++++----- 2 files changed, 52 insertions(+), 18 deletions(-) diff --git a/src/modules/15_development/components/scholarship/DetailView.vue b/src/modules/15_development/components/scholarship/DetailView.vue index 2e02c1877..9a2a260f2 100644 --- a/src/modules/15_development/components/scholarship/DetailView.vue +++ b/src/modules/15_development/components/scholarship/DetailView.vue @@ -267,6 +267,9 @@ async function fetchDataDetail(id: string) { isStatus.value = data.status; isGov.value = data.citizenId ? true : false; isGuarantor.value = data.guarantorCitizenId ? true : false; + if (isStatus.value !== "PENDING") { + router.push(`/development/scholarship-detail/${id}`); + } }) .catch((err) => { messageError($q, err); diff --git a/src/modules/15_development/views/Scholarship.vue b/src/modules/15_development/views/Scholarship.vue index 97c22e15a..a82bbd429 100644 --- a/src/modules/15_development/views/Scholarship.vue +++ b/src/modules/15_development/views/Scholarship.vue @@ -91,6 +91,19 @@ const columns = ref([ headerStyle: "font-size: 14px", style: "font-size: 14px", }, + + { + name: "status", + align: "left", + label: "สถานะ", + sortable: true, + field: "status", + format(val, row) { + return conventStatus(val); + }, + headerStyle: "font-size: 14px", + style: "font-size: 14px", + }, ]); const visibleColumns = ref([ "year", @@ -100,6 +113,7 @@ const visibleColumns = ref([ "posType", "posLevel", "posExecutive", + "status", ]); const scholarshipTypeOp = ref([ @@ -138,13 +152,16 @@ function fetchList() { http .get( config.API.devScholarship + - `?page=${formQuery.page}&pageSize=${formQuery.pageSize}&keyword=${formQuery.keyword.trim()}&year=${formQuery.year}&scholarshipType=${formQuery.type}` + `?page=${formQuery.page}&pageSize=${ + formQuery.pageSize + }&keyword=${formQuery.keyword.trim()}&year=${ + formQuery.year + }&scholarshipType=${formQuery.type}` ) .then((res) => { const data = res.data.result.data; maxPage.value = Math.ceil(res.data.result.total / formQuery.pageSize); totalList.value = res.data.result.total; - rows.value = data; }) .catch((err) => { @@ -177,23 +194,36 @@ function updatePagination(newPagination: NewPagination) { formQuery.pageSize = newPagination.rowsPerPage; } -/** download file */ -function onDownload() { - showLoader(); - http - .get(config.API.developmentReportScholarship()) - .then((res) => { - const dataList = res.data.result; - genReportXLSX(dataList, "รายการข้าราชการ ฯ ที่ได้รับทุนการศึกษา/ฝึกอบรม"); - }) - .catch((e) => { - messageError($q, e); - }) - .finally(() => { - hideLoader(); - }); +function conventStatus(val: string) { + switch (val) { + case "PENDING": + return "กำลังศึกษา"; + case "GRADUATE": + return "เรียนจบ"; + case "NOTGRADUATE": + return "เรียนไม่จบ"; + default: + break; + } } +// /** download file */ +// function onDownload() { +// showLoader(); +// http +// .get(config.API.developmentReportScholarship()) +// .then((res) => { +// const dataList = res.data.result; +// genReportXLSX(dataList, "รายการข้าราชการ ฯ ที่ได้รับทุนการศึกษา/ฝึกอบรม"); +// }) +// .catch((e) => { +// messageError($q, e); +// }) +// .finally(() => { +// hideLoader(); +// }); +// } + /** เช็ค เมื่อมีการเปลี่ยนค่าของ ข้อมูลในเเถว */ watch( () => formQuery.pageSize, @@ -370,8 +400,9 @@ onMounted(() => { flat dense round + :disable="props.row.status !== 'PENDING'" icon="edit" - color="edit" + :color="props.row.status !== 'PENDING' ? 'grey-6' : 'edit'" @click="onClickAddOrView(true, props.row.id)" > แก้ไขข้อมูล