diff --git a/src/api/14_KPI/api.KPI.ts b/src/api/14_KPI/api.KPI.ts index c2a3ea2c2..5149ddd7c 100644 --- a/src/api/14_KPI/api.KPI.ts +++ b/src/api/14_KPI/api.KPI.ts @@ -2,22 +2,23 @@ import env from "../index"; const KPI = `${env.API_URI}/kpi`; const kpiPeriod = `${env.API_URI}/kpi/period`; const kpiEvaluation = `${env.API_URI}/kpi/evaluation`; +const kpiUserEvaluation = `${env.API_URI}/kpi/user/evaluation`; +const kpiAchievement = `${env.API_URI}/kpi/user/achievement`; const kpiGroup = `${env.API_URI}/kpi/group`; const kpiPlan = `${env.API_URI}/kpi/plan`; const kpiCapacity = `${env.API_URI}/kpi/capacity`; const kpiLink = `${env.API_URI}/kpi/link`; +const KpiUser = `${env.API_URI}/kpi/user`; export default { KPI, /** รอบการประเมินผล*/ - kpiPeriod: `${kpiPeriod}`, + kpiPeriod, kpiPeriodById: (id: string) => `${kpiPeriod}/${id}`, kpiEvaluation, - /** role */ - kpiRoleMainList:`${KPI}/role`, + kpiRoleMainList: `${KPI}/role`, - kpiGroup, kpiGroupById: (id: string) => `${kpiGroup}/${id}`, kpiPlan, @@ -27,4 +28,10 @@ export default { kpiCapacity, kpiLink, + + kpiUserEvaluation, + profilePosition: () => `${env.API_URI}/org/profile/keycloak/position`, + kpiAchievement: (type: string) => `${kpiAchievement}/${type}`, + kpiAchievementPoint: (type: string) => `${kpiAchievement}/${type}/point`, + kpiUserCapacity: `${KpiUser}/capacity`, }; diff --git a/src/modules/14_KPI/components/detailList/01_Assessment.vue b/src/modules/14_KPI/components/detailList/01_Assessment.vue new file mode 100644 index 000000000..963388874 --- /dev/null +++ b/src/modules/14_KPI/components/detailList/01_Assessment.vue @@ -0,0 +1,238 @@ + + + + + diff --git a/src/modules/14_KPI/components/detailList/02_CommanderAbove.vue b/src/modules/14_KPI/components/detailList/02_CommanderAbove.vue new file mode 100644 index 000000000..d33dbfeb9 --- /dev/null +++ b/src/modules/14_KPI/components/detailList/02_CommanderAbove.vue @@ -0,0 +1,3 @@ + \ No newline at end of file diff --git a/src/modules/14_KPI/components/detailList/03_CommanderAboveOneStep.vue b/src/modules/14_KPI/components/detailList/03_CommanderAboveOneStep.vue new file mode 100644 index 000000000..c60e29914 --- /dev/null +++ b/src/modules/14_KPI/components/detailList/03_CommanderAboveOneStep.vue @@ -0,0 +1,3 @@ + \ No newline at end of file diff --git a/src/modules/14_KPI/components/detailList/04_File.vue b/src/modules/14_KPI/components/detailList/04_File.vue new file mode 100644 index 000000000..cf76d7ddc --- /dev/null +++ b/src/modules/14_KPI/components/detailList/04_File.vue @@ -0,0 +1,239 @@ + + + diff --git a/src/modules/14_KPI/components/detailList/Dialog/01_FormIndicator.vue b/src/modules/14_KPI/components/detailList/Dialog/01_FormIndicator.vue new file mode 100644 index 000000000..65e8531a6 --- /dev/null +++ b/src/modules/14_KPI/components/detailList/Dialog/01_FormIndicator.vue @@ -0,0 +1,527 @@ + + + + diff --git a/src/modules/14_KPI/components/detailList/Dialog/03_FormIndicatorSpecial.vue b/src/modules/14_KPI/components/detailList/Dialog/03_FormIndicatorSpecial.vue new file mode 100644 index 000000000..9d103c41a --- /dev/null +++ b/src/modules/14_KPI/components/detailList/Dialog/03_FormIndicatorSpecial.vue @@ -0,0 +1,362 @@ + + + + diff --git a/src/modules/14_KPI/components/detailList/Dialog/04_FormCompetency.vue b/src/modules/14_KPI/components/detailList/Dialog/04_FormCompetency.vue new file mode 100644 index 000000000..8fcd6077e --- /dev/null +++ b/src/modules/14_KPI/components/detailList/Dialog/04_FormCompetency.vue @@ -0,0 +1,486 @@ + + + + + diff --git a/src/modules/14_KPI/components/detailList/Dialog/DialogListCriteria.vue b/src/modules/14_KPI/components/detailList/Dialog/DialogListCriteria.vue new file mode 100644 index 000000000..1904da9ce --- /dev/null +++ b/src/modules/14_KPI/components/detailList/Dialog/DialogListCriteria.vue @@ -0,0 +1,53 @@ + + + diff --git a/src/modules/14_KPI/components/detailList/DialogEvaluate/01_Indicator.vue b/src/modules/14_KPI/components/detailList/DialogEvaluate/01_Indicator.vue new file mode 100644 index 000000000..16133dea3 --- /dev/null +++ b/src/modules/14_KPI/components/detailList/DialogEvaluate/01_Indicator.vue @@ -0,0 +1,286 @@ + + + + diff --git a/src/modules/14_KPI/components/detailList/DialogEvaluate/02_Competenct.vue b/src/modules/14_KPI/components/detailList/DialogEvaluate/02_Competenct.vue new file mode 100644 index 000000000..899ce1395 --- /dev/null +++ b/src/modules/14_KPI/components/detailList/DialogEvaluate/02_Competenct.vue @@ -0,0 +1,262 @@ + + + + + diff --git a/src/modules/14_KPI/components/detailList/TabMain.vue b/src/modules/14_KPI/components/detailList/TabMain.vue new file mode 100644 index 000000000..416fc6982 --- /dev/null +++ b/src/modules/14_KPI/components/detailList/TabMain.vue @@ -0,0 +1,89 @@ + + + + diff --git a/src/modules/14_KPI/components/detailList/Topic/!02_CompetencyCard.vue b/src/modules/14_KPI/components/detailList/Topic/!02_CompetencyCard.vue new file mode 100644 index 000000000..665dc0864 --- /dev/null +++ b/src/modules/14_KPI/components/detailList/Topic/!02_CompetencyCard.vue @@ -0,0 +1,345 @@ + diff --git a/src/modules/14_KPI/components/detailList/Topic/01_Indicator.vue b/src/modules/14_KPI/components/detailList/Topic/01_Indicator.vue new file mode 100644 index 000000000..55a980b93 --- /dev/null +++ b/src/modules/14_KPI/components/detailList/Topic/01_Indicator.vue @@ -0,0 +1,395 @@ + + + diff --git a/src/modules/14_KPI/components/detailList/Topic/02_Competency.vue b/src/modules/14_KPI/components/detailList/Topic/02_Competency.vue new file mode 100644 index 000000000..52a22db76 --- /dev/null +++ b/src/modules/14_KPI/components/detailList/Topic/02_Competency.vue @@ -0,0 +1,391 @@ + + + + + diff --git a/src/modules/14_KPI/store/KPIStore.ts b/src/modules/14_KPI/store/KPIStore.ts index 5cc082e07..2cdd7f3dd 100644 --- a/src/modules/14_KPI/store/KPIStore.ts +++ b/src/modules/14_KPI/store/KPIStore.ts @@ -1,9 +1,188 @@ import { defineStore } from "pinia"; import { ref } from "vue"; +import type { DataOption } from "@/modules/14_KPI/interface/index/Main"; // store export const useKPIDataStore = defineStore("KPIDataStore", () => { - const competencyType = ref("HEAD"); + // const competencyType = ref("HEAD"); - return { competencyType }; + const tabMain = ref("1"); + const dataProfile = ref(); + const dataEvaluation = ref(); + + const competencyType = ref([ + { + id: "HEAD", + name: "สมรรถนะหลัก", + }, + { + id: "GROUP", + name: "สมรรถนะประจำกลุ่มงาน", + }, + { + id: "EXECUTIVE", + name: "สมรรถนะประจำผู้บริหารกรุงเทพมหานคร", + }, + { + id: "DIRECTOR", + name: "สมรรถนะเฉพาะสำหรับตำแหน่ง ผอ.เขต ผช.ผอ.เขต และหัวหน้าฝ่ายในสังกัด สนง.เขต", + }, + { + id: "INSPECTOR", + name: "สมรรถนะเฉพาะสำหรับตำแหน่งผู้ตรวจราชการ กทม. และผู้ตรวจราชการ", + }, + ]); + + function convertStatus(val: string) { + switch (val) { + case "PENDING": + return "รอดำเนินการ"; + case "INPROGRESS": + return "กําลังดำเนินการ"; + case "DONE": + return "ประเมินเสร็จสิ้น"; + default: + break; + } + } + + function convertResults(val: string) { + switch (val) { + case "PENDING": + return "รอดำเนินการ"; + case "PASSED": + return "ผ่านการประเมิน"; + case "NOTPASSED": + return "ไม่ผ่านการประเมิน"; + default: + break; + } + } + + const ratingColors = ref([ + "light-blue-3", + "light-blue-6", + "blue", + "blue-9", + "blue-10", + ]); + + function checkCompetency() { + const position = dataProfile.value.position; + const posTypeName = dataProfile.value.posTypeName; + const posLevelName = dataProfile.value.posLevelName; + + if ( + position == "ผู้ตรวจราชการกรุงเทพมหานคร" || + position == "ผู้ตรวจราชการ" + ) { + competencyType.value = competencyType.value.filter( + (x: DataOption) => x.id == "HEAD" || x.id == "INSPECTOR" + ); + } else if (position == "ผู้อำนวยการเขต") { + competencyType.value = competencyType.value.filter( + (x: DataOption) => x.id == "HEAD" || x.id == "DIRECTOR" + ); + } else { + switch (posTypeName + " " + posLevelName) { + // case "ทั่วไป ปฏิบัติงาน": + // case "ทั่วไป ชำนาญงาน": + // case "ทั่วไป อาวุโส": + // case "วิชาการ ปฏิบัติการ": + // case "วิชาการ ชำนาญการ": + // case "วิชาการ ชำนาญการพิเศษ": + // case "วิชาการ เชี่ยวชาญ": + // case "วิชาการ ทรงคุณวุฒิ": + // competencyType.value = competencyType.value.filter( + // (x: DataOptions) => x.id == "HEAD" || x.id == "GROUP" + // ); + // break; + case "อำนวยการ ต้น": + case "อำนวยการ สูง": + case "บริหาร ต้น": + case "บริหาร สูง": + competencyType.value = competencyType.value.filter( + (x: DataOption) => x.id == "HEAD" || x.id == "EXECUTIVE" + ); + break; + default: + competencyType.value = competencyType.value.filter( + (x: DataOption) => x.id == "HEAD" || x.id == "GROUP" + ); + break; + } + } + } + + const defaultCompetencyCoreLevel = ref(); + const defaultCompetencyGroupLevel = ref(null); + function checkCompetencyDefaultCompetencyLevel() { + const posTypeName = dataProfile.value.posTypeName; + const posLevelName = dataProfile.value.posLevelName; + + switch (posTypeName + " " + posLevelName) { + case "บริหาร สูง": + defaultCompetencyCoreLevel.value = 5; + break; + case "บริหาร ต้น": + defaultCompetencyCoreLevel.value = 4; + break; + case "อำนวยการ สูง": + defaultCompetencyCoreLevel.value = 4; + break; + case "อำนวยการ ต้น": + defaultCompetencyCoreLevel.value = 3; + break; + case "วิชาการ ทรงคุณวุฒิ": + defaultCompetencyCoreLevel.value = 5; + defaultCompetencyGroupLevel.value = 5; + break; + case "วิชาการ เชี่ยวชาญ": + defaultCompetencyCoreLevel.value = 4; + defaultCompetencyGroupLevel.value = 4; + break; + case "วิชาการ ชำนาญการพิเศษ": + defaultCompetencyCoreLevel.value = 3; + defaultCompetencyGroupLevel.value = 4; + break; + case "วิชาการ ชำนาญการ": + defaultCompetencyCoreLevel.value = 2; + defaultCompetencyGroupLevel.value = 3; + break; + case "วิชาการ ปฏิบัติการ": + defaultCompetencyCoreLevel.value = 1; + defaultCompetencyGroupLevel.value = 2; + break; + case "ทั่วไป ทักษะพิเศษ": + defaultCompetencyCoreLevel.value = 4; + defaultCompetencyGroupLevel.value = 4; + break; + case "ทั่วไป อาวุโส": + defaultCompetencyCoreLevel.value = 3; + defaultCompetencyGroupLevel.value = 3; + break; + case "ทั่วไป ชำนาญงาน": + defaultCompetencyCoreLevel.value = 2; + defaultCompetencyGroupLevel.value = 2; + break; + case "ทั่วไป ปฏิบัติงาน": + defaultCompetencyCoreLevel.value = 1; + defaultCompetencyGroupLevel.value = 1; + break; + default: + break; + } + } + + return { + competencyType, + convertStatus, + convertResults, + tabMain, + dataProfile, + dataEvaluation, + ratingColors, + checkCompetency, + checkCompetencyDefaultCompetencyLevel, + }; }); diff --git a/src/modules/14_KPI/views/detail.vue b/src/modules/14_KPI/views/detail.vue index 818d0ca87..6c25a30f0 100644 --- a/src/modules/14_KPI/views/detail.vue +++ b/src/modules/14_KPI/views/detail.vue @@ -1,3 +1,244 @@ + + + diff --git a/src/modules/14_KPI/views/list.vue b/src/modules/14_KPI/views/list.vue index fd60fc191..bdffc356c 100644 --- a/src/modules/14_KPI/views/list.vue +++ b/src/modules/14_KPI/views/list.vue @@ -1,3 +1,328 @@ + + + diff --git a/src/modules/15_development/components/BasicInfo.vue b/src/modules/15_development/components/BasicInfo.vue index dc44c614f..73b437851 100644 --- a/src/modules/15_development/components/BasicInfo.vue +++ b/src/modules/15_development/components/BasicInfo.vue @@ -45,11 +45,14 @@ function fetchData(id: string) { .get(config.API.developmentMainTab("tab1", id)) .then(async (res) => { const data = res.data.result; + formData.year = data.year; formData.reason = data.reason; formData.projectName = data.projectName; formData.objective = data.objective; formData.nodeId = data.nodeId; + formData.node = data.node; + formData.orgRevisionId = data.revisionId; const arrayExpanded = [ data.root, @@ -59,19 +62,6 @@ function fetchData(id: string) { data.child4, ]; expanded.value = arrayExpanded.filter((e) => e !== null).slice(0, -1); - - // if (node.value && formData?.nodeId) { - // const nodeTree = await searchAndReplace(node.value, formData?.nodeId); - // if (nodeTree) { - // expanded.value = []; - // const parts = nodeTree?.orgName.split("/"); - // for (let i = 1; i < parts.length; i++) { - // const arrangedParts = parts[i]; - // expanded.value.push(arrangedParts); - // } - // updateSelected(nodeTree); - // } - // } }) .catch((err) => { messageError($q, err); @@ -144,26 +134,6 @@ function updateSelected(data: DataTree) { formData.orgRevisionId = data.orgRevisionId; } -/** - * function หาหน่วยงานที่รับผิดชอบ - * @param orgTreeData ข้อมูล nodeTree - * @param treeId tree ID - */ -async function searchAndReplace(orgTreeData: any, treeId: string | null) { - if (orgTreeData) { - for (let orgTree of orgTreeData) { - if (orgTree.orgTreeId === treeId) { - return orgTree; - } - let foundOrg: any = await searchAndReplace(orgTree.children, treeId); - if (foundOrg) { - return foundOrg; - } - } - return false; - } -} - onMounted(async () => { fetchActive(); });