2024-03-04 17:54:52 +07:00
|
|
|
<script setup lang="ts">
|
2025-02-25 15:27:01 +07:00
|
|
|
import { ref, watch, computed, onMounted } from "vue";
|
2024-09-18 17:24:21 +07:00
|
|
|
|
2024-08-01 14:10:55 +07:00
|
|
|
import { checkPermission } from "@/utils/permissions";
|
2024-03-08 16:08:46 +07:00
|
|
|
import { useRouter } from "vue-router";
|
2024-09-18 17:24:21 +07:00
|
|
|
import { useRegistryNewDataStore } from "@/modules/04_registryPerson/store";
|
2024-12-04 18:00:36 +07:00
|
|
|
import { useCounterMixin } from "@/stores/mixin";
|
2024-03-04 17:54:52 +07:00
|
|
|
|
2025-02-25 15:27:01 +07:00
|
|
|
/** importType*/
|
2024-12-04 18:00:36 +07:00
|
|
|
import { useQuasar, type QTableProps } from "quasar";
|
|
|
|
|
import type {
|
|
|
|
|
FormFilter,
|
|
|
|
|
RangeAge,
|
|
|
|
|
} from "@/modules/04_registryPerson/interface/request/Main";
|
2024-03-04 17:54:52 +07:00
|
|
|
|
2025-02-25 15:27:01 +07:00
|
|
|
/** importComponent*/
|
2024-08-01 12:12:28 +07:00
|
|
|
import DialogHistory from "@/modules/04_registryPerson/components/DialogHistory.vue";
|
2024-12-04 18:00:36 +07:00
|
|
|
|
2025-02-25 15:27:01 +07:00
|
|
|
/* use*/
|
2024-12-04 18:00:36 +07:00
|
|
|
const $q = useQuasar();
|
2025-02-25 15:27:01 +07:00
|
|
|
const router = useRouter();
|
2024-12-04 18:00:36 +07:00
|
|
|
const mixin = useCounterMixin();
|
2025-02-25 15:27:01 +07:00
|
|
|
const { date2Thai } = mixin;
|
2024-03-08 10:49:49 +07:00
|
|
|
const store = useRegistryNewDataStore();
|
2024-12-04 18:00:36 +07:00
|
|
|
|
2024-10-04 16:44:30 +07:00
|
|
|
//props
|
2024-09-18 17:24:21 +07:00
|
|
|
const formFilter = defineModel<FormFilter>("formFilter", { required: true }); //ข้อมูลการค้นหา
|
|
|
|
|
const maxPage = defineModel<Number>("maxPage", { required: true }); //จำนวนหน้าทั้งหมด
|
|
|
|
|
const empType = defineModel<string>("empType", { required: true }); //ประเภท ข้ารายการ,ลูกจ้าง
|
|
|
|
|
const isFilter = defineModel<boolean>("isFilter", { required: true }); //แสดงการค้นหา
|
2024-03-08 10:49:49 +07:00
|
|
|
const props = defineProps({
|
|
|
|
|
rows: { type: Array },
|
|
|
|
|
fetchData: { type: Function },
|
|
|
|
|
fetchType: { type: Function },
|
2024-09-04 12:21:51 +07:00
|
|
|
total: { type: Number, default: 0 },
|
2024-03-08 10:49:49 +07:00
|
|
|
});
|
|
|
|
|
|
2025-02-25 15:27:01 +07:00
|
|
|
const rangeAge = ref<RangeAge>({
|
|
|
|
|
min: 18,
|
|
|
|
|
max: 60,
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
const objMarkerLabel = computed(() => {
|
|
|
|
|
return { 39: `ช่วงอายุ ${rangeAge.value.min}-${rangeAge.value.max} ปี` };
|
|
|
|
|
});
|
|
|
|
|
const year = ref<number>(new Date().getFullYear());
|
|
|
|
|
|
2024-10-04 16:44:30 +07:00
|
|
|
//ตัวแปร
|
2024-08-01 14:10:55 +07:00
|
|
|
const modalHistory = ref<boolean>(false); //ประวัติถือครองตำแหน่ง
|
2024-12-04 18:00:36 +07:00
|
|
|
const modalReport = ref<boolean>(false);
|
2024-10-04 16:44:30 +07:00
|
|
|
//ข้อมูล Table
|
2024-03-08 10:49:49 +07:00
|
|
|
const columns = ref<QTableProps["columns"]>([
|
|
|
|
|
{
|
|
|
|
|
name: "no",
|
|
|
|
|
align: "left",
|
|
|
|
|
label: "ลำดับ",
|
2025-02-19 17:39:45 +07:00
|
|
|
sortable: false,
|
2024-03-08 10:49:49 +07:00
|
|
|
field: "no",
|
|
|
|
|
headerStyle: "font-size: 14px",
|
|
|
|
|
style: "font-size: 14px",
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
name: "fullName",
|
|
|
|
|
align: "left",
|
2024-11-22 18:04:12 +07:00
|
|
|
label: "ชื่อ-นามสกุล",
|
2025-02-19 17:39:45 +07:00
|
|
|
sortable: false,
|
2024-03-08 10:49:49 +07:00
|
|
|
field: "fullName",
|
|
|
|
|
headerStyle: "font-size: 14px; min-width: 200px",
|
|
|
|
|
style: "font-size: 14px",
|
|
|
|
|
},
|
2024-03-04 17:54:52 +07:00
|
|
|
{
|
2024-03-08 10:49:49 +07:00
|
|
|
name: "posNo",
|
|
|
|
|
align: "left",
|
2025-03-17 16:01:02 +07:00
|
|
|
label: empType.value === "officer" ? "เลขที่ตำแหน่ง" : "ตำแหน่งเลขที่",
|
2025-02-19 17:39:45 +07:00
|
|
|
sortable: false,
|
2024-03-08 10:49:49 +07:00
|
|
|
field: "posNo",
|
|
|
|
|
headerStyle: "font-size: 14px",
|
|
|
|
|
style: "font-size: 14px",
|
2024-03-04 17:54:52 +07:00
|
|
|
},
|
|
|
|
|
{
|
2024-03-08 10:49:49 +07:00
|
|
|
name: "position",
|
|
|
|
|
align: "left",
|
2024-06-13 16:44:41 +07:00
|
|
|
label: "ตำแหน่งในสายงาน",
|
2025-02-19 17:39:45 +07:00
|
|
|
sortable: false,
|
2024-03-08 10:49:49 +07:00
|
|
|
field: "position",
|
|
|
|
|
headerStyle: "font-size: 14px",
|
|
|
|
|
style: "font-size: 14px",
|
2024-03-04 17:54:52 +07:00
|
|
|
},
|
2024-03-05 15:53:38 +07:00
|
|
|
{
|
2024-03-08 10:49:49 +07:00
|
|
|
name: "posPath",
|
|
|
|
|
align: "left",
|
2024-06-13 16:44:41 +07:00
|
|
|
label: "ตำแหน่งประเภท",
|
2025-02-19 17:39:45 +07:00
|
|
|
sortable: false,
|
2024-04-03 16:26:02 +07:00
|
|
|
field: "posType",
|
2024-03-08 10:49:49 +07:00
|
|
|
headerStyle: "font-size: 14px",
|
|
|
|
|
style: "font-size: 14px",
|
2024-03-05 15:53:38 +07:00
|
|
|
},
|
|
|
|
|
{
|
2024-03-08 10:49:49 +07:00
|
|
|
name: "posLevel",
|
|
|
|
|
align: "left",
|
2024-06-13 16:44:41 +07:00
|
|
|
label: "ระดับ",
|
2025-02-19 17:39:45 +07:00
|
|
|
sortable: false,
|
2024-04-03 16:26:02 +07:00
|
|
|
field: "posLevel",
|
2024-03-08 10:49:49 +07:00
|
|
|
headerStyle: "font-size: 14px",
|
|
|
|
|
style: "font-size: 14px",
|
2024-05-17 16:23:25 +07:00
|
|
|
format(val, row) {
|
|
|
|
|
return row.posTypeShortName
|
2024-05-17 16:35:22 +07:00
|
|
|
? row.posTypeShortName + " " + row.posLevel
|
2024-05-17 16:23:25 +07:00
|
|
|
: row.posLevel;
|
|
|
|
|
},
|
2024-03-05 15:53:38 +07:00
|
|
|
},
|
|
|
|
|
{
|
2024-05-17 16:35:22 +07:00
|
|
|
name: "org",
|
2024-03-08 10:49:49 +07:00
|
|
|
align: "left",
|
|
|
|
|
label: "สังกัด",
|
2025-02-19 17:39:45 +07:00
|
|
|
sortable: false,
|
2024-05-17 16:35:22 +07:00
|
|
|
field: "org",
|
2024-03-08 10:49:49 +07:00
|
|
|
headerStyle: "font-size: 14px",
|
|
|
|
|
style: "font-size: 14px",
|
2025-02-19 17:39:45 +07:00
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
name: "dateAppoint",
|
|
|
|
|
align: "left",
|
|
|
|
|
label: "วันที่บรรจุ",
|
2025-02-25 15:27:01 +07:00
|
|
|
sortable: true,
|
2025-02-19 17:39:45 +07:00
|
|
|
field: "dateAppoint",
|
2025-02-25 15:27:01 +07:00
|
|
|
headerStyle: "font-size: 14px;pointer-events: none;",
|
|
|
|
|
format(val) {
|
2025-02-19 17:39:45 +07:00
|
|
|
return date2Thai(val);
|
|
|
|
|
},
|
|
|
|
|
style: "font-size: 14px",
|
2024-03-08 10:49:49 +07:00
|
|
|
},
|
|
|
|
|
]);
|
|
|
|
|
const visibleColumns = ref<string[]>([
|
|
|
|
|
"no",
|
|
|
|
|
"fullName",
|
|
|
|
|
"posNo",
|
|
|
|
|
"position",
|
|
|
|
|
"posPath",
|
|
|
|
|
"posType",
|
|
|
|
|
"posLevel",
|
2024-05-17 16:35:22 +07:00
|
|
|
"org",
|
2025-02-19 17:39:45 +07:00
|
|
|
"dateAppoint",
|
2024-03-08 10:49:49 +07:00
|
|
|
]);
|
2024-08-01 14:10:55 +07:00
|
|
|
const pagination = ref({
|
|
|
|
|
page: formFilter.value.page,
|
|
|
|
|
rowsPerPage: formFilter.value.pageSize,
|
2025-02-25 15:27:01 +07:00
|
|
|
sortBy: "",
|
|
|
|
|
descending: false,
|
2024-08-01 14:10:55 +07:00
|
|
|
});
|
2024-03-08 10:49:49 +07:00
|
|
|
|
2025-02-25 15:27:01 +07:00
|
|
|
watch(
|
|
|
|
|
() => store.formFilter.dateAppoint,
|
|
|
|
|
() => {
|
|
|
|
|
checkFilterDateAppoint();
|
|
|
|
|
}
|
|
|
|
|
);
|
|
|
|
|
|
|
|
|
|
function checkFilterDateAppoint() {
|
|
|
|
|
if (store.formFilter.dateAppoint) {
|
|
|
|
|
pagination.value.sortBy = "dateAppoint";
|
|
|
|
|
pagination.value.descending =
|
|
|
|
|
formFilter.value.dateAppoint === "DESC" ? true : false;
|
|
|
|
|
} else {
|
|
|
|
|
pagination.value.sortBy = "";
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
2024-10-04 16:44:30 +07:00
|
|
|
/** function เปลี่ยนหน้า Table*/
|
2024-03-08 10:49:49 +07:00
|
|
|
function updatePagePagination() {
|
|
|
|
|
props.fetchData?.();
|
|
|
|
|
}
|
|
|
|
|
|
2024-08-01 14:10:55 +07:00
|
|
|
/**
|
|
|
|
|
* function เปลี่ยนแถวต่อหน้า
|
|
|
|
|
* @param newPagination ข้อมูล Pagination
|
|
|
|
|
*/
|
2024-03-08 10:49:49 +07:00
|
|
|
function updatePageSizePagination(newPagination: any) {
|
|
|
|
|
formFilter.value.page = 1;
|
|
|
|
|
formFilter.value.pageSize = newPagination.rowsPerPage;
|
|
|
|
|
}
|
|
|
|
|
|
2024-10-04 16:44:30 +07:00
|
|
|
/** function เปิด popup ประวัติถือครองตำแหน่ง*/
|
2024-03-08 10:49:49 +07:00
|
|
|
function onClickHistory() {
|
|
|
|
|
modalHistory.value = !modalHistory.value;
|
|
|
|
|
}
|
|
|
|
|
|
2024-08-01 14:10:55 +07:00
|
|
|
/**
|
|
|
|
|
* function rediract หน้ารายละเอียด
|
|
|
|
|
* @param id รายการ
|
|
|
|
|
*/
|
2024-03-08 16:08:46 +07:00
|
|
|
function onClickViewDetail(id: string) {
|
2024-05-14 16:05:58 +07:00
|
|
|
if (empType.value === "officer") {
|
2024-08-09 11:45:58 +07:00
|
|
|
router.push(`/registry-officer/${id}`);
|
2024-05-13 18:06:06 +07:00
|
|
|
} else {
|
2024-08-01 12:12:28 +07:00
|
|
|
router.push(`/registry-employee/${id}`);
|
2024-05-13 18:06:06 +07:00
|
|
|
}
|
2024-03-08 16:08:46 +07:00
|
|
|
}
|
|
|
|
|
|
2024-10-04 16:44:30 +07:00
|
|
|
/** function redirect ไปหน้ารายการคำร้องขอแก้ไขข้อมูล*/
|
2024-07-19 11:39:51 +07:00
|
|
|
function redirectToPagePetition() {
|
2024-11-06 17:54:50 +07:00
|
|
|
if (empType.value === "officer") {
|
|
|
|
|
router.push(`/registry-officer/request-edit`);
|
|
|
|
|
} else {
|
|
|
|
|
router.push(`/registry-employee/request-edit`);
|
|
|
|
|
}
|
2024-07-19 11:39:51 +07:00
|
|
|
}
|
|
|
|
|
|
2024-09-18 17:24:21 +07:00
|
|
|
/**
|
|
|
|
|
* ดูการเปลี่ยนแปลงของ formFilter.value.pageSize
|
|
|
|
|
* เมื่อมีการเปลี่ยนแปลงจำทำการดึงข้อมูลรายการทะเบียนประวัติใหม่ตามจำนวน formFilter.value.pageSize
|
|
|
|
|
*/
|
2024-03-08 10:49:49 +07:00
|
|
|
watch(
|
|
|
|
|
() => formFilter.value.pageSize,
|
|
|
|
|
() => {
|
|
|
|
|
props.fetchData?.();
|
|
|
|
|
}
|
|
|
|
|
);
|
2025-02-25 15:27:01 +07:00
|
|
|
|
|
|
|
|
onMounted(() => {
|
|
|
|
|
checkFilterDateAppoint();
|
|
|
|
|
});
|
2024-03-04 17:54:52 +07:00
|
|
|
</script>
|
|
|
|
|
|
|
|
|
|
<template>
|
2024-03-15 16:09:29 +07:00
|
|
|
<div class="col-12 row q-pb-sm q-col-gutter-sm items-center">
|
2024-07-19 11:39:51 +07:00
|
|
|
<div class="row q-gutter-sm">
|
2024-03-15 16:09:29 +07:00
|
|
|
<q-btn
|
2024-11-29 14:14:30 +07:00
|
|
|
v-if="
|
|
|
|
|
empType === 'officer' ||
|
|
|
|
|
(empType === 'perm' && checkPermission($route)?.attrIsUpdate)
|
|
|
|
|
"
|
2024-03-15 16:09:29 +07:00
|
|
|
color="primary"
|
2024-07-19 11:39:51 +07:00
|
|
|
label="รายการคำร้องขอแก้ไข"
|
|
|
|
|
@click="redirectToPagePetition()"
|
2024-03-15 16:09:29 +07:00
|
|
|
>
|
2024-07-19 11:39:51 +07:00
|
|
|
<q-tooltip>รายการคำร้องขอแก้ไข</q-tooltip></q-btn
|
2024-03-15 16:09:29 +07:00
|
|
|
>
|
|
|
|
|
<q-btn
|
2024-08-13 18:05:23 +07:00
|
|
|
v-if="checkPermission($route)?.attrIsGet"
|
2024-03-15 16:09:29 +07:00
|
|
|
round
|
|
|
|
|
flat
|
|
|
|
|
dense
|
2024-08-05 12:58:48 +07:00
|
|
|
color="deep-purple"
|
2024-03-15 16:09:29 +07:00
|
|
|
icon="mdi-history"
|
|
|
|
|
@click="onClickHistory"
|
|
|
|
|
>
|
|
|
|
|
<q-tooltip>ประวัติถือครองตำแหน่ง</q-tooltip></q-btn
|
|
|
|
|
>
|
|
|
|
|
</div>
|
2024-03-08 10:49:49 +07:00
|
|
|
<q-space />
|
2024-09-04 12:21:51 +07:00
|
|
|
<div v-if="total > 0" class="text-teal">
|
|
|
|
|
พบข้อมูลทั้งหมด {{ total.toLocaleString() }} รายการ
|
|
|
|
|
</div>
|
2024-12-04 18:00:36 +07:00
|
|
|
<!-- empType === "officer" ? -->
|
2025-02-20 17:31:15 +07:00
|
|
|
<!-- <div>
|
2024-12-04 18:00:36 +07:00
|
|
|
<q-btn
|
|
|
|
|
flat
|
|
|
|
|
dense
|
|
|
|
|
icon="download"
|
|
|
|
|
color="primary"
|
|
|
|
|
round
|
|
|
|
|
@click="onGovernment"
|
|
|
|
|
><q-tooltip
|
|
|
|
|
>รายงานสถิติข้อมูล{{
|
|
|
|
|
empType == "officer" ? "ข้าราชการ กทม. สามัญ" : "ลูกจ้างประจำ กทม."
|
|
|
|
|
}}</q-tooltip
|
|
|
|
|
></q-btn
|
|
|
|
|
>
|
2025-02-20 17:31:15 +07:00
|
|
|
</div> -->
|
2024-03-08 10:49:49 +07:00
|
|
|
<q-select
|
|
|
|
|
v-if="store.mode === 'table'"
|
|
|
|
|
v-model="visibleColumns"
|
|
|
|
|
multiple
|
|
|
|
|
outlined
|
|
|
|
|
dense
|
|
|
|
|
options-dense
|
|
|
|
|
:display-value="$q.lang.table.columns"
|
|
|
|
|
emit-value
|
|
|
|
|
map-options
|
|
|
|
|
:options="columns"
|
|
|
|
|
option-value="name"
|
2024-11-05 16:33:46 +07:00
|
|
|
style="min-width: 140px"
|
2024-03-15 16:09:29 +07:00
|
|
|
class="full-height"
|
|
|
|
|
hide-bottom-space
|
2024-03-08 10:49:49 +07:00
|
|
|
/>
|
2024-03-15 16:09:29 +07:00
|
|
|
<div>
|
|
|
|
|
<q-btn-toggle
|
|
|
|
|
v-model="store.mode"
|
|
|
|
|
dense
|
|
|
|
|
class="my-custom-toggle no-shadow"
|
|
|
|
|
toggle-color="grey-4"
|
|
|
|
|
:options="[
|
|
|
|
|
{ value: 'table', slot: 'table' },
|
|
|
|
|
{ value: 'card', slot: 'card' },
|
|
|
|
|
]"
|
|
|
|
|
>
|
|
|
|
|
<template v-slot:table>
|
|
|
|
|
<q-icon
|
|
|
|
|
name="format_list_bulleted"
|
|
|
|
|
class="q-px-sm q-py-xs"
|
|
|
|
|
size="22px"
|
|
|
|
|
:style="{
|
|
|
|
|
color: store.mode === 'table' ? '#787B7C' : '#C9D3DB',
|
|
|
|
|
}"
|
|
|
|
|
/>
|
|
|
|
|
</template>
|
2024-03-08 10:49:49 +07:00
|
|
|
|
2024-03-15 16:09:29 +07:00
|
|
|
<template v-slot:card>
|
|
|
|
|
<q-icon
|
|
|
|
|
name="mdi-view-grid-outline"
|
|
|
|
|
size="22px"
|
|
|
|
|
class="q-px-sm q-py-xs"
|
|
|
|
|
:style="{
|
|
|
|
|
color: store.mode === 'card' ? '#787B7C' : '#C9D3DB',
|
|
|
|
|
}"
|
|
|
|
|
/>
|
|
|
|
|
</template>
|
|
|
|
|
</q-btn-toggle>
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
2024-09-18 17:24:21 +07:00
|
|
|
|
2024-03-04 17:54:52 +07:00
|
|
|
<d-table
|
|
|
|
|
ref="table"
|
2024-03-08 10:49:49 +07:00
|
|
|
row-key="id"
|
2024-03-04 17:54:52 +07:00
|
|
|
flat
|
|
|
|
|
bordered
|
|
|
|
|
dense
|
2024-03-08 10:49:49 +07:00
|
|
|
:card-container-class="store.mode === 'card' ? 'q-col-gutter-md' : ''"
|
|
|
|
|
:columns="columns"
|
|
|
|
|
:rows="props.rows"
|
|
|
|
|
:grid="store.mode === 'card'"
|
|
|
|
|
:paging="true"
|
|
|
|
|
v-model:pagination="pagination"
|
2024-03-21 16:00:45 +07:00
|
|
|
:rows-per-page-options="[20, 50, 100]"
|
2024-03-04 17:54:52 +07:00
|
|
|
:visible-columns="visibleColumns"
|
2024-03-08 10:49:49 +07:00
|
|
|
@update:pagination="updatePageSizePagination"
|
2024-03-04 17:54:52 +07:00
|
|
|
>
|
|
|
|
|
>
|
|
|
|
|
<template v-slot:header="props">
|
|
|
|
|
<q-tr :props="props">
|
|
|
|
|
<q-th v-for="col in props.cols" :key="col.name" :props="props">
|
2024-05-17 16:23:25 +07:00
|
|
|
<span class="text-weight-medium" v-if="col.name === 'posLevel'">{{
|
|
|
|
|
empType === "officer" ? col.label : "ระดับชั้นงาน"
|
|
|
|
|
}}</span>
|
2024-05-17 16:35:22 +07:00
|
|
|
<span class="text-weight-medium" v-else-if="col.name === 'posPath'">{{
|
|
|
|
|
empType === "officer" ? col.label : "กลุ่มงาน"
|
|
|
|
|
}}</span>
|
2024-06-13 16:44:41 +07:00
|
|
|
<span
|
|
|
|
|
class="text-weight-medium"
|
|
|
|
|
v-else-if="col.name === 'position'"
|
|
|
|
|
>{{ empType === "officer" ? col.label : "ตำแหน่ง" }}</span
|
|
|
|
|
>
|
2024-05-17 16:23:25 +07:00
|
|
|
|
|
|
|
|
<span class="text-weight-medium" v-else>{{ col.label }}</span>
|
2024-03-04 17:54:52 +07:00
|
|
|
</q-th>
|
|
|
|
|
</q-tr>
|
|
|
|
|
</template>
|
2024-03-08 10:49:49 +07:00
|
|
|
<template v-slot:body="props" v-if="store.mode === 'table'">
|
2024-04-03 16:26:02 +07:00
|
|
|
<q-tr :props="props">
|
|
|
|
|
<q-td v-for="col in props.cols" :key="col.id">
|
2024-03-08 10:49:49 +07:00
|
|
|
<div v-if="col.name === 'no'">
|
|
|
|
|
{{
|
|
|
|
|
(formFilter.page - 1) * formFilter.pageSize + props.rowIndex + 1
|
|
|
|
|
}}
|
|
|
|
|
</div>
|
2024-05-17 16:35:22 +07:00
|
|
|
<div v-else-if="col.name == 'fullName'">
|
2024-03-08 10:49:49 +07:00
|
|
|
<div class="row col-12 wrap items-center">
|
|
|
|
|
<q-item>
|
|
|
|
|
<q-item-section avatar>
|
2024-05-14 16:05:58 +07:00
|
|
|
<q-avatar size="50px" class="bg-grey-2">
|
|
|
|
|
<q-img :src="props.row.avatar" />
|
2024-03-08 10:49:49 +07:00
|
|
|
</q-avatar>
|
|
|
|
|
</q-item-section>
|
|
|
|
|
<q-item-section>
|
2024-08-05 13:44:18 +07:00
|
|
|
<div
|
2024-08-13 18:05:23 +07:00
|
|
|
v-if="!checkPermission($route)?.attrIsGet"
|
|
|
|
|
class="text-weight-medium"
|
|
|
|
|
>
|
|
|
|
|
{{
|
2024-09-05 10:07:52 +07:00
|
|
|
`${
|
|
|
|
|
props.row.rank
|
|
|
|
|
? props.row.rank
|
|
|
|
|
: props.row.prefix
|
|
|
|
|
? props.row.prefix
|
|
|
|
|
: ""
|
|
|
|
|
}${props.row.firstName} ${props.row.lastName}`
|
2024-08-13 18:05:23 +07:00
|
|
|
}}
|
|
|
|
|
</div>
|
|
|
|
|
<div
|
|
|
|
|
v-else
|
2024-08-05 13:44:18 +07:00
|
|
|
class="text-weight-medium text-blue-4 cursor-pointer"
|
2024-08-19 14:39:16 +07:00
|
|
|
@click="
|
|
|
|
|
checkPermission($route)?.attrIsGet &&
|
|
|
|
|
onClickViewDetail(props.row.id)
|
|
|
|
|
"
|
2024-08-05 13:44:18 +07:00
|
|
|
>
|
|
|
|
|
<q-tooltip>รายละเอียด</q-tooltip>
|
2024-03-08 10:49:49 +07:00
|
|
|
{{
|
2024-09-05 10:07:52 +07:00
|
|
|
`${
|
|
|
|
|
props.row.rank
|
|
|
|
|
? props.row.rank
|
|
|
|
|
: props.row.prefix
|
|
|
|
|
? props.row.prefix
|
|
|
|
|
: ""
|
|
|
|
|
}${props.row.firstName} ${props.row.lastName}`
|
2024-03-08 10:49:49 +07:00
|
|
|
}}
|
2024-08-05 13:44:18 +07:00
|
|
|
<q-icon name="mdi-open-in-new" size="xs"></q-icon>
|
2024-03-08 10:49:49 +07:00
|
|
|
</div>
|
2024-08-19 14:39:16 +07:00
|
|
|
<div class="text-weight-light">
|
|
|
|
|
{{ props.row.citizenId }}
|
|
|
|
|
</div>
|
2024-03-08 10:49:49 +07:00
|
|
|
</q-item-section>
|
|
|
|
|
</q-item>
|
|
|
|
|
</div>
|
2024-05-17 16:35:22 +07:00
|
|
|
</div>
|
|
|
|
|
<div v-else class="table_ellipsis">
|
2024-03-08 10:49:49 +07:00
|
|
|
{{ col.value ? col.value : "-" }}
|
2024-05-17 16:35:22 +07:00
|
|
|
</div>
|
2024-03-04 17:54:52 +07:00
|
|
|
</q-td>
|
|
|
|
|
</q-tr>
|
|
|
|
|
</template>
|
2024-03-05 15:53:38 +07:00
|
|
|
<template v-slot:item="props" v-else>
|
2024-03-15 16:09:29 +07:00
|
|
|
<div class="col-xs-12 col-sm-4 col-md-3">
|
2024-08-05 11:08:01 +07:00
|
|
|
<q-card flat bordered>
|
2024-03-15 16:09:29 +07:00
|
|
|
<q-card-section class="text-center q-pb-none">
|
2024-04-29 17:31:02 +07:00
|
|
|
<q-avatar size="80px" class="bg-grey-2">
|
|
|
|
|
<q-img :src="props.row.avatar" />
|
2024-03-08 13:11:20 +07:00
|
|
|
</q-avatar>
|
|
|
|
|
|
2024-08-05 13:44:18 +07:00
|
|
|
<div
|
2024-08-19 14:39:16 +07:00
|
|
|
v-if="!checkPermission($route)?.attrIsGet"
|
|
|
|
|
class="text-weight-medium q-mt-sm"
|
|
|
|
|
>
|
|
|
|
|
{{
|
2024-09-04 14:37:39 +07:00
|
|
|
`${
|
|
|
|
|
props.row.rank
|
|
|
|
|
? props.row.rank
|
|
|
|
|
: props.row.prefix
|
|
|
|
|
? props.row.prefix
|
|
|
|
|
: ""
|
|
|
|
|
}${props.row.firstName} ${props.row.lastName}`
|
2024-08-19 14:39:16 +07:00
|
|
|
}}
|
|
|
|
|
</div>
|
|
|
|
|
<div
|
|
|
|
|
v-else
|
2024-08-05 13:44:18 +07:00
|
|
|
class="text-weight-medium q-mt-md text-blue-4 cursor-pointer"
|
|
|
|
|
@click="
|
|
|
|
|
checkPermission($route)?.attrIsGet &&
|
|
|
|
|
onClickViewDetail(props.row.id)
|
|
|
|
|
"
|
|
|
|
|
>
|
|
|
|
|
<q-tooltip>รายละเอียด</q-tooltip>
|
2024-03-08 13:11:20 +07:00
|
|
|
{{
|
2024-09-04 14:37:39 +07:00
|
|
|
`${
|
|
|
|
|
props.row.rank
|
|
|
|
|
? props.row.rank
|
|
|
|
|
: props.row.prefix
|
|
|
|
|
? props.row.prefix
|
|
|
|
|
: ""
|
|
|
|
|
}${props.row.firstName} ${props.row.lastName}`
|
2024-03-08 13:11:20 +07:00
|
|
|
}}
|
2024-08-05 13:44:18 +07:00
|
|
|
<q-icon name="mdi-open-in-new" size="xs"></q-icon>
|
2024-03-08 13:11:20 +07:00
|
|
|
</div>
|
|
|
|
|
<div class="text-weight-light full-width text-center">
|
|
|
|
|
{{ props.row.citizenId }}
|
|
|
|
|
</div>
|
|
|
|
|
</q-card-section>
|
|
|
|
|
|
2024-03-15 17:29:09 +07:00
|
|
|
<q-card-section class="q-pa-sm">
|
2024-03-11 17:42:27 +07:00
|
|
|
<q-card bordered class="bg-grey-13">
|
2024-06-24 17:54:53 +07:00
|
|
|
<q-card-section>
|
2025-03-17 16:01:02 +07:00
|
|
|
<div class="text-grey">
|
|
|
|
|
{{
|
|
|
|
|
empType === "officer" ? `เลขที่ตำแหน่ง` : `ตำแหน่งเลขที่`
|
|
|
|
|
}}
|
|
|
|
|
</div>
|
2024-06-24 17:54:53 +07:00
|
|
|
<div class="text-subtitle2 text-black q-ml-sm">
|
|
|
|
|
{{ props.row.posNo ? props.row.posNo : "-" }}
|
|
|
|
|
</div>
|
|
|
|
|
|
|
|
|
|
<div class="text-grey">
|
|
|
|
|
{{ empType === "officer" ? `ตำแหน่งในสายงาน` : `ตำแหน่ง` }}
|
|
|
|
|
</div>
|
|
|
|
|
<div class="text-subtitle2 text-black q-ml-sm">
|
|
|
|
|
{{ props.row.position ? props.row.position : "-" }}
|
|
|
|
|
</div>
|
|
|
|
|
|
|
|
|
|
<div class="text-grey">
|
|
|
|
|
{{ empType === "officer" ? "ตำแหน่งประเภท" : "กลุ่มงาน" }}
|
|
|
|
|
</div>
|
|
|
|
|
<div class="text-subtitle2 text-black q-ml-sm">
|
|
|
|
|
{{ props.row.posType ? props.row.posType : "-" }}
|
|
|
|
|
</div>
|
|
|
|
|
|
|
|
|
|
<div class="text-grey">
|
|
|
|
|
{{ empType === "officer" ? "ระดับ" : "ระดับชั้นงาน" }}
|
|
|
|
|
</div>
|
|
|
|
|
<div class="text-subtitle2 text-black q-ml-sm">
|
|
|
|
|
{{
|
|
|
|
|
props.row.posLevel
|
|
|
|
|
? props.row.posTypeShortName
|
|
|
|
|
? `${props.row.posTypeShortName} ${props.row.posLevel}`
|
|
|
|
|
: props.row.posLevel
|
|
|
|
|
: "-"
|
|
|
|
|
}}
|
|
|
|
|
</div>
|
|
|
|
|
</q-card-section>
|
2024-03-08 13:11:20 +07:00
|
|
|
</q-card>
|
|
|
|
|
</q-card-section>
|
|
|
|
|
</q-card>
|
|
|
|
|
</div>
|
2024-03-05 15:53:38 +07:00
|
|
|
</template>
|
2024-03-08 10:49:49 +07:00
|
|
|
<template v-slot:pagination="scope">
|
2024-04-03 16:26:02 +07:00
|
|
|
ทั้งหมด {{ props.total }} รายการ
|
2024-03-08 10:49:49 +07:00
|
|
|
<q-pagination
|
|
|
|
|
v-model="formFilter.page"
|
|
|
|
|
active-color="primary"
|
|
|
|
|
color="dark"
|
|
|
|
|
:max="Number(maxPage)"
|
|
|
|
|
:max-pages="5"
|
|
|
|
|
size="sm"
|
|
|
|
|
boundary-links
|
|
|
|
|
direction-links
|
|
|
|
|
@update:model-value="updatePagePagination()"
|
|
|
|
|
></q-pagination>
|
|
|
|
|
</template>
|
|
|
|
|
<template v-slot:no-data="{ icon, message, filter }">
|
|
|
|
|
<div class="full-width row flex-center text-accent q-gutter-sm">
|
|
|
|
|
<span
|
|
|
|
|
><div
|
|
|
|
|
style="
|
|
|
|
|
height: 50vh;
|
|
|
|
|
display: flex;
|
|
|
|
|
flex-direction: column;
|
|
|
|
|
justify-content: center;
|
|
|
|
|
align-items: center;
|
|
|
|
|
"
|
|
|
|
|
class="text-grey-5"
|
|
|
|
|
>
|
|
|
|
|
<q-icon name="search" size="4rem" />
|
|
|
|
|
|
2024-08-13 18:05:23 +07:00
|
|
|
<span>{{ isFilter ? "ไม่พบข้อมูล" : "ค้นหาข้อมูล" }}</span>
|
2024-03-08 10:49:49 +07:00
|
|
|
</div>
|
|
|
|
|
</span>
|
|
|
|
|
</div>
|
|
|
|
|
</template>
|
2024-03-04 17:54:52 +07:00
|
|
|
</d-table>
|
2024-03-08 10:49:49 +07:00
|
|
|
|
2024-12-04 18:00:36 +07:00
|
|
|
<q-dialog v-model="modalReport" persistent>
|
2024-12-10 14:00:25 +07:00
|
|
|
<q-card class="col-12" style="width: 40%">
|
2025-02-20 17:31:15 +07:00
|
|
|
<!-- <DialogHeader
|
2024-12-04 18:00:36 +07:00
|
|
|
:tittle="
|
|
|
|
|
empType == 'officer'
|
|
|
|
|
? 'รายงานสถิติข้อมูลข้าราชการ กทม. สามัญ'
|
|
|
|
|
: 'รายงานสถิติข้อมูลลูกจ้างประจำ กทม.'
|
|
|
|
|
"
|
|
|
|
|
:close="closeDialog"
|
2025-02-20 17:31:15 +07:00
|
|
|
/> -->
|
2024-12-04 18:00:36 +07:00
|
|
|
<q-separator />
|
2024-12-11 15:05:31 +07:00
|
|
|
<q-card-section class="q-pa-lg">
|
2024-12-10 14:00:25 +07:00
|
|
|
<div class="column q-pa-sm q-gutter-y-sm">
|
2024-12-11 15:05:31 +07:00
|
|
|
<datepicker
|
|
|
|
|
menu-class-name="modalfix"
|
|
|
|
|
v-model="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
|
|
|
|
|
outlined
|
|
|
|
|
:model-value="year === 0 ? 'ทั้งหมด' : Number(year) + 543"
|
|
|
|
|
:label="`${'ปีงบประมาณ'}`"
|
|
|
|
|
bg-color="white"
|
2024-12-04 18:00:36 +07:00
|
|
|
>
|
2024-12-11 15:05:31 +07:00
|
|
|
<template v-slot:prepend>
|
|
|
|
|
<q-icon
|
|
|
|
|
name="event"
|
|
|
|
|
class="cursor-pointer"
|
|
|
|
|
style="color: var(--q-primary)"
|
|
|
|
|
>
|
|
|
|
|
</q-icon>
|
|
|
|
|
</template>
|
|
|
|
|
</q-input>
|
|
|
|
|
</template>
|
|
|
|
|
</datepicker>
|
|
|
|
|
|
|
|
|
|
<span class="text-body1 q-pt-sm text-weight-medium"
|
|
|
|
|
>เลือกช่วงอายุ</span
|
|
|
|
|
>
|
|
|
|
|
<div class="q-px-lg q-pt-lg">
|
|
|
|
|
<q-range
|
|
|
|
|
v-model="rangeAge"
|
|
|
|
|
:min="18"
|
|
|
|
|
:max="60"
|
|
|
|
|
label
|
|
|
|
|
:marker-labels="objMarkerLabel"
|
|
|
|
|
color="primary"
|
|
|
|
|
>
|
|
|
|
|
</q-range>
|
|
|
|
|
</div>
|
2024-12-04 18:00:36 +07:00
|
|
|
</div>
|
|
|
|
|
</q-card-section>
|
|
|
|
|
<q-separator />
|
2025-02-20 17:38:23 +07:00
|
|
|
<!-- <q-card-actions align="right" class="q-ma-xs">
|
2024-12-10 14:00:25 +07:00
|
|
|
<q-btn
|
|
|
|
|
:loading="loadingBtn"
|
|
|
|
|
:disable="loadingBtn"
|
|
|
|
|
color="primary"
|
|
|
|
|
icon="download"
|
|
|
|
|
label="ดาวน์โหลดรายงาน"
|
|
|
|
|
@click="getReport"
|
2024-12-11 15:05:31 +07:00
|
|
|
style="width: 200px"
|
2024-12-10 14:00:25 +07:00
|
|
|
>
|
|
|
|
|
<q-tooltip>ดาวน์โหลดรายงาน</q-tooltip>
|
|
|
|
|
</q-btn>
|
2025-02-20 17:38:23 +07:00
|
|
|
</q-card-actions> -->
|
2024-12-04 18:00:36 +07:00
|
|
|
</q-card>
|
|
|
|
|
</q-dialog>
|
|
|
|
|
|
2024-09-18 17:24:21 +07:00
|
|
|
<!-- ประวัติถือครองตำแหน่ง -->
|
2024-03-08 10:49:49 +07:00
|
|
|
<DialogHistory v-model:modal="modalHistory" />
|
2024-03-04 17:54:52 +07:00
|
|
|
</template>
|
2024-03-05 15:53:38 +07:00
|
|
|
|
|
|
|
|
<style scoped>
|
2024-03-08 13:11:20 +07:00
|
|
|
.hover-button:hover {
|
2024-03-05 15:53:38 +07:00
|
|
|
background-color: #089cfc;
|
2024-03-08 13:11:20 +07:00
|
|
|
color: white !important;
|
2024-03-05 15:53:38 +07:00
|
|
|
}
|
2024-03-08 13:11:20 +07:00
|
|
|
|
2024-03-08 10:49:49 +07:00
|
|
|
.my-card {
|
|
|
|
|
width: 100%;
|
|
|
|
|
height: 100%;
|
|
|
|
|
}
|
2024-03-11 17:42:27 +07:00
|
|
|
|
|
|
|
|
.bg-grey-13 {
|
2024-03-15 16:09:29 +07:00
|
|
|
background: #f1f2f496 !important;
|
|
|
|
|
}
|
|
|
|
|
|
2024-03-21 16:00:45 +07:00
|
|
|
.my-custom-toggle {
|
2024-03-15 16:09:29 +07:00
|
|
|
border: 1px solid #d0d0d2;
|
|
|
|
|
}
|
2024-03-21 16:00:45 +07:00
|
|
|
.cardRO {
|
2024-03-15 16:09:29 +07:00
|
|
|
border-radius: 10px;
|
|
|
|
|
}
|
|
|
|
|
|
2024-03-21 16:00:45 +07:00
|
|
|
.cardRO:hover {
|
2024-03-15 16:09:29 +07:00
|
|
|
cursor: pointer;
|
|
|
|
|
background: #dcdcdc33 !important;
|
|
|
|
|
}
|
2024-03-21 16:00:45 +07:00
|
|
|
.cardRO:hover .textName {
|
|
|
|
|
color: #02a998;
|
2024-03-11 17:42:27 +07:00
|
|
|
}
|
2024-03-05 15:53:38 +07:00
|
|
|
</style>
|