Merge branch 'develop' into devTee

This commit is contained in:
STW_TTTY\stwtt 2024-04-29 18:05:34 +07:00
commit 681367b790
3 changed files with 33 additions and 11 deletions

View file

@ -14,9 +14,9 @@ import Competency from "@/modules/08_KPI/components/Tab/Topic/02_Competency.vue"
import { useCounterMixin } from "@/stores/mixin";
import { useKpiDataStore } from "@/modules/08_KPI/store";
import type { ListCriteria } from "@/modules/08_KPI/interface/request/index";
const score = defineModel("score", { type: Number, default: 0 });
const dataListCriteria = ref<ListCriteria[]>([]);
const modalCriteria = ref<boolean>(false);
@ -58,7 +58,8 @@ function fetchListPlanned() {
0
);
totalResults1.value = (result * 60) / weight;
totalResults1.value =
(result * store.dataEvaluation.plannedPoint) / weight;
}
})
.catch((err) => {
@ -91,7 +92,8 @@ function fetchListRole() {
0
);
totalResults2.value = (result * 60) / weight;
totalResults2.value =
(result * store.dataEvaluation.rolePoint) / weight;
}
})
.catch((err) => {
@ -125,7 +127,8 @@ function fetchAssigned() {
0
);
totalResults3.value = (result * 20) / weight;
totalResults3.value =
(result * store.dataEvaluation.specialPoint) / weight;
}
})
.catch((err) => {
@ -160,7 +163,7 @@ function getCriteria() {
}
onMounted(() => {
getCriteria()
getCriteria();
fetchListPlanned();
fetchListRole();
fetchAssigned();
@ -207,7 +210,15 @@ onMounted(() => {
</div> -->
<div class="col-12 text-center row justify-center">
<span>สรปผลการประเมนผลสมฤทธของงาน (คะแนนเต 80 คะแนน)</span>
<span
>สรปผลการประเมนผลสมฤทธของงาน (คะแนนเต
{{
store.dataEvaluation.plannedPoint +
store.dataEvaluation.rolePoint +
store.dataEvaluation.specialPoint
}}
คะแนน)</span
>
<div class="text-primary q-pl-md">{{ resultWork }}</div>
</div>
</div>
@ -230,11 +241,14 @@ onMounted(() => {
</q-btn>
</div>
<Competency v-model:dataListCriteria="dataListCriteria"/>
<Competency v-model:dataListCriteria="dataListCriteria" />
</div>
</q-scroll-area>
<DialogListCriteria v-model:modal="modalCriteria" v-model:dataListCriteria="dataListCriteria"/>
<DialogListCriteria
v-model:modal="modalCriteria"
v-model:dataListCriteria="dataListCriteria"
/>
</template>
<style scoped>

View file

@ -12,6 +12,7 @@ import File from "@/modules/08_KPI/components/Tab/05_File.vue";
const store = useKpiDataStore();
const route = useRoute();
const isReadonly = <boolean>(route.name === "KPIEditEvaluator" ? true : false);
const score = defineModel("score", { type: Number, default: 0 });
const itemsTab = ref<any>([
{
@ -38,6 +39,7 @@ const itemsTab = ref<any>([
const splitterModel = ref<number>(12);
</script>
<template>
<q-splitter v-model="splitterModel" disable>
<template v-slot:before>
@ -82,7 +84,7 @@ const splitterModel = ref<number>(12);
:name="tab.name"
class="q-pa-none"
>
<Assessment v-if="store.tabMain === '1'" />
<Assessment v-if="store.tabMain === '1'" v-model:score="score" />
<Evaluator v-if="store.tabMain === '2'" :type="'evaluator'" />
<Evaluator v-if="store.tabMain === '3'" :type="'commander'" />
<Evaluator v-if="store.tabMain === '4'" :type="'commanderHigh'" />

View file

@ -153,7 +153,10 @@ function getData(type: string) {
if (total > 0) {
let weightAvg = weight / total;
let resultAvg = result / total;
let sum = weightAvg != 0 ? (resultAvg / weightAvg) * 20 : 0;
let sum =
weightAvg != 0
? (resultAvg / weightAvg) * store.dataEvaluation.capacityPoint
: 0;
resultEvaluation.value = sum.toFixed(2);
}
// end cal summary
@ -344,7 +347,10 @@ onMounted(() => {
/>
<div class="row text-body2 text-weight-bold justify-center">
<span>สรปผลการประเมนสมรรถนะ (คะแนนเต 20 คะแนน)</span>
<span
>สรปผลการประเมนสมรรถนะ (คะแนนเต
{{ store.dataEvaluation.capacityPoint }} คะแนน)</span
>
<div class="text-primary q-pl-md">{{ resultEvaluation }}</div>
</div>
</template>