updated คะแนนประเมินระบบ kpi

This commit is contained in:
Warunee Tamkoo 2024-05-02 14:44:22 +07:00
parent 1cbaecce8e
commit 1ae9e85af9
3 changed files with 29 additions and 4 deletions

View file

@ -142,8 +142,11 @@ function fetchAssigned() {
function onInfo() {
modalCriteria.value = true;
}
const totalCompetency = ref<number>(0);
const resultWork = computed(() => {
const total = totalResults1.value + totalResults2.value + totalResults3.value;
score.value = total;
return total.toFixed(2);
});
@ -162,6 +165,19 @@ function getCriteria() {
});
}
watch(
() => totalCompetency.value,
(newValue, oldValue) => {
if (newValue !== oldValue) {
score.value =
totalResults1.value +
totalResults2.value +
totalResults3.value +
newValue;
}
}
);
watch(
() => store.dataEvaluation.plannedPoint,
(newValue, oldValue) => {
@ -203,7 +219,7 @@ onMounted(() => {
class="bg-white row col-12 text-dark q-pa-md"
>
<div class="text-weight-bold text-body2">
<span class="txt-under text-blue-6">องคประกอบท 1</span>
<span class="txt-under text-blue-6">องคประกอบท 1 </span>
<span class="q-ml-sm"> ผลสมฤทธของงาน</span>
</div>
@ -268,7 +284,10 @@ onMounted(() => {
</q-btn>
</div>
<Competency v-model:dataListCriteria="dataListCriteria" />
<Competency
v-model:dataListCriteria="dataListCriteria"
v-model:total-competency="totalCompetency"
/>
</div>
</q-scroll-area>

View file

@ -18,6 +18,10 @@ import type {
const dataListCriteria = defineModel<ListCriteria[]>("dataListCriteria", {
required: true,
});
const totalCompetency = defineModel("totalCompetency", {
type: Number,
default: 0,
});
const sortedDataListCriteria = computed(() => {
return dataListCriteria.value.sort((a, b) => a.level - b.level);
@ -159,6 +163,7 @@ function getData(type: string) {
? (resultAvg / weightAvg) * store.dataEvaluation.capacityPoint
: 0;
resultEvaluation.value = sum.toFixed(2);
totalCompetency.value = sum;
}
// end cal summary

View file

@ -49,6 +49,7 @@ const commanderHighMainOp = ref<DataOptions[]>([]);
const evaluatorId = ref<any>(null);
const commanderId = ref<any>(null);
const commanderHighId = ref<any>(null);
const score = ref<number>(0);
const formProfile = reactive<FormProfile>({
fullName: "",
@ -440,7 +441,7 @@ onMounted(() => {
<div class="column">
<span class="text-grey-6">คะแนนประเม</span>
<span class="text-weight-medium text-primary">{{
formProfile.score
score.toFixed(2)
}}</span>
</div>
</div>
@ -451,7 +452,7 @@ onMounted(() => {
</q-card>
<q-card class="q-mt-md rounded">
<TabMain />
<TabMain v-model:score="score" />
</q-card>
</div>
</div>