updated kpi progress & problem

This commit is contained in:
Warunee Tamkoo 2024-05-14 09:50:52 +07:00
parent 9156fb8e72
commit beebb44d2f
8 changed files with 291 additions and 213 deletions

View file

@ -21,6 +21,14 @@ const indicatorWeightTotal = defineModel("indicatorWeightTotal", {
type: Number,
default: 0,
});
const indicatorWeight1Total = defineModel("indicatorWeight1Total", {
type: Number,
default: 0,
});
const indicatorWeight2Total = defineModel("indicatorWeight2Total", {
type: Number,
default: 0,
});
const dataListCriteria = ref<ListCriteria[]>([]);
const modalCriteria = ref<boolean>(false);
@ -72,6 +80,8 @@ function fetchListPlanned() {
);
weightPlanned.value = weight;
indicatorWeight1Total.value = Number(weight);
store.indicatorScoreVal = result;
totalResults1.value =
(result * store.dataEvaluation.plannedPoint) / weight;
@ -104,6 +114,7 @@ function fetchListRole() {
);
weightRole.value = weight;
indicatorWeight1Total.value = Number(weight);
totalResults2.value =
(result * store.dataEvaluation.rolePoint) / weight;
@ -168,6 +179,13 @@ function getCriteria() {
});
}
const isShowScore = computed(() => {
return (
store.tabOpen === 3 &&
store.dataEvaluation.evaluationStatus === "EVALUATING"
);
});
watch(
[weightPlanned, weightRole, weightAssigned],
([newA, newB, newC], [prevA, prevB, prevC]) => {
@ -219,39 +237,43 @@ onMounted(() => {
:total="totalResults1"
/>
<q-table
flat
dense
bordered
:rows="[
{
name: 'รวมผลการประเมิน (ร้อยละ)',
value: store.excusiveIndicator1PercentVal,
},
{
name: 'ผลการประเมินมิติที่ 1 (คะแนน)',
value: store.excusiveIndicator1ScoreVal,
},
]"
:columns="[
{
name: 'name',
field: 'name',
label: 'name',
style: 'font-size: 14px',
},
{
name: 'value',
field: 'value',
label: 'value',
style: 'font-size: 14px; font-weight: bold',
},
]"
row-key="name"
hide-header
hide-bottom
class="q-mt-xs q-mb-md"
/>
<div v-if="isShowScore">
<q-table
flat
dense
bordered
:rows="[
{
name: 'รวมผลการประเมิน (ร้อยละ)',
value: store.excusiveIndicator1PercentVal,
},
{
name: 'ผลการประเมินมิติที่ 1 (คะแนน)',
value: store.excusiveIndicator1ScoreVal,
},
]"
:columns="[
{
name: 'name',
field: 'name',
label: 'name',
style: 'font-size: 14px',
},
{
name: 'value',
field: 'value',
label: 'value',
style: 'font-size: 14px; font-weight: bold',
},
]"
row-key="name"
hide-header
hide-bottom
class="q-mt-xs q-mb-md"
/>
</div>
<div v-else class="q-mt-md"></div>
<Work
v-model:data="rows_03"
@ -261,50 +283,52 @@ onMounted(() => {
:total="totalResults3"
/>
<q-table
flat
dense
bordered
:rows="[
{
name: 'รวมผลการประเมิน (ร้อยละ)',
value: store.excusiveIndicator2PercentVal,
},
{
name: 'ผลการประเมินมิติที่ 2 (คะแนน)',
value: store.excusiveIndicator2ScoreVal,
},
]"
:columns="[
{
name: 'name',
field: 'name',
label: 'name',
style: 'font-size: 14px',
},
{
name: 'value',
field: 'value',
label: 'value',
style: 'font-size: 14px; font-weight: bold',
},
]"
row-key="name"
hide-header
hide-bottom
class="q-mt-xs q-mb-md"
/>
<div v-if="isShowScore">
<q-table
flat
dense
bordered
:rows="[
{
name: 'รวมผลการประเมิน (ร้อยละ)',
value: store.excusiveIndicator2PercentVal,
},
{
name: 'ผลการประเมินมิติที่ 2 (คะแนน)',
value: store.excusiveIndicator2ScoreVal,
},
]"
:columns="[
{
name: 'name',
field: 'name',
label: 'name',
style: 'font-size: 14px',
},
{
name: 'value',
field: 'value',
label: 'value',
style: 'font-size: 14px; font-weight: bold',
},
]"
row-key="name"
hide-header
hide-bottom
class="q-mt-xs q-mb-md"
/>
<div class="row text-body2 text-weight-bold">
<div class="col-12 text-center row justify-center">
<span
>สรปผลการประเมนผลสมฤทธของงาน ( 1 + 2)
(คะแนนเต
{{ store.excusiveIndicatorScore }}
คะแนน)</span
>
<div class="text-primary q-pl-md">
{{ store.indicatorScoreVal }}
<div class="row text-body2 text-weight-bold">
<div class="col-12 text-center row justify-center">
<span
>สรปผลการประเมนผลสมฤทธของงาน ( 1 + 2)
(คะแนนเต
{{ store.excusiveIndicatorScore }}
คะแนน)</span
>
<div class="text-primary q-pl-md">
{{ store.indicatorScoreVal }}
</div>
</div>
</div>
</div>
@ -333,45 +357,47 @@ onMounted(() => {
:total="totalResults3"
/>
<q-table
flat
dense
bordered
:rows="[
{
name: 'รวมผลการประเมิน (ร้อยละ)',
value: store.indicatorPercentVal,
},
]"
:columns="[
{
name: 'name',
field: 'name',
label: 'name',
style: 'font-size: 14px',
},
{
name: 'value',
field: 'value',
label: 'value',
style: 'font-size: 14px; font-weight: bold',
},
]"
row-key="name"
hide-header
hide-bottom
class="q-mt-xs q-mb-md"
/>
<div v-if="isShowScore">
<q-table
flat
dense
bordered
:rows="[
{
name: 'รวมผลการประเมิน (ร้อยละ)',
value: store.indicatorPercentVal,
},
]"
:columns="[
{
name: 'name',
field: 'name',
label: 'name',
style: 'font-size: 14px',
},
{
name: 'value',
field: 'value',
label: 'value',
style: 'font-size: 14px; font-weight: bold',
},
]"
row-key="name"
hide-header
hide-bottom
class="q-mt-xs q-mb-md"
/>
<div class="row text-body2 text-weight-bold">
<div class="col-12 text-center row justify-center">
<span
>สรปผลการประเมนผลสมฤทธของงาน (คะแนนเต
{{ store.indicatorScore }}
คะแนน)</span
>
<div class="text-primary q-pl-md">
{{ store.indicatorScoreVal }}
<div class="row text-body2 text-weight-bold">
<div class="col-12 text-center row justify-center">
<span
>สรปผลการประเมนผลสมฤทธของงาน (คะแนนเต
{{ store.indicatorScore }}
คะแนน)</span
>
<div class="text-primary q-pl-md">
{{ store.indicatorScoreVal }}
</div>
</div>
</div>
</div>
@ -398,6 +424,7 @@ onMounted(() => {
<Competency v-model:dataListCriteria="dataListCriteria" />
<q-table
v-if="isShowScore"
flat
dense
bordered
@ -434,59 +461,61 @@ onMounted(() => {
<div v-if="!store.dataProfile.posExecutiveName">
<Develop />
<q-table
flat
dense
bordered
:rows="[
{
name: `ผลการประเมินการพัฒนาตนเอง (คะแนนเต็ม ${store.devScore} คะแนน)`,
value: store.devScoreVal,
},
]"
:columns="[
{
name: 'name',
field: 'name',
label: 'name',
style: 'font-size: 14px',
},
{
name: 'value',
field: 'value',
label: 'value',
style: 'font-size: 14px; font-weight: bold',
},
]"
row-key="name"
hide-header
hide-bottom
class="q-mt-xs q-mb-md"
/>
</div>
<div v-if="isShowScore">
<q-table
flat
dense
bordered
:rows="[
{
name: `ผลการประเมินการพัฒนาตนเอง (คะแนนเต็ม ${store.devScore} คะแนน)`,
value: store.devScoreVal,
},
]"
:columns="[
{
name: 'name',
field: 'name',
label: 'name',
style: 'font-size: 14px',
},
{
name: 'value',
field: 'value',
label: 'value',
style: 'font-size: 14px; font-weight: bold',
},
]"
row-key="name"
hide-header
hide-bottom
class="q-mt-xs q-mb-md"
/>
</div>
<div
v-if="!store.dataProfile.posExecutiveName"
class="row text-body2 text-weight-bold"
>
<div class="col-12 text-center row justify-center">
<span
>สรปผลการประเมนพฤตกรรมการปฏราชการ (สมรรถนะ+การพฒนาตนเอง)
(คะแนนเต {{ store.competencyDevScore }} คะแนน)</span
>
<div class="text-primary q-pl-md">
{{ store.competencyDevScoreVal }}
<div
v-if="isShowScore && !store.dataProfile.posExecutiveName"
class="row text-body2 text-weight-bold"
>
<div class="col-12 text-center row justify-center">
<span
>สรปผลการประเมนพฤตกรรมการปฏราชการ (สมรรถนะ+การพฒนาตนเอง)
(คะแนนเต {{ store.competencyDevScore }} คะแนน)</span
>
<div class="text-primary q-pl-md">
{{ store.competencyDevScoreVal }}
</div>
</div>
</div>
</div>
<div v-else class="row text-body2 text-weight-bold">
<div class="col-12 text-center row justify-center">
<span
>สรปผลการประเมนพฤตกรรมการปฏราชการ (สมรรถนะ) (คะแนนเต
{{ store.competencyScore }} คะแนน)</span
>
<div class="text-primary q-pl-md">
{{ store.competencyScoreVal }}
<div v-else class="row text-body2 text-weight-bold">
<div class="col-12 text-center row justify-center">
<span
>สรปผลการประเมนพฤตกรรมการปฏราชการ (สมรรถนะ) (คะแนนเต
{{ store.competencyScore }} คะแนน)</span
>
<div class="text-primary q-pl-md">
{{ store.competencyScoreVal }}
</div>
</div>
</div>
</div>

View file

@ -15,6 +15,14 @@ const indicatorWeightTotal = defineModel("indicatorWeightTotal", {
type: Number,
default: 0,
});
const indicatorWeight1Total = defineModel("indicatorWeight1Total", {
type: Number,
default: 0,
});
const indicatorWeight2Total = defineModel("indicatorWeight2Total", {
type: Number,
default: 0,
});
const itemsTab = ref<any>([
{
@ -102,6 +110,8 @@ const splitterModel = ref<number>(12);
<Assessment
v-if="store.tabMain === '1'"
v-model:indicatorWeightTotal="indicatorWeightTotal"
v-model:indicatorWeight1Total="indicatorWeight1Total"
v-model:indicatorWeight2Total="indicatorWeight2Total"
/>
<Assessment v-if="store.tabMain === '2'" :type="'evaluator'" />
<Assessment v-if="store.tabMain === '3'" :type="'commander'" />

View file

@ -357,36 +357,42 @@ watch(
</div>
</q-td>
<td>
<!-- <div v-if="store.dataEvaluation.evaluationStatus == 'APPROVE'"> -->
<q-btn
flat
round
icon="mdi-developer-board"
color="blue-6"
size="12px"
dense
@click="openPopupProgress(props.row.id)"
<div
v-if="
store.dataEvaluation.evaluationStatus == 'APPROVE' &&
store.tabMain === '2'
"
>
<q-tooltip>รายงานความกาวหน</q-tooltip>
</q-btn>
<q-btn
flat
round
icon="warning"
color="red-5"
size="12px"
dense
main="problem"
@click="openPopupProblem(props.row.id)"
>
<q-tooltip>รายงานปญหา</q-tooltip>
</q-btn>
<!-- </div> -->
<q-btn
flat
round
icon="mdi-developer-board"
color="blue-6"
size="12px"
dense
@click="openPopupProgress(props.row.id)"
>
<q-tooltip>รายงานความกาวหน</q-tooltip>
</q-btn>
<q-btn
flat
round
icon="warning"
color="red-5"
size="12px"
dense
main="problem"
@click="openPopupProblem(props.row.id)"
>
<q-tooltip>รายงานปญหา</q-tooltip>
</q-btn>
</div>
<div
v-if="
store.dataEvaluation.evaluationStatus === 'NEW' &&
store.rolePerson === 'USER'
store.rolePerson === 'USER' &&
store.tabMain === '1'
"
>
<q-btn

View file

@ -290,13 +290,7 @@ onMounted(() => {
<q-th v-for="col in props.cols" :key="col.name" :props="props">
<span class="text-weight-medium">{{ col.label }}</span>
</q-th>
<q-th
auto-width
v-if="
store.dataEvaluation.evaluationStatus === 'NEW' &&
store.rolePerson === 'USER'
"
/>
<q-th auto-width />
</q-tr>
</template>
<template v-slot:body="props">
@ -359,7 +353,12 @@ onMounted(() => {
</div>
</q-td>
<q-td>
<div v-if="store.dataEvaluation.evaluationStatus == 'APPROVE'">
<div
v-if="
store.dataEvaluation.evaluationStatus == 'APPROVE' &&
store.tabMain === '2'
"
>
<q-btn
flat
round
@ -388,7 +387,8 @@ onMounted(() => {
<div
v-if="
store.dataEvaluation.evaluationStatus === 'NEW' &&
store.rolePerson === 'USER'
store.rolePerson === 'USER' &&
store.tabMain === '1'
"
>
<q-btn

View file

@ -287,7 +287,12 @@ onMounted(() => {
</div>
</q-td>
<q-td>
<div v-if="store.dataEvaluation.evaluationStatus == 'APPROVE'">
<div
v-if="
store.dataEvaluation.evaluationStatus == 'APPROVE' &&
store.tabMain === '1'
"
>
<q-btn
flat
round
@ -316,7 +321,8 @@ onMounted(() => {
<div
v-if="
store.dataEvaluation.evaluationStatus === 'NEW' &&
store.rolePerson === 'USER'
store.rolePerson === 'USER' &&
store.tabMain === '2'
"
>
<q-btn

View file

@ -273,15 +273,36 @@ export const useKpiDataStore = defineStore("KPIDate", () => {
rolePerson.value = role;
switch (dataEvaluation.value.evaluationStatus) {
case "NEW" || "NEW_EVALUATOR" || "NEW_COMMANDER" || "NEW_COMMANDER_HIGH":
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;
default:
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;
default:
tabOpen.value = 1;
break;
}
}

View file

@ -346,6 +346,8 @@ function requireEdit() {
}
const indicatorWeightTotal = ref<number>(0);
const indicatorWeight1Total = ref<number>(0);
const indicatorWeight2Total = ref<number>(0);
onMounted(async () => {
showLoader();
await getAll();
@ -400,9 +402,12 @@ onMounted(async () => {
<div class="q-gutter-x-sm">
<span
v-if="
store.dataProfile.posExecutiveName == null &&
indicatorWeightTotal > 0 &&
indicatorWeightTotal != 100
(store.dataProfile.posExecutiveName == null &&
indicatorWeightTotal > 0 &&
indicatorWeightTotal != 100) ||
(store.dataEvaluation.evaluatorId != null &&
indicatorWeight1Total != 100 &&
indicatorWeight2Total != 20)
"
class="text-red"
>*ำหน(อยละ) ผลสมฤทธของงานไมกตอง</span
@ -413,9 +418,12 @@ onMounted(async () => {
store.dataEvaluation.evaluationStatus == 'NEW'
"
:disabled="
store.dataEvaluation.evaluatorId == null ||
(indicatorWeightTotal > 0 &&
indicatorWeightTotal != 100)
(store.dataProfile.posExecutiveName == null &&
indicatorWeightTotal > 0 &&
indicatorWeightTotal != 100) ||
(store.dataEvaluation.evaluatorId != null &&
indicatorWeight1Total != 100 &&
indicatorWeight2Total != 20)
"
unelevated
round
@ -558,6 +566,8 @@ onMounted(async () => {
v-model:indicatorScore="indicatorScore"
v-model:competencyScore="competencyScore"
v-model:indicatorWeightTotal="indicatorWeightTotal"
v-model:indicatorWeight1Total="indicatorWeight1Total"
v-model:indicatorWeight2Total="indicatorWeight2Total"
/>
</q-card>
</div>

View file

@ -305,11 +305,7 @@ onMounted(async () => {
narrow-indicator
>
<q-tab name="1" label="รายการทั้งหมด" @click="onChangTab" />
<q-tab
name="2"
label="อนุมัติเพื่อเริ่มประเมิน"
@click="onChangTab"
/>
<q-tab name="2" label="รออนุมัติข้อตกลง" @click="onChangTab" />
<q-tab
name="3"
label="รออนุมัติแก้ไขข้อตกลง"