fix bug kpi

This commit is contained in:
Warunee Tamkoo 2024-05-15 18:23:55 +07:00
parent 63611d0811
commit 1fa38897cf
7 changed files with 82 additions and 69 deletions

View file

@ -13,21 +13,12 @@ import DialogHeader from "@/components/DialogHeader.vue";
import type { FormProfile } from "@/modules/08_KPI/interface/request/index";
import type { DataOptions } from "@/modules/08_KPI/interface/index/Main";
const scoreTotal = ref<boolean>(false);
const modalScore = ref<boolean>(false);
// const modalScore = ref<boolean>(false);
const modalEdit = ref<boolean>(false);
const route = useRoute();
const id = ref<string>(route.params.id as string);
const isReadonly = <boolean>(route.name === "KPIEditEvaluator" ? true : false);
const totalScore = computed(
() =>
Number(plannedPoint.value) +
Number(rolePoint.value) +
Number(specialPoint.value) +
Number(capacityPoint.value)
);
const plannedPoint = ref<string>("");
const rolePoint = ref<string>("");
const specialPoint = ref<string>("");
@ -49,8 +40,6 @@ const commanderHighMainOp = ref<DataOptions[]>([]);
const evaluatorId = ref<any>(null);
const commanderId = ref<any>(null);
const commanderHighId = ref<any>(null);
const indicatorScore = ref<number>(0);
const competencyScore = ref<number>(0);
const formProfile = reactive<FormProfile>({
fullName: "",
@ -114,7 +103,7 @@ async function fetchProfile(id: string) {
config.API.fileByFile("ทะเบียนประวัติ", "โปรไฟล์", id, `profile-${id}`)
)
.then(async (res) => {
store.dataProfile.avartar = res.data.downloadUrl;
store.dataEvaluation.avartar = res.data.downloadUrl;
})
.catch(() => {
// profilePicture.value = avatar;
@ -226,30 +215,6 @@ function filterOption(val: any, update: Function, refData: string) {
}
}
watch(
[plannedPoint, rolePoint, specialPoint, capacityPoint],
(
[newPlannedPoint, newRolePoint, newSpecialPoint, newCapacityPoint],
[oldPlannedPoint, oldRolePoint, oldSpecialPoint, oldCapacityPoint]
) => {
if (
newPlannedPoint !== "" &&
newRolePoint !== "" &&
newSpecialPoint !== "" &&
newCapacityPoint !== ""
) {
if (totalScore.value == 100) {
scoreTotal.value = false;
} else {
scoreTotal.value = true;
}
}
// else {
// console.log(2);
// }
}
);
// function onSubmitScore() {
// showLoader();
// http
@ -382,7 +347,7 @@ onMounted(async () => {
style="left: 2%; top: 50%; transform: translateY(-50%)"
>
<q-avatar size="95px">
<q-img :src="store.dataProfile.avartar" />
<q-img :src="store.dataEvaluation.avartar" />
</q-avatar>
</div>
<div class="row col-12">
@ -390,7 +355,7 @@ onMounted(async () => {
<div class="col-12" style="padding-left: 12%">
<div class="row col-12 items-center">
<span class="text-h6 text-weight-medium text-primary">{{
`${store.dataProfile.prefix}${store.dataProfile.firstName} ${store.dataProfile.lastName}`
`${store.dataEvaluation.prefix}${store.dataEvaluation.firstName} ${store.dataEvaluation.lastName}`
}}</span>
<q-space />
<div class="q-gutter-x-sm">
@ -528,7 +493,7 @@ onMounted(async () => {
<div class="column">
<span class="text-grey-6">ตำแหนงในสายงาน</span>
<span class="text-weight-medium text-dark">{{
store.dataProfile.position
store.dataEvaluation.position
}}</span>
</div>
</div>
@ -536,7 +501,7 @@ onMounted(async () => {
<div class="column">
<span class="text-grey-6">ประเภทตำแหน</span>
<span class="text-weight-medium text-dark">{{
store.dataProfile.posTypeName
store.dataEvaluation.posTypeName
}}</span>
</div>
</div>
@ -544,7 +509,7 @@ onMounted(async () => {
<div class="column">
<span class="text-grey-6">ระดบตำแหน</span>
<span class="text-weight-medium text-dark">{{
store.dataProfile.posLevelName
store.dataEvaluation.posLevelName
}}</span>
</div>
</div>