diff --git a/src/api/14_KPI/api.KPI.ts b/src/api/14_KPI/api.KPI.ts index c79f6b90b..bc4f01250 100644 --- a/src/api/14_KPI/api.KPI.ts +++ b/src/api/14_KPI/api.KPI.ts @@ -1,41 +1,50 @@ 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 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 kpiLink = `${env.API_URI}/kpi/link`; -const KpiUser = `${env.API_URI}/kpi/user`; +const KpiCapacity = `${env.API_URI}/kpi/capacity`; const KpiFile = `${env.API_URI}/salary/file`; +const KpiEvaluationInfo = `${env.API_URI}/kpi/evaluation`; +const Kpiorg = `${env.API_URI}/org/profile/commander`; + +const KpiUser = `${env.API_URI}/kpi/user`; +const kpiAchievement = `${env.API_URI}/kpi/user/achievement`; +const kpiReason = `${env.API_URI}/kpi/reason`; + +const urlFile = `${env.API_URI}/salary`; + export default { KPI, /** รอบการประเมินผล*/ kpiPeriod, kpiPeriodById: (id: string) => `${kpiPeriod}/${id}`, kpiEvaluation, - kpiFile: KpiFile, - - /** role */ - kpiRoleMainList: `${KPI}/role`, - - kpiGroup, - kpiGroupById: (id: string) => `${kpiGroup}/${id}`, kpiPlan, - kpiPlanById: (id: string) => `${kpiPlan}/${id}`, + kpiRole, kpiSpecial, + KpiCapacity, + KpiFile: KpiFile, - /** สมรรถนะ */ - kpiCapacity, - - kpiLink, - - kpiUserEvaluation, - profilePosition: () => `${env.API_URI}/org/profile/keycloak/position`, kpiAchievement: (type: string) => `${kpiAchievement}/${type}`, kpiAchievementPoint: (type: string) => `${kpiAchievement}/${type}/point`, + + kpiScoreTotal: () => `${kpiEvaluation}/point`, + + /** ผลสัมฤทธิ์ของงาน*/ + fileByFile: (name: string, group: string, id: string, fileName: string) => + `${urlFile}/file/${name}/${group}/${id}/${fileName}`, kpiUserCapacity: `${KpiUser}/capacity`, + KpiEvaluationInfo, + Kpiorg, + kpiEvaluationCheck: `${kpiEvaluation}/check`, + kpiSendToStatus: (id: string) => `${kpiEvaluation}/status/${id}`, + kpiReqEdit: (id: string) => `${kpiEvaluation}/edit/${id}`, + /**ประเมิน*/ + kpiAchievementDevelop: `${kpiAchievement}/development`, + + kpiCommentP: (typP: string, type: string, role: string, id: string) => + `${kpiReason}/${typP}/${type}/${role}/${id}`, }; diff --git a/src/modules/14_KPI/components/DialogHistory.vue b/src/modules/14_KPI/components/DialogHistory.vue deleted file mode 100644 index 485d0b4ce..000000000 --- a/src/modules/14_KPI/components/DialogHistory.vue +++ /dev/null @@ -1,65 +0,0 @@ - - diff --git a/src/modules/14_KPI/components/Tab/01_Assessment.vue b/src/modules/14_KPI/components/Tab/01_Assessment.vue new file mode 100644 index 000000000..f4a73105b --- /dev/null +++ b/src/modules/14_KPI/components/Tab/01_Assessment.vue @@ -0,0 +1,587 @@ + + + + + diff --git a/src/modules/14_KPI/components/detailList/02_Evaluator.vue b/src/modules/14_KPI/components/Tab/02_Evaluator.vue similarity index 68% rename from src/modules/14_KPI/components/detailList/02_Evaluator.vue rename to src/modules/14_KPI/components/Tab/02_Evaluator.vue index 9a00c9219..ef89da4b1 100644 --- a/src/modules/14_KPI/components/detailList/02_Evaluator.vue +++ b/src/modules/14_KPI/components/Tab/02_Evaluator.vue @@ -6,8 +6,8 @@ import config from "@/app.config"; import http from "@/plugins/http"; import type { QTableProps } from "quasar"; -// import type { FormComment } from "@/modules/08_KPI/interface/request/index"; -import type { ResEvaluator } from "@/modules/14_KPI/interface/response/Main"; +import type { FormComment } from "@/modules/14_KPI/interface/request/index"; +import type { ResEvaluator } from "@/modules/14_KPI/interface/response/index"; import DialogHeader from "@/components/DialogHeader.vue"; @@ -54,24 +54,24 @@ const rows = ref([]); const filterKeyword = ref(""); const modal = ref(false); -// const formComment = reactive({ -// topic: "", -// reason: "", -// }); -// const optionTopicMain = ref([ -// "เห็นชอบตัวชี้วัดผลสัมฤทธิ์ของงาน รายการสมรรถนะ และน้ำหนักคะแนนของผู้ใต้บังคับบัญชา", -// "ส่งกลับให้แก้ไข", -// "บันทึกคำปรึกษาแนะนำ", -// "บันทึกความเห็น", -// "เห็นด้วยกับผลการประเมิน", -// "บันทึกข้อเสนอแนะการพัฒนา", -// ]); -// const optionTopic = ref(optionTopicMain.value); +const formComment = reactive({ + topic: "", + reason: "", +}); +const optionTopicMain = ref([ + "เห็นชอบตัวชี้วัดผลสัมฤทธิ์ของงาน รายการสมรรถนะ และน้ำหนักคะแนนของผู้ใต้บังคับบัญชา", + "ส่งกลับให้แก้ไข", + "บันทึกคำปรึกษาแนะนำ", + "บันทึกความเห็น", + "เห็นด้วยกับผลการประเมิน", + "บันทึกข้อเสนอแนะการพัฒนา", +]); +const optionTopic = ref(optionTopicMain.value); function fetchList() { showLoader(); http - .get(config.API.kpiUserEvaluation + `/${props.type}/${evaluatorId.value}`) + .get(config.API.kpiEvaluation + `/${props.type}/${evaluatorId.value}`) .then((res) => { rows.value = res.data.result; }) @@ -83,54 +83,54 @@ function fetchList() { }); } -// function openDialog() { -// modal.value = true; -// } +function openDialog() { + modal.value = true; +} -// function closeDialog() { -// modal.value = false; -// formComment.topic = ""; -// formComment.reason = ""; -// } +function closeDialog() { + modal.value = false; + formComment.topic = ""; + formComment.reason = ""; +} -// function createValue(val: string, done: Function) { -// if (val.length > 0) { -// if (!optionTopic.value.includes(val)) { -// optionTopic.value.push(val); -// } -// done(val); -// } -// } +function createValue(val: string, done: Function) { + if (val.length > 0) { + if (!optionTopic.value.includes(val)) { + optionTopic.value.push(val); + } + done(val); + } +} -// function filterFn(val: string, update: Function) { -// update(() => { -// optionTopic.value = optionTopicMain.value.filter( -// (v: string) => v.indexOf(val) > -1 -// ); -// }); -// } +function filterFn(val: string, update: Function) { + update(() => { + optionTopic.value = optionTopicMain.value.filter( + (v: string) => v.indexOf(val) > -1 + ); + }); +} -// function onSubmit() { -// dialogConfirm($q, () => { -// showLoader(); -// http -// .put( -// config.API.kpiUserEvaluation + `/${props.type}/${evaluatorId.value}`, -// formComment -// ) -// .then(() => { -// fetchList(); -// closeDialog(); -// success($q, "บันทึกข้อมูลสำเร็จ"); -// }) -// .catch((err) => { -// messageError($q, err); -// }) -// .finally(() => { -// hideLoader(); -// }); -// }); -// } +function onSubmit() { + dialogConfirm($q, () => { + showLoader(); + http + .put( + config.API.kpiEvaluation + `/${props.type}/${evaluatorId.value}`, + formComment + ) + .then(() => { + fetchList(); + closeDialog(); + success($q, "บันทึกข้อมูลสำเร็จ"); + }) + .catch((err) => { + messageError($q, err); + }) + .finally(() => { + hideLoader(); + }); + }); +} const pagination = ref({ sortBy: "desc", @@ -146,7 +146,15 @@ onMounted(() => { - + - + - + diff --git a/src/modules/14_KPI/components/detailList/03_CommanderAbove.vue b/src/modules/14_KPI/components/Tab/03_CommanderAbove.vue similarity index 100% rename from src/modules/14_KPI/components/detailList/03_CommanderAbove.vue rename to src/modules/14_KPI/components/Tab/03_CommanderAbove.vue diff --git a/src/modules/14_KPI/components/detailList/04_CommanderAboveOneStep.vue b/src/modules/14_KPI/components/Tab/04_CommanderAboveOneStep.vue similarity index 100% rename from src/modules/14_KPI/components/detailList/04_CommanderAboveOneStep.vue rename to src/modules/14_KPI/components/Tab/04_CommanderAboveOneStep.vue diff --git a/src/modules/14_KPI/components/detailList/05_File.vue b/src/modules/14_KPI/components/Tab/05_File.vue similarity index 71% rename from src/modules/14_KPI/components/detailList/05_File.vue rename to src/modules/14_KPI/components/Tab/05_File.vue index 1116f835a..7d970f5cc 100644 --- a/src/modules/14_KPI/components/detailList/05_File.vue +++ b/src/modules/14_KPI/components/Tab/05_File.vue @@ -19,14 +19,13 @@ const { messageError, dialogRemove, } = useCounterMixin(); - interface ArrayFileList { id: string; pathName: string; fileName: string; } -const isReadonly = (route.name === "KPIDetail" ? true : false); +const isReadonly = (route.name === "KPIEditEvaluator" ? true : false); const documentFile = ref(null); const fileList = ref([]); @@ -34,7 +33,7 @@ const fileList = ref([]); async function getData() { showLoader(); await http - .get(config.API.kpiFile + `/KPI/ไฟล์เอกสาร/${id.value}`) + .get(config.API.KpiFile + `/KPI/ไฟล์เอกสาร/${id.value}`) .then((res) => { fileList.value = res.data; }) @@ -47,56 +46,57 @@ async function getData() { } async function uploadFileDoc(uploadUrl: string, file: any) { - // const Data = new FormData(); - // Data.append("file", documentFile.value); - // showLoader(); - // await axios - // .put(uploadUrl, file, { - // headers: { - // "Content-Type": file.type, - // }, - // }) - // .then((res) => { - // success($q, "อัปโหลดไฟล์สำเร็จ"); - // getData(); - // }) - // .catch((e) => { - // messageError($q, e); - // }) - // .finally(() => { - // hideLoader(); - // documentFile.value = null; - // }); + const Data = new FormData(); + Data.append("file", documentFile.value); + showLoader(); + await axios + .put(uploadUrl, file, { + headers: { + "Content-Type": file.type, + }, + }) + .then((res) => { + success($q, "อัปโหลดไฟล์สำเร็จ"); + getData(); + }) + .catch((e) => { + messageError($q, e); + }) + .finally(() => { + hideLoader(); + documentFile.value = null; + }); } async function clickUpload(file: any) { - // const fileName = { fileName: file.name }; - // dialogConfirm( - // $q, - // async () => { - // const selectedFile = file; - // const formdata = new FormData(); - // formdata.append("file", selectedFile); - // await http - // .post(config.API.file + `/KPI/ไฟล์เอกสาร/${id.value}`, { - // replace: false, - // fileList: fileName, - // }) - // .then(async (res) => { - // const foundKey: string | undefined = Object.keys(res.data).find( - // (key) => - // res.data[key]?.fileName !== undefined && - // res.data[key]?.fileName !== "" - // ); - // foundKey && - // uploadFileDoc(res.data[foundKey]?.uploadUrl, documentFile.value); - // }) - // .catch((err) => { - // messageError($q, err); - // }); - // }, - // "ยืนยันการอัปโหลดไฟล์", - // "ต้องการยืนยันการอัปโหลดไฟล์นี้หรือไม่ ?" - // ); + const fileName = { fileName: file.name }; + + dialogConfirm( + $q, + async () => { + const selectedFile = file; + const formdata = new FormData(); + formdata.append("file", selectedFile); + await http + .post(config.API.file + `/KPI/ไฟล์เอกสาร/${id.value}`, { + replace: false, + fileList: fileName, + }) + .then(async (res) => { + const foundKey: string | undefined = Object.keys(res.data).find( + (key) => + res.data[key]?.fileName !== undefined && + res.data[key]?.fileName !== "" + ); + foundKey && + uploadFileDoc(res.data[foundKey]?.uploadUrl, documentFile.value); + }) + .catch((err) => { + messageError($q, err); + }); + }, + "ยืนยันการอัปโหลดไฟล์", + "ต้องการยืนยันการอัปโหลดไฟล์นี้หรือไม่ ?" + ); } /** @@ -106,7 +106,7 @@ async function clickUpload(file: any) { function downloadFile(fileName: string) { showLoader(); http - .get(config.API.kpiFile + `/KPI/ไฟล์เอกสาร/${id.value}/${fileName}`) + .get(config.API.file + `/KPI/ไฟล์เอกสาร/${id.value}/${fileName}`) .then((res) => { const data = res.data.downloadUrl; window.open(data, "_blank"); @@ -127,7 +127,7 @@ function deleteFile(fileName: string) { dialogRemove($q, async () => { showLoader(); http - .delete(config.API.kpiFile + `/KPI/ไฟล์เอกสาร/${id.value}/${fileName}`) + .delete(config.API.file + `/KPI/ไฟล์เอกสาร/${id.value}/${fileName}`) .then((res) => { success($q, `ลบไฟล์สำเร็จ`); diff --git a/src/modules/14_KPI/components/Tab/Dialog/01_FormIndicator.vue b/src/modules/14_KPI/components/Tab/Dialog/01_FormIndicator.vue new file mode 100644 index 000000000..383316661 --- /dev/null +++ b/src/modules/14_KPI/components/Tab/Dialog/01_FormIndicator.vue @@ -0,0 +1,949 @@ + + + + + diff --git a/src/modules/14_KPI/components/detailList/Dialog/03_FormIndicatorSpecial.vue b/src/modules/14_KPI/components/Tab/Dialog/03_FormIndicatorSpecial.vue similarity index 97% rename from src/modules/14_KPI/components/detailList/Dialog/03_FormIndicatorSpecial.vue rename to src/modules/14_KPI/components/Tab/Dialog/03_FormIndicatorSpecial.vue index 9d103c41a..24f34ee3a 100644 --- a/src/modules/14_KPI/components/detailList/Dialog/03_FormIndicatorSpecial.vue +++ b/src/modules/14_KPI/components/Tab/Dialog/03_FormIndicatorSpecial.vue @@ -4,11 +4,11 @@ import { useQuasar } from "quasar"; import config from "@/app.config"; import http from "@/plugins/http"; -import type { FormDataAssigned } from "@/modules/08_KPI/interface/request/index"; +import type { FormDataAssigned } from "@/modules/14_KPI/interface/request/index"; import DialogHeader from "@/components/DialogHeader.vue"; -import { useKpiDataStore } from "@/modules/08_KPI/store"; +import { useKpiDataStore } from "@/modules/14_KPI/store"; import { useCounterMixin } from "@/stores/mixin"; const $q = useQuasar(); @@ -33,7 +33,7 @@ const formData = reactive({ including: "", //รหัสตัวชี้วัด includingName: "", //ชื่อตัวชี้วัด target: "", //ค่าเป้าหมาย - unit: null, //หน่วยนับ + unit: "", //หน่วยนับ weight: null, //น้ำหนัก (ร้อยละ) meaning: "", //นิยามหรือความหมายของตัวชี้วัด formula: "", //สูตรคำนวณ @@ -80,7 +80,7 @@ function closeDialog() { formData.including = ""; formData.includingName = ""; formData.target = ""; - formData.unit = null; + formData.unit = ""; formData.achievement1 = ""; formData.achievement2 = ""; formData.achievement3 = ""; @@ -95,7 +95,7 @@ function onSubmit() { dialogConfirm($q, async () => { showLoader(); formData.weight = Number(formData.weight); - formData.unit = Number(formData.unit); + formData.unit = formData.unit; formData.kpiUserEvaluationId = store.dataEvaluation.id; try { @@ -140,11 +140,11 @@ watch( @@ -182,7 +182,6 @@ watch( :rules="[(val:string) => !!val || `${'กรุณากรอกหน่วยนับ'}`,]" hide-bottom-space class="inputgreen" - mask="#" reverse-fill-mask lazy-rules /> diff --git a/src/modules/14_KPI/components/detailList/Dialog/04_FormCompetency.vue b/src/modules/14_KPI/components/Tab/Dialog/04_FormCompetency.vue similarity index 78% rename from src/modules/14_KPI/components/detailList/Dialog/04_FormCompetency.vue rename to src/modules/14_KPI/components/Tab/Dialog/04_FormCompetency.vue index 693f069d9..9d2f9e00d 100644 --- a/src/modules/14_KPI/components/detailList/Dialog/04_FormCompetency.vue +++ b/src/modules/14_KPI/components/Tab/Dialog/04_FormCompetency.vue @@ -1,15 +1,15 @@ -
- + + + + + + +
@@ -483,4 +563,42 @@ watch( border: 1px solid #ededed !important; border-radius: 8px; } - --> +.custom-table2 { + .q-table tr:nth-child(odd) td { + background: white; + } + + .q-table tr:nth-child(even) td { + background: #f8f8f8; + } + + .q-table thead tr { + background: #ecebeb; + } + + .q-table thead tr th { + position: sticky; + } + + .q-table td:nth-of-type(2) { + z-index: 3 !important; + } + + .q-table th:nth-of-type(2), + .q-table td:nth-of-type(2) { + position: sticky; + left: 0; + z-index: 1; + } + + /* this will be the loading indicator */ + .q-table thead tr:last-child th { + /* height of all previous header rows */ + top: 48px; + } + + .q-table thead tr:first-child th { + top: 0; + } +} + diff --git a/src/modules/14_KPI/components/Tab/Dialog/DialogCommentProblem.vue b/src/modules/14_KPI/components/Tab/Dialog/DialogCommentProblem.vue new file mode 100644 index 000000000..81e535143 --- /dev/null +++ b/src/modules/14_KPI/components/Tab/Dialog/DialogCommentProblem.vue @@ -0,0 +1,607 @@ + + + diff --git a/src/modules/14_KPI/components/Tab/Dialog/DialogCommentProgress.vue b/src/modules/14_KPI/components/Tab/Dialog/DialogCommentProgress.vue new file mode 100644 index 000000000..9f8da4a60 --- /dev/null +++ b/src/modules/14_KPI/components/Tab/Dialog/DialogCommentProgress.vue @@ -0,0 +1,523 @@ + + + diff --git a/src/modules/14_KPI/components/Tab/Dialog/DialogDevelop.vue b/src/modules/14_KPI/components/Tab/Dialog/DialogDevelop.vue new file mode 100644 index 000000000..c74686959 --- /dev/null +++ b/src/modules/14_KPI/components/Tab/Dialog/DialogDevelop.vue @@ -0,0 +1,258 @@ + + diff --git a/src/modules/14_KPI/components/detailList/Dialog/DialogListCriteria.vue b/src/modules/14_KPI/components/Tab/Dialog/DialogListCriteria.vue similarity index 100% rename from src/modules/14_KPI/components/detailList/Dialog/DialogListCriteria.vue rename to src/modules/14_KPI/components/Tab/Dialog/DialogListCriteria.vue diff --git a/src/modules/14_KPI/components/Tab/Dialog/DialogViewInfo.vue b/src/modules/14_KPI/components/Tab/Dialog/DialogViewInfo.vue new file mode 100644 index 000000000..12c71e88b --- /dev/null +++ b/src/modules/14_KPI/components/Tab/Dialog/DialogViewInfo.vue @@ -0,0 +1,111 @@ +divdiv + + + + + diff --git a/src/modules/14_KPI/components/detailList/DialogEvaluate/01_Indicator.vue b/src/modules/14_KPI/components/Tab/DialogEvaluate/01_Indicator.vue similarity index 82% rename from src/modules/14_KPI/components/detailList/DialogEvaluate/01_Indicator.vue rename to src/modules/14_KPI/components/Tab/DialogEvaluate/01_Indicator.vue index 16133dea3..2e1978601 100644 --- a/src/modules/14_KPI/components/detailList/DialogEvaluate/01_Indicator.vue +++ b/src/modules/14_KPI/components/Tab/DialogEvaluate/01_Indicator.vue @@ -8,7 +8,7 @@ import DialogHeader from "@/components/DialogHeader.vue"; import type { QTableProps } from "quasar"; -import { useKpiDataStore } from "@/modules/08_KPI/store"; +import { useKpiDataStore } from "@/modules/14_KPI/store"; import { useCounterMixin } from "@/stores/mixin"; const $q = useQuasar(); @@ -16,6 +16,10 @@ const store = useKpiDataStore(); const { showLoader, hideLoader, messageError, dialogConfirm, success } = useCounterMixin(); +const props = defineProps({ + fetchList: { type: Function, required: true }, +}); + const modal = defineModel("modal", { required: true }); const rows = defineModel("data", { required: true }); const numpage = defineModel("numpage", { required: true }); @@ -126,9 +130,12 @@ function onSubmit() { dialogConfirm($q, async () => { try { showLoader(); + console.log(rows.value); + const formData = rows.value.map((e: any) => ({ id: e.id, point: e.point, + summary: ((e.point / 5) * e.weight).toFixed(2), })); const url = @@ -139,7 +146,9 @@ function onSubmit() { : numpage.value === 3 ? config.API.kpiAchievementPoint("special") : ""; - await http.post(url, formData); + await http.post(url, formData).then((res) => { + props.fetchList(); + }); success($q, "บันทึกข้อมูลสำเร็จ"); } catch (err) { messageError($q, err); @@ -183,7 +192,29 @@ function onSubmit() {
- + + +
+ +
+
+
+ + +
{{ props.row.point ? `ระดับ ${props.row.point}` : "" }} @@ -283,4 +314,19 @@ 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: #cde6fb !important; +} +.q-btn-group--outline > .q-btn-item + .q-btn-item.active:before { + border-left: 1px solid #2196f3 !important; + background-color: #cde6fb; +} +.q-btn-group--outline > .q-btn-item.active:not(:last-child):before { + border: 1px solid #2196f3; + background-color: #cde6fb; +} diff --git a/src/modules/14_KPI/components/detailList/DialogEvaluate/02_Competenct.vue b/src/modules/14_KPI/components/Tab/DialogEvaluate/02_Competenct.vue similarity index 73% rename from src/modules/14_KPI/components/detailList/DialogEvaluate/02_Competenct.vue rename to src/modules/14_KPI/components/Tab/DialogEvaluate/02_Competenct.vue index 899ce1395..aea90e8cd 100644 --- a/src/modules/14_KPI/components/detailList/DialogEvaluate/02_Competenct.vue +++ b/src/modules/14_KPI/components/Tab/DialogEvaluate/02_Competenct.vue @@ -3,18 +3,18 @@ import { ref, watch, computed } from "vue"; import DialogHeader from "@/components/DialogHeader.vue"; import { useCounterMixin } from "@/stores/mixin"; +import { useKpiDataStore } from "@/modules/14_KPI/store"; import { useQuasar, type QTableProps } from "quasar"; import http from "@/plugins/http"; import config from "@/app.config"; -// import type { ListCriteria } from "@/modules/08_KPI/interface/request/index"; +import type { ListCriteria } from "@/modules/14_KPI/interface/request/index"; -const dataListCriteria = defineModel("dataListCriteria", { +const dataListCriteria = defineModel("dataListCriteria", { required: true, }); -import { useKPIDataStore } from "@/modules/14_KPI/store/KPIStore"; const sortedDataListCriteria = computed(() => { return dataListCriteria.value.sort((a, b) => a.level - b.level); }); @@ -31,7 +31,7 @@ const { success, dialogMessageNotify, } = useCounterMixin(); -const store = useKPIDataStore(); +const store = useKpiDataStore(); const $q = useQuasar(); const modal = defineModel("modal", { required: true }); const rows = defineModel("data", { required: true }); @@ -108,28 +108,30 @@ function closeDialog() { } function onSubmit() { - // const main = rows.value; - // const checkPoint = main.some((item: any) => item.point === 0); - // if (checkPoint) { - // dialogMessageNotify($q, "กรุณาเลือกระดับคะแนนตามเกณฑ์การประเมิน"); - // } else { - // dialogConfirm($q, () => { - // const data = rows.value; - // const body = data.map((i: any) => ({ - // id: i.id, - // point: i.point, - // })); - // http - // .post(config.API.kpiUserCapacity + `/point`, body) - // .then((res) => { - // closeDialog(); - // }) - // .catch((e) => { - // messageError($q, e); - // }) - // .finally(() => {}); - // }); - // } + const main = rows.value; + const checkPoint = main.some((item: any) => item.point === 0); + + if (checkPoint) { + dialogMessageNotify($q, "กรุณาเลือกระดับคะแนนตามเกณฑ์การประเมิน"); + } else { + dialogConfirm($q, () => { + const data = rows.value; + const body = data.map((i: any) => ({ + id: i.id, + point: i.point, + summary: i.point * 20, + })); + http + .post(config.API.kpiUserCapacity + `/point`, body) + .then((res) => { + closeDialog(); + }) + .catch((e) => { + messageError($q, e); + }) + .finally(() => {}); + }); + } } @@ -170,8 +172,26 @@ function onSubmit() {
-
- + + + +
+ +
+
+
+
+ +
-
รอ ทำ select
{{ props.row.point !== 0 ? props.row.point * 20 : "-" }} @@ -259,4 +278,19 @@ 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: #cde6fb !important; +} +.q-btn-group--outline > .q-btn-item + .q-btn-item.active:before { + border-left: 1px solid #2196f3 !important; + background-color: #cde6fb; +} +.q-btn-group--outline > .q-btn-item.active:not(:last-child):before { + border: 1px solid #2196f3; + background-color: #cde6fb; +} diff --git a/src/modules/14_KPI/components/Tab/DialogEvaluate/03_DialogEvalutionDevelop.vue b/src/modules/14_KPI/components/Tab/DialogEvaluate/03_DialogEvalutionDevelop.vue new file mode 100644 index 000000000..4f2fe3c79 --- /dev/null +++ b/src/modules/14_KPI/components/Tab/DialogEvaluate/03_DialogEvalutionDevelop.vue @@ -0,0 +1,277 @@ + + + diff --git a/src/modules/14_KPI/components/Tab/TabMain.vue b/src/modules/14_KPI/components/Tab/TabMain.vue new file mode 100644 index 000000000..daa95ee63 --- /dev/null +++ b/src/modules/14_KPI/components/Tab/TabMain.vue @@ -0,0 +1,107 @@ + + + + + diff --git a/src/modules/14_KPI/components/detailList/Topic/01_Indicator.vue b/src/modules/14_KPI/components/Tab/Topic/01_Indicator.vue similarity index 54% rename from src/modules/14_KPI/components/detailList/Topic/01_Indicator.vue rename to src/modules/14_KPI/components/Tab/Topic/01_Indicator.vue index 55a980b93..a66a56739 100644 --- a/src/modules/14_KPI/components/detailList/Topic/01_Indicator.vue +++ b/src/modules/14_KPI/components/Tab/Topic/01_Indicator.vue @@ -7,15 +7,18 @@ import http from "@/plugins/http"; import type { QTableProps } from "quasar"; -// import Dialog from "@/modules/14_KPI/components/detailList/Dialog/01_FormIndicator.vue"; -// import Dialog03 from "@/modules/14_KPI/components/detailList/Dialog/03_FormIndicatorSpecial.vue"; -// import DialogEvaluate from "@/modules/14_KPI/components/detailList/DialogEvaluate/01_Indicator.vue"; +import Dialog from "@/modules/14_KPI/components/Tab/Dialog/01_FormIndicator.vue"; +// import Dialog03 from "@/modules/14_KPI/components/Tab/Dialog/03_FormIndicatorSpecial.vue"; +import DialogEvaluate from "@/modules/14_KPI/components/Tab/DialogEvaluate/01_Indicator.vue"; +import DialogViewInfo from "@/modules/14_KPI/components/Tab/Dialog/DialogViewInfo.vue"; +import DialogProgress from "@/modules/14_KPI/components/Tab/Dialog/DialogCommentProgress.vue"; +import DialogProblem from "@/modules/14_KPI/components/Tab/Dialog/DialogCommentProblem.vue"; import { useCounterMixin } from "@/stores/mixin"; -import { useKPIDataStore } from "@/modules/14_KPI/store/KPIStore"; +import { useKpiDataStore } from "@/modules/14_KPI/store"; const $q = useQuasar(); -const store = useKPIDataStore(); +const store = useKpiDataStore(); const route = useRoute(); const { date2Thai, @@ -26,24 +29,26 @@ const { success, } = useCounterMixin(); -const isReadonly = (route.name === "KPIDetail" ? true : false); const title = defineModel("title", { required: true }); const rows = defineModel("data", { required: true }); const numpage = defineModel("page", { required: true }); -const evaluationTotal = defineModel("total", { required: true }); const props = defineProps({ fetchList: { type: Function, required: true }, }); -const visibleColumns = ref([ - "includingName", - "target", - "point", - "weight", - "achievement", - "evaluationResults", -]); +const visibleColumns = ref( + store.tabOpen === 3 && store.tabMain === "3" + ? [ + "includingName", + "target", + "point", + "weight", + "achievement", + "evaluationResults", + ] + : ["includingName", "target", "weight"] +); const columns = ref([ { name: "includingName", @@ -119,42 +124,67 @@ const modal = ref(false); const modalAssigned = ref(false); const isStatusEdit = ref(false); const modalEvaluate = ref(false); +const modalViewInfo = ref(false); function onAdd(edit: boolean = false, id: string = "") { isStatusEdit.value = edit; kpiUserPlannedId.value = id; - if (numpage.value !== 3) { - modal.value = true; - } else if (numpage.value == 3) { - modalAssigned.value = true; - } + // if (numpage.value !== 3) { + modal.value = true; + // } else if (numpage.value == 3) { + // modalAssigned.value = true; + // } } -function onEvaluate() { +function onClickView(id: string) { + kpiUserPlannedId.value = id; + modalViewInfo.value = true; +} + +async function onEvaluate() { modalEvaluate.value = true; } function onDelete(id: string) { - // dialogRemove($q, async () => { - // try { - // showLoader(); - // const url = - // numpage.value === 1 - // ? config.API.kpiAchievement("planned") + `/${id}` - // : numpage.value === 2 - // ? config.API.kpiAchievement("role") + `/${id}` - // : numpage.value === 3 - // ? config.API.kpiAchievement("special") + `/${id}` - // : ""; - // await http.delete(url); - // success($q, "ลบข้อมูลสำเร็จ"); - // props.fetchList?.(); - // } catch (err) { - // messageError($q, err); - // } finally { - // hideLoader(); - // } - // }); + dialogRemove($q, async () => { + try { + showLoader(); + const url = + numpage.value === 1 + ? config.API.kpiAchievement("planned") + `/${id}` + : numpage.value === 2 + ? config.API.kpiAchievement("role") + `/${id}` + : numpage.value === 3 + ? config.API.kpiAchievement("special") + `/${id}` + : ""; + await http.delete(url); + success($q, "ลบข้อมูลสำเร็จ"); + props.fetchList?.(); + } catch (err) { + messageError($q, err); + } finally { + hideLoader(); + } + }); +} + +const modalProgress = ref(false); +const modalProblem = ref(false); +const type = ref(""); +const idList = ref(""); +function openPopupProgress(id: string) { + modalProgress.value = true; + type.value = + numpage.value === 1 ? "plan" : numpage.value === 2 ? "role" : "special"; + idList.value = id; +} + +function openPopupProblem(id: string) { + modalProblem.value = true; + + type.value = + numpage.value === 1 ? "plan" : numpage.value === 2 ? "role" : "special"; + idList.value = id; } watch( @@ -166,24 +196,47 @@ watch( } ); -watch( - () => modalAssigned.value, - () => { - if (!modalAssigned.value) { - props.fetchList?.(); - } - } -); +const isEditStep1 = computed(() => { + return ( + (store.dataEvaluation.evaluationStatus === "NEW" && + store.rolePerson === "USER" && + store.tabMain === "1") || + (store.dataEvaluation.evaluationStatus === "NEW_EVALUATOR" && + store.rolePerson === "EVALUATOR" && + store.tabMain === "1") + ); +}); -watch( - () => modalEvaluate.value, - () => { - if (!modalEvaluate.value) { - props.fetchList?.(); - } - } -); +const isEditStep3 = computed(() => { + return ( + (store.dataEvaluation.evaluationStatus === "EVALUATING" && + store.rolePerson === "USER" && + store.tabMain === "3") || + (store.dataEvaluation.evaluationStatus === "EVALUATING_EVALUATOR" && + store.rolePerson === "EVALUATOR" && + store.tabMain === "3") + ); +}); + +// watch( +// () => modalAssigned.value, +// () => { +// if (!modalAssigned.value) { +// props.fetchList?.(); +// } +// } +// ); + +// watch( +// () => modalEvaluate.value, +// () => { +// if (!modalEvaluate.value) { +// props.fetchList?.(); +// } +// } +// ); + + diff --git a/src/modules/14_KPI/components/detailList/Topic/02_Competency.vue b/src/modules/14_KPI/components/Tab/Topic/02_Competency.vue similarity index 56% rename from src/modules/14_KPI/components/detailList/Topic/02_Competency.vue rename to src/modules/14_KPI/components/Tab/Topic/02_Competency.vue index 1ef5a0f8e..0c02658d8 100644 --- a/src/modules/14_KPI/components/detailList/Topic/02_Competency.vue +++ b/src/modules/14_KPI/components/Tab/Topic/02_Competency.vue @@ -1,39 +1,36 @@ @@ -211,7 +272,7 @@ onMounted(() => {
{{ item.name }} { { hide-pagination class="custom-table2" no-data-label="ไม่มีข้อมูล" + :visible-columns="visibleColumns" > @@ -347,13 +458,16 @@ onMounted(() => { :get-data="getData" /> -
- สรุปผลการประเมินสมรรถนะ (คะแนนเต็ม - {{ store.dataEvaluation.capacityPoint }} คะแนน) -
{{ resultEvaluation }}
-
+ + diff --git a/src/modules/14_KPI/components/Tab/Topic/03_Develop.vue b/src/modules/14_KPI/components/Tab/Topic/03_Develop.vue new file mode 100644 index 000000000..55190bb9f --- /dev/null +++ b/src/modules/14_KPI/components/Tab/Topic/03_Develop.vue @@ -0,0 +1,449 @@ + + + + + diff --git a/src/modules/14_KPI/components/Table.vue b/src/modules/14_KPI/components/Table.vue deleted file mode 100644 index 1d46c384a..000000000 --- a/src/modules/14_KPI/components/Table.vue +++ /dev/null @@ -1,5 +0,0 @@ - - - - - diff --git a/src/modules/14_KPI/components/detailList/01_Assessment.vue b/src/modules/14_KPI/components/detailList/01_Assessment.vue deleted file mode 100644 index 58d269d07..000000000 --- a/src/modules/14_KPI/components/detailList/01_Assessment.vue +++ /dev/null @@ -1,244 +0,0 @@ - - - - - diff --git a/src/modules/14_KPI/components/detailList/Dialog/01_FormIndicator.vue b/src/modules/14_KPI/components/detailList/Dialog/01_FormIndicator.vue deleted file mode 100644 index 65e8531a6..000000000 --- a/src/modules/14_KPI/components/detailList/Dialog/01_FormIndicator.vue +++ /dev/null @@ -1,527 +0,0 @@ - - - - diff --git a/src/modules/14_KPI/components/detailList/TabMain.vue b/src/modules/14_KPI/components/detailList/TabMain.vue deleted file mode 100644 index 1f9e7cc17..000000000 --- a/src/modules/14_KPI/components/detailList/TabMain.vue +++ /dev/null @@ -1,102 +0,0 @@ - - - - - diff --git a/src/modules/14_KPI/components/detailList/Topic/!02_CompetencyCard.vue b/src/modules/14_KPI/components/detailList/Topic/!02_CompetencyCard.vue deleted file mode 100644 index 665dc0864..000000000 --- a/src/modules/14_KPI/components/detailList/Topic/!02_CompetencyCard.vue +++ /dev/null @@ -1,345 +0,0 @@ - diff --git a/src/modules/14_KPI/interface/request/index.ts b/src/modules/14_KPI/interface/request/index.ts new file mode 100644 index 000000000..25eb9e8e0 --- /dev/null +++ b/src/modules/14_KPI/interface/request/index.ts @@ -0,0 +1,82 @@ +interface FormProfile { + fullName: string; + + position: string; + type: string; + level: string; + status: string | undefined; + result: string | undefined; + score: string; + + avartar: string; +} + +interface FormDataAssigned { + including: string; + includingName: string; + target: string; + unit: string; + weight: number | null; + achievement1: string; + achievement2: string; + achievement3: string; + achievement4: string; + achievement5: string; + meaning: string; + formula: string; + kpiUserEvaluationId: string; +} + +interface FormCapacityList { + id: string | null; + name: string; + level: string; + point: number; + weight: number; + summary: number; +} + +interface ListCriteria { + id: string; + level: number; + description: string; +} +interface ListCapacity { + id: string; + level: number; + description: string; + capacityId: string; +} + +interface FormComment { + topic: string; + reason: string; +} + +interface FormCommentByRole { + id: string; + topic: string; + reason: string; + + reasonEvaluator: string; + reasonCommander: string; + reasonCommanderHigh: string; +} + +interface FormQuery { + page: number; + pageSize: number; + round: string; + keyword: string; +} + +export type { + FormProfile, + FormDataAssigned, + FormCapacityList, + ListCriteria, + ListCapacity, + FormComment, + FormCommentByRole, + FormQuery, +}; diff --git a/src/modules/14_KPI/store.ts b/src/modules/14_KPI/store.ts new file mode 100644 index 000000000..85cc771d5 --- /dev/null +++ b/src/modules/14_KPI/store.ts @@ -0,0 +1,402 @@ +import { defineStore } from "pinia"; +import { ref, reactive } from "vue"; +import type { DataOption } from "@/modules/14_KPI/interface/index/Main"; +import type { FormQuery } from "@/modules/14_KPI/interface/request/index"; + +export const useKpiDataStore = defineStore("KPIDataAdmin", () => { + const tabMainevaluator = ref("1"); + const yearRound = ref(new Date().getFullYear()); + const formQuery = reactive({ + page: 1, + pageSize: 10, + round: "", + keyword: "", + }); + const selected = ref([]); + + const tabMain = ref("1"); + 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: null, + evaluationStatus: null, + profileId: null, + evaluatorId: null, + commanderId: null, + commanderHighId: null, + plannedPoint: 0, + rolePoint: 0, + specialPoint: 0, + }); + + const competencyType = ref([ + { + id: "HEAD", + name: "สมรรถนะหลัก", + }, + { + id: "GROUP", + name: "สมรรถนะประจำกลุ่มงาน", + }, + { + id: "EXECUTIVE", + name: "สมรรถนะประจำผู้บริหารกรุงเทพมหานคร", + }, + { + id: "DIRECTOR", + name: "สมรรถนะเฉพาะสำหรับตำแหน่ง ผอ.เขต ผช.ผอ.เขต และหัวหน้าฝ่ายในสังกัด สนง.เขต", + }, + { + id: "INSPECTOR", + name: "สมรรถนะเฉพาะสำหรับตำแหน่งผู้ตรวจราชการ กทม. และผู้ตรวจราชการ", + }, + ]); + + function convertCompetencyType(val: string) { + const competency = competencyType.value.find( + (x: DataOption) => x.id == val + ); + return competency?.name; + } + + const statusOptions = ref([ + { + id: "NEW", + name: "จัดทำข้อตกลง", + }, + { + id: "NEW_EVALUATOR", + name: "รอผู้ประเมินตรวจสอบข้อตกลง", + }, + { + id: "NEW_COMMANDER", + name: "รอผู้บังคับบัญชาเหนือขึ้นไปตรวจสอบข้อตกลง", + }, + { + id: "NEW_COMMANDER_HIGH", + name: "รอผู้บังคับบัญชาเหนือขึ้นไปอีกชั้นหนึ่งตรวจสอบข้อตกลง", + }, + { + id: "APPROVE", + name: "รายงานความก้าวหน้า", + }, + { + id: "EVALUATING", + name: "รายงานผลสำเร็จของงาน", + }, + { + id: "EVALUATING_EVALUATOR", + name: "รอผู้ประเมินตรวจสอบผล", + }, + { + id: "EVALUATING_COMMANDER", + name: "รอผู้บังคับบัญชาเหนือขึ้นไปตรวจสอบผล", + }, + { + id: "EVALUATING_COMMANDER_HIGH", + name: "รอผู้บังคับบัญชาเหนือขึ้นไปอีกชั้นหนึ่งตรวจสอบผล", + }, + { + id: "COMPLETE", + name: "เสร็จสิ้น", + }, + ]); + + function convertStatus(val: string) { + return statusOptions.value.find((x: DataOption) => x.id == val)?.name; + } + + function convertResults(val: string) { + switch (val) { + case "PENDING": + return "รอดำเนินการ"; + case "PASSED": + return "ผ่านการประเมิน"; + case "NOTPASSED": + return "ไม่ผ่านการประเมิน"; + default: + break; + } + } + + function checkCompetency() { + const position = dataEvaluation.value.position; + const posTypeName = dataEvaluation.value.posTypeName; + const posLevelName = dataEvaluation.value.posLevelName; + const executiveName = dataEvaluation.value.posExecutiveName; + + 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 { + if (executiveName == null) { + competencyType.value = competencyType.value.filter( + (x: DataOption) => x.id == "HEAD" || x.id == "GROUP" + ); + } else { + competencyType.value = competencyType.value.filter( + (x: DataOption) => x.id == "HEAD" || x.id == "EXECUTIVE" + ); + } + // switch (posTypeName + " " + posLevelName) { + // // case "ทั่วไป ปฏิบัติงาน": + // // case "ทั่วไป ชำนาญงาน": + // // case "ทั่วไป อาวุโส": + // // case "วิชาการ ปฏิบัติการ": + // // case "วิชาการ ชำนาญการ": + // // case "วิชาการ ชำนาญการพิเศษ": + // // case "วิชาการ เชี่ยวชาญ": + // // case "วิชาการ ทรงคุณวุฒิ": + // // competencyType.value = competencyType.value.filter( + // // (x: DataOption) => 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 = dataEvaluation.value.posTypeName; + const posLevelName = dataEvaluation.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: + defaultCompetencyCoreLevel.value = 1; + defaultCompetencyGroupLevel.value = 1; + break; + } + } + + const ratingColors = ref([ + "light-blue-3", + "light-blue-6", + "blue", + "blue-9", + "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": + tabOpen.value = 1; + break; + case "NEW_EVALUATOR": + tabOpen.value = 1; + break; + case "NEW_COMMANDER": + tabOpen.value = 1; + break; + case "NEW_COMMANDER_HIGH": + tabOpen.value = 1; + break; + case "APPROVE": + tabOpen.value = 2; + break; + case "EVALUATING": + tabOpen.value = 3; + break; + case "EVALUATING_EVALUATOR": + tabOpen.value = 3; + break; + case "EVALUATING_COMMANDER": + tabOpen.value = 3; + break; + case "EVALUATING_COMMANDER_HIGH": + tabOpen.value = 3; + break; + case "COMPLETE": + tabOpen.value = 3; + break; + default: + tabOpen.value = 1; + break; + } + } + + // SUMMARY GENERAL CASE + const indicatorWeightTotal = ref(0); // น้ำหนักรวมกรณีทั่วไป + const indicatorWeight1Total = ref(0); // น้ำหนักรวมมิติที่ 1 ต้องไม่เกิน 100% + const indicatorWeight2Total = ref(0); // น้ำหนักรวมมิติที่ 2 ต้องไม่เกิน 20 + + const indicatorPercentVal = ref(0); // รวมผลการประเมิน (ร้อยละ) ที่ได้จริง + const indicatorScore = ref(70); // สรุปผลการประเมินผลสัมฤทธิ์ของงาน ( คะแนนเต็ม indicatorScore คะแนน) + const competencyScore = ref(20); // ผลการประเมินสมรรถนะ (competencyScore คะแนน) + const devScoreVal = ref(0); // ผลการประเมินการพัฒนาตนเองที่ได้กี่คะแนน + const competencyDevScore = ref(30); // สรุปผลการประเมินพฤติกรรมการปฏิบัติราชการ (สมรรถนะ+การพัฒนาตนเอง) (คะแนนเต็ม competencyDevScore คะแนน) + const devScore = ref(10); // ผลการประเมินการพัฒนาตนเอง (devScore คะแนน) + + // SUMMARY EXCLUSIVE CASE + 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 excusiveCompetencyScore = ref(20); // ผลการประเมินสมรรถนะ (competencyScore คะแนน) + + const indicatorScoreVal = ref(0); // สรุปผลการประเมินผลสัมฤทธิ์ของงานที่ได้ + const competencyScoreVal = ref(0); // ผลการประเมินสมรรถนะที่ได้กี่คะแนน + + return { + tabMain, + dataProfile, + dataEvaluation, + competencyType, + convertCompetencyType, + convertStatus, + convertResults, + checkCompetency, + checkCompetencyDefaultCompetencyLevel, + defaultCompetencyCoreLevel, + defaultCompetencyGroupLevel, + ratingColors, + checkStep, + tabOpen, + rolePerson, + + // score + indicatorWeightTotal, + indicatorWeight1Total, + indicatorWeight2Total, + indicatorPercentVal, + indicatorScore, + indicatorScoreVal, + competencyScore, + competencyScoreVal, + devScore, + devScoreVal, + competencyDevScore, + excusiveCompetencyScore, + excusiveIndicator1PercentVal, + excusiveIndicator1Weight, + excusiveIndicator1ScoreVal, + excusiveIndicator2Weight, + excusiveIndicator2PercentVal, + excusiveIndicator2ScoreVal, + excusiveIndicatorScore, + + //รายการการประเมินผลการปฏิบัติราชการระดับบุคคล + tabMainevaluator, + formQuery, + yearRound, + selected, + statusOptions, + }; +}); diff --git a/src/modules/14_KPI/store/KPIStore.ts b/src/modules/14_KPI/store/KPIStore.ts deleted file mode 100644 index 18533052d..000000000 --- a/src/modules/14_KPI/store/KPIStore.ts +++ /dev/null @@ -1,194 +0,0 @@ -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 competencyTypeVal = ref("HEAD"); - - const tabMain = ref("1"); - const dataProfile = ref(); - const dataEvaluation = ref({ - plannedPoint: 0, - rolePoint: 0, - specialPoint: 0, - capacityPoint: 0, - }); - - 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 { - competencyTypeVal, - 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 b7f83f3c4..02a814934 100644 --- a/src/modules/14_KPI/views/detail.vue +++ b/src/modules/14_KPI/views/detail.vue @@ -1,29 +1,47 @@ @@ -103,132 +310,436 @@ onMounted(async () => { flat color="primary" class="q-mr-sm" - @click=" - () => { - store.dataEvaluation = {}; - isReadonly ? router.push(`/KPI-list`) : router.push(`/KPI`); - } - " + @click="router.push(`/KPI-list`)" /> - {{ id ? `รายละเอียดแบบประเมิน` : `เพิ่มแบบประเมิน` }} - + รายละเอียดการประเมินผลการปฏิบัติราชการระดับบุคคล
-
- -
- - +
+
+ +
+ + + +
+
+
+
+
+ {{ + `${store.dataEvaluation.prefix}${store.dataEvaluation.firstName} ${store.dataEvaluation.lastName}` + }} + +
+ *น้ำหนัก(ร้อยละ) ผลสัมฤทธิ์ของงานไม่ถูกต้อง + + ส่งให้ผู้ประเมินอนุมัติ + - - -
-
-
-
-
- {{ - formProfile.fullName ? formProfile.fullName : "-" - }} - -
- - ดูข้อมูลการช่วยราชการ - - - ดูข้อมูลการทดลองงาน - + + ส่งให้ผู้ประเมินอนุมัติผลการประเมิน + + + + ขอแก้ไขข้อตกลง + + + + + {{ + store.dataEvaluation.evaluationStatus === "NEW" && + store.rolePerson === "USER" + ? "แก้ไขผู้ประเมิน" + : "ข้อมูลผู้ประเมิน" + }} + + + ดูข้อมูลการช่วยราชการ + + + ดูข้อมูลการทดลองงาน + +
-
-
-
-
-
-
- ตำแหน่งในสายงาน - {{ - formProfile.position - }} +
+
+
+
+
+ ตำแหน่งในสายงาน + {{ + store.dataEvaluation.position + }} +
-
-
-
- ประเภทตำแหน่ง - {{ - formProfile.type - }} +
+
+ ประเภทตำแหน่ง + {{ + store.dataEvaluation.posTypeName + }} +
-
-
-
- ระดับตำแหน่ง - {{ - formProfile.level - }} +
+
+ ระดับตำแหน่ง + {{ + store.dataEvaluation.posLevelName + }} +
-
-
-
- สถานะการประเมิน - {{ - formProfile.status - }} +
+
+ สถานะการประเมิน + {{ + formProfile.status + }} +
-
-
-
- ผลการประเมิน - {{ - formProfile.result - }} +
+
+ ผลการประเมิน + {{ + formProfile.result + }} +
-
-
-
- คะแนนประเมิน - {{ (indicatorScore + competencyScore).toFixed(2) }} - +
+
+ คะแนนประเมิน + + {{ + store.dataEvaluation.posExecutiveName == null + ? ( + store.indicatorScoreVal + + store.competencyScoreVal + + store.devScoreVal + ).toFixed(2) + : ( + store.excusiveIndicator1ScoreVal + + store.excusiveIndicator2ScoreVal + + store.competencyScoreVal + ).toFixed(2) + }} + +
-
- + - - - + + + +
+ + + + + + + +
+ + + + + + + +
+
+ + + บันทึกข้อมูล + +
+
+
+ +