Merge branch 'nice' into develop

This commit is contained in:
DESKTOP-1R2VSQH\Lenovo ThinkPad E490 2025-01-31 11:30:29 +07:00
commit 09d00df7e9
3 changed files with 143 additions and 12 deletions

View file

@ -13,6 +13,7 @@ interface FormFilter {
isAll?: boolean;
nodeId?: string | null;
node?: string | null | number;
retireType?: null | string;
}
interface FormAddPerson {
@ -54,6 +55,7 @@ interface QueryParams {
node?: number | string | null | undefined;
nodeId?: string;
isAll?: boolean;
retireType?: string | null;
}
interface FormChangeName {
@ -81,9 +83,9 @@ interface FormDataIDP {
createdAt?: Date | null;
}
interface RangeAge{
min:number
max:number
interface RangeAge {
min: number;
max: number;
}
export type {
FormFilter,
@ -93,5 +95,5 @@ export type {
QueryParams,
FormChangeName,
FormDataIDP,
RangeAge
RangeAge,
};

View file

@ -71,6 +71,7 @@ export const useRegistryNewDataStore = defineStore("registryNew", () => {
nodeId: null,
node: null,
searchType: "fullName",
retireType: null,
});
const labelOption = reactive({
@ -79,6 +80,7 @@ export const useRegistryNewDataStore = defineStore("registryNew", () => {
posLevel: "ทั้งหมด",
retireYear: "",
node: "เลือกหน่วยงาน",
retireType: "ทั้งหมด",
});
function convertTypeRetired(val: string) {
@ -103,12 +105,30 @@ export const useRegistryNewDataStore = defineStore("registryNew", () => {
case "PLACEMENT_TRANSFER":
return "โอนออก ";
case "RETIRE_RESIGN_EMP":
return "ให้ออกจากราชการ(ลูกจ้าง) ";
return "ให้ออกจากราชการ(ลูกจ้าง)";
default:
return "";
}
}
const retireTypeOps = ref<DataOption[]>([
{ id: "RETIRE", name: "เกษียณ" },
{ id: "RETIRE_RESIGN", name: "ลาออก" },
{ id: "RETIRE_DECEASED", name: "ถึงแก่กรรม" },
{ id: "RETIRE_OUT", name: "ให้ออกจากราชการ" },
{ id: "DISCIPLINE_RESULT_REMOVE", name: "ปลดออกจากราชการ" },
{ id: "DISCIPLINE_RESULT_DISMISS", name: "ไล่ออกจากราชการ" },
{ id: "DISCIPLINE_SUSPEND", name: "ถูกพักจากราชการ" },
{ id: "PROBATION_REPORT", name: "ไม่ผ่านทดลองงาน" },
]);
const retireTypeEmpOps = ref<DataOption[]>([
{ id: "RETIRE", name: "เกษียณ" },
{ id: "RETIRE_RESIGN", name: "ลาออก" },
{ id: "RETIRE_DECEASED", name: "ถึงแก่กรรม" },
{ id: "RETIRE_RESIGN_EMP", name: "ให้ออกจากราชการ" },
]);
return {
fetchType,
fetchLevel,
@ -125,5 +145,7 @@ export const useRegistryNewDataStore = defineStore("registryNew", () => {
tabs,
tabsManu,
convertTypeRetired,
retireTypeOps,
retireTypeEmpOps,
};
});

View file

@ -108,6 +108,9 @@ async function fetchDataPerson() {
if (store.formFilter.isShowRetire != null) {
queryParams.isRetire = store.formFilter.isShowRetire;
queryParams.retireType = queryParams.isRetire
? store.formFilter.retireType
: undefined;
}
if (empType.value !== "officer") {
@ -187,9 +190,7 @@ async function insertAvatar(items: DataPerson[]) {
);
}
/**
* funciotn นหาขอม
*/
/** funciotn ค้นหาข้อมูล */
function onclickSearch() {
store.formFilter.page = 1;
store.formFilter.keyword =
@ -203,15 +204,16 @@ function onclickSearch() {
*/
function selectType() {
empType.value = route.name == "registryNew" ? "officer" : "perm";
store.formFilter.isShowRetire = false;
store.labelOption.retireType = "ทั้งหมด";
store.formFilter.retireType = null;
store.formFilter.keyword = "";
if (empType.value !== "officer") {
store.formFilter.isShowRetire = null;
store.formFilter.isProbation = null;
store.formFilter.keyword = "";
fetchOptionGroup();
} else {
store.formFilter.isShowRetire = false;
store.formFilter.isProbation = false;
store.formFilter.keyword = "";
fetchType();
}
@ -267,6 +269,17 @@ function selectPosLevel(item: DataOption) {
fetchDataPerson();
}
/**
* function เลอกประเภทตำแหน
* @param item ประเภทระด
*/
function selectRetireType(item: DataOption) {
store.labelOption.retireType = item.name;
store.formFilter.page = 1;
store.formFilter.retireType = item.id;
fetchDataPerson();
}
/**
* function เคลวเลอก
* @param t ประเภทตวเลอก
@ -291,6 +304,9 @@ function clearSelect(t: string) {
empType.value === "officer"
? "เลือกหน่วยงาน/ส่วนราชการ"
: "เลือกหน่วยงาน";
} else if (t === "retireType") {
store.labelOption.retireType = "ทั้งหมด";
store.formFilter.retireType = null;
}
store.formFilter.page = 1;
fetchDataPerson();
@ -554,6 +570,57 @@ onMounted(async () => {
@update:model-value="getSearch"
/>
</div>
<div
class="row q-gutter-sm justify-center"
v-if="empType !== 'officer'"
>
<q-toggle
v-model="store.formFilter.isShowRetire"
color="primary"
label="แสดงข้อมูลผู้พ้นจากราชการ"
@update:model-value="getSearch"
/>
<q-btn-dropdown
v-if="store.formFilter.isShowRetire"
rounded
flat
dense
label-color="white"
dropdown-icon="mdi-chevron-down"
class="q-px-sm"
>
<template v-slot:label>
{{
store.labelOption.retireType !== "ทั้งหมด"
? store.labelOption.retireType
: `ประเภท${store.labelOption.retireType}`
}}
<q-btn
v-if="store.labelOption.retireType !== 'ทั้งหมด'"
size="10px"
flat
round
color="white"
icon="close"
@click.stop.prevent="clearSelect('retireType')"
/>
</template>
<q-list>
<q-item
v-for="(item, index) in store.retireTypeEmpOps"
:key="index"
clickable
v-close-popup
@click="selectRetireType(item)"
>
<q-item-section>
<q-item-label>{{ item.name }}</q-item-label>
</q-item-section>
</q-item>
</q-list>
</q-btn-dropdown>
</div>
<div
v-if="empType === 'officer'"
@ -578,6 +645,46 @@ onMounted(async () => {
label="แสดงตำแหน่งทั้งหมด"
@update:model-value="getSearch"
/>
<q-btn-dropdown
v-if="store.formFilter.isShowRetire"
rounded
flat
dense
label-color="white"
dropdown-icon="mdi-chevron-down"
class="q-px-sm"
>
<template v-slot:label>
{{
store.labelOption.retireType !== "ทั้งหมด"
? store.labelOption.retireType
: `ประเภทการพ้นจากราชการ${store.labelOption.retireType}`
}}
<q-btn
v-if="store.labelOption.retireType !== 'ทั้งหมด'"
size="10px"
flat
round
color="white"
icon="close"
@click.stop.prevent="clearSelect('retireType')"
/>
</template>
<q-list>
<q-item
v-for="(item, index) in store.retireTypeOps"
:key="index"
clickable
v-close-popup
@click="selectRetireType(item)"
>
<q-item-section>
<q-item-label>{{ item.name }}</q-item-label>
</q-item-section>
</q-item>
</q-list>
</q-btn-dropdown>
</div>
</div>
</div>