diff --git a/src/api/02_organizational/api.organization.ts b/src/api/02_organizational/api.organization.ts index f63a60e0f..b5371a1f9 100644 --- a/src/api/02_organizational/api.organization.ts +++ b/src/api/02_organizational/api.organization.ts @@ -4,6 +4,8 @@ const organization = `${env.API_URI}/org`; const orgPos = `${env.API_URI}/org/pos`; const orgProfile = `${env.API_URI}/org/profile`; const orgEmployeePos = `${env.API_URI}/org/employee/pos`; +const orgAct = `${env.API_URI}/org/act`; +const orgPosAct = `${env.API_URI}/org/pos/act`; export default { keycloakPosition: () => `${organization}/profile/keycloak/position`, @@ -100,4 +102,8 @@ export default { changePositionByIdProfile: `${organization}/placement/change-position/profile`, orgProfileReport: `${orgProfile}-employee/report`, + + /** รักษาการตำแหน่ง*/ + orgAct, + orgPosAct, }; diff --git a/src/api/05_placement/api.probation.ts b/src/api/05_placement/api.probation.ts index a4f54e3ea..c465ffb1d 100644 --- a/src/api/05_placement/api.probation.ts +++ b/src/api/05_placement/api.probation.ts @@ -34,8 +34,6 @@ export default { changestatusProbations: (personalId: string) => `${evaluate}/report/change-status?personal_id=${personalId}`, - - // probationGetAssignList: (personalId: string) => // `${finish}/probation-assign-list?personal_id=${personalId}`, // clearPosition: (personalId:string) => `${placement}/position/clear/${personalId}` @@ -86,4 +84,6 @@ export default { summaryReportDetail: (id: string) => `${evaluate}/report?assign_id=${id}`, orgProfilePlacement: (id: string) => `${orgProfile}/profile/placement/${id}`, + orgProfileStatus: (profileId: string) => + `${orgProfile}/profile/probation/${profileId}`, }; diff --git a/src/interface/request/main/main.ts b/src/interface/request/main/main.ts index 18e1cf255..8d89da985 100644 --- a/src/interface/request/main/main.ts +++ b/src/interface/request/main/main.ts @@ -134,6 +134,13 @@ const menuList = readonly([ path: "organizationalNew", role: "organization", }, + { + key: 3, + icon: "mdi-account-convert", + label: "รักษาการในตำแหน่ง", + path: "acting", + role: "organization", + }, { key: 3, icon: "o_groups", @@ -561,7 +568,7 @@ const menuList = readonly([ role: "evaluateKPI", }, { - label: "จัดทำประกาศผู้มีผลการปฏิบัติราชการระดับดีเด่นและดีมาก", + label: "รายงาน", path: "KPIReport", role: "evaluateKPI", }, diff --git a/src/modules/02_organizationalNew/components/DialogFormAgency.vue b/src/modules/02_organizationalNew/components/DialogFormAgency.vue index 30f625473..3ca95bea3 100644 --- a/src/modules/02_organizationalNew/components/DialogFormAgency.vue +++ b/src/modules/02_organizationalNew/components/DialogFormAgency.vue @@ -143,8 +143,7 @@ function onSubmit() { ["org" + type + "PhoneIn"]: formData.orgPhoneIn, ["org" + type + "Fax"]: formData.orgFax, ["org" + type + "Rank"]: formData.orgLevel, - ["org" + type + "RankSub"]: - level.value !== 0 ? formData.orgLevelSub : undefined, + ["org" + type + "RankSub"]: formData.orgLevelSub, [nameId]: rootId, responsibility: formData.responsibility != null ? formData.responsibility : "", @@ -217,8 +216,8 @@ watch( () => { if (props.modal === true) { if (actionType.value === "ADD") { - console.log(props.dataNode); - console.log(level.value); + // console.log(props.dataNode); + // console.log(level.value); if (props.dataNode) { formData.orgCode = @@ -238,6 +237,8 @@ watch( orgLevelOption.value = orgLevelOptionMain.value.slice(1, 4); formData.orgLevel = ""; } + + formData.orgLevel == "DEPARTMENT" ? selectOrgLevele("DEPARTMENT") : ""; } else { if (props.dataNode) { formData.orgName = props.dataNode.orgTreeName; @@ -274,9 +275,16 @@ const tittleName = computed(() => { function selectOrgLevele(val: string, status: boolean = true) { formData.orgLevelSub = status ? "" : formData.orgLevelSub; switch (val) { + case "DEPARTMENT": + orgLevelSubOptionMain.value = [ + { name: "สำนัก", id: "BUREAU" }, + { name: "สำนักงาน", id: "OFFICE" }, + { name: "สำนักงานเขต", id: "DISTRICT" }, + ]; + break; case "OFFICE": orgLevelSubOptionMain.value = [ - { name: "ระดับกอง", id: "DIVISION" }, + { name: "กอง", id: "DIVISION" }, { name: "สำนักงาน", id: "OFFICE", @@ -289,7 +297,7 @@ function selectOrgLevele(val: string, status: boolean = true) { break; case "DIVISION": orgLevelSubOptionMain.value = [ - { name: "ระดับส่วน", id: "SECTION" }, + { name: "ส่วน", id: "SECTION" }, { name: "กลุ่มภารกิจ", id: "MISSION", @@ -298,11 +306,19 @@ function selectOrgLevele(val: string, status: boolean = true) { case "SECTION": orgLevelSubOptionMain.value = [ - { name: "ระดับฝ่าย", id: "FACTION" }, + { name: "ฝ่าย", id: "FACTION" }, { name: "กลุ่มงาน", id: "WORK", }, + { + name: "สถานีดับเพลิงและกู้ภัย", + id: "FIRESTATION", + }, + { + name: "โรงเรียน", + id: "SCHOOL", + }, ]; default: @@ -415,9 +431,8 @@ function selectOrgLevele(val: string, status: boolean = true) { lazy-rules /> -
+
{ id: 21, name: "โปรดเกล้าฯ แต่งตั้งให้ดำรงตำแหน่ง{รายละเอียดของตำแหน่งและหน่วยงาน}", }, + { + id: 22, + name: "รักษาการในตำแหน่งหัวหน้าฝ่าย {ฝ่าย…} {หน่วยงาน/สำนัก} {ลำดับที่…} คำสั่ง {หน่วยงาน/สำนัก} ที่ {เลขที่/ปีงบประมาณ} ลว. {วันที่ลงนาม}", + }, ]); const optionDoc = ref([ diff --git a/src/modules/05_placement/components/probation/MainProbation.vue b/src/modules/05_placement/components/probation/MainProbation.vue index 4592a32f1..b81afd7a5 100644 --- a/src/modules/05_placement/components/probation/MainProbation.vue +++ b/src/modules/05_placement/components/probation/MainProbation.vue @@ -327,22 +327,22 @@ async function filterKeyword2Fn(page: number) { * @param id string * @param data type */ -async function fecthlistProbation(id: string, data: any) { - try { - probationlist.value = []; - const res = await http.post( - config.API.profileSearchNewOcIdType(id, "officer"), - { - criterias: data, - } - ); - return res.data.result; - } catch (err) { - messageError($q, err); - } finally { - hideLoader(); - } -} +// async function fecthlistProbation(id: string, data: any) { +// try { +// probationlist.value = []; +// const res = await http.post( +// config.API.profileSearchNewOcIdType(id, "officer"), +// { +// criterias: data, +// } +// ); +// return res.data.result; +// } catch (err) { +// messageError($q, err); +// } finally { +// hideLoader(); +// } +// } /** * ค้นหาข้อมูลตามไอดี @@ -389,9 +389,16 @@ function clickAdd(data: any) { await http .post(config.API.personalAdd(), data) - .then(() => { - getpersonalList(); - success($q, "เพิ่มข้อมูลสำเร็จ"); + .then(async () => { + await http + .get(config.API.orgProfileStatus(data.id)) + .then((res) => { + getpersonalList(); + success($q, "เพิ่มข้อมูลสำเร็จ"); + }) + .catch((e) => { + messageError($q, e); + }); }) .catch((e) => { messageError($q, e); diff --git a/src/modules/14_KPI/views/report.vue b/src/modules/14_KPI/views/report.vue index 4cbb751f5..363c57f73 100644 --- a/src/modules/14_KPI/views/report.vue +++ b/src/modules/14_KPI/views/report.vue @@ -21,6 +21,52 @@ const organization = ref(""); const roundOp = ref([]); const organizationOpsMain = ref([]); const organizationOps = ref([]); +const typeReport = ref(""); +const listReportMain = ref([ + { + id: "1", + name: "รายงานสรุปผลการประเมินผลการปฏิบัติราชการระดับบุคคล แสดงจำนวนผู้มีผลการประเมินระดับต่างๆ ในแต่ละรอบการประเมินรายหน่วยงาน/ส่วนราชการ", + }, + { + id: "2", + name: "รายงานสรุปผลการประเมินผลการปฏิบัติราชการระดับบุคคล แสดงรายละเอียดผู้มีผลการประเมินระดับต่างๆ รายหน่วยงาน/ส่วนราชการ ", + }, + { + id: "3", + name: "รายงานสรุปผลการประเมินผลการปฏิบัติราชการระดับบุคคล แสดงรายละเอียดผลการประเมินของผู้ใต้บังคับบัญชา", + }, + { + id: "4", + name: "แบบสรุปผลการประเมินผลการปฏิบัติราชการระดับบุคคล (รายบุคคล)", + }, + { + id: "5", + name: "รายงานผลการประเมินผลการปฏิบัติราชการย้อนหลัง ๕ ปี", + }, + { + id: "6", + name: "รายงานผลการประเมินผลการปฏิบัติราชการย้อนหลัง ๓ ปี", + }, + { + id: "7", + name: "รายงานสรุปแผนพัฒนาการปฏิบัติราชการรายบุคคล", + }, + { + id: "8", + name: "รายงานแผนพัฒนาการปฏิบัติราชการรายบุคคล", + }, + { + id: "9", + name: "จัดทำประกาศผู้มีผลการปฏิบัติราชการระดับดีเด่นและดีมาก", + }, +]); +const listReport = ref([]); +const searchField = ref("fullName"); +const search = ref(""); +const typeFilter = ref([ + { id: "fullName", name: "ชื่อ-นามสกุล" }, + { id: "citizenId", name: "เลขประจำตัวประชาชน" }, +]); function fetchRoundOption() { http @@ -112,9 +158,9 @@ function fetchReport() { * function เรียกไฟล์ PDF * @param data ข้อมูลบัญชีวันลา */ -async function genPDf(data: any) { +function genPDf(data: any) { showLoader(); - await axios + axios .post(config.API.reportTemplate + `/docx`, data, { headers: { accept: "application/pdf", @@ -144,12 +190,26 @@ function changOption() { fetchReport(); } -function filterSelector(val: string, update: Function) { - update(() => { - organizationOps.value = organizationOpsMain.value.filter( - (v: DataOption) => v.name.toLowerCase().indexOf(val) > -1 - ); - }); +function filterSelector(val: string, update: Function, type: string) { + switch (type) { + case "typereport": + update(() => { + listReport.value = listReportMain.value.filter( + (v: DataOption) => v.name.toLowerCase().indexOf(val) > -1 + ); + }); + break; + case "organization": + update(() => { + organizationOps.value = organizationOpsMain.value.filter( + (v: DataOption) => v.name.toLowerCase().indexOf(val) > -1 + ); + }); + break; + + default: + break; + } } const splitterModel = ref(14); @@ -159,7 +219,9 @@ const pdfSrc = ref(); const dataDownload = ref(); async function downloadReport(data: any, type: string) { - var fileName = "ประกาศผู้มีผลการปฏิบัติราชการระดับดีเด่นและดีมาก"; + const name = + listReportMain.value.find((e) => e.id === typeReport.value)?.name ?? ""; + var fileName = name; genReport(data, fileName, type); } @@ -184,60 +246,11 @@ onMounted(() => {