updated kpi
This commit is contained in:
parent
a121569433
commit
a69d9e331d
8 changed files with 97 additions and 107 deletions
|
|
@ -34,7 +34,7 @@ export default {
|
||||||
KpiEvaluationInfo,
|
KpiEvaluationInfo,
|
||||||
Kpiorg,
|
Kpiorg,
|
||||||
kpiEvaluationCheck: `${kpiEvaluation}/check`,
|
kpiEvaluationCheck: `${kpiEvaluation}/check`,
|
||||||
|
kpiSendToStatus: (id: string) => `${kpiEvaluation}/status/${id}`,
|
||||||
/**ประเมิน*/
|
/**ประเมิน*/
|
||||||
kpiAchievementDevelop:`${kpiAchievement}/development`
|
kpiAchievementDevelop:`${kpiAchievement}/development`
|
||||||
};
|
};
|
||||||
|
|
|
||||||
|
|
@ -18,11 +18,7 @@ import { useKpiDataStore } from "@/modules/08_KPI/store";
|
||||||
|
|
||||||
import type { ListCriteria } from "@/modules/08_KPI/interface/request/index";
|
import type { ListCriteria } from "@/modules/08_KPI/interface/request/index";
|
||||||
|
|
||||||
const indicatorScore = defineModel("indicatorScore", {
|
const indicatorWeightTotal = defineModel("indicatorWeightTotal", {
|
||||||
type: Number,
|
|
||||||
default: 0,
|
|
||||||
});
|
|
||||||
const competencyScore = defineModel("competencyScore", {
|
|
||||||
type: Number,
|
type: Number,
|
||||||
default: 0,
|
default: 0,
|
||||||
});
|
});
|
||||||
|
|
@ -119,6 +115,9 @@ const columns = ref<QTableProps["columns"]>([
|
||||||
},
|
},
|
||||||
]);
|
]);
|
||||||
|
|
||||||
|
const weightPlanned = ref<number>(0);
|
||||||
|
const weightRole = ref<number>(0);
|
||||||
|
const weightAssigned = ref<number>(0);
|
||||||
function fetchListPlanned() {
|
function fetchListPlanned() {
|
||||||
http
|
http
|
||||||
.get(config.API.kpiAchievement("planned") + `?id=${evaluationId.value}`)
|
.get(config.API.kpiAchievement("planned") + `?id=${evaluationId.value}`)
|
||||||
|
|
@ -140,6 +139,8 @@ function fetchListPlanned() {
|
||||||
0
|
0
|
||||||
);
|
);
|
||||||
|
|
||||||
|
weightPlanned.value = weight;
|
||||||
|
|
||||||
totalResults1.value =
|
totalResults1.value =
|
||||||
(result * store.dataEvaluation.plannedPoint) / weight;
|
(result * store.dataEvaluation.plannedPoint) / weight;
|
||||||
}
|
}
|
||||||
|
|
@ -170,6 +171,8 @@ function fetchListRole() {
|
||||||
0
|
0
|
||||||
);
|
);
|
||||||
|
|
||||||
|
weightRole.value = weight;
|
||||||
|
|
||||||
totalResults2.value =
|
totalResults2.value =
|
||||||
(result * store.dataEvaluation.rolePoint) / weight;
|
(result * store.dataEvaluation.rolePoint) / weight;
|
||||||
}
|
}
|
||||||
|
|
@ -201,6 +204,8 @@ function fetchAssigned() {
|
||||||
0
|
0
|
||||||
);
|
);
|
||||||
|
|
||||||
|
weightAssigned.value = weight;
|
||||||
|
|
||||||
totalResults3.value =
|
totalResults3.value =
|
||||||
(result * store.dataEvaluation.specialPoint) / weight;
|
(result * store.dataEvaluation.specialPoint) / weight;
|
||||||
}
|
}
|
||||||
|
|
@ -216,7 +221,6 @@ function onInfo() {
|
||||||
|
|
||||||
const resultWork = computed(() => {
|
const resultWork = computed(() => {
|
||||||
const total = totalResults1.value + totalResults2.value + totalResults3.value;
|
const total = totalResults1.value + totalResults2.value + totalResults3.value;
|
||||||
indicatorScore.value = total;
|
|
||||||
return total.toFixed(2);
|
return total.toFixed(2);
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
@ -233,28 +237,13 @@ function getCriteria() {
|
||||||
}
|
}
|
||||||
|
|
||||||
watch(
|
watch(
|
||||||
() => store.dataEvaluation.plannedPoint,
|
[weightPlanned, weightRole, weightAssigned],
|
||||||
(newValue, oldValue) => {
|
([newA, newB, newC], [prevA, prevB, prevC]) => {
|
||||||
if (newValue !== oldValue) {
|
if (newA !== prevA || newB !== prevB || newC !== prevC) {
|
||||||
fetchListPlanned();
|
indicatorWeightTotal.value =
|
||||||
}
|
Number(weightPlanned.value) +
|
||||||
}
|
Number(weightAssigned.value) +
|
||||||
);
|
Number(weightRole.value);
|
||||||
|
|
||||||
watch(
|
|
||||||
() => store.dataEvaluation.rolePoint,
|
|
||||||
(newValue, oldValue) => {
|
|
||||||
if (newValue !== oldValue) {
|
|
||||||
fetchListRole();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
);
|
|
||||||
|
|
||||||
watch(
|
|
||||||
() => store.dataEvaluation.specialPoint,
|
|
||||||
(newValue, oldValue) => {
|
|
||||||
if (newValue !== oldValue) {
|
|
||||||
fetchAssigned();
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
);
|
);
|
||||||
|
|
@ -330,27 +319,47 @@ onMounted(() => {
|
||||||
|
|
||||||
<div class="q-gutter-md q-mt-sm">
|
<div class="q-gutter-md q-mt-sm">
|
||||||
<!-- องค์ประกอบที่ 1 -->
|
<!-- องค์ประกอบที่ 1 -->
|
||||||
<Work
|
<div v-if="store.dataProfile.posExecutiveName != null">
|
||||||
v-model:data="rows_01"
|
<Work
|
||||||
:title="`1. งานตามแผนปฏิบัติราชการประจำปี`"
|
v-model:data="rows_01"
|
||||||
:page="1"
|
:title="`มิติที่ 1 ภารกิจตามนโยบายและยุทธศาสตร์ของกรุงเทพมหานคร`"
|
||||||
:fetchList="fetchListPlanned"
|
:page="1"
|
||||||
:total="totalResults1"
|
:fetchList="fetchListPlanned"
|
||||||
/>
|
:total="totalResults1"
|
||||||
<Work
|
/>
|
||||||
v-model:data="rows_02"
|
<Work
|
||||||
:title="`2. งานตามหน้าที่ความรับผิดชอบหลัก`"
|
v-model:data="rows_03"
|
||||||
:page="2"
|
:title="`มิติที่ 2 วาระเร่งด่วนที่ได้รับมอบหมายพิเศษ (ถ้ามี)`"
|
||||||
:fetchList="fetchListRole"
|
:page="3"
|
||||||
:total="totalResults2"
|
:fetchList="fetchAssigned"
|
||||||
/>
|
:total="totalResults3"
|
||||||
<Work
|
/>
|
||||||
v-model:data="rows_03"
|
</div>
|
||||||
:title="`3. งานที่ได้รับมอบหมายพิเศษ`"
|
|
||||||
:page="3"
|
<div v-else>
|
||||||
:fetchList="fetchAssigned"
|
<Work
|
||||||
:total="totalResults3"
|
v-model:data="rows_01"
|
||||||
/>
|
:title="`1. งานตามแผนปฏิบัติราชการประจำปี`"
|
||||||
|
:page="1"
|
||||||
|
:fetchList="fetchListPlanned"
|
||||||
|
:total="totalResults1"
|
||||||
|
/>
|
||||||
|
<Work
|
||||||
|
v-model:data="rows_02"
|
||||||
|
:title="`2. งานตามหน้าที่ความรับผิดชอบหลัก`"
|
||||||
|
:page="2"
|
||||||
|
:fetchList="fetchListRole"
|
||||||
|
:total="totalResults2"
|
||||||
|
/>
|
||||||
|
<Work
|
||||||
|
v-model:data="rows_03"
|
||||||
|
:title="`3. งานที่ได้รับมอบหมายพิเศษ`"
|
||||||
|
:page="3"
|
||||||
|
:fetchList="fetchAssigned"
|
||||||
|
:total="totalResults3"
|
||||||
|
/>
|
||||||
|
</div>
|
||||||
|
|
||||||
<div class="row text-body2 text-weight-bold">
|
<div class="row text-body2 text-weight-bold">
|
||||||
<!-- <div class="col-6 text-center row justify-center">
|
<!-- <div class="col-6 text-center row justify-center">
|
||||||
<span>รวมผลการประเมิน (ร้อยละ) 100</span>
|
<span>รวมผลการประเมิน (ร้อยละ) 100</span>
|
||||||
|
|
@ -389,10 +398,7 @@ onMounted(() => {
|
||||||
</q-btn>
|
</q-btn>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<Competency
|
<Competency v-model:dataListCriteria="dataListCriteria" />
|
||||||
v-model:dataListCriteria="dataListCriteria"
|
|
||||||
v-model:competencyScore="competencyScore"
|
|
||||||
/>
|
|
||||||
|
|
||||||
<q-card bordered style="border-radius: 5px" class="no-shadow">
|
<q-card bordered style="border-radius: 5px" class="no-shadow">
|
||||||
<q-card-section class="bg-grey-2 q-py-sm">
|
<q-card-section class="bg-grey-2 q-py-sm">
|
||||||
|
|
@ -548,9 +554,9 @@ onMounted(() => {
|
||||||
<div class="row text-body2 text-weight-bold justify-center">
|
<div class="row text-body2 text-weight-bold justify-center">
|
||||||
<span
|
<span
|
||||||
>สรุปผลการประเมินสมรรถนะ (คะแนนเต็ม
|
>สรุปผลการประเมินสมรรถนะ (คะแนนเต็ม
|
||||||
{{ store.dataEvaluation.capacityPoint }} คะแนน)</span
|
{{ store.competencyScore }} คะแนน)</span
|
||||||
>
|
>
|
||||||
<div class="text-primary q-pl-md">{{ competencyScore }}</div>
|
<div class="text-primary q-pl-md">{{ store.competencyScoreVal }}</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</q-scroll-area>
|
</q-scroll-area>
|
||||||
|
|
|
||||||
|
|
@ -175,7 +175,6 @@ function onSubmit() {
|
||||||
kpiCapacityId: formDetail.id,
|
kpiCapacityId: formDetail.id,
|
||||||
level: expectedLevel.value.toString(),
|
level: expectedLevel.value.toString(),
|
||||||
weight: weight.value,
|
weight: weight.value,
|
||||||
summary: 0,
|
|
||||||
};
|
};
|
||||||
showLoader();
|
showLoader();
|
||||||
http[idProps.value ? `put` : `post`](url, body)
|
http[idProps.value ? `put` : `post`](url, body)
|
||||||
|
|
@ -489,9 +488,9 @@ watch(
|
||||||
</template>
|
</template>
|
||||||
<template v-slot:no-data="{ icon, message }">
|
<template v-slot:no-data="{ icon, message }">
|
||||||
<div
|
<div
|
||||||
class="q-pa-md text-weight-bold full-width text-center "
|
class="q-pa-md text-weight-bold full-width text-center"
|
||||||
>
|
>
|
||||||
<span style="font-size: 16px;">ไม่พบข้อมูลสมรรถนะ</span>
|
<span style="font-size: 16px">ไม่พบข้อมูลสมรรถนะ</span>
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
</q-table>
|
</q-table>
|
||||||
|
|
|
||||||
|
|
@ -119,6 +119,7 @@ function onSubmit() {
|
||||||
const body = data.map((i: any) => ({
|
const body = data.map((i: any) => ({
|
||||||
id: i.id,
|
id: i.id,
|
||||||
point: i.point,
|
point: i.point,
|
||||||
|
summary: i.point * 20,
|
||||||
}));
|
}));
|
||||||
http
|
http
|
||||||
.post(config.API.kpiUserCapacity + `/point`, body)
|
.post(config.API.kpiUserCapacity + `/point`, body)
|
||||||
|
|
|
||||||
|
|
@ -11,18 +11,11 @@ import File from "@/modules/08_KPI/components/Tab/05_File.vue";
|
||||||
|
|
||||||
const store = useKpiDataStore();
|
const store = useKpiDataStore();
|
||||||
const route = useRoute();
|
const route = useRoute();
|
||||||
const isReadonly = ref<boolean>(
|
const indicatorWeightTotal = defineModel("indicatorWeightTotal", {
|
||||||
route.name === "KPIEditEvaluator" ? true : false
|
|
||||||
);
|
|
||||||
const step = ref<number>(1); // 1 = จัดทำข้อตกลง, 2 = รายงานความก้าวหน้า, 3 = รายงานผลสำเร็จของงาน
|
|
||||||
const indicatorScore = defineModel("indicatorScore", {
|
|
||||||
type: Number,
|
|
||||||
default: 0,
|
|
||||||
});
|
|
||||||
const competencyScore = defineModel("competencyScore", {
|
|
||||||
type: Number,
|
type: Number,
|
||||||
default: 0,
|
default: 0,
|
||||||
});
|
});
|
||||||
|
|
||||||
const itemsTab = ref<any>([
|
const itemsTab = ref<any>([
|
||||||
{
|
{
|
||||||
name: "1",
|
name: "1",
|
||||||
|
|
@ -108,8 +101,7 @@ const splitterModel = ref<number>(12);
|
||||||
>
|
>
|
||||||
<Assessment
|
<Assessment
|
||||||
v-if="store.tabMain === '1'"
|
v-if="store.tabMain === '1'"
|
||||||
v-model:indicatorScore="indicatorScore"
|
v-model:indicatorWeightTotal="indicatorWeightTotal"
|
||||||
v-model:competencyScore="competencyScore"
|
|
||||||
/>
|
/>
|
||||||
<Assessment v-if="store.tabMain === '2'" :type="'evaluator'" />
|
<Assessment v-if="store.tabMain === '2'" :type="'evaluator'" />
|
||||||
<Assessment v-if="store.tabMain === '3'" :type="'commander'" />
|
<Assessment v-if="store.tabMain === '3'" :type="'commander'" />
|
||||||
|
|
|
||||||
|
|
@ -373,19 +373,7 @@ watch(
|
||||||
</td>
|
</td>
|
||||||
</q-tr>
|
</q-tr>
|
||||||
</template>
|
</template>
|
||||||
<template v-slot:bottom>
|
|
||||||
<span class="text-body2 text-weight-bold"
|
|
||||||
>รวมผลการประเมิน (ร้อยละ)</span
|
|
||||||
>
|
|
||||||
<div class="text-primary q-pl-md">{{ evaluationTotal }}</div>
|
|
||||||
</template>
|
|
||||||
</q-table>
|
</q-table>
|
||||||
<!-- <div class="row text-body2 text-weight-bold q-pa-md">
|
|
||||||
<div class="col-12 text-center row justify-center">
|
|
||||||
<span>รวมผลการประเมิน (ร้อยละ)</span>
|
|
||||||
<div class="text-primary q-pl-md">{{ evaluationTotal }}</div>
|
|
||||||
</div>
|
|
||||||
</div> -->
|
|
||||||
</q-card-section>
|
</q-card-section>
|
||||||
</q-card>
|
</q-card>
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -18,10 +18,6 @@ import type {
|
||||||
const dataListCriteria = defineModel<ListCriteria[]>("dataListCriteria", {
|
const dataListCriteria = defineModel<ListCriteria[]>("dataListCriteria", {
|
||||||
required: true,
|
required: true,
|
||||||
});
|
});
|
||||||
const competencyScore = defineModel("competencyScore", {
|
|
||||||
type: Number,
|
|
||||||
default: 0,
|
|
||||||
});
|
|
||||||
|
|
||||||
const sortedDataListCriteria = computed(() => {
|
const sortedDataListCriteria = computed(() => {
|
||||||
return dataListCriteria.value.sort((a, b) => a.level - b.level);
|
return dataListCriteria.value.sort((a, b) => a.level - b.level);
|
||||||
|
|
@ -168,7 +164,6 @@ function getData(type: string) {
|
||||||
? (resultAvg / weightAvg) * store.dataEvaluation.capacityPoint
|
? (resultAvg / weightAvg) * store.dataEvaluation.capacityPoint
|
||||||
: 0;
|
: 0;
|
||||||
// resultEvaluation.value = sum.toFixed(2);
|
// resultEvaluation.value = sum.toFixed(2);
|
||||||
competencyScore.value = sum;
|
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -293,25 +293,21 @@ function sendToEvaluatore() {
|
||||||
$q,
|
$q,
|
||||||
() => {
|
() => {
|
||||||
if (id.value) {
|
if (id.value) {
|
||||||
// showLoader();
|
showLoader();
|
||||||
// http
|
http
|
||||||
// .put(config.API.kpiEvaluationCheck + `/${id.value}`, {
|
.put(config.API.kpiSendToStatus(id.value), {
|
||||||
// evaluatorId: evaluatorId.value ? evaluatorId.value.id : null,
|
status: "NEW_EVALUATOR",
|
||||||
// commanderId: commanderId.value ? commanderId.value.id : null,
|
})
|
||||||
// commanderHighId: commanderHighId.value
|
.then((res) => {
|
||||||
// ? commanderHighId.value.id
|
success($q, "ส่งข้อตกลงให้ผู้ประเมินอนุมัติสำเร็จ");
|
||||||
// : null,
|
close();
|
||||||
// })
|
})
|
||||||
// .then((res) => {
|
.catch((e) => {
|
||||||
// success($q, "บันทึกสำเร็จ");
|
messageError($q, e);
|
||||||
// close();
|
})
|
||||||
// })
|
.finally(() => {
|
||||||
// .catch((e) => {
|
hideLoader();
|
||||||
// messageError($q, e);
|
});
|
||||||
// })
|
|
||||||
// .finally(() => {
|
|
||||||
// hideLoader();
|
|
||||||
// });
|
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"ยืนยันการส่งข้อตกลงให้ผู้ประเมินอนุมัติ",
|
"ยืนยันการส่งข้อตกลงให้ผู้ประเมินอนุมัติ",
|
||||||
|
|
@ -350,6 +346,7 @@ function requireEdit() {
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
const indicatorWeightTotal = ref<number>(0);
|
||||||
onMounted(async () => {
|
onMounted(async () => {
|
||||||
showLoader();
|
showLoader();
|
||||||
await getAll();
|
await getAll();
|
||||||
|
|
@ -402,12 +399,23 @@ onMounted(async () => {
|
||||||
}}</span>
|
}}</span>
|
||||||
<q-space />
|
<q-space />
|
||||||
<div class="q-gutter-x-sm">
|
<div class="q-gutter-x-sm">
|
||||||
|
<span
|
||||||
|
v-if="
|
||||||
|
indicatorWeightTotal > 0 && indicatorWeightTotal != 100
|
||||||
|
"
|
||||||
|
class="text-red"
|
||||||
|
>*น้ำหนัก(ร้อยละ) ผลสัมฤทธิ์ของงานไม่ถูกต้อง</span
|
||||||
|
>
|
||||||
<q-btn
|
<q-btn
|
||||||
v-if="
|
v-if="
|
||||||
store.rolePerson == 'USER' &&
|
store.rolePerson == 'USER' &&
|
||||||
store.dataEvaluation.evaluationStatus == 'NEW'
|
store.dataEvaluation.evaluationStatus == 'NEW'
|
||||||
"
|
"
|
||||||
:disabled="store.dataEvaluation.evaluatorId == null"
|
:disabled="
|
||||||
|
store.dataEvaluation.evaluatorId == null ||
|
||||||
|
(indicatorWeightTotal > 0 &&
|
||||||
|
indicatorWeightTotal != 100)
|
||||||
|
"
|
||||||
unelevated
|
unelevated
|
||||||
round
|
round
|
||||||
icon="mdi-send"
|
icon="mdi-send"
|
||||||
|
|
@ -548,6 +556,7 @@ onMounted(async () => {
|
||||||
<TabMain
|
<TabMain
|
||||||
v-model:indicatorScore="indicatorScore"
|
v-model:indicatorScore="indicatorScore"
|
||||||
v-model:competencyScore="competencyScore"
|
v-model:competencyScore="competencyScore"
|
||||||
|
v-model:indicatorWeightTotal="indicatorWeightTotal"
|
||||||
/>
|
/>
|
||||||
</q-card>
|
</q-card>
|
||||||
</div>
|
</div>
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue