fix รายการข้าราชการ ฯ ที่ได้รับทุนการศึกษา/ฝึกอบรม
This commit is contained in:
parent
ff7610e60d
commit
db069e0ff9
2 changed files with 52 additions and 18 deletions
|
|
@ -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);
|
||||
|
|
|
|||
|
|
@ -91,6 +91,19 @@ const columns = ref<QTableProps["columns"]>([
|
|||
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<string[]>([
|
||||
"year",
|
||||
|
|
@ -100,6 +113,7 @@ const visibleColumns = ref<string[]>([
|
|||
"posType",
|
||||
"posLevel",
|
||||
"posExecutive",
|
||||
"status",
|
||||
]);
|
||||
|
||||
const scholarshipTypeOp = ref<DataOption[]>([
|
||||
|
|
@ -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)"
|
||||
>
|
||||
<q-tooltip>แก้ไขข้อมูล</q-tooltip>
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue