diff --git a/src/api/KPI/api.kpis.ts b/src/api/KPI/api.kpis.ts
index a3392d6..8a708cc 100644
--- a/src/api/KPI/api.kpis.ts
+++ b/src/api/KPI/api.kpis.ts
@@ -15,11 +15,10 @@ const KpiUser = `${env.API_URI}/kpi/user`;
const kpiAchievement = `${env.API_URI}/kpi/user/achievement`;
const kpiReason = `${env.API_URI}/kpi/reason`;
-
// const placementKeycloak = `${env.API_URI}/placement/officer/keycloak`;
const placementKeycloak = `${env.API_URI}/placement/officer/profileId`;
// const orgPosition = `${env.API_URI}/org/profile/keycloak/position `;
-const orgPosition = `${env.API_URI}/org/profile/profileid/position`;
+const orgPosition = `${env.API_URI}/org/profile/profileid/position`;
export default {
kpiPeriod,
kpiEvaluation,
@@ -51,9 +50,13 @@ export default {
/**ประเมิน*/
kpiAchievementDevelop: `${kpiAchievement}/development`,
- kpiCommentP:(typP:string,type:string,role:string,id:string)=>`${kpiReason}/${typP}/${type}/${role}/${id}`,
+ kpiCommentP: (typP: string, type: string, role: string, id: string) =>
+ `${kpiReason}/${typP}/${type}/${role}/${id}`,
placementKeycloak,
orgPosition,
- sendToCommander:`${KpiUser}/evaluation/admin/change-status`
+ sendToCommander: `${KpiUser}/evaluation/admin/change-status`,
+ sendToSummary: (id: string) => `${kpiEvaluation}/summary/${id}`,
+ updatePoint: (id: string) => `${kpiEvaluation}/point/${id}`,
+ openPoint: (id: string) => `${kpiEvaluation}/open/${id}`,
};
diff --git a/src/modules/08_KPI/components/Tab/01_Assessment.vue b/src/modules/08_KPI/components/Tab/01_Assessment.vue
index e3b7464..1302797 100644
--- a/src/modules/08_KPI/components/Tab/01_Assessment.vue
+++ b/src/modules/08_KPI/components/Tab/01_Assessment.vue
@@ -152,10 +152,6 @@ function fetchAssigned() {
});
}
-function onInfo() {
- modalCriteria.value = true;
-}
-
function getCriteria() {
http
.get(config.API.KpiEvaluationInfo)
@@ -195,6 +191,24 @@ watch(
store.indicatorScoreVal =
store.indicatorPercentVal * (store.indicatorScore / 100);
+
+ if (
+ store.isUpdate &&
+ store.tabMain === "3" &&
+ (store.dataEvaluation.evaluationStatus === "EVALUATOR" ||
+ store.dataEvaluation.evaluationStatus === "EVALUATING_EVALUATOR")
+ ) {
+ http
+ .put(config.API.updatePoint(evaluationId.value), {
+ totalPoint1: store.indicatorScoreVal.toFixed(2),
+ summaryPoint: (
+ store.indicatorScoreVal +
+ store.competencyScoreVal +
+ store.devScoreVal
+ ).toFixed(2),
+ })
+ .then((res) => {});
+ }
}
}
);
@@ -221,7 +235,12 @@ onMounted(() => {
-
+
{
:rows="[
{
name: `สรุปผลการประเมินสมรรถนะ (คะแนนเต็ม ${
- !store.dataEvaluation.posExecutiveName
+ store.dataEvaluation.posTypeName != 'อำนวยการ' &&
+ store.dataEvaluation.posTypeName != 'บริหาร'
? store.competencyScore
: store.excusiveCompetencyScore
} คะแนน)`,
@@ -446,7 +466,12 @@ onMounted(() => {
class="q-mt-xs q-mb-md"
/>
-
+
@@ -484,7 +509,10 @@ onMounted(() => {
diff --git a/src/modules/08_KPI/components/Tab/04_Result.vue b/src/modules/08_KPI/components/Tab/04_Result.vue
index 6e763fb..977e7e9 100644
--- a/src/modules/08_KPI/components/Tab/04_Result.vue
+++ b/src/modules/08_KPI/components/Tab/04_Result.vue
@@ -37,10 +37,10 @@ const additionalSuperiorComment = ref
("");
const superiorCommentCheck = ref("");
const additionalSuperiorCheck = ref("");
-const weight1 = ref(10);
+const weight1 = ref(0);
const result1 = ref(0);
-const weight2 = ref(50);
-const result2 = ref(60);
+const weight2 = ref(0);
+const result2 = ref(0);
const sumWeight = computed(() => {
return weight1.value + weight2.value;
});
@@ -51,28 +51,28 @@ const sumResult = computed(() => {
const group = computed(() => {
return convert(sumResult.value);
});
-const options = ref([
- {
- label: "ดีเด่น (คะแนนร้อยละ ๙๐.๐๐ ขึ้นไป)",
- value: "EXCELLENT",
- },
- {
- label: "ดีมาก (คะแนนร้อยละ ๘๐.๐๐ - ๘๙.๙๙)",
- value: "VERYGOOD",
- },
- {
- label: "ดี (คะแนนร้อยละ ๗๐.๐๐ - ๗๙.๙๙)",
- value: "GOOD",
- },
- {
- label: "พอใช้ (คะแนนร้อยละ ๖๐.๐๐ - ๖๙.๙๙)",
- value: "FAIR",
- },
- {
- label: "ต้องปรับปรุง (คะแนนต่ำกว่าร้อยละ ๖๐.๐๐)",
- value: "IMPROVEMENT",
- },
-]);
+// const options = ref([
+// {
+// label: "ดีเด่น (คะแนนร้อยละ ๙๐.๐๐ ขึ้นไป)",
+// value: "EXCELLENT",
+// },
+// {
+// label: "ดีมาก (คะแนนร้อยละ ๘๐.๐๐ - ๘๙.๙๙)",
+// value: "VERYGOOD",
+// },
+// {
+// label: "ดี (คะแนนร้อยละ ๗๐.๐๐ - ๗๙.๙๙)",
+// value: "GOOD",
+// },
+// {
+// label: "พอใช้ (คะแนนร้อยละ ๖๐.๐๐ - ๖๙.๙๙)",
+// value: "FAIR",
+// },
+// {
+// label: "ต้องปรับปรุง (คะแนนต่ำกว่าร้อยละ ๖๐.๐๐)",
+// value: "IMPROVEMENT",
+// },
+// ]);
function convert(score: any): string {
if (score >= 90) {
@@ -120,7 +120,7 @@ function onSubmitCommander() {
showLoader();
http
.put(config.API.kpiSendToReason(id.value, "commander"), {
- isReason: superiorCommentCheck.value,
+ isReason: superiorCommentCheck.value == "true" ? true : false,
reason: superiorComment.value,
})
.then((res) => {
@@ -145,7 +145,7 @@ function onSubmitCommanderHigh() {
showLoader();
http
.put(config.API.kpiSendToReason(id.value, "commanderHigh"), {
- isReason: additionalSuperiorCheck.value,
+ isReason: additionalSuperiorCheck.value == "true" ? true : false,
reason: additionalSuperiorComment.value,
})
.then((res) => {
@@ -179,6 +179,10 @@ async function fetchEvaluation() {
.then(async (res) => {
const data = res.data.result;
store.dataEvaluation = await data;
+
+ if (data.profileId == store.dataProfile.profileId) {
+ userOpen();
+ }
})
.catch((e) => {
messageError($q, e);
@@ -188,6 +192,12 @@ async function fetchEvaluation() {
});
}
+function userOpen() {
+ http.get(config.API.openPoint(id.value)).then(async (res) => {
+ // success($q, "เปิดการประเมินสำเร็จ");
+ });
+}
+
function getData() {
http
.get(config.API.kpiSendToGet(id.value))
@@ -197,14 +207,19 @@ function getData() {
developmentMethod.value = data.developEvaluator;
developmentPeriod.value = data.timeEvaluator;
evaluatorComment.value = data.reasonEvaluator;
- superiorCommentCheck.value = data.isReasonCommander.toString();
+ superiorCommentCheck.value = data.isReasonCommander
+ ? data.isReasonCommander.toString()
+ : "";
superiorComment.value = data.reasonCommander;
- additionalSuperiorCheck.value = data.isReasonCommanderHigh.toString();
+ additionalSuperiorCheck.value = data.isReasonCommanderHigh
+ ? data.isReasonCommanderHigh.toString()
+ : "";
additionalSuperiorComment.value = data.reasonCommanderHigh;
- result1.value = data.totalPoint1
- result2.value = data.totalPoint2_1 + data.totalPoint2_2
-
+ result1.value = data.totalPoint1;
+ result2.value = data.totalPoint2_1 + data.totalPoint2_2;
+ weight1.value = data.weightPoint1;
+ weight2.value = data.weightPoint2;
})
.catch((e) => {
messageError($q, e);
@@ -216,6 +231,7 @@ onMounted(() => {
fetchEvaluation();
});
+
@@ -456,7 +472,10 @@ onMounted(() => {
lazy-rules
v-model="superiorComment"
outlined
- :readonly="superiorCommentCheck == 'true'||store.dataEvaluation.evaluationStatus !== 'SUMMARY_COMMANDER'"
+ :readonly="
+ superiorCommentCheck == 'true' ||
+ store.dataEvaluation.evaluationStatus !== 'SUMMARY_COMMANDER'
+ "
type="textarea"
label="ความเห็นของผู้บังคับบัญชาเหนือขึ้นไป"
hide-bottom-space
diff --git a/src/modules/08_KPI/components/Tab/Dialog/DialogCommentProgress.vue b/src/modules/08_KPI/components/Tab/Dialog/DialogCommentProgress.vue
index be69cf2..8019b3d 100644
--- a/src/modules/08_KPI/components/Tab/Dialog/DialogCommentProgress.vue
+++ b/src/modules/08_KPI/components/Tab/Dialog/DialogCommentProgress.vue
@@ -18,7 +18,14 @@ const numLevel = ref
("");
const store = useKpiDataStore();
const $q = useQuasar();
const mixin = useCounterMixin();
-const { dialogConfirm, showLoader, hideLoader, messageError, success,dialogMessageNotify } = mixin;
+const {
+ dialogConfirm,
+ showLoader,
+ hideLoader,
+ messageError,
+ success,
+ dialogMessageNotify,
+} = mixin;
const check = ref("");
const rows = defineModel("rows");
@@ -87,19 +94,18 @@ function clickList(index: string, data: any) {
function onSubmitAdd() {
// type
- if (numLevel.value == "") {
- dialogMessageNotify($q,'กรุณาเลือกคะแนน')
+ if (
+ numLevel.value == "" &&
+ type.value != "capacity" &&
+ type.value != "development"
+ ) {
+ dialogMessageNotify($q, "กรุณาเลือกคะแนน");
} else {
dialogConfirm($q, () => {
showLoader();
http
.put(
- config.API.kpiCommentP(
- "progress",
- type.value,
- store.rolePerson.toLocaleLowerCase(),
- idList.value
- ),
+ config.API.kpiCommentP("progress", type.value, "user", idList.value),
{
reason: formDataAdd.reason,
topic: formDataAdd.topic,
@@ -139,6 +145,7 @@ function closeAdd() {
modalAdd.value = false;
formDataAdd.topic = "";
formDataAdd.reason = "";
+ numLevel.value = "";
}
function getList() {
@@ -246,6 +253,13 @@ watch(
-
+
{{
@@ -356,11 +375,15 @@ watch(
ผู้สร้าง
{{ formDataView.createdFullName }}
-
-
-
-
+
+
+
+
+
+
+ คะแนนความก้าวหน้า
+
+
{
try {
showLoader();
- console.log(rows.value);
+ store.isUpdate = true;
const formData = rows.value.map((e: any) => ({
id: e.id,
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 5aa515d..4e5450c 100644
--- a/src/modules/08_KPI/components/Tab/DialogEvaluate/02_Competenct.vue
+++ b/src/modules/08_KPI/components/Tab/DialogEvaluate/02_Competenct.vue
@@ -115,6 +115,7 @@ function onSubmit() {
dialogMessageNotify($q, "กรุณาเลือกระดับคะแนนตามเกณฑ์การประเมิน");
} else {
dialogConfirm($q, () => {
+ store.isUpdate = true;
const data = rows.value;
const body = data.map((i: any) => ({
id: i.id,
diff --git a/src/modules/08_KPI/components/Tab/DialogEvaluate/03_DialogEvalutionDevelop.vue b/src/modules/08_KPI/components/Tab/DialogEvaluate/03_DialogEvalutionDevelop.vue
index 4f2fe3c..33a0726 100644
--- a/src/modules/08_KPI/components/Tab/DialogEvaluate/03_DialogEvalutionDevelop.vue
+++ b/src/modules/08_KPI/components/Tab/DialogEvaluate/03_DialogEvalutionDevelop.vue
@@ -5,11 +5,14 @@ import config from "@/app.config";
import { useCounterMixin } from "@/stores/mixin";
import { useQuasar, type QTableProps } from "quasar";
import { ref } from "vue";
+import { useKpiDataStore } from "@/modules/08_KPI/store";
const props = defineProps({
getAll: Function,
});
+const store = useKpiDataStore();
+
const $q = useQuasar();
const mixin = useCounterMixin();
const {
@@ -89,6 +92,7 @@ function onSubmit() {
summary: i.summary,
}));
showLoader();
+ store.isUpdate = true;
http
.post(config.API.kpiAchievementDevelop + `/point`, data)
.then((res) => {
diff --git a/src/modules/08_KPI/components/Tab/TabMain.vue b/src/modules/08_KPI/components/Tab/TabMain.vue
index cc90cd6..b4ad8fb 100644
--- a/src/modules/08_KPI/components/Tab/TabMain.vue
+++ b/src/modules/08_KPI/components/Tab/TabMain.vue
@@ -1,12 +1,12 @@
@@ -430,16 +480,21 @@ onMounted(async () => {
>
{{
- `${store.dataEvaluation.prefix}${store.dataEvaluation.firstName} ${store.dataEvaluation.lastName}`
+ store.dataEvaluation.firstName
+ ? `${store.dataEvaluation.prefix}${store.dataEvaluation.firstName} ${store.dataEvaluation.lastName}`
+ : ""
}}
{
color="grey-2"
text-color="blue-6"
size="md"
- @click="sendToEvaluatore('NEW_EVALUATOR')"
+ @click="sendToEvaluatore()"
>
ส่งให้ผู้ประเมินอนุมัติ
{
color="grey-2"
text-color="blue-6"
size="md"
- @click="sendToCommander"
+ @click="sendToEvauator"
>
ทำการประเมิน
@@ -497,13 +555,13 @@ onMounted(async () => {
color="grey-2"
text-color="blue-6"
size="md"
- @click="sendToEvaluatore('EVALUATING_EVALUATOR')"
+ @click="sendToEvaluateEvaluatore()"
>
ส่งให้ผู้ประเมินรายงานผลสำเร็จของงาน
-
ส่งไปสรุปผลการประเมิน
-
+ -->
+ สรุปผลการประเมิน
+
+
+ {
คะแนนประเมิน
{{
- store.dataEvaluation.posExecutiveName == null
+ store.dataEvaluation.posTypeName != "อำนวยการ" &&
+ store.dataEvaluation.posTypeName != "บริหาร"
? (
store.indicatorScoreVal +
store.competencyScoreVal +
diff --git a/src/modules/08_KPI/views/main.vue b/src/modules/08_KPI/views/main.vue
index eaa8e98..269582b 100644
--- a/src/modules/08_KPI/views/main.vue
+++ b/src/modules/08_KPI/views/main.vue
@@ -273,10 +273,10 @@ function getProfile() {
http
.get(config.API.profilePosition())
.then(async (res) => {
- const data = res.data.result;
+ const data = await res.data.result;
store.dataProfile = data;
- await store.checkCompetency();
- await store.checkCompetencyDefaultCompetencyLevel();
+ store.checkCompetency();
+ store.checkCompetencyDefaultCompetencyLevel();
formRound.profileId = data.profileId;
formRound.prefix = data.prefix;
@@ -329,15 +329,21 @@ function getOrgOp() {
const data = res.data.result;
evaluatorIdMainOp.value = data.caregiver.map((i: any) => ({
id: i.id,
- name: `${i.prefix ? i.prefix :''}${i.firstName ? i.firstName : ''} ${i.lastName ? i.lastName:''}`,
+ name: `${i.prefix ? i.prefix : ""}${i.firstName ? i.firstName : ""} ${
+ i.lastName ? i.lastName : ""
+ }`,
}));
commanderIdMainOp.value = data.commander.map((i: any) => ({
id: i.id,
- name: `${i.prefix ? i.prefix :''}${i.firstName ? i.firstName : ''} ${i.lastName ? i.lastName:''}`,
+ name: `${i.prefix ? i.prefix : ""}${i.firstName ? i.firstName : ""} ${
+ i.lastName ? i.lastName : ""
+ }`,
}));
commanderHighMainOp.value = data.chairman.map((i: any) => ({
id: i.id,
- name: `${i.prefix ? i.prefix :''}${i.firstName ? i.firstName : ''} ${i.lastName ? i.lastName:''}`,
+ name: `${i.prefix ? i.prefix : ""}${i.firstName ? i.firstName : ""} ${
+ i.lastName ? i.lastName : ""
+ }`,
}));
})
.catch((e) => {
@@ -636,7 +642,7 @@ onMounted(() => {
:options="roundDialgOp"
hide-bottom-space
lazy-rules
- :rules="[(val) => !!val.id || `${'กรุณาเลือกรอบการประเมิน'}`]"
+ :rules="[(val:any) => !!val.id || `${'กรุณาเลือกรอบการประเมิน'}`]"
@update:model-value="checkClosed"
/>
diff --git a/src/modules/08_KPI/views/mainEvaluator.vue b/src/modules/08_KPI/views/mainEvaluator.vue
index 065562e..a622939 100644
--- a/src/modules/08_KPI/views/mainEvaluator.vue
+++ b/src/modules/08_KPI/views/mainEvaluator.vue
@@ -186,6 +186,7 @@ watch(
function onChangTab() {
store.formQuery.page = 1;
+ dataListMain.value = [];
fetchList();
store.selected = [];
}