2024-03-04 12:46:42 +07:00
|
|
|
<script setup lang="ts">
|
2024-05-17 15:50:22 +07:00
|
|
|
import { ref, reactive, computed, onMounted } from "vue";
|
2024-03-04 17:54:52 +07:00
|
|
|
import { useQuasar } from "quasar";
|
2024-03-07 13:46:12 +07:00
|
|
|
import http from "@/plugins/http";
|
|
|
|
|
import config from "@/app.config";
|
|
|
|
|
|
|
|
|
|
/** importType*/
|
2024-08-01 12:12:28 +07:00
|
|
|
import type { DataOption } from "@/modules/04_registryPerson/interface/index/Main";
|
2024-07-08 17:00:01 +07:00
|
|
|
import type {
|
|
|
|
|
DataPerson,
|
|
|
|
|
DataType,
|
2024-08-01 12:12:28 +07:00
|
|
|
} from "@/modules/04_registryPerson/interface/response/Main";
|
2024-03-07 13:46:12 +07:00
|
|
|
|
|
|
|
|
/** importComponents*/
|
2024-08-01 12:12:28 +07:00
|
|
|
import TableView from "@/modules/04_registryPerson/components/TableView.vue";
|
2024-04-29 17:31:02 +07:00
|
|
|
import avatar from "@/assets/avatar_user.jpg";
|
2024-08-13 18:05:23 +07:00
|
|
|
import DialogHeader from "@/components/DialogHeader.vue";
|
2024-03-07 13:46:12 +07:00
|
|
|
|
|
|
|
|
/** importStore*/
|
2024-08-01 12:12:28 +07:00
|
|
|
import { useRegistryNewDataStore } from "@/modules/04_registryPerson/store";
|
2024-03-07 13:46:12 +07:00
|
|
|
import { useCounterMixin } from "@/stores/mixin";
|
2024-08-09 11:45:58 +07:00
|
|
|
import { useRoute } from "vue-router";
|
2024-03-04 17:54:52 +07:00
|
|
|
|
|
|
|
|
const $q = useQuasar();
|
2024-03-07 13:46:12 +07:00
|
|
|
const store = useRegistryNewDataStore();
|
|
|
|
|
const { showLoader, hideLoader, messageError } = useCounterMixin();
|
2024-08-09 11:45:58 +07:00
|
|
|
const route = useRoute();
|
2024-03-07 13:46:12 +07:00
|
|
|
|
2024-03-04 17:54:52 +07:00
|
|
|
const mode = ref<"table" | "card">("table");
|
2024-03-07 13:46:12 +07:00
|
|
|
|
2024-08-13 18:05:23 +07:00
|
|
|
const isShowFilter = ref<boolean>(true);
|
|
|
|
|
const isShowBtnFilter = ref<boolean>(false);
|
|
|
|
|
const empType = ref<string>("officer"); // officer / employee / perm
|
2024-03-07 13:46:12 +07:00
|
|
|
|
2024-03-08 10:49:49 +07:00
|
|
|
const searchType = ref<string>("fullName");
|
2024-08-13 18:05:23 +07:00
|
|
|
|
2024-03-08 10:49:49 +07:00
|
|
|
const maxPage = ref<number>(1);
|
2024-07-08 17:00:01 +07:00
|
|
|
const total = ref<number>(0);
|
2024-08-13 18:05:23 +07:00
|
|
|
const selectNode = ref<boolean>(false);
|
2024-03-08 10:49:49 +07:00
|
|
|
|
|
|
|
|
const dataPersonMain = ref<DataPerson[]>([]);
|
2024-03-07 13:46:12 +07:00
|
|
|
|
|
|
|
|
const conditionTotal = computed(() => {
|
|
|
|
|
let num: string = "";
|
2024-08-13 18:05:23 +07:00
|
|
|
if (store.formFilter.isProbation && store.formFilter.isShowRetire) {
|
2024-03-07 13:46:12 +07:00
|
|
|
num = "(2)";
|
2024-08-13 18:05:23 +07:00
|
|
|
} else if (store.formFilter.isProbation || store.formFilter.isShowRetire) {
|
2024-03-07 13:46:12 +07:00
|
|
|
num = "(1)";
|
|
|
|
|
} else "";
|
|
|
|
|
|
|
|
|
|
return num;
|
|
|
|
|
});
|
|
|
|
|
|
2024-07-08 17:00:01 +07:00
|
|
|
/**
|
|
|
|
|
* function เรียกข้อมูลตำแหน่งประเภท
|
|
|
|
|
*/
|
2024-03-07 13:46:12 +07:00
|
|
|
function fetchType() {
|
2024-05-17 15:50:22 +07:00
|
|
|
http
|
|
|
|
|
.get(config.API.orgPosType)
|
|
|
|
|
.then((res) => {
|
|
|
|
|
store.fetchType(res.data.result);
|
|
|
|
|
})
|
|
|
|
|
.catch((err) => {
|
|
|
|
|
messageError($q, err);
|
|
|
|
|
});
|
2024-03-08 10:49:49 +07:00
|
|
|
}
|
|
|
|
|
|
2024-07-08 17:00:01 +07:00
|
|
|
/**
|
|
|
|
|
* function เรียกข้อมูลกลุ่มงาน
|
|
|
|
|
*/
|
2024-05-17 15:50:22 +07:00
|
|
|
function fetchOptionGroup() {
|
|
|
|
|
http
|
|
|
|
|
.get(config.API.orgEmployeeType)
|
|
|
|
|
.then((res) => {
|
|
|
|
|
store.fetchType(res.data.result);
|
|
|
|
|
})
|
|
|
|
|
.catch((err) => {
|
|
|
|
|
messageError($q, err);
|
|
|
|
|
});
|
|
|
|
|
}
|
|
|
|
|
|
2024-03-08 10:49:49 +07:00
|
|
|
function fetchYearOption() {
|
|
|
|
|
if (store.yearOps.length === 0) {
|
|
|
|
|
const options = [];
|
|
|
|
|
const year = new Date().getFullYear();
|
|
|
|
|
|
|
|
|
|
for (let i = year - 40; i <= year + 60; i++) {
|
|
|
|
|
options.push({ id: i.toString(), name: (i + 543).toString() });
|
|
|
|
|
}
|
|
|
|
|
if (options) {
|
|
|
|
|
store.yearOps.push(...options);
|
|
|
|
|
}
|
|
|
|
|
}
|
2024-03-07 13:46:12 +07:00
|
|
|
}
|
|
|
|
|
|
2024-07-08 17:00:01 +07:00
|
|
|
/**
|
|
|
|
|
* function fetch รายชื่อข้อมูลทะเบียนประวัติ
|
|
|
|
|
*/
|
|
|
|
|
function fetchDataPerson() {
|
2024-03-08 10:49:49 +07:00
|
|
|
showLoader();
|
2024-03-27 10:44:35 +07:00
|
|
|
let queryParams: any = {
|
2024-08-13 18:05:23 +07:00
|
|
|
page: store.formFilter.page,
|
|
|
|
|
pageSize: store.formFilter.pageSize,
|
2024-03-25 07:54:38 +07:00
|
|
|
};
|
|
|
|
|
|
2024-08-13 18:05:23 +07:00
|
|
|
if (store.formFilter.keyword) {
|
2024-03-25 07:54:38 +07:00
|
|
|
queryParams = Object.assign({}, queryParams, {
|
|
|
|
|
searchField: searchType.value,
|
2024-08-13 18:05:23 +07:00
|
|
|
searchKeyword: store.formFilter.keyword,
|
2024-03-27 10:44:35 +07:00
|
|
|
});
|
|
|
|
|
}
|
|
|
|
|
|
2024-08-13 18:05:23 +07:00
|
|
|
if (store.labelOption.posLevel != "ทั้งหมด") {
|
2024-03-27 10:44:35 +07:00
|
|
|
queryParams = Object.assign({}, queryParams, {
|
2024-08-13 18:05:23 +07:00
|
|
|
posLevel: store.labelOption.posLevel,
|
2024-03-27 10:44:35 +07:00
|
|
|
});
|
|
|
|
|
}
|
|
|
|
|
|
2024-08-13 18:05:23 +07:00
|
|
|
if (store.labelOption.posType != "ทั้งหมด") {
|
2024-03-27 10:44:35 +07:00
|
|
|
queryParams = Object.assign({}, queryParams, {
|
2024-08-13 18:05:23 +07:00
|
|
|
posType: store.labelOption.posType,
|
2024-03-25 07:54:38 +07:00
|
|
|
});
|
2024-03-27 10:44:35 +07:00
|
|
|
}
|
2024-03-25 07:54:38 +07:00
|
|
|
|
2024-08-13 18:05:23 +07:00
|
|
|
if (store.formFilter.isProbation != null) {
|
|
|
|
|
queryParams.isProbation = store.formFilter.isProbation;
|
2024-03-26 11:08:26 +07:00
|
|
|
}
|
2024-03-27 10:44:35 +07:00
|
|
|
|
2024-08-13 18:05:23 +07:00
|
|
|
if (store.formFilter.isShowRetire != null) {
|
|
|
|
|
queryParams.isRetire = store.formFilter.isShowRetire;
|
2024-03-27 10:44:35 +07:00
|
|
|
}
|
|
|
|
|
|
2024-05-20 14:43:46 +07:00
|
|
|
if (empType.value !== "officer") {
|
|
|
|
|
queryParams.type = empType.value;
|
|
|
|
|
}
|
|
|
|
|
|
2024-03-07 13:46:12 +07:00
|
|
|
http
|
2024-05-13 18:06:06 +07:00
|
|
|
.get(
|
|
|
|
|
config.API.registryNew(empType.value !== "officer" ? "-employee" : ""),
|
|
|
|
|
{ params: queryParams }
|
|
|
|
|
)
|
2024-03-08 10:49:49 +07:00
|
|
|
.then((res) => {
|
2024-08-13 18:05:23 +07:00
|
|
|
maxPage.value = Math.ceil(
|
|
|
|
|
res.data.result.total / store.formFilter.pageSize
|
|
|
|
|
);
|
2024-03-08 10:49:49 +07:00
|
|
|
dataPersonMain.value = res.data.result.data;
|
2024-04-03 16:26:02 +07:00
|
|
|
total.value = res.data.result.total;
|
2024-08-13 18:05:23 +07:00
|
|
|
isShowBtnFilter.value = true;
|
2024-04-29 17:31:02 +07:00
|
|
|
insertAvatar(res.data.result.data);
|
2024-03-07 13:46:12 +07:00
|
|
|
})
|
|
|
|
|
.catch((err) => {
|
|
|
|
|
messageError($q, err);
|
|
|
|
|
})
|
|
|
|
|
.finally(() => {
|
2024-03-27 10:44:35 +07:00
|
|
|
hideLoader();
|
2024-03-07 13:46:12 +07:00
|
|
|
});
|
|
|
|
|
}
|
|
|
|
|
|
2024-07-08 17:00:01 +07:00
|
|
|
/**
|
|
|
|
|
* function fetch รูปโปรไฟล์
|
|
|
|
|
* @param items ข้อมูลคน
|
|
|
|
|
*/
|
2024-04-29 17:31:02 +07:00
|
|
|
function insertAvatar(items: DataPerson[]) {
|
|
|
|
|
items.map((x: any, index: number) => {
|
2024-05-17 13:43:29 +07:00
|
|
|
if (x.avatarName != null) {
|
|
|
|
|
http
|
|
|
|
|
.get(
|
|
|
|
|
config.API.fileByFile("ทะเบียนประวัติ", "โปรไฟล์", x.id, x.avatarName)
|
|
|
|
|
)
|
|
|
|
|
.then((img) => {
|
|
|
|
|
dataPersonMain.value[index] = {
|
|
|
|
|
...x,
|
|
|
|
|
avatar: img.data.downloadUrl,
|
|
|
|
|
};
|
|
|
|
|
})
|
|
|
|
|
.catch(() => {
|
|
|
|
|
dataPersonMain.value[index] = {
|
|
|
|
|
...x,
|
|
|
|
|
avatar: avatar,
|
|
|
|
|
};
|
|
|
|
|
});
|
|
|
|
|
} else {
|
|
|
|
|
dataPersonMain.value[index] = {
|
|
|
|
|
...x,
|
|
|
|
|
avatar: avatar,
|
|
|
|
|
};
|
|
|
|
|
}
|
2024-04-29 17:31:02 +07:00
|
|
|
});
|
|
|
|
|
}
|
|
|
|
|
|
2024-07-08 17:00:01 +07:00
|
|
|
/**
|
|
|
|
|
* funciotn แสดงตัวเลือกเพิ่มเติม
|
|
|
|
|
*/
|
2024-08-13 18:05:23 +07:00
|
|
|
// function onClickShowFilter() {
|
|
|
|
|
// isShowFilter.value = !isShowFilter.value;
|
|
|
|
|
// isShowBtnFilter.value = false;
|
|
|
|
|
// if (isShowFilter.value) {
|
|
|
|
|
// // fetchLevel();
|
|
|
|
|
// fetchYearOption();
|
|
|
|
|
// }
|
|
|
|
|
// }
|
2024-03-08 10:49:49 +07:00
|
|
|
|
2024-07-08 17:00:01 +07:00
|
|
|
/**
|
|
|
|
|
* funciotn ค้นหาข้อมูล
|
|
|
|
|
*/
|
2024-03-08 10:49:49 +07:00
|
|
|
function onclickSearch() {
|
2024-03-11 13:12:38 +07:00
|
|
|
isShowFilter.value = true;
|
2024-08-13 18:05:23 +07:00
|
|
|
// isShowBtnFilter.value = false;
|
|
|
|
|
store.formFilter.page = 1;
|
2024-03-11 13:12:38 +07:00
|
|
|
if (isShowFilter.value) {
|
|
|
|
|
fetchType();
|
2024-07-08 17:00:01 +07:00
|
|
|
// fetchLevel();
|
2024-03-11 13:12:38 +07:00
|
|
|
fetchYearOption();
|
|
|
|
|
}
|
2024-08-13 18:05:23 +07:00
|
|
|
store.formFilter.keyword =
|
|
|
|
|
store.formFilter.keyword === null ? "" : store.formFilter.keyword;
|
2024-07-08 17:00:01 +07:00
|
|
|
fetchDataPerson();
|
2024-03-07 13:46:12 +07:00
|
|
|
}
|
|
|
|
|
|
2024-07-08 17:00:01 +07:00
|
|
|
/**
|
|
|
|
|
* function เลือกประเภทข้าราชการ
|
|
|
|
|
* @param item ประเภทข้าราชการ
|
|
|
|
|
*/
|
2024-08-09 11:45:58 +07:00
|
|
|
async function selectType() {
|
|
|
|
|
empType.value = await (route.name == "registryNew" ? "officer" : "perm");
|
2024-05-17 15:50:22 +07:00
|
|
|
|
2024-08-09 11:45:58 +07:00
|
|
|
if (empType.value !== "officer") {
|
2024-08-13 18:05:23 +07:00
|
|
|
store.formFilter.isShowRetire = null;
|
|
|
|
|
store.formFilter.isProbation = null;
|
2024-05-17 15:50:22 +07:00
|
|
|
fetchOptionGroup();
|
|
|
|
|
} else {
|
|
|
|
|
fetchType();
|
|
|
|
|
}
|
|
|
|
|
|
2024-08-13 18:05:23 +07:00
|
|
|
// เช็ค store ถ้าเปลี่ยนประเภททะเบียนประวัติ ให้ล่างค่า filter ใหม่
|
|
|
|
|
if (store.formFilter.type != empType.value) {
|
|
|
|
|
store.labelOption.posType = "ทั้งหมด";
|
|
|
|
|
store.labelOption.posLevel = "ทั้งหมด";
|
|
|
|
|
store.formFilter.type = empType.value;
|
|
|
|
|
} else {
|
|
|
|
|
// แต่ถ้าประเภทเดิมระบบจะใช้ filter เดิมที่เคยค้นหาไว้
|
|
|
|
|
if (
|
|
|
|
|
store.formFilter.keyword != "" ||
|
|
|
|
|
store.labelOption.posType != "ทั้งหมด" ||
|
|
|
|
|
store.labelOption.posLevel != "ทั้งหมด" ||
|
|
|
|
|
store.formFilter.isShowRetire != null ||
|
|
|
|
|
store.formFilter.isProbation != null
|
|
|
|
|
) {
|
|
|
|
|
store.formFilter.page = 1;
|
|
|
|
|
fetchDataPerson();
|
|
|
|
|
}
|
|
|
|
|
}
|
2024-03-07 13:46:12 +07:00
|
|
|
}
|
|
|
|
|
|
2024-07-08 17:00:01 +07:00
|
|
|
/**
|
|
|
|
|
* function เลือกประเภทตำแหน่ง
|
|
|
|
|
* @param item ประเภทตำแหน่ง
|
|
|
|
|
*/
|
2024-03-07 13:46:12 +07:00
|
|
|
function selectPosType(item: DataOption) {
|
2024-07-08 17:00:01 +07:00
|
|
|
const dataType = store.posTypeMain.find((e: DataType) => e.id === item.id);
|
|
|
|
|
store.fetchLevel(dataType?.posLevels);
|
2024-08-13 18:05:23 +07:00
|
|
|
store.labelOption.posType = item.name;
|
|
|
|
|
store.labelOption.posLevel = "ทั้งหมด";
|
|
|
|
|
store.formFilter.page = 1;
|
2024-03-27 10:44:35 +07:00
|
|
|
fetchDataPerson();
|
2024-03-07 13:46:12 +07:00
|
|
|
}
|
|
|
|
|
|
2024-07-08 17:00:01 +07:00
|
|
|
/**
|
|
|
|
|
* function เลือกประเภทตำแหน่ง
|
|
|
|
|
* @param item ประเภทระดับ
|
|
|
|
|
*/
|
2024-03-07 13:46:12 +07:00
|
|
|
function selectPosLevel(item: DataOption) {
|
2024-08-13 18:05:23 +07:00
|
|
|
store.labelOption.posLevel = item.name;
|
|
|
|
|
store.formFilter.page = 1;
|
2024-03-27 10:44:35 +07:00
|
|
|
fetchDataPerson();
|
2024-03-07 13:46:12 +07:00
|
|
|
}
|
|
|
|
|
|
2024-07-08 17:00:01 +07:00
|
|
|
/**
|
|
|
|
|
* function เคลีย์ตัวเลือก
|
|
|
|
|
* @param t ประเภทตัวเลือก
|
|
|
|
|
*/
|
2024-03-07 13:46:12 +07:00
|
|
|
function clearSelect(t: string) {
|
2024-03-27 10:44:35 +07:00
|
|
|
if (t === "posType") {
|
2024-08-13 18:05:23 +07:00
|
|
|
store.labelOption.posType = "ทั้งหมด";
|
|
|
|
|
store.labelOption.posLevel = "ทั้งหมด";
|
2024-03-07 13:46:12 +07:00
|
|
|
} else if (t === "posLevel") {
|
2024-08-13 18:05:23 +07:00
|
|
|
store.labelOption.posLevel = "ทั้งหมด";
|
2024-03-07 13:46:12 +07:00
|
|
|
} else if (t === "retireYear") {
|
2024-08-13 18:05:23 +07:00
|
|
|
store.labelOption.retireYear = "";
|
2024-03-07 13:46:12 +07:00
|
|
|
} else if (t === "rangeYear") {
|
2024-08-13 18:05:23 +07:00
|
|
|
store.formFilter.rangeYear.min = 0;
|
|
|
|
|
store.formFilter.rangeYear.max = 60;
|
2024-03-07 13:46:12 +07:00
|
|
|
}
|
2024-08-13 18:05:23 +07:00
|
|
|
store.formFilter.page = 1;
|
2024-03-27 10:44:35 +07:00
|
|
|
fetchDataPerson();
|
2024-03-07 13:46:12 +07:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
onMounted(async () => {
|
2024-08-09 11:45:58 +07:00
|
|
|
selectType();
|
2024-03-07 13:46:12 +07:00
|
|
|
});
|
2024-03-04 12:46:42 +07:00
|
|
|
</script>
|
2024-08-09 11:45:58 +07:00
|
|
|
|
2024-03-04 12:46:42 +07:00
|
|
|
<template>
|
2024-04-29 17:31:02 +07:00
|
|
|
<q-card class="q-mt-md">
|
2024-03-15 16:09:29 +07:00
|
|
|
<q-card-section class="card-img q-pb-lg">
|
2024-03-25 07:54:38 +07:00
|
|
|
<div class="text-h5 text-center q-py-md text-weight-medium">
|
|
|
|
|
ค้นหาข้อมูลทะเบียนประวัติ
|
2024-08-09 11:45:58 +07:00
|
|
|
{{
|
|
|
|
|
empType === "officer" ? "ข้าราชการ กทม. สามัญ" : "ลูกจ้างประจำ กทม."
|
|
|
|
|
}}
|
2024-03-25 07:54:38 +07:00
|
|
|
</div>
|
2024-03-07 13:46:12 +07:00
|
|
|
<div class="row justify-center">
|
2024-03-25 07:54:38 +07:00
|
|
|
<div
|
|
|
|
|
class="col-xs-12 col-sm-12 col-md-11 q-pa-md bg-Search rounded-borders"
|
|
|
|
|
>
|
2024-03-08 10:49:49 +07:00
|
|
|
<q-form @submit="onclickSearch">
|
2024-03-15 16:09:29 +07:00
|
|
|
<div class="bg-white row col-12 q-pa-none rounded-borders">
|
|
|
|
|
<div class="row col-11">
|
|
|
|
|
<div class="col-3 row wrap">
|
|
|
|
|
<q-select
|
|
|
|
|
borderless
|
|
|
|
|
bg-color="white"
|
|
|
|
|
v-model="searchType"
|
|
|
|
|
:options="store.searchTypeOption"
|
|
|
|
|
emit-value
|
|
|
|
|
dense
|
|
|
|
|
emit-option
|
|
|
|
|
option-label="name"
|
|
|
|
|
option-value="id"
|
|
|
|
|
map-options
|
2024-03-25 07:54:38 +07:00
|
|
|
class="selectS col-11 q-px-md"
|
2024-03-15 16:09:29 +07:00
|
|
|
color="deep-orange"
|
|
|
|
|
dropdown-icon="mdi-chevron-down"
|
|
|
|
|
/>
|
|
|
|
|
<q-separator vertical />
|
|
|
|
|
</div>
|
2024-03-08 10:49:49 +07:00
|
|
|
<q-input
|
2024-03-15 16:09:29 +07:00
|
|
|
borderless
|
2024-03-08 10:49:49 +07:00
|
|
|
dense
|
|
|
|
|
bg-color="white"
|
2024-08-13 18:05:23 +07:00
|
|
|
v-model="store.formFilter.keyword"
|
2024-03-08 10:49:49 +07:00
|
|
|
clearable
|
|
|
|
|
placeholder="ค้นหา"
|
2024-03-15 16:09:29 +07:00
|
|
|
class="col-9 q-pr-md"
|
2024-03-27 10:44:35 +07:00
|
|
|
@clear="fetchDataPerson"
|
2024-03-08 10:49:49 +07:00
|
|
|
>
|
2024-03-15 16:09:29 +07:00
|
|
|
<template v-slot:before>
|
|
|
|
|
<q-icon name="search" color="deep-orange" />
|
|
|
|
|
</template>
|
2024-03-08 10:49:49 +07:00
|
|
|
</q-input>
|
2024-03-15 16:09:29 +07:00
|
|
|
</div>
|
|
|
|
|
<div class="row col-1">
|
2024-03-25 07:54:38 +07:00
|
|
|
<q-btn
|
|
|
|
|
class="fit btnSearch"
|
|
|
|
|
unelevated
|
|
|
|
|
color="deep-orange"
|
|
|
|
|
label="ค้นหา"
|
|
|
|
|
type="submit"
|
|
|
|
|
/>
|
2024-03-15 16:09:29 +07:00
|
|
|
</div>
|
|
|
|
|
</div>
|
2024-03-08 10:49:49 +07:00
|
|
|
</q-form>
|
2024-03-15 16:09:29 +07:00
|
|
|
<div v-if="isShowBtnFilter" class="col-12 row q-mt-sm">
|
2024-03-25 07:54:38 +07:00
|
|
|
<q-space />
|
2024-08-13 18:05:23 +07:00
|
|
|
พบข้อมูลทั้งหมด {{ total }} รายการ
|
|
|
|
|
<!-- <q-btn
|
2024-03-15 16:09:29 +07:00
|
|
|
flat
|
|
|
|
|
label="ตัวเลือกเพิ่มเติม"
|
|
|
|
|
icon-right="mdi-tune"
|
|
|
|
|
@click="onClickShowFilter"
|
|
|
|
|
dense
|
|
|
|
|
class="q-px-sm"
|
2024-08-13 18:05:23 +07:00
|
|
|
></q-btn> -->
|
2024-03-15 16:09:29 +07:00
|
|
|
</div>
|
2024-03-07 13:46:12 +07:00
|
|
|
|
2024-03-08 10:49:49 +07:00
|
|
|
<div
|
2024-08-13 18:05:23 +07:00
|
|
|
:class="
|
|
|
|
|
!isShowBtnFilter
|
|
|
|
|
? 'row q-mt-sm q-gutter-sm justify-center'
|
|
|
|
|
: 'row q-gutter-sm justify-center'
|
|
|
|
|
"
|
2024-03-08 10:49:49 +07:00
|
|
|
v-if="isShowFilter"
|
|
|
|
|
>
|
2024-08-13 18:05:23 +07:00
|
|
|
<q-btn-dropdown
|
2024-03-15 16:09:29 +07:00
|
|
|
flat
|
2024-03-08 10:49:49 +07:00
|
|
|
rounded
|
2024-03-15 16:09:29 +07:00
|
|
|
dense
|
2024-03-08 10:49:49 +07:00
|
|
|
label-color="white"
|
2024-03-15 16:09:29 +07:00
|
|
|
dropdown-icon="mdi-chevron-down"
|
|
|
|
|
class="q-px-sm"
|
2024-08-13 18:05:23 +07:00
|
|
|
@click="() => (selectNode = true)"
|
2024-03-08 10:49:49 +07:00
|
|
|
>
|
|
|
|
|
<template v-slot:label>
|
2024-08-13 18:05:23 +07:00
|
|
|
{{ `${store.labelOption.node}` }}
|
2024-03-08 10:49:49 +07:00
|
|
|
</template>
|
|
|
|
|
</q-btn-dropdown>
|
|
|
|
|
|
2024-08-13 18:05:23 +07:00
|
|
|
<q-separator inset vertical class="lineFil" />
|
2024-03-15 16:09:29 +07:00
|
|
|
|
2024-03-08 10:49:49 +07:00
|
|
|
<q-btn-dropdown
|
|
|
|
|
rounded
|
2024-03-15 16:09:29 +07:00
|
|
|
flat
|
|
|
|
|
dense
|
2024-03-08 10:49:49 +07:00
|
|
|
label-color="white"
|
2024-03-15 16:09:29 +07:00
|
|
|
dropdown-icon="mdi-chevron-down"
|
|
|
|
|
class="q-px-sm"
|
2024-05-17 15:50:22 +07:00
|
|
|
>
|
2024-03-08 10:49:49 +07:00
|
|
|
<template v-slot:label>
|
2024-03-11 17:42:27 +07:00
|
|
|
{{
|
2024-08-13 18:05:23 +07:00
|
|
|
store.labelOption.posType !== "ทั้งหมด"
|
|
|
|
|
? store.labelOption.posType
|
2024-05-14 16:05:58 +07:00
|
|
|
: empType === "officer"
|
2024-08-13 18:05:23 +07:00
|
|
|
? `ตำแหน่งประเภท${store.labelOption.posType}`
|
|
|
|
|
: `กลุ่มงาน${store.labelOption.posType}`
|
2024-03-11 17:42:27 +07:00
|
|
|
}}
|
2024-03-08 10:49:49 +07:00
|
|
|
<q-btn
|
2024-08-13 18:05:23 +07:00
|
|
|
v-if="store.labelOption.posType !== 'ทั้งหมด'"
|
2024-03-08 10:49:49 +07:00
|
|
|
size="10px"
|
|
|
|
|
flat
|
|
|
|
|
round
|
|
|
|
|
color="white"
|
|
|
|
|
icon="close"
|
|
|
|
|
@click.stop.prevent="clearSelect('posType')"
|
|
|
|
|
/>
|
|
|
|
|
</template>
|
|
|
|
|
<q-list>
|
|
|
|
|
<q-item
|
|
|
|
|
v-for="(item, index) in store.posTypeOps"
|
|
|
|
|
:key="index"
|
|
|
|
|
clickable
|
|
|
|
|
v-close-popup
|
|
|
|
|
@click="selectPosType(item)"
|
|
|
|
|
>
|
|
|
|
|
<q-item-section>
|
|
|
|
|
<q-item-label>{{ item.name }}</q-item-label>
|
|
|
|
|
</q-item-section>
|
|
|
|
|
</q-item>
|
|
|
|
|
</q-list>
|
|
|
|
|
</q-btn-dropdown>
|
|
|
|
|
|
2024-03-15 16:09:29 +07:00
|
|
|
<q-separator inset vertical class="lineFil" />
|
2024-03-08 10:49:49 +07:00
|
|
|
<q-btn-dropdown
|
2024-03-15 16:09:29 +07:00
|
|
|
flat
|
|
|
|
|
dense
|
2024-03-08 10:49:49 +07:00
|
|
|
rounded
|
|
|
|
|
label-color="white"
|
2024-03-15 16:09:29 +07:00
|
|
|
dropdown-icon="mdi-chevron-down"
|
|
|
|
|
class="q-px-sm"
|
2024-08-13 18:05:23 +07:00
|
|
|
:disable="store.labelOption.posType === 'ทั้งหมด' ? true : false"
|
2024-05-17 15:50:22 +07:00
|
|
|
>
|
2024-03-08 10:49:49 +07:00
|
|
|
<template v-slot:label>
|
2024-03-11 17:42:27 +07:00
|
|
|
{{
|
2024-08-13 18:05:23 +07:00
|
|
|
store.labelOption.posLevel !== "ทั้งหมด"
|
|
|
|
|
? store.labelOption.posLevel
|
2024-05-14 16:05:58 +07:00
|
|
|
: empType === "officer"
|
2024-08-13 18:05:23 +07:00
|
|
|
? `ระดับ${store.labelOption.posLevel}`
|
|
|
|
|
: `ระดับชั้นงาน${store.labelOption.posLevel}`
|
2024-03-11 17:42:27 +07:00
|
|
|
}}
|
2024-03-08 10:49:49 +07:00
|
|
|
<q-btn
|
|
|
|
|
size="10px"
|
|
|
|
|
flat
|
|
|
|
|
round
|
|
|
|
|
color="white"
|
|
|
|
|
icon="close"
|
2024-08-13 18:05:23 +07:00
|
|
|
v-if="store.labelOption.posLevel !== 'ทั้งหมด'"
|
2024-03-08 10:49:49 +07:00
|
|
|
@click.stop.prevent="clearSelect('posLevel')"
|
|
|
|
|
/>
|
|
|
|
|
</template>
|
2024-05-17 15:50:22 +07:00
|
|
|
<q-list
|
|
|
|
|
:style="store.posLevelOps.length > 9 ? 'height: 450px' : ''"
|
|
|
|
|
>
|
2024-03-08 10:49:49 +07:00
|
|
|
<q-item
|
|
|
|
|
v-for="(item, index) in store.posLevelOps"
|
|
|
|
|
:key="index"
|
|
|
|
|
clickable
|
|
|
|
|
v-close-popup
|
|
|
|
|
@click="selectPosLevel(item)"
|
|
|
|
|
>
|
|
|
|
|
<q-item-section>
|
|
|
|
|
<q-item-label>{{ item.name }}</q-item-label>
|
|
|
|
|
</q-item-section>
|
|
|
|
|
</q-item>
|
|
|
|
|
</q-list>
|
|
|
|
|
</q-btn-dropdown>
|
|
|
|
|
|
2024-05-17 15:50:22 +07:00
|
|
|
<q-separator
|
|
|
|
|
inset
|
|
|
|
|
vertical
|
|
|
|
|
class="lineFil"
|
|
|
|
|
v-if="empType === 'officer'"
|
|
|
|
|
/>
|
2024-03-15 16:09:29 +07:00
|
|
|
|
2024-03-08 10:49:49 +07:00
|
|
|
<q-btn-dropdown
|
2024-05-17 15:50:22 +07:00
|
|
|
v-if="empType === 'officer'"
|
2024-03-15 16:09:29 +07:00
|
|
|
flat
|
|
|
|
|
dense
|
2024-03-08 10:49:49 +07:00
|
|
|
rounded
|
2024-03-15 16:09:29 +07:00
|
|
|
label-color="white"
|
|
|
|
|
dropdown-icon="mdi-chevron-down"
|
2024-03-08 10:49:49 +07:00
|
|
|
:label="`เงื่อนไขอื่นๆ ${conditionTotal}`"
|
2024-03-15 16:09:29 +07:00
|
|
|
class="q-px-sm"
|
2024-05-17 15:50:22 +07:00
|
|
|
>
|
2024-03-08 10:49:49 +07:00
|
|
|
<q-list>
|
|
|
|
|
<q-item clickable v-close-popup>
|
|
|
|
|
<q-item-section>
|
|
|
|
|
<q-toggle
|
2024-08-13 18:05:23 +07:00
|
|
|
v-model="store.formFilter.isProbation"
|
2024-03-08 10:49:49 +07:00
|
|
|
color="primary"
|
|
|
|
|
label="ทดลองปฏิบัติหน้าที่ราชการ"
|
2024-03-27 10:44:35 +07:00
|
|
|
@update:model-value="fetchDataPerson"
|
2024-03-08 10:49:49 +07:00
|
|
|
/>
|
|
|
|
|
</q-item-section>
|
|
|
|
|
</q-item>
|
|
|
|
|
<q-item clickable v-close-popup>
|
|
|
|
|
<q-item-section>
|
|
|
|
|
<q-toggle
|
2024-08-13 18:05:23 +07:00
|
|
|
v-model="store.formFilter.isShowRetire"
|
2024-03-08 10:49:49 +07:00
|
|
|
color="primary"
|
|
|
|
|
label="แสดงข้อมูลผู้พ้นจากราชการ"
|
2024-03-27 10:44:35 +07:00
|
|
|
@update:model-value="fetchDataPerson"
|
2024-03-08 10:49:49 +07:00
|
|
|
/>
|
|
|
|
|
</q-item-section>
|
|
|
|
|
</q-item>
|
|
|
|
|
</q-list>
|
|
|
|
|
</q-btn-dropdown>
|
2024-03-07 13:46:12 +07:00
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
</q-card-section>
|
|
|
|
|
|
|
|
|
|
<q-separator />
|
|
|
|
|
|
|
|
|
|
<q-card-section>
|
2024-03-08 13:11:20 +07:00
|
|
|
<TableView
|
|
|
|
|
v-model:mode="mode"
|
|
|
|
|
:rows="dataPersonMain"
|
2024-08-13 18:05:23 +07:00
|
|
|
v-model:formFilter="store.formFilter"
|
2024-03-08 13:11:20 +07:00
|
|
|
v-model:maxPage="maxPage"
|
|
|
|
|
:fetchData="fetchDataPerson"
|
|
|
|
|
:fetchType="fetchType"
|
2024-04-03 16:26:02 +07:00
|
|
|
:total="total"
|
2024-05-13 18:06:06 +07:00
|
|
|
:empType="empType"
|
2024-08-13 18:05:23 +07:00
|
|
|
:is-filter="isShowBtnFilter"
|
2024-03-08 13:11:20 +07:00
|
|
|
/>
|
2024-03-07 13:46:12 +07:00
|
|
|
</q-card-section>
|
|
|
|
|
</q-card>
|
2024-08-13 18:05:23 +07:00
|
|
|
|
|
|
|
|
<!-- แสดง dialog เลือกหน่วยงาน/ส่วนราชการ -->
|
|
|
|
|
<q-dialog v-model="selectNode" persistent>
|
|
|
|
|
<q-card style="width: 850px; max-width: 80vw">
|
|
|
|
|
<DialogHeader
|
|
|
|
|
tittle="เลือกหน่วยงาน/ส่วนราชการ"
|
|
|
|
|
:close="() => (selectNode = false)"
|
|
|
|
|
/>
|
|
|
|
|
|
|
|
|
|
<q-separator />
|
|
|
|
|
|
|
|
|
|
<q-card-section class="q-pa-sm"> </q-card-section>
|
|
|
|
|
</q-card>
|
|
|
|
|
</q-dialog>
|
2024-03-04 12:46:42 +07:00
|
|
|
</template>
|
|
|
|
|
|
2024-03-27 10:59:32 +07:00
|
|
|
<style scoped>
|
2024-03-07 13:46:12 +07:00
|
|
|
.card-img {
|
|
|
|
|
background: url("@/assets/registry-banner.png");
|
|
|
|
|
background-size: cover;
|
|
|
|
|
color: white;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
:deep(.custom-select.q-field--outlined .q-field__control) {
|
|
|
|
|
color: white;
|
|
|
|
|
background-color: #36969f;
|
|
|
|
|
}
|
|
|
|
|
:deep(.custom-select.q-field--outlined .q-field__control::before) {
|
|
|
|
|
border: 1px solid #fff;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
:deep(.custom-btn.q-btn--outline::before) {
|
|
|
|
|
background-color: #36969f;
|
2024-03-04 17:54:52 +07:00
|
|
|
}
|
2024-03-15 16:09:29 +07:00
|
|
|
|
2024-03-25 07:54:38 +07:00
|
|
|
.btnSearch {
|
2024-03-15 16:09:29 +07:00
|
|
|
border-radius: 0px 4px 4px 0px;
|
|
|
|
|
}
|
2024-03-25 07:54:38 +07:00
|
|
|
.bg-Search {
|
2024-03-15 16:09:29 +07:00
|
|
|
background: #00000015;
|
|
|
|
|
}
|
2024-03-25 07:54:38 +07:00
|
|
|
.lineFil {
|
|
|
|
|
transform: rotate(30deg);
|
2024-03-15 16:09:29 +07:00
|
|
|
height: 20px;
|
|
|
|
|
margin-top: 15px;
|
|
|
|
|
background: #ffffff7b !important;
|
|
|
|
|
}
|
2024-03-25 07:54:38 +07:00
|
|
|
.selectS .q-field__control .q-field__append .q-icon {
|
2024-03-15 16:09:29 +07:00
|
|
|
color: #ff5722 !important;
|
|
|
|
|
}
|
2024-03-07 13:46:12 +07:00
|
|
|
</style>
|