fixing bug
This commit is contained in:
parent
080ef0b4e8
commit
700dcaee4a
6 changed files with 143 additions and 160 deletions
|
|
@ -185,22 +185,6 @@ watch(
|
|||
|
||||
store.indicatorScoreVal =
|
||||
store.indicatorPercentVal * (store.indicatorScore / 100);
|
||||
|
||||
if (store.isUpdate && store.tabMain === "3") {
|
||||
http
|
||||
.put(config.API.updatePoint(evaluationId.value), {
|
||||
totalPoint1: (
|
||||
store.indicatorPercentVal *
|
||||
(store.indicatorScore / 100)
|
||||
).toFixed(2),
|
||||
summaryPoint: (
|
||||
store.indicatorScoreVal +
|
||||
store.competencyScoreVal +
|
||||
store.devScoreVal
|
||||
).toFixed(2),
|
||||
})
|
||||
.then((res) => {});
|
||||
}
|
||||
}
|
||||
}
|
||||
);
|
||||
|
|
|
|||
|
|
@ -19,6 +19,7 @@ import type {
|
|||
import DialogListCriteria from "@/modules/08_KPI/components/Tab/Dialog/DialogListCriteria.vue";
|
||||
import DialogCompetncyByRow from "@/modules/08_KPI/components/Tab/Dialog/DialogCompetncyByRow.vue";
|
||||
import DialogLevel from "@/modules/08_KPI/components/Tab/Dialog/DialogLevel.vue";
|
||||
import type { DataOptions } from "@/modules/08_KPI/interface/index/Main";
|
||||
|
||||
const modalLevel = ref<boolean>(false);
|
||||
const modalCompetncyByRow = ref<boolean>(false);
|
||||
|
|
@ -146,8 +147,8 @@ function getData(type: string) {
|
|||
let result = 0;
|
||||
let weight = 0;
|
||||
let total = 0;
|
||||
for (let index = 0; index < store.competencyType.length; index++) {
|
||||
const element = await store.competencyType[index];
|
||||
for (let index = 0; index < competencyType.value.length; index++) {
|
||||
const element = await competencyType.value[index];
|
||||
|
||||
const dataArr = await lists.value.find(
|
||||
(x: any) => x.type == element.id
|
||||
|
|
@ -184,24 +185,6 @@ function getData(type: string) {
|
|||
? (resultAvg / weightAvg) * store.competencyScore
|
||||
: 0;
|
||||
}
|
||||
|
||||
if (
|
||||
store.isUpdate &&
|
||||
store.tabMain === "3" &&
|
||||
(store.dataEvaluation.evaluationStatus === "EVALUATOR" ||
|
||||
store.dataEvaluation.evaluationStatus === "EVALUATING_EVALUATOR")
|
||||
) {
|
||||
http
|
||||
.put(config.API.updatePoint(store.dataEvaluation.id), {
|
||||
totalPoint2_1: store.competencyScoreVal.toFixed(2),
|
||||
summaryPoint: (
|
||||
store.indicatorScoreVal +
|
||||
store.competencyScoreVal +
|
||||
store.devScoreVal
|
||||
).toFixed(2),
|
||||
})
|
||||
.then((res) => {});
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
|
|
@ -273,18 +256,6 @@ const isEditStep3 = computed(() => {
|
|||
);
|
||||
});
|
||||
|
||||
watch(
|
||||
() => store.dataEvaluation.capacityPoint,
|
||||
(newValue, oldValue) => {
|
||||
if (newValue !== oldValue) {
|
||||
for (let index = 0; index < store.competencyType.length; index++) {
|
||||
const element = store.competencyType[index];
|
||||
getData(element.id);
|
||||
}
|
||||
}
|
||||
}
|
||||
);
|
||||
|
||||
function onInfo() {
|
||||
modalCriteria.value = true;
|
||||
}
|
||||
|
|
@ -299,16 +270,32 @@ function onLevel(num: number, list: any) {
|
|||
modalLevel.value = true;
|
||||
}
|
||||
|
||||
onMounted(() => {
|
||||
for (let index = 0; index < store.competencyType.length; index++) {
|
||||
const element = store.competencyType[index];
|
||||
getData(element.id);
|
||||
}
|
||||
const competencyType = ref<DataOptions[]>([]);
|
||||
onMounted(async () => {
|
||||
setTimeout(async () => {
|
||||
competencyType.value = await (store.dataEvaluation.posTypeName ==
|
||||
"อำนวยการ" || store.dataEvaluation.posTypeName == "บริหาร"
|
||||
? store.competencyType.filter(
|
||||
(x: DataOptions) =>
|
||||
x.id == "HEAD" ||
|
||||
x.id == "EXECUTIVE" ||
|
||||
x.id == "INSPECTOR" ||
|
||||
x.id == "DIRECTOR"
|
||||
)
|
||||
: store.competencyType.filter(
|
||||
(x: DataOptions) => x.id == "HEAD" || x.id == "GROUP"
|
||||
));
|
||||
|
||||
for (let index = 0; index < competencyType.value.length; index++) {
|
||||
const element = competencyType.value[index];
|
||||
getData(element.id);
|
||||
}
|
||||
}, 1000);
|
||||
});
|
||||
</script>
|
||||
|
||||
<template>
|
||||
<div v-for="(item, index) in store.competencyType" :key="index">
|
||||
<div v-for="(item, index) in competencyType" :key="index">
|
||||
<q-card bordered style="border-radius: 5px" class="no-shadow q-mt-sm">
|
||||
<q-card-section class="bg-grey-2 q-py-sm">
|
||||
<div class="row items-center">
|
||||
|
|
|
|||
|
|
@ -126,24 +126,6 @@ function getDevelop() {
|
|||
(sum: number, e: any) => sum + e.summary,
|
||||
0
|
||||
);
|
||||
|
||||
if (
|
||||
store.isUpdate &&
|
||||
store.tabMain === "3" &&
|
||||
(store.dataEvaluation.evaluationStatus === "EVALUATOR" ||
|
||||
store.dataEvaluation.evaluationStatus === "EVALUATING_EVALUATOR")
|
||||
) {
|
||||
http
|
||||
.put(config.API.updatePoint(store.dataEvaluation.id), {
|
||||
totalPoint2_2: store.devScoreVal.toFixed(2),
|
||||
summaryPoint: (
|
||||
store.indicatorScoreVal +
|
||||
store.competencyScoreVal +
|
||||
store.devScoreVal
|
||||
).toFixed(2),
|
||||
})
|
||||
.then((res) => {});
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue