2024-04-02 16:00:31 +07:00
|
|
|
<script setup lang="ts">
|
|
|
|
|
import { ref, reactive, onMounted } from "vue";
|
|
|
|
|
import { useQuasar, type QTableProps } from "quasar";
|
|
|
|
|
import { useRouter } from "vue-router";
|
|
|
|
|
|
|
|
|
|
/** importStore*/
|
|
|
|
|
import { useCounterMixin } from "@/stores/mixin";
|
|
|
|
|
|
|
|
|
|
/** use*/
|
|
|
|
|
const $q = useQuasar();
|
|
|
|
|
const router = useRouter();
|
|
|
|
|
const { showLoader, hideLoader } = useCounterMixin();
|
|
|
|
|
|
|
|
|
|
/** หัวตาราง */
|
|
|
|
|
const rows = ref<any>([]);
|
|
|
|
|
const columns = ref<QTableProps["columns"]>([
|
|
|
|
|
{
|
|
|
|
|
name: "citizenId",
|
|
|
|
|
align: "left",
|
|
|
|
|
label: "เลขประจำตัวประชาชน ",
|
|
|
|
|
sortable: true,
|
|
|
|
|
field: "citizenId",
|
|
|
|
|
headerStyle: "font-size: 14px",
|
|
|
|
|
style: "font-size: 14px",
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
name: "name",
|
|
|
|
|
align: "left",
|
|
|
|
|
label: "ชื่อ-นามสกุล",
|
|
|
|
|
sortable: true,
|
|
|
|
|
field: "name",
|
|
|
|
|
headerStyle: "font-size: 14px",
|
|
|
|
|
style: "font-size: 14px",
|
|
|
|
|
},
|
|
|
|
|
|
|
|
|
|
{
|
|
|
|
|
name: "position",
|
|
|
|
|
align: "left",
|
|
|
|
|
label: "ตำแหน่ง",
|
|
|
|
|
sortable: true,
|
|
|
|
|
field: "position",
|
|
|
|
|
headerStyle: "font-size: 14px",
|
|
|
|
|
style: "font-size: 14px",
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
name: "type",
|
|
|
|
|
align: "left",
|
|
|
|
|
label: "ประเภท",
|
|
|
|
|
sortable: true,
|
|
|
|
|
field: "type",
|
|
|
|
|
headerStyle: "font-size: 14px",
|
|
|
|
|
style: "font-size: 14px",
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
name: "level",
|
|
|
|
|
align: "left",
|
|
|
|
|
label: "ระดับ",
|
|
|
|
|
sortable: true,
|
|
|
|
|
field: "level",
|
|
|
|
|
headerStyle: "font-size: 14px",
|
|
|
|
|
style: "font-size: 14px",
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
name: "positionPath",
|
|
|
|
|
align: "left",
|
|
|
|
|
label: "ตำแหน่งทางการบริหาร",
|
|
|
|
|
sortable: true,
|
|
|
|
|
field: "positionPath",
|
|
|
|
|
headerStyle: "font-size: 14px",
|
|
|
|
|
style: "font-size: 14px",
|
|
|
|
|
},
|
|
|
|
|
]);
|
|
|
|
|
const visibleColumns = ref<string[]>([
|
|
|
|
|
"citizenId",
|
|
|
|
|
"name",
|
|
|
|
|
"position",
|
|
|
|
|
"type",
|
|
|
|
|
"level",
|
|
|
|
|
"positionPath",
|
|
|
|
|
]);
|
|
|
|
|
|
|
|
|
|
const options = ref<any>([
|
|
|
|
|
"การศึกษาในประเทศ",
|
|
|
|
|
"ฝึกอบรมในประเทศที่ส่งไปพัฒนากับหน่วยวงานภายนอก (หลักสูตรที่ไม่มีการไปต่างประเทศ)",
|
|
|
|
|
"ฝึกอบรมในประเทศที่ส่งไปพัฒนากับหน่วยวงานภายนอก (หลักสูตรที่มีการไปต่างประเทศ)",
|
|
|
|
|
"ฝึกอบรมในประเทศที่ส่งไปพัฒนากับหน่วยวงานภายนอก (หลักสูตรประเภทนักบริหาร)",
|
|
|
|
|
]);
|
|
|
|
|
const itemDownload = ref<any>([
|
|
|
|
|
{
|
|
|
|
|
label: "ดาวน์โหลด 1",
|
|
|
|
|
value: "",
|
|
|
|
|
icon: "mdi-file-pdf-box",
|
|
|
|
|
color: "green",
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
label: "ดาวน์โหลด 2",
|
|
|
|
|
value: "",
|
|
|
|
|
icon: "mdi-file-table",
|
|
|
|
|
color: "red",
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
label: "ดาวน์โหลด 3",
|
|
|
|
|
value: "",
|
|
|
|
|
icon: "mdi-file-word",
|
|
|
|
|
color: "blue",
|
|
|
|
|
},
|
|
|
|
|
]);
|
|
|
|
|
|
|
|
|
|
const formFilter = reactive({
|
|
|
|
|
page: 1,
|
|
|
|
|
pageSize: 10,
|
|
|
|
|
year: new Date().getFullYear(),
|
|
|
|
|
type: "การศึกษาในประเทศ",
|
|
|
|
|
keyword: "",
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
function fetchList() {
|
|
|
|
|
showLoader();
|
|
|
|
|
const data = [
|
|
|
|
|
{
|
|
|
|
|
id: "1",
|
|
|
|
|
citizenId: "123XXXXXXXXXXX",
|
|
|
|
|
name: "นางสาวสาวิตรี ศรีสมัย",
|
|
|
|
|
position: "นักทรัพยากรบุคคล",
|
|
|
|
|
type: "ทั่วไป",
|
|
|
|
|
level: "ปฏิบัติงาน",
|
|
|
|
|
positionPath: "นักทรัพยากรบุคคล",
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
id: "2",
|
|
|
|
|
citizenId: "1234XXXXXXXXXX",
|
|
|
|
|
name: "นายณัฐพงศ์ ดิษยบุตร",
|
|
|
|
|
position: "นักทรัพยากรบุคคล",
|
|
|
|
|
type: "ทั่วไป",
|
|
|
|
|
level: "ปฏิบัติงาน",
|
|
|
|
|
positionPath: "",
|
|
|
|
|
},
|
|
|
|
|
];
|
|
|
|
|
rows.value = data;
|
|
|
|
|
setTimeout(() => {
|
|
|
|
|
hideLoader();
|
|
|
|
|
}, 500);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
function onClickAddOrView(status: boolean = false, id: string = "") {
|
|
|
|
|
status
|
|
|
|
|
? router.push(`/development/scholarship/${id}`)
|
|
|
|
|
: router.push("/development/scholarship/add");
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
onMounted(() => {
|
|
|
|
|
fetchList();
|
|
|
|
|
});
|
|
|
|
|
</script>
|
|
|
|
|
|
2024-04-01 12:37:15 +07:00
|
|
|
<template>
|
2024-04-02 16:00:31 +07:00
|
|
|
<div class="toptitle text-dark col-12 row items-center">
|
|
|
|
|
รายการข้าราชการฯที่ได้รับทุนการศึกษา/ฝึกอบรม
|
|
|
|
|
</div>
|
|
|
|
|
<q-card flat bordered class="q-pa-md">
|
|
|
|
|
<q-toolbar style="padding: 0px">
|
|
|
|
|
<div class="row q-gutter-sm">
|
|
|
|
|
<datepicker
|
|
|
|
|
menu-class-name="modalfix"
|
|
|
|
|
v-model="formFilter.year"
|
|
|
|
|
:locale="'th'"
|
|
|
|
|
autoApply
|
|
|
|
|
year-picker
|
|
|
|
|
:enableTimePicker="false"
|
|
|
|
|
>
|
|
|
|
|
<template #year="{ year }">{{ year + 543 }}</template>
|
|
|
|
|
<template #year-overlay-value="{ value }">{{
|
|
|
|
|
parseInt(value + 543)
|
|
|
|
|
}}</template>
|
|
|
|
|
<template #trigger>
|
|
|
|
|
<q-input
|
|
|
|
|
dense
|
|
|
|
|
lazy-rules
|
|
|
|
|
outlined
|
|
|
|
|
:model-value="Number(formFilter.year) + 543"
|
|
|
|
|
:label="`${'ปีงบประมาณ'}`"
|
|
|
|
|
>
|
|
|
|
|
<template v-slot:prepend>
|
|
|
|
|
<q-icon
|
|
|
|
|
name="event"
|
|
|
|
|
class="cursor-pointer"
|
|
|
|
|
style="color: var(--q-primary)"
|
|
|
|
|
>
|
|
|
|
|
</q-icon>
|
|
|
|
|
</template>
|
|
|
|
|
</q-input>
|
|
|
|
|
</template>
|
|
|
|
|
</datepicker>
|
|
|
|
|
<q-select
|
|
|
|
|
dense
|
|
|
|
|
outlined
|
|
|
|
|
v-model="formFilter.type"
|
|
|
|
|
:options="options"
|
|
|
|
|
label="เลือกประเภททุน"
|
|
|
|
|
/>
|
|
|
|
|
<q-btn
|
|
|
|
|
flat
|
|
|
|
|
round
|
|
|
|
|
dense
|
|
|
|
|
icon="add"
|
|
|
|
|
color="primary"
|
|
|
|
|
@click="onClickAddOrView()"
|
|
|
|
|
>
|
|
|
|
|
<q-tooltip>เพิ่ม</q-tooltip>
|
|
|
|
|
</q-btn>
|
|
|
|
|
</div>
|
|
|
|
|
|
|
|
|
|
<q-space />
|
|
|
|
|
<div class="row q-gutter-sm">
|
2024-04-02 17:25:48 +07:00
|
|
|
<q-btn
|
|
|
|
|
flat
|
|
|
|
|
round
|
|
|
|
|
color="blue"
|
|
|
|
|
icon="mdi-arrow-down-bold-circle-outline"
|
|
|
|
|
>
|
2024-04-02 16:00:31 +07:00
|
|
|
<q-menu>
|
|
|
|
|
<q-list style="min-width: 100px" dense>
|
|
|
|
|
<q-item clickable v-close-popup v-for="items in itemDownload">
|
|
|
|
|
<q-item-section avatar>
|
|
|
|
|
<q-icon :color="items.color" :name="items.icon" />
|
|
|
|
|
</q-item-section>
|
|
|
|
|
<q-item-section :class="`text-${items.color}`">{{
|
|
|
|
|
items.label
|
|
|
|
|
}}</q-item-section>
|
|
|
|
|
</q-item>
|
|
|
|
|
</q-list>
|
|
|
|
|
</q-menu>
|
2024-04-02 17:25:48 +07:00
|
|
|
<q-tooltip>ดาวน์โหลด</q-tooltip>
|
2024-04-02 16:00:31 +07:00
|
|
|
</q-btn>
|
|
|
|
|
|
|
|
|
|
<q-input
|
|
|
|
|
standout
|
|
|
|
|
dense
|
|
|
|
|
v-model="formFilter.keyword"
|
|
|
|
|
ref="filterRef"
|
|
|
|
|
outlined
|
|
|
|
|
debounce="300"
|
|
|
|
|
placeholder="ค้นหา"
|
|
|
|
|
>
|
|
|
|
|
<template v-slot:append>
|
|
|
|
|
<q-icon v-if="formFilter.keyword == ''" name="search" />
|
|
|
|
|
<q-icon
|
|
|
|
|
v-if="formFilter.keyword !== ''"
|
|
|
|
|
name="clear"
|
|
|
|
|
class="cursor-pointer"
|
|
|
|
|
@click="formFilter.keyword = ''"
|
|
|
|
|
/>
|
|
|
|
|
</template>
|
|
|
|
|
</q-input>
|
|
|
|
|
|
|
|
|
|
<q-select
|
|
|
|
|
v-model="visibleColumns"
|
|
|
|
|
multiple
|
|
|
|
|
outlined
|
|
|
|
|
dense
|
|
|
|
|
options-dense
|
|
|
|
|
:display-value="$q.lang.table.columns"
|
|
|
|
|
emit-value
|
|
|
|
|
map-options
|
|
|
|
|
:options="columns"
|
|
|
|
|
option-value="name"
|
|
|
|
|
options-cover
|
|
|
|
|
style="min-width: 150px"
|
|
|
|
|
/>
|
|
|
|
|
</div>
|
|
|
|
|
</q-toolbar>
|
|
|
|
|
|
|
|
|
|
<div class="col-12">
|
|
|
|
|
<d-table
|
|
|
|
|
for="table"
|
|
|
|
|
ref="table"
|
|
|
|
|
:columns="columns"
|
|
|
|
|
:rows="rows"
|
|
|
|
|
row-key="subject"
|
|
|
|
|
flat
|
|
|
|
|
bordered
|
|
|
|
|
dense
|
|
|
|
|
class="custom-header-table"
|
|
|
|
|
:visible-columns="visibleColumns"
|
|
|
|
|
>
|
|
|
|
|
<template v-slot:header="props">
|
|
|
|
|
<q-tr :props="props">
|
|
|
|
|
<q-th v-for="col in props.cols" :key="col.name" :props="props">
|
|
|
|
|
<span class="text-weight-medium">{{ col.label }}</span>
|
|
|
|
|
</q-th>
|
|
|
|
|
</q-tr>
|
|
|
|
|
</template>
|
|
|
|
|
<template v-slot:body="props">
|
|
|
|
|
<q-tr :props="props" class="cursor-pointer">
|
|
|
|
|
<q-td
|
|
|
|
|
v-for="col in props.cols"
|
|
|
|
|
:key="col.name"
|
|
|
|
|
:props="props"
|
|
|
|
|
@click="onClickAddOrView(true, props.row.id)"
|
|
|
|
|
>
|
|
|
|
|
<div class="table_ellipsis">
|
|
|
|
|
{{ col.value ? col.value : "-" }}
|
|
|
|
|
</div>
|
|
|
|
|
</q-td>
|
|
|
|
|
</q-tr>
|
|
|
|
|
</template>
|
|
|
|
|
</d-table>
|
2024-04-01 12:37:15 +07:00
|
|
|
</div>
|
2024-04-02 16:00:31 +07:00
|
|
|
</q-card>
|
|
|
|
|
</template>
|
|
|
|
|
|
|
|
|
|
<style scoped></style>
|