diff --git a/src/api/KPI/api.kpis.ts b/src/api/KPI/api.kpis.ts index edd7f13..7dcac38 100644 --- a/src/api/KPI/api.kpis.ts +++ b/src/api/KPI/api.kpis.ts @@ -5,6 +5,7 @@ const kpiPeriod = `${env.API_URI}/kpi/period`; const kpiEvaluation = `${env.API_URI}/kpi/user/evaluation`; const kpiPlan = `${env.API_URI}/kpi/plan`; const kpiRole = `${env.API_URI}/kpi/role`; +const kpiSpecial = `${env.API_URI}/kpi/special`; const KpiCapacity = `${env.API_URI}/kpi/capacity`; const KpiFile = `${env.API_URI}/salary/file`; const KpiEvaluationInfo = `${env.API_URI}/kpi/evaluation`; @@ -17,6 +18,7 @@ export default { kpiEvaluation, kpiPlan, kpiRole, + kpiSpecial, KpiCapacity, file: KpiFile, @@ -25,7 +27,6 @@ export default { kpiScoreTotal: () => `${kpiEvaluation}/point`, - /** ผลสัมฤทธิ์ของงาน*/ fileByFile: (name: string, group: string, id: string, fileName: string) => `${url}/file/${name}/${group}/${id}/${fileName}`, diff --git a/src/modules/08_KPI/components/Tab/Dialog/01_FormIndicator.vue b/src/modules/08_KPI/components/Tab/Dialog/01_FormIndicator.vue index 553bd8f..c6cdf50 100644 --- a/src/modules/08_KPI/components/Tab/Dialog/01_FormIndicator.vue +++ b/src/modules/08_KPI/components/Tab/Dialog/01_FormIndicator.vue @@ -1,10 +1,12 @@ - + - + + + + + + + {{ year + 543 }} + {{ + parseInt(value + 543) + }} + + + + + + + + + + + + + + + + + + + - + @@ -335,6 +588,30 @@ watch( + + + ทั้งหมด {{ totalList }} รายการ + + @@ -350,7 +627,7 @@ watch( - + หน่วยงาน/ส่วนราชการ {{ formDetail.nodeName }} @@ -361,11 +638,43 @@ watch( ลำดับ/รหัสตัวชี้วัด - {{ formDetail.including }} + + + + {{ formDetail.including }} + ชื่อตัวชี้วัด - {{ formDetail.includingName }} + + + {{ formDetail.includingName }} + ค่าเป้าหมาย @@ -380,6 +689,7 @@ watch( (val) => !!val || `${'กรุณากรอกค่าเป้าหมาย'}`, ]" hide-bottom-space + lazy-rules /> @@ -395,6 +705,7 @@ watch( :rules="[ (val) => !!val || `${'กรุณากรอกหน่วยนับ'}`, ]" + lazy-rules hide-bottom-space reverse-fill-mask /> @@ -414,6 +725,7 @@ watch( !!val || `${'กรุณากรอกน้ำหนัก (ร้อยละ)'}`, ]" hide-bottom-space + lazy-rules mask="###" /> @@ -429,34 +741,84 @@ watch( ระดับคะแนน ผลสำเร็จของงาน - + 5 - - {{ formDetail.achievement5 }} + + - + 4 - {{ formDetail.achievement4 }} + - + 3 - {{ formDetail.achievement3 }} + - + 2 - {{ formDetail.achievement2 }} + - + 1 - {{ formDetail.achievement1 }} + @@ -471,6 +833,7 @@ watch( :rules="[(val:string) => !!val || `${'กรุณากรอกตัวชี้วัด'}`,]" hide-bottom-space class="inputgreen" + lazy-rules /> @@ -484,6 +847,7 @@ watch( :rules="[(val:string) => !!val || `${'กรุณากรอกตัวชี้วัด'}`,]" hide-bottom-space class="inputgreen" + lazy-rules /> @@ -497,8 +861,57 @@ watch( :rules="[(val:string) => !!val || `${'กรุณากรอกข้อมูลเอกสารหลักฐาน'}`,]" hide-bottom-space class="inputgreen" + lazy-rules /> + + + {{ year + 543 }} + {{ + parseInt(value + 543) + }} + + + + + + + + + + + + + diff --git a/src/modules/08_KPI/components/Tab/DialogEvaluate/02_Competenct.vue b/src/modules/08_KPI/components/Tab/DialogEvaluate/02_Competenct.vue index 86e645c..ae6c2a5 100644 --- a/src/modules/08_KPI/components/Tab/DialogEvaluate/02_Competenct.vue +++ b/src/modules/08_KPI/components/Tab/DialogEvaluate/02_Competenct.vue @@ -171,8 +171,26 @@ function onSubmit() { - - + + + + + + + + + + + - รอ ทำ select {{ props.row.point !== 0 ? props.row.point * 20 : "-" }} @@ -260,4 +277,14 @@ function onSubmit() { top: 0; } } +.q-btn-group--outline > .q-btn-item:not(:last-child):before { + border-right: 1px solid #c4c4c4; +} +.q-btn-group--outline > .q-btn-item.active { + color: #2196f3 !important; + background-color: #fff; +} +.q-btn-group--outline > .q-btn-item.active:not(:last-child):before { + border: 1px solid #2196f3; +} diff --git a/src/modules/08_KPI/components/Tab/TabMain.vue b/src/modules/08_KPI/components/Tab/TabMain.vue index d559d84..5240d73 100644 --- a/src/modules/08_KPI/components/Tab/TabMain.vue +++ b/src/modules/08_KPI/components/Tab/TabMain.vue @@ -11,7 +11,9 @@ import File from "@/modules/08_KPI/components/Tab/05_File.vue"; const store = useKpiDataStore(); const route = useRoute(); -const isReadonly = ref(route.name === "KPIEditEvaluator" ? true : false); +const isReadonly = ref( + route.name === "KPIEditEvaluator" ? true : false +); const step = ref(1); // 1 = จัดทำข้อตกลง, 2 = รายงานความก้าวหน้า, 3 = รายงานผลสำเร็จของงาน const indicatorScore = defineModel("indicatorScore", { type: Number, @@ -69,8 +71,16 @@ const splitterModel = ref(12); :label="tab.label" /> --> - - + + - + /> --> diff --git a/src/modules/08_KPI/store.ts b/src/modules/08_KPI/store.ts index b0337f2..0ef9c19 100644 --- a/src/modules/08_KPI/store.ts +++ b/src/modules/08_KPI/store.ts @@ -4,8 +4,45 @@ import type { DataOptions } from "./interface/index/Main"; export const useKpiDataStore = defineStore("KPIDate", () => { const tabMain = ref("1"); - const dataProfile = ref(null); + const dataProfile = ref({ + profileId: null, + prefix: "", + rank: "", + firstName: "", + lastName: "", + citizenId: "", + position: "", + posMaster: null, + posLevelName: null, + posLevelRank: null, + posLevelId: null, + posTypeName: null, + posTypeRank: null, + posTypeId: null, + posExecutiveName: "", + posExecutivePriority: null, + posExecutiveId: null, + rootId: null, + root: "", + child1Id: null, + child1: null, + child2Id: null, + child2: null, + child3Id: null, + child3: null, + child4Id: null, + child4: null, + node: null, + nodeId: null, + }); + const dataEvaluation = ref({ + evaluationReqEdit: "NEW", + evaluationStatus: "NEW", + profileId: null, + evaluatorId: null, + commanderId: null, + commanderHighId: null, plannedPoint: 0, rolePoint: 0, specialPoint: 0, @@ -43,12 +80,26 @@ export const useKpiDataStore = defineStore("KPIDate", () => { function convertStatus(val: string) { switch (val) { - case "PENDING": - return "รอดำเนินการ"; - case "INPROGRESS": - return "กําลังดำเนินการ"; - case "DONE": - return "ประเมินเสร็จสิ้น"; + case "NEW": + return "จัดทำข้อตกลง"; + case "NEW_EVALUATOR": + return "รอผู้ประเมินตรวจสอบข้อตกลง"; + case "NEW_COMMANDER": + return "รอผู้บังคับบัญชาเหนือขึ้นไปตรวจสอบข้อตกลง"; + case "NEW_COMMANDER_HIGH": + return "รอผู้บังคับบัญชาเหนือขึ้นไปอีกชั้นหนึ่งตรวจสอบข้อตกลง"; + case "APPROVE": + return "รายงานความก้าวหน้า"; + case "EVALUATING": + return "รายงานผลสำเร็จของงาน"; + case "EVALUATING_EVALUATOR": + return "รอผู้ประเมินตรวจสอบผล"; + case "EVALUATING_COMMANDER": + return "รอผู้บังคับบัญชาเหนือขึ้นไปตรวจสอบผล"; + case "EVALUATING_COMMANDER_HIGH": + return "รอผู้บังคับบัญชาเหนือขึ้นไปอีกชั้นหนึ่งตรวจสอบผล"; + case "COMPLETE": + return "เสร็จสิ้น"; default: break; } @@ -182,6 +233,60 @@ export const useKpiDataStore = defineStore("KPIDate", () => { "blue-10", ]); + // ROLE & TAB + const rolePerson = ref("USER"); //"USER" | "EVALUATOR" | "COMMANDER", "COMMANDERHIGH" + const tabOpen = ref(1); + function checkStep() { + const role = + dataEvaluation.value.profileId == dataProfile.value.profileId + ? "USER" + : dataEvaluation.value.evaluatorId == dataProfile.value.profileId + ? "EVALUATOR" + : dataEvaluation.value.commanderId == dataProfile.value.profileId + ? "COMMANDER" + : dataEvaluation.value.commanderHighId == dataProfile.value.profileId + ? "COMMANDERHIGH" + : ""; + rolePerson.value = role; + + switch (dataEvaluation.value.evaluationStatus) { + case "NEW" || "NEW_EVALUATOR" || "NEW_COMMANDER" || "NEW_COMMANDER_HIGH": + tabOpen.value = 1; + break; + case "APPROVE": + tabOpen.value = 2; + break; + default: + tabOpen.value = 3; + break; + } + } + + // SUMMARY GENERAL CASE + const indicatorPercent = ref(100); // รวมผลการประเมิน (ร้อยละ) + const indicatorPercentVal = ref(0); // รวมผลการประเมิน (ร้อยละ) ที่ได้จริง + const indicatorScore = ref(80); // สรุปผลการประเมินผลสัมฤทธิ์ของงาน ( คะแนนเต็ม indicatorScore คะแนน) + const indicatorScoreVal = ref(0); // สรุปผลการประเมินผลสัมฤทธิ์ของงานที่ได้ + const competencyScore = ref(20); // ผลการประเมินสมรรถนะ (competencyScore คะแนน) + const competencyScoreVal = ref(0); // ผลการประเมินสมรรถนะที่ได้กี่คะแนน + const devScore = ref(10); // ผลการประเมินการพัฒนาตนเอง (devScore คะแนน) + const devScoreVal = ref(0); // ผลการประเมินการพัฒนาตนเองที่ได้กี่คะแนน + const competencyDevScore = ref(30); // สรุปผลการประเมินพฤติกรรมการปฏิบัติราชการ (สมรรถนะ+การพัฒนาตนเอง) (คะแนนเต็ม competencyDevScore คะแนน) + const competencyDevScoreVal = ref(0); // สรุปผลการประเมินพฤติกรรมการปฏิบัติราชการ (สมรรถนะ+การพัฒนาตนเอง)ที่ได้กี่คะแนน + + // SUMMARY EXCLUSIVE CASE + const excusiveIndicatorPercent = ref(100); // รวมผลการประเมิน (ร้อยละ) แต่ละมิติต้องไม่เกิน 100% + const excusiveIndicator1PercentVal = ref(0); // รวมผลการประเมิน (ร้อยละ) มิติที่ 1 ที่ได้จริง + const excusiveIndicator1Weight = ref(60); // น้ำหนักของมิติที่ 1 + const excusiveIndicator1ScoreVal = ref(0); // คะแนนมิติที่ 1 ที่ได้จริง + const excusiveIndicator2Weight = ref(20); // น้ำหนักของมิติที่ 2 + const excusiveIndicator2PercentVal = ref(0); // รวมผลการประเมิน (ร้อยละ) มิติที่ 2 ที่ได้จริง + const excusiveIndicator2ScoreVal = ref(0); // คะแนนมิติที่ 2 ที่ได้จริง + const excusiveIndicatorScore = ref(80); // สรุปผลการประเมินผลสัมฤทธิ์ของงาน (มิติที่ 1 + มิติที่ 2) ( คะแนนเต็ม excusiveIndicatorScore คะแนน) + const excusiveIndicatorScoreVal = ref(0); // สรุปผลการประเมินผลสัมฤทธิ์ของงาน (มิติที่ 1 + มิติที่ 2) คะแนนที่ได้จริง + const excusiveCompetencyScore = ref(20); // ผลการประเมินสมรรถนะ (competencyScore คะแนน) + const excusiveCompetencyScoreVal = ref(0); // ผลการประเมินสมรรถนะที่ได้กี่คะแนน + return { tabMain, dataProfile, @@ -195,5 +300,31 @@ export const useKpiDataStore = defineStore("KPIDate", () => { defaultCompetencyCoreLevel, defaultCompetencyGroupLevel, ratingColors, + checkStep, + tabOpen, + rolePerson, + + // score + indicatorPercent, + indicatorPercentVal, + indicatorScore, + indicatorScoreVal, + competencyScore, + competencyScoreVal, + devScore, + devScoreVal, + competencyDevScore, + competencyDevScoreVal, + excusiveCompetencyScore, + excusiveCompetencyScoreVal, + excusiveIndicatorPercent, + excusiveIndicator1PercentVal, + excusiveIndicator1Weight, + excusiveIndicator1ScoreVal, + excusiveIndicator2Weight, + excusiveIndicator2PercentVal, + excusiveIndicator2ScoreVal, + excusiveIndicatorScore, + excusiveIndicatorScoreVal, }; }); diff --git a/src/modules/08_KPI/views/form.vue b/src/modules/08_KPI/views/form.vue index 91be026..881fcd9 100644 --- a/src/modules/08_KPI/views/form.vue +++ b/src/modules/08_KPI/views/form.vue @@ -70,6 +70,7 @@ function fetchEvaluation() { .get(config.API.kpiEvaluation + `/${id.value}`) .then((res) => { const data = res.data.result; + store.dataEvaluation = data; formProfile.status = store.convertStatus(data.evaluationStatus); formProfile.result = store.convertResults(data.evaluationResults); @@ -94,9 +95,11 @@ function getProfile() { .get(config.API.profilePosition()) .then((res) => { const data = res.data.result; + store.dataProfile = data; store.checkCompetency(); store.checkCompetencyDefaultCompetencyLevel(); + store.checkStep(); }) .catch((e) => { messageError($q, e); @@ -281,10 +284,72 @@ async function clearScore() { async function getAll() { await fetchEvaluation(); - await (store.dataProfile === null ? getProfile() : ""); + await (store.dataProfile.profileId === null ? getProfile() : ""); // await getProfile(); await getOrgOp(); } +function sendToEvaluatore() { + dialogConfirm( + $q, + () => { + if (id.value) { + // showLoader(); + // http + // .put(config.API.kpiEvaluationCheck + `/${id.value}`, { + // evaluatorId: evaluatorId.value ? evaluatorId.value.id : null, + // commanderId: commanderId.value ? commanderId.value.id : null, + // commanderHighId: commanderHighId.value + // ? commanderHighId.value.id + // : null, + // }) + // .then((res) => { + // success($q, "บันทึกสำเร็จ"); + // close(); + // }) + // .catch((e) => { + // messageError($q, e); + // }) + // .finally(() => { + // hideLoader(); + // }); + } + }, + "ยืนยันการส่งข้อตกลงให้ผู้ประเมินอนุมัติ", + "ต้องการยืนยันส่งข้อตกลงนี้ให้ผู้ประเมินอนุมัติใช่หรือไม่?" + ); +} + +function requireEdit() { + dialogConfirm( + $q, + () => { + if (id.value) { + // showLoader(); + // http + // .put(config.API.kpiEvaluationCheck + `/${id.value}`, { + // evaluatorId: evaluatorId.value ? evaluatorId.value.id : null, + // commanderId: commanderId.value ? commanderId.value.id : null, + // commanderHighId: commanderHighId.value + // ? commanderHighId.value.id + // : null, + // }) + // .then((res) => { + // success($q, "บันทึกสำเร็จ"); + // close(); + // }) + // .catch((e) => { + // messageError($q, e); + // }) + // .finally(() => { + // hideLoader(); + // }); + } + }, + "ยืนยันการขอแก้ไขข้อตกลง", + "ต้องการยืนยันการขอแก้ไขข้อตกลงนี้ใช่หรือไม่?" + ); +} + onMounted(async () => { showLoader(); await getAll(); @@ -292,6 +357,8 @@ onMounted(async () => { + @@ -335,6 +402,42 @@ onMounted(async () => { }} + + ส่งให้ผู้ประเมินอนุมัติ + + + ขอแก้ไขข้อตกลง + +