updated
This commit is contained in:
parent
5e8c8589cb
commit
11e5e13039
11 changed files with 118 additions and 149 deletions
|
|
@ -1,6 +1,5 @@
|
|||
<script setup lang="ts">
|
||||
import { computed, ref, onMounted } from "vue";
|
||||
import DialogHeader from "@/components/DialogHeader.vue";
|
||||
import { ref, onMounted } from "vue";
|
||||
import { useQuasar } from "quasar";
|
||||
import { useCounterMixin } from "@/stores/mixin";
|
||||
import { useKpiDataStore } from "@/modules/08_KPI/store";
|
||||
|
|
@ -41,52 +40,9 @@ const weight1 = ref<number>(0);
|
|||
const result1 = ref<number>(0);
|
||||
const weight2 = ref<number>(0);
|
||||
const result2 = ref<number>(0);
|
||||
const sumWeight = computed(() => {
|
||||
return weight1.value + weight2.value;
|
||||
});
|
||||
const sumResult = computed(() => {
|
||||
return result1.value + result2.value;
|
||||
});
|
||||
|
||||
const group = computed(() => {
|
||||
return convert(sumResult.value);
|
||||
});
|
||||
// const options = ref<any[]>([
|
||||
// {
|
||||
// label: "ดีเด่น (คะแนนร้อยละ ๙๐.๐๐ ขึ้นไป)",
|
||||
// value: "EXCELLENT",
|
||||
// },
|
||||
// {
|
||||
// label: "ดีมาก (คะแนนร้อยละ ๘๐.๐๐ - ๘๙.๙๙)",
|
||||
// value: "VERYGOOD",
|
||||
// },
|
||||
// {
|
||||
// label: "ดี (คะแนนร้อยละ ๗๐.๐๐ - ๗๙.๙๙)",
|
||||
// value: "GOOD",
|
||||
// },
|
||||
// {
|
||||
// label: "พอใช้ (คะแนนร้อยละ ๖๐.๐๐ - ๖๙.๙๙)",
|
||||
// value: "FAIR",
|
||||
// },
|
||||
// {
|
||||
// label: "ต้องปรับปรุง (คะแนนต่ำกว่าร้อยละ ๖๐.๐๐)",
|
||||
// value: "IMPROVEMENT",
|
||||
// },
|
||||
// ]);
|
||||
|
||||
function convert(score: any): string {
|
||||
if (score >= 90) {
|
||||
return "EXCELLENT";
|
||||
} else if (score >= 80) {
|
||||
return "VERYGOOD";
|
||||
} else if (score >= 70) {
|
||||
return "GOOD";
|
||||
} else if (score >= 60) {
|
||||
return "FAIR";
|
||||
} else {
|
||||
return "IMPROVEMENT";
|
||||
}
|
||||
}
|
||||
const sumWeight = ref<number>(0);
|
||||
const sumResult = ref<number>(0);
|
||||
const result = ref<string>("");
|
||||
|
||||
function onSubmit() {
|
||||
dialogConfirm($q, () => {
|
||||
|
|
@ -173,14 +129,22 @@ function resetCommanderHigh() {
|
|||
additionalSuperiorCommentRef.value.resetValidation();
|
||||
}
|
||||
|
||||
/**
|
||||
* ดึงข้อมูลการประเมิน
|
||||
*/
|
||||
async function fetchEvaluation() {
|
||||
await http
|
||||
.get(config.API.kpiEvaluation + `/${id.value}`)
|
||||
.then(async (res) => {
|
||||
const data = res.data.result;
|
||||
// เก็บข้อมูลการประเมินเข้า store
|
||||
store.dataEvaluation = await data;
|
||||
|
||||
if (data.profileId == store.dataProfile.profileId) {
|
||||
// เช็คว่าถ้าผู้รับการประเมินเปิดการประเมินไปแล้วจะไม่ยิงอัปเดตสถานะการเปิดดูอีก แต่ถ้ายังไม่เคยเปิดจะยิงเพื่ออัปเดต
|
||||
if (
|
||||
!store.dataEvaluation.isOpen &&
|
||||
data.profileId == store.dataProfile.profileId
|
||||
) {
|
||||
userOpen();
|
||||
}
|
||||
})
|
||||
|
|
@ -207,25 +171,26 @@ function getData() {
|
|||
developmentMethod.value = data.developEvaluator;
|
||||
developmentPeriod.value = data.timeEvaluator;
|
||||
evaluatorComment.value = data.reasonEvaluator;
|
||||
superiorCommentCheck.value = data.isReasonCommander
|
||||
? data.isReasonCommander.toString()
|
||||
: "";
|
||||
superiorCommentCheck.value = data.isReasonCommander.toString();
|
||||
|
||||
superiorComment.value = data.reasonCommander;
|
||||
|
||||
additionalSuperiorCheck.value = data.isReasonCommanderHigh
|
||||
? data.isReasonCommanderHigh.toString()
|
||||
: "";
|
||||
additionalSuperiorCheck.value = data.isReasonCommanderHigh.toString();
|
||||
additionalSuperiorComment.value = data.reasonCommanderHigh;
|
||||
result1.value = data.totalPoint1;
|
||||
result2.value = data.totalPoint2_1 + data.totalPoint2_2;
|
||||
weight1.value = data.weightPoint1;
|
||||
weight2.value = data.weightPoint2;
|
||||
sumWeight.value = data.weightPoint1 + data.weightPoint2;
|
||||
sumResult.value = data.summaryPoint;
|
||||
result.value = data.evaluationResults;
|
||||
})
|
||||
.catch((e) => {
|
||||
messageError($q, e);
|
||||
})
|
||||
.finally(() => {});
|
||||
}
|
||||
|
||||
onMounted(() => {
|
||||
getData();
|
||||
fetchEvaluation();
|
||||
|
|
@ -292,35 +257,35 @@ onMounted(() => {
|
|||
<div class="col-12 no-pointer">
|
||||
<div class="column">
|
||||
<q-radio
|
||||
v-model="group"
|
||||
v-model="result"
|
||||
checked-icon="task_alt"
|
||||
unchecked-icon="panorama_fish_eye"
|
||||
val="EXCELLENT"
|
||||
label="ดีเด่น (คะแนนร้อยละ 90.00 ขึ้นไป)"
|
||||
/>
|
||||
<q-radio
|
||||
v-model="group"
|
||||
v-model="result"
|
||||
checked-icon="task_alt"
|
||||
unchecked-icon="panorama_fish_eye"
|
||||
val="VERYGOOD"
|
||||
val="VERY_GOOD"
|
||||
label="ดีมาก (คะแนนร้อยละ 80.00 - 89.99)"
|
||||
/>
|
||||
<q-radio
|
||||
v-model="group"
|
||||
v-model="result"
|
||||
checked-icon="task_alt"
|
||||
unchecked-icon="panorama_fish_eye"
|
||||
val="GOOD"
|
||||
label="ดี (คะแนนร้อยละ 70.00 - 79.99)"
|
||||
/>
|
||||
<q-radio
|
||||
v-model="group"
|
||||
v-model="result"
|
||||
checked-icon="task_alt"
|
||||
unchecked-icon="panorama_fish_eye"
|
||||
val="FAIR"
|
||||
label="พอใช้ (คะแนนร้อยละ 60.00 - 69.99)"
|
||||
/>
|
||||
<q-radio
|
||||
v-model="group"
|
||||
v-model="result"
|
||||
checked-icon="task_alt"
|
||||
unchecked-icon="panorama_fish_eye"
|
||||
val="IMPROVEMENT"
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue