2024-03-04 12:46:42 +07:00
|
|
|
<script setup lang="ts">
|
2024-03-27 10:44:35 +07:00
|
|
|
import { ref, reactive, computed, onMounted, watch } 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-03-05 10:51:02 +07:00
|
|
|
import type { QTableColumn } from "quasar";
|
2024-03-07 13:46:12 +07:00
|
|
|
import type { DataOption } from "@/modules/04_registryNew/interface/index/Main";
|
2024-03-08 10:49:49 +07:00
|
|
|
import type { DataPerson } from "@/modules/04_registryNew/interface/response/Main";
|
|
|
|
|
import type { FormFilter } from "@/modules/04_registryNew/interface/request/Main";
|
2024-03-07 13:46:12 +07:00
|
|
|
|
|
|
|
|
/** importComponents*/
|
2024-03-08 13:11:20 +07:00
|
|
|
import TableView from "@/modules/04_registryNew/components/TableView.vue";
|
2024-04-29 17:31:02 +07:00
|
|
|
import avatar from "@/assets/avatar_user.jpg";
|
2024-03-07 13:46:12 +07:00
|
|
|
|
|
|
|
|
/** importStore*/
|
|
|
|
|
import { useRegistryNewDataStore } from "@/modules/04_registryNew/store";
|
|
|
|
|
import { useCounterMixin } from "@/stores/mixin";
|
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-03-04 17:54:52 +07:00
|
|
|
const mode = ref<"table" | "card">("table");
|
2024-03-07 13:46:12 +07:00
|
|
|
|
2024-03-08 10:49:49 +07:00
|
|
|
const isShowFilter = ref<boolean>(false);
|
|
|
|
|
const isShowBtnFilter = ref<boolean>(true);
|
2024-03-27 10:44:35 +07:00
|
|
|
const empType = ref<string>("officer"); // ประเภท ขรก./ลูกจ้างประจำ/ลูกจ้างชั่วคราว
|
2024-03-07 13:46:12 +07:00
|
|
|
const labelOption = reactive({
|
2024-03-27 10:44:35 +07:00
|
|
|
type: "ข้าราชการ กทม.สามัญ",
|
2024-03-07 13:46:12 +07:00
|
|
|
posType: "ทั้งหมด",
|
|
|
|
|
posLevel: "ทั้งหมด",
|
2024-03-08 10:49:49 +07:00
|
|
|
retireYear: "",
|
2024-03-07 13:46:12 +07:00
|
|
|
});
|
|
|
|
|
|
2024-03-08 10:49:49 +07:00
|
|
|
const searchType = ref<string>("fullName");
|
|
|
|
|
const formFilter = reactive<FormFilter>({
|
|
|
|
|
page: 1,
|
|
|
|
|
pageSize: 12,
|
|
|
|
|
keyword: "",
|
|
|
|
|
type: "",
|
|
|
|
|
posType: "",
|
|
|
|
|
posLevel: "",
|
|
|
|
|
retireYear: "",
|
|
|
|
|
rangeYear: { min: 0, max: 60 },
|
2024-03-27 10:44:35 +07:00
|
|
|
isShowRetire: null,
|
|
|
|
|
isProbation: null,
|
2024-03-07 13:46:12 +07:00
|
|
|
});
|
2024-03-08 10:49:49 +07:00
|
|
|
const maxPage = ref<number>(1);
|
|
|
|
|
|
|
|
|
|
const dataPersonMain = ref<DataPerson[]>([]);
|
2024-03-07 13:46:12 +07:00
|
|
|
|
|
|
|
|
const conditionTotal = computed(() => {
|
|
|
|
|
let num: string = "";
|
2024-03-08 10:49:49 +07:00
|
|
|
if (formFilter.isProbation && formFilter.isShowRetire) {
|
2024-03-07 13:46:12 +07:00
|
|
|
num = "(2)";
|
2024-03-08 10:49:49 +07:00
|
|
|
} else if (formFilter.isProbation || formFilter.isShowRetire) {
|
2024-03-07 13:46:12 +07:00
|
|
|
num = "(1)";
|
|
|
|
|
} else "";
|
|
|
|
|
|
|
|
|
|
return num;
|
|
|
|
|
});
|
|
|
|
|
|
2024-03-08 10:49:49 +07:00
|
|
|
/** function เรียกข้อมูลประเภทตำแหน่ง*/
|
2024-03-07 13:46:12 +07:00
|
|
|
function fetchType() {
|
2024-03-08 10:49:49 +07:00
|
|
|
if (store.posTypeOps.length === 0) {
|
|
|
|
|
http
|
|
|
|
|
.get(config.API.orgPosType)
|
|
|
|
|
.then((res) => {
|
|
|
|
|
store.fetchType(res.data.result);
|
|
|
|
|
})
|
|
|
|
|
.catch((err) => {
|
|
|
|
|
messageError($q, err);
|
|
|
|
|
})
|
|
|
|
|
.finally(() => {
|
|
|
|
|
hideLoader();
|
|
|
|
|
});
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/** function เรียกข้อมูลระดับตำแหน่ง*/
|
|
|
|
|
function fetchLevel() {
|
|
|
|
|
if (store.posLevelOps.length === 0) {
|
|
|
|
|
http
|
|
|
|
|
.get(config.API.orgPosLevel)
|
|
|
|
|
.then((res) => {
|
|
|
|
|
store.fetchLevel(res.data.result);
|
|
|
|
|
})
|
|
|
|
|
.catch((err) => {
|
|
|
|
|
messageError($q, err);
|
|
|
|
|
})
|
|
|
|
|
.finally(() => {
|
|
|
|
|
hideLoader();
|
|
|
|
|
});
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
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-04-03 16:26:02 +07:00
|
|
|
const total = ref<number>(0);
|
2024-03-25 07:54:38 +07:00
|
|
|
async function fetchDataPerson(search: boolean = false) {
|
2024-03-08 10:49:49 +07:00
|
|
|
showLoader();
|
2024-03-25 07:54:38 +07:00
|
|
|
|
2024-03-27 10:44:35 +07:00
|
|
|
let queryParams: any = {
|
2024-03-25 07:54:38 +07:00
|
|
|
page: formFilter.page,
|
|
|
|
|
pageSize: formFilter.pageSize,
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
if (search) {
|
|
|
|
|
queryParams = Object.assign({}, queryParams, {
|
|
|
|
|
searchField: searchType.value,
|
|
|
|
|
searchKeyword: formFilter.keyword,
|
2024-03-27 10:44:35 +07:00
|
|
|
});
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if (labelOption.posLevel != "ทั้งหมด") {
|
|
|
|
|
queryParams = Object.assign({}, queryParams, {
|
2024-03-26 11:08:26 +07:00
|
|
|
posLevel: labelOption.posLevel,
|
2024-03-27 10:44:35 +07:00
|
|
|
});
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if (labelOption.posType != "ทั้งหมด") {
|
|
|
|
|
queryParams = Object.assign({}, queryParams, {
|
2024-03-26 11:08:26 +07:00
|
|
|
posType: 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-03-27 10:44:35 +07:00
|
|
|
if (formFilter.isProbation != null) {
|
|
|
|
|
queryParams.isProbation = formFilter.isProbation;
|
2024-03-26 11:08:26 +07:00
|
|
|
}
|
2024-03-27 10:44:35 +07:00
|
|
|
|
|
|
|
|
if (formFilter.isShowRetire != null) {
|
|
|
|
|
queryParams.isRetire = formFilter.isShowRetire;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// check type person 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) => {
|
|
|
|
|
maxPage.value = Math.ceil(res.data.result.total / formFilter.pageSize);
|
|
|
|
|
dataPersonMain.value = res.data.result.data;
|
2024-04-03 16:26:02 +07:00
|
|
|
total.value = res.data.result.total;
|
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
|
|
|
// setTimeout(() => {
|
|
|
|
|
hideLoader();
|
|
|
|
|
// }, 500);
|
2024-03-07 13:46:12 +07:00
|
|
|
});
|
|
|
|
|
}
|
|
|
|
|
|
2024-04-29 17:31:02 +07:00
|
|
|
function insertAvatar(items: DataPerson[]) {
|
|
|
|
|
items.map((x: any, index: number) => {
|
|
|
|
|
http
|
|
|
|
|
.get(
|
2024-05-16 13:58:27 +07:00
|
|
|
config.API.fileByFile("ทะเบียนประวัติ", "โปรไฟล์", x.id, x.avatarName)
|
2024-04-29 17:31:02 +07:00
|
|
|
)
|
|
|
|
|
.then((img) => {
|
|
|
|
|
dataPersonMain.value[index] = {
|
|
|
|
|
...x,
|
|
|
|
|
avatar: img.data.downloadUrl,
|
|
|
|
|
};
|
|
|
|
|
})
|
|
|
|
|
.catch(() => {
|
|
|
|
|
dataPersonMain.value[index] = {
|
|
|
|
|
...x,
|
|
|
|
|
avatar: avatar,
|
|
|
|
|
};
|
|
|
|
|
});
|
|
|
|
|
});
|
|
|
|
|
}
|
|
|
|
|
// const convertImageProfile = (id: string) => {
|
|
|
|
|
// return http
|
|
|
|
|
// .get(
|
|
|
|
|
// config.API.fileByFile("ทะเบียนประวัติ", "โปรไฟล์", id, "profile-" + id)
|
|
|
|
|
// )
|
|
|
|
|
// .then((res) => {
|
|
|
|
|
// return res.data.downloadUrl;
|
|
|
|
|
// })
|
|
|
|
|
// .catch(() => {
|
|
|
|
|
// return avatar;
|
|
|
|
|
// });
|
|
|
|
|
// };
|
|
|
|
|
|
2024-03-07 13:46:12 +07:00
|
|
|
function onClickShowFilter() {
|
|
|
|
|
isShowFilter.value = !isShowFilter.value;
|
2024-03-08 10:49:49 +07:00
|
|
|
isShowBtnFilter.value = false;
|
|
|
|
|
if (isShowFilter.value) {
|
|
|
|
|
fetchType();
|
|
|
|
|
fetchLevel();
|
|
|
|
|
fetchYearOption();
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
function onclickSearch() {
|
2024-03-11 13:12:38 +07:00
|
|
|
isShowFilter.value = true;
|
|
|
|
|
isShowBtnFilter.value = false;
|
|
|
|
|
if (isShowFilter.value) {
|
|
|
|
|
fetchType();
|
|
|
|
|
fetchLevel();
|
|
|
|
|
fetchYearOption();
|
|
|
|
|
}
|
2024-03-08 10:49:49 +07:00
|
|
|
formFilter.keyword = formFilter.keyword === null ? "" : formFilter.keyword;
|
2024-03-25 07:54:38 +07:00
|
|
|
fetchDataPerson(true);
|
2024-03-07 13:46:12 +07:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
function selectType(item: DataOption) {
|
|
|
|
|
labelOption.type = item.name;
|
2024-03-27 10:44:35 +07:00
|
|
|
empType.value = item.id;
|
|
|
|
|
fetchDataPerson();
|
2024-03-07 13:46:12 +07:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
function selectPosType(item: DataOption) {
|
|
|
|
|
labelOption.posType = item.name;
|
2024-03-27 10:44:35 +07:00
|
|
|
fetchDataPerson();
|
2024-03-07 13:46:12 +07:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
function selectPosLevel(item: DataOption) {
|
|
|
|
|
labelOption.posLevel = item.name;
|
2024-03-27 10:44:35 +07:00
|
|
|
fetchDataPerson();
|
2024-03-07 13:46:12 +07:00
|
|
|
}
|
|
|
|
|
|
2024-03-08 10:49:49 +07:00
|
|
|
function selectRetireYear(item: DataOption) {
|
|
|
|
|
labelOption.retireYear = item.name;
|
|
|
|
|
}
|
|
|
|
|
|
2024-03-07 13:46:12 +07:00
|
|
|
function clearSelect(t: string) {
|
2024-03-27 10:44:35 +07:00
|
|
|
if (t === "posType") {
|
2024-03-07 13:46:12 +07:00
|
|
|
labelOption.posType = "ทั้งหมด";
|
|
|
|
|
} else if (t === "posLevel") {
|
|
|
|
|
labelOption.posLevel = "ทั้งหมด";
|
|
|
|
|
} else if (t === "retireYear") {
|
2024-03-08 10:49:49 +07:00
|
|
|
labelOption.retireYear = "";
|
2024-03-07 13:46:12 +07:00
|
|
|
} else if (t === "rangeYear") {
|
2024-03-08 10:49:49 +07:00
|
|
|
formFilter.rangeYear.min = 0;
|
|
|
|
|
formFilter.rangeYear.max = 60;
|
2024-03-07 13:46:12 +07:00
|
|
|
}
|
2024-03-27 10:44:35 +07:00
|
|
|
|
|
|
|
|
fetchDataPerson();
|
2024-03-07 13:46:12 +07:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
onMounted(async () => {
|
2024-03-08 10:49:49 +07:00
|
|
|
fetchDataPerson();
|
2024-03-07 13:46:12 +07:00
|
|
|
});
|
2024-03-04 12:46:42 +07:00
|
|
|
</script>
|
|
|
|
|
<template>
|
2024-03-15 16:09:29 +07:00
|
|
|
<!-- <div class="toptitle text-dark col-12 row items-center">
|
2024-03-04 12:46:42 +07:00
|
|
|
ข้อมูลทะเบียนประวัติ
|
2024-03-15 16:09:29 +07:00
|
|
|
</div> -->
|
2024-03-07 13:46:12 +07:00
|
|
|
|
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">
|
|
|
|
|
ค้นหาข้อมูลทะเบียนประวัติ
|
|
|
|
|
</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"
|
|
|
|
|
v-model="formFilter.keyword"
|
|
|
|
|
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-03-15 16:09:29 +07:00
|
|
|
<q-btn
|
|
|
|
|
flat
|
|
|
|
|
label="ตัวเลือกเพิ่มเติม"
|
|
|
|
|
icon-right="mdi-tune"
|
|
|
|
|
@click="onClickShowFilter"
|
|
|
|
|
dense
|
|
|
|
|
class="q-px-sm"
|
|
|
|
|
></q-btn>
|
|
|
|
|
</div>
|
2024-03-07 13:46:12 +07:00
|
|
|
|
2024-03-08 10:49:49 +07:00
|
|
|
<div
|
2024-03-15 16:09:29 +07:00
|
|
|
class="row q-mt-sm q-gutter-sm justify-center"
|
2024-03-08 10:49:49 +07:00
|
|
|
v-if="isShowFilter"
|
|
|
|
|
>
|
|
|
|
|
<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-03-08 10:49:49 +07:00
|
|
|
>
|
|
|
|
|
<template v-slot:label>
|
|
|
|
|
{{ `${labelOption.type}` }}
|
|
|
|
|
|
2024-03-27 10:44:35 +07:00
|
|
|
<!-- <q-btn
|
2024-03-08 10:49:49 +07:00
|
|
|
size="10px"
|
|
|
|
|
flat
|
|
|
|
|
round
|
|
|
|
|
color="white"
|
|
|
|
|
icon="close"
|
2024-03-11 17:42:27 +07:00
|
|
|
v-if="labelOption.type !== 'ประเภททั้งหมด'"
|
2024-03-08 10:49:49 +07:00
|
|
|
@click.stop.prevent="clearSelect('type')"
|
2024-03-27 10:44:35 +07:00
|
|
|
/> -->
|
2024-03-08 10:49:49 +07:00
|
|
|
</template>
|
|
|
|
|
<q-list>
|
|
|
|
|
<q-item
|
|
|
|
|
v-for="(item, index) in store.employeeClassOps"
|
|
|
|
|
:key="index"
|
|
|
|
|
clickable
|
|
|
|
|
v-close-popup
|
|
|
|
|
@click="selectType(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
|
|
|
|
|
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-03-25 07:54:38 +07:00
|
|
|
><!-- class="custom-btn" -->
|
2024-03-08 10:49:49 +07:00
|
|
|
<template v-slot:label>
|
2024-03-11 17:42:27 +07:00
|
|
|
{{
|
|
|
|
|
labelOption.posType !== "ทั้งหมด"
|
|
|
|
|
? labelOption.posType
|
2024-05-14 16:05:58 +07:00
|
|
|
: empType === "officer"
|
|
|
|
|
? `ประเภทตำแหน่ง${labelOption.posType}`
|
|
|
|
|
: `กลุ่มงาน${labelOption.posType}`
|
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"
|
|
|
|
|
v-if="labelOption.posType !== 'ทั้งหมด'"
|
|
|
|
|
@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-03-25 07:54:38 +07:00
|
|
|
><!-- class="custom-btn" -->
|
2024-03-08 10:49:49 +07:00
|
|
|
<template v-slot:label>
|
2024-03-11 17:42:27 +07:00
|
|
|
{{
|
|
|
|
|
labelOption.posLevel !== "ทั้งหมด"
|
|
|
|
|
? labelOption.posLevel
|
2024-05-14 16:05:58 +07:00
|
|
|
: empType === "officer"
|
|
|
|
|
? `ระดับตำแหน่ง${labelOption.posLevel}`
|
|
|
|
|
: `ระดับชั้นงาน${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"
|
|
|
|
|
v-if="labelOption.posLevel !== 'ทั้งหมด'"
|
|
|
|
|
@click.stop.prevent="clearSelect('posLevel')"
|
|
|
|
|
/>
|
|
|
|
|
</template>
|
|
|
|
|
<q-list style="height: 300px">
|
|
|
|
|
<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-03-15 16:09:29 +07:00
|
|
|
<q-separator inset vertical class="lineFil" />
|
|
|
|
|
|
2024-03-27 10:44:35 +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-03-27 10:44:35 +07:00
|
|
|
>
|
2024-03-08 10:49:49 +07:00
|
|
|
<template v-slot:label>
|
|
|
|
|
{{ `ปีเกษียณ${labelOption.retireYear}` }}
|
|
|
|
|
<q-btn
|
|
|
|
|
size="10px"
|
|
|
|
|
flat
|
|
|
|
|
round
|
|
|
|
|
color="white"
|
|
|
|
|
icon="close"
|
|
|
|
|
v-if="labelOption.retireYear !== ''"
|
|
|
|
|
@click.stop.prevent="clearSelect('retireYear')"
|
|
|
|
|
/>
|
|
|
|
|
</template>
|
|
|
|
|
<q-list style="height: 300px">
|
|
|
|
|
<q-item
|
|
|
|
|
v-for="(item, index) in store.yearOps"
|
|
|
|
|
:key="index"
|
|
|
|
|
clickable
|
|
|
|
|
v-close-popup
|
|
|
|
|
@click="selectRetireYear(item)"
|
|
|
|
|
>
|
|
|
|
|
<q-item-section>
|
|
|
|
|
<q-item-label>{{ item.name }}</q-item-label>
|
|
|
|
|
</q-item-section>
|
|
|
|
|
</q-item>
|
|
|
|
|
</q-list>
|
2024-03-27 10:44:35 +07:00
|
|
|
</q-btn-dropdown> -->
|
2024-03-08 10:49:49 +07:00
|
|
|
|
2024-03-27 10:44:35 +07:00
|
|
|
<!-- <q-separator inset vertical class="lineFil" /> -->
|
2024-03-15 16:09:29 +07:00
|
|
|
|
2024-03-08 10:49:49 +07:00
|
|
|
<!-- <datepicker
|
|
|
|
|
menu-class-name="modalfix"
|
|
|
|
|
v-model="formFilter.retireYear"
|
|
|
|
|
:locale="'th'"
|
|
|
|
|
autoApply
|
|
|
|
|
year-picker
|
|
|
|
|
:enableTimePicker="false"
|
|
|
|
|
clearable
|
|
|
|
|
style="width: 120px"
|
|
|
|
|
>
|
|
|
|
|
<template #year="{ year }">{{ year + 543 }}</template>
|
|
|
|
|
<template #year-overlay-value="{ value }">{{
|
|
|
|
|
parseInt(value + 543)
|
|
|
|
|
}}</template>
|
|
|
|
|
<template #trigger>
|
|
|
|
|
<q-input
|
|
|
|
|
class="cursor-pointer custom-select"
|
|
|
|
|
rounded
|
|
|
|
|
label-color="white"
|
|
|
|
|
outlined
|
|
|
|
|
dense
|
|
|
|
|
input-style="color:white;"
|
|
|
|
|
borderless
|
|
|
|
|
:model-value="
|
|
|
|
|
formFilter.retireYear === null
|
|
|
|
|
? null
|
|
|
|
|
: formFilter.retireYear + 543
|
|
|
|
|
"
|
|
|
|
|
:label="`${'ปีเกษียณ'}`"
|
|
|
|
|
>
|
|
|
|
|
<template v-slot:append>
|
|
|
|
|
<q-btn
|
|
|
|
|
size="10px"
|
|
|
|
|
flat
|
|
|
|
|
round
|
|
|
|
|
color="white"
|
|
|
|
|
icon="close"
|
|
|
|
|
v-if="formFilter.retireYear !== null"
|
|
|
|
|
@click.stop.prevent="clearSelect('retireYear')"
|
|
|
|
|
/>
|
|
|
|
|
</template>
|
|
|
|
|
</q-input>
|
|
|
|
|
</template>
|
|
|
|
|
</datepicker> -->
|
|
|
|
|
|
2024-03-27 10:44:35 +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-03-27 10:44:35 +07:00
|
|
|
>
|
2024-03-08 10:49:49 +07:00
|
|
|
<template v-slot:label>
|
|
|
|
|
{{
|
|
|
|
|
`อายุราชการ (${formFilter.rangeYear.min} - ${formFilter.rangeYear.max} ปี)`
|
|
|
|
|
}}
|
|
|
|
|
<q-btn
|
|
|
|
|
size="10px"
|
|
|
|
|
flat
|
|
|
|
|
round
|
|
|
|
|
color="white"
|
|
|
|
|
icon="close"
|
|
|
|
|
v-if="
|
|
|
|
|
formFilter.rangeYear.min !== 0 ||
|
|
|
|
|
formFilter.rangeYear.max !== 60
|
|
|
|
|
"
|
|
|
|
|
@click.stop.prevent="clearSelect('rangeYear')"
|
|
|
|
|
/>
|
|
|
|
|
</template>
|
|
|
|
|
<div class="row justify-center">
|
|
|
|
|
<div class="col-12 q-pa-md text-center">
|
|
|
|
|
<div>
|
|
|
|
|
<span>จำนวนปี</span>
|
|
|
|
|
<q-badge
|
|
|
|
|
color="grey-4"
|
|
|
|
|
text-color="black"
|
|
|
|
|
class="q-ml-sm"
|
|
|
|
|
:label="`${formFilter.rangeYear.min}-${formFilter.rangeYear.max}`"
|
|
|
|
|
/>
|
|
|
|
|
</div>
|
|
|
|
|
<div class="q-mt-lg">
|
|
|
|
|
<q-range
|
|
|
|
|
v-model="formFilter.rangeYear"
|
|
|
|
|
:min="0"
|
|
|
|
|
:max="60"
|
|
|
|
|
:step="1"
|
|
|
|
|
label
|
|
|
|
|
color="primary"
|
|
|
|
|
selection-color="blue"
|
|
|
|
|
label-color="primary"
|
|
|
|
|
thumb-color="blue"
|
|
|
|
|
/>
|
2024-03-07 13:46:12 +07:00
|
|
|
</div>
|
|
|
|
|
</div>
|
2024-03-08 10:49:49 +07:00
|
|
|
</div>
|
2024-03-27 10:44:35 +07:00
|
|
|
</q-btn-dropdown> -->
|
2024-03-08 10:49:49 +07:00
|
|
|
|
2024-03-27 10:44:35 +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
|
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-03-25 07:54:38 +07:00
|
|
|
><!-- class="custom-btn" -->
|
2024-03-08 10:49:49 +07:00
|
|
|
<q-list>
|
|
|
|
|
<q-item clickable v-close-popup>
|
|
|
|
|
<q-item-section>
|
|
|
|
|
<q-toggle
|
|
|
|
|
v-model="formFilter.isProbation"
|
|
|
|
|
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
|
|
|
|
|
v-model="formFilter.isShowRetire"
|
|
|
|
|
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"
|
|
|
|
|
v-model:formFilter="formFilter"
|
|
|
|
|
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-03-08 13:11:20 +07:00
|
|
|
/>
|
2024-03-07 13:46:12 +07:00
|
|
|
</q-card-section>
|
|
|
|
|
</q-card>
|
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>
|