kpi updated

This commit is contained in:
Warunee Tamkoo 2024-05-14 23:48:29 +07:00
parent 56a38622e5
commit 6c532a0202
8 changed files with 266 additions and 182 deletions

View file

@ -291,7 +291,7 @@ async function getAll() {
await getOrgOp();
}
function sendToEvaluatore() {
function sendToEvaluatore(status: string) {
dialogConfirm(
$q,
() => {
@ -299,7 +299,7 @@ function sendToEvaluatore() {
showLoader();
http
.put(config.API.kpiSendToStatus(id.value), {
status: "NEW_EVALUATOR",
status: status,
})
.then((res) => {
success($q, "ส่งข้อตกลงให้ผู้ประเมินอนุมัติสำเร็จ");
@ -345,9 +345,6 @@ function requireEdit() {
);
}
const indicatorWeightTotal = ref<number>(0);
const indicatorWeight1Total = ref<number>(0);
const indicatorWeight2Total = ref<number>(0);
onMounted(async () => {
showLoader();
await getAll();
@ -355,8 +352,6 @@ onMounted(async () => {
</script>
<template>
<!-- evaluationStatus={{ store.dataEvaluation.evaluationStatus }} | tabOpen =
{{ store.tabOpen }} | rolePerson = {{ store.rolePerson }} | -->
<div class="col-12 row justify-center">
<div class="col-xs-12 col-sm-12 col-md-11">
<div class="toptitle text-white col-12 row items-center">
@ -400,14 +395,18 @@ onMounted(async () => {
}}</span>
<q-space />
<div class="q-gutter-x-sm">
<!-- {{
store.dataProfile.posExecutiveName == null &&
store.indicatorWeightTotal != 100
}}
| {{ store.indicatorWeightTotal }} | -->
<span
v-if="
(store.dataProfile.posExecutiveName == null &&
indicatorWeightTotal > 0 &&
indicatorWeightTotal != 100) ||
(store.dataEvaluation.evaluatorId != null &&
indicatorWeight1Total != 100 &&
indicatorWeight2Total != 20)
store.indicatorWeightTotal != 100) ||
(store.dataEvaluation.posExecutiveName != null &&
(store.indicatorWeight1Total != 100 ||
store.indicatorWeight2Total != 20))
"
class="text-red"
>*ำหน(อยละ) ผลสมฤทธของงานไมกตอง</span
@ -419,11 +418,10 @@ onMounted(async () => {
"
:disabled="
(store.dataProfile.posExecutiveName == null &&
indicatorWeightTotal > 0 &&
indicatorWeightTotal != 100) ||
(store.dataEvaluation.evaluatorId != null &&
indicatorWeight1Total != 100 &&
indicatorWeight2Total != 20)
store.indicatorWeightTotal != 100) ||
(store.dataEvaluation.posExecutiveName != null &&
(store.indicatorWeight1Total != 100 ||
store.indicatorWeight2Total != 20))
"
unelevated
round
@ -431,10 +429,27 @@ onMounted(async () => {
color="grey-2"
text-color="blue-6"
size="md"
@click="sendToEvaluatore()"
@click="sendToEvaluatore('NEW_EVALUATOR')"
>
<q-tooltip>งใหประเมนอน</q-tooltip>
</q-btn>
<q-btn
v-if="
store.rolePerson == 'USER' &&
store.dataEvaluation.evaluationStatus == 'EVALUATING'
"
unelevated
round
icon="mdi-send"
color="grey-2"
text-color="blue-6"
size="md"
@click="sendToEvaluatore('EVALUATING_EVALUATOR')"
>
<q-tooltip>งใหประเมนอนผลการประเม</q-tooltip>
</q-btn>
<q-btn
v-if="
store.rolePerson == 'USER' &&
@ -468,7 +483,10 @@ onMounted(async () => {
<q-tooltip>แกไขคะแนนเต</q-tooltip>
</q-btn> -->
<q-btn
v-if="!isReadonly"
v-if="
store.dataEvaluation.evaluationStatus === 'NEW' &&
store.rolePerson === 'USER'
"
unelevated
round
icon="edit"
@ -550,9 +568,21 @@ onMounted(async () => {
<div class="col-2">
<div class="column">
<span class="text-grey-6">คะแนนประเม</span>
<span class="text-weight-medium text-primary">{{
(indicatorScore + competencyScore).toFixed(2)
}}</span>
<span class="text-weight-medium text-primary">
{{
store.dataProfile.posExecutiveName == null
? (
store.indicatorScoreVal +
store.competencyScoreVal +
store.devScoreVal
).toFixed(2)
: (
store.excusiveIndicator1ScoreVal +
store.excusiveIndicator2ScoreVal +
store.competencyScore
).toFixed(2)
}}
</span>
</div>
</div>
</div>
@ -562,13 +592,7 @@ onMounted(async () => {
</q-card>
<q-card class="q-mt-md rounded">
<TabMain
v-model:indicatorScore="indicatorScore"
v-model:competencyScore="competencyScore"
v-model:indicatorWeightTotal="indicatorWeightTotal"
v-model:indicatorWeight1Total="indicatorWeight1Total"
v-model:indicatorWeight2Total="indicatorWeight2Total"
/>
<TabMain />
</q-card>
</div>
</div>