Merge branch 'develop' into devTee

This commit is contained in:
setthawutttty 2025-02-03 14:09:24 +07:00
commit 3b1c883c8e
7 changed files with 169 additions and 40 deletions

View file

@ -58,9 +58,9 @@ const props = defineProps({
//
const orgLevelOptionMain = ref<DataOption[]>([
{ name: "ระดับสำนัก", id: "DEPARTMENT" },
{ name: "หน่วยงาน", id: "DEPARTMENT" },
{
name: "ระดับกอง/สำนักงาน/ส่วนราชการ/โรงพยาบาล/เทียบเท่ากอง",
name: "ระดับกองหรือเทียบเท่า",
id: "OFFICE",
},
{ name: "ระดับส่วน/กลุ่มภารกิจ", id: "DIVISION" },

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>

View file

@ -242,10 +242,7 @@ async function postData(action: string) {
/** ผลการประเมินการทดลองปฏิบัติหน้าที่ราชการ */
function selectResult() {
if (result.value !== 3) {
expand_month.value = "";
}
expand_month.value = "";
changeReson52(Number(result.value));
}
@ -274,7 +271,9 @@ function changeReson52(val: number) {
reson52.value = "เห็นควรให้ออกจากราชการ";
break;
case 3:
reson52.value = `เห็นควรให้ขยายเวลาทดลองปฏิบัตหิน้าท่ีราชการต่อไปอีก ${expand_month.value} เดือน`;
reson52.value = `เห็นควรให้ขยายเวลาทดลองปฏิบัตหน้าที่ราชการต่อไปอีก ${
expand_month.value ? expand_month.value : ""
} เดอน`;
break;
default:
@ -362,6 +361,7 @@ onMounted(async () => {
"
:enableTimePicker="false"
week-start="0"
:max-date="date_finish"
>
<template #year="{ year }">
{{ year + 543 }}
@ -401,17 +401,18 @@ onMounted(async () => {
<div class="col-xs-12 col-sm-6">
<datepicker
menu-class-name="modalfix"
v-model="date_finish"
:locale="'th'"
autoApply
:readonly="
!status ||
checkRoutePermisson ||
probationStore.dataPermissions?.tab6.isEdit == false
"
v-model="date_finish"
:locale="'th'"
autoApply
borderless
:enableTimePicker="false"
week-start="0"
:min-date="date_start"
>
<template #year="{ year }">
{{ year + 543 }}
@ -522,10 +523,8 @@ onMounted(async () => {
<div class="row q-mt-xs" v-if="result === 3">
<q-input
outlined
@update:model-value="changeReson52(3)"
dense
@update:model-value="
reson52 = `เห็นควรให้ขยายเวลาทดลองปฏิบัตหิน้าท่ีราชการต่อไปอีก ${expand_month} เดือน`
"
v-model="expand_month"
label="จำนวนเดือน"
:rules="[(val:string) => !!val || 'กรุณากรอกจำนวนเดือน']"

View file

@ -125,7 +125,7 @@ async function onDownloadFile() {
}
async function onUpdateStatusAssign() {
http
await http
.patch(
config.API.createformReport(assignId.value) +
`&evaluate_no=${round.value}`

View file

@ -154,7 +154,6 @@ const probation_statusOP = ref<any>([
/** get ข้อมูล งานที่ได้รับมอบหมาย */
async function getAssignList() {
showLoader();
await http
.get(config.API.probationGetAssignList(personalId.value))
.then(async (res) => {
@ -173,15 +172,11 @@ async function getAssignList() {
})
.catch((err) => {
messageError($q, err);
})
.finally(() => {
hideLoader();
});
}
/** รายละเอียด ตาม id */
async function getpersonalList() {
showLoader();
await http
.get(config.API.personal(personalId.value))
.then(async (res) => {
@ -195,9 +190,6 @@ async function getpersonalList() {
})
.catch((err) => {
messageError($q, err);
})
.finally(() => {
hideLoader();
});
}
@ -301,12 +293,19 @@ function onSearch() {
/** get ค่า เมื่อโหลดหน้า */
onMounted(async () => {
await Promise.all([
getpersonalList(),
getAssignList(),
fetchProfilePhoto(),
fetchCheckCommittee(),
]);
try {
showLoader();
await Promise.all([
getpersonalList(),
getAssignList(),
fetchProfilePhoto(),
fetchCheckCommittee(),
]);
} catch (error) {
console.error("Error fetching data:", error);
} finally {
hideLoader();
}
});
</script>