fixing bug
This commit is contained in:
parent
080ef0b4e8
commit
700dcaee4a
6 changed files with 143 additions and 160 deletions
|
|
@ -157,39 +157,41 @@ export const useKpiDataStore = defineStore("KPIDate", () => {
|
|||
}
|
||||
}
|
||||
|
||||
async function checkCompetency() {
|
||||
// const position = await dataEvaluation.value.position;
|
||||
// const executiveName = await dataEvaluation.value.posExecutiveName;
|
||||
const posTypeName = dataEvaluation.value.posTypeName;
|
||||
const posLevelName = dataEvaluation.value.posLevelName;
|
||||
// async function checkCompetency() {
|
||||
// // const position = await dataEvaluation.value.position;
|
||||
// // const executiveName = await dataEvaluation.value.posExecutiveName;
|
||||
// const posTypeName = await dataEvaluation.value.posTypeName;
|
||||
// const posLevelName = dataEvaluation.value.posLevelName;
|
||||
|
||||
// if (
|
||||
// position == "ผู้ตรวจราชการกรุงเทพมหานคร" ||
|
||||
// position == "ผู้ตรวจราชการ"
|
||||
// ) {
|
||||
// competencyType.value = competencyType.value.filter(
|
||||
// (x: DataOptions) => x.id == "HEAD" || x.id == "INSPECTOR"
|
||||
// );
|
||||
// } else if (position == "ผู้อำนวยการเขต") {
|
||||
// competencyType.value = competencyType.value.filter(
|
||||
// (x: DataOptions) => x.id == "HEAD" || x.id == "DIRECTOR"
|
||||
// );
|
||||
// } else {
|
||||
if (posTypeName == "อำนวยการ" || posTypeName == "บริหาร") {
|
||||
competencyType.value = competencyType.value.filter(
|
||||
(x: DataOptions) =>
|
||||
x.id == "HEAD" ||
|
||||
x.id == "EXECUTIVE" ||
|
||||
x.id == "INSPECTOR" ||
|
||||
x.id == "DIRECTOR"
|
||||
);
|
||||
} else {
|
||||
competencyType.value = competencyType.value.filter(
|
||||
(x: DataOptions) => x.id == "HEAD" || x.id == "GROUP"
|
||||
);
|
||||
}
|
||||
// }
|
||||
}
|
||||
// console.log("posTypeName===>", posTypeName);
|
||||
|
||||
// // if (
|
||||
// // position == "ผู้ตรวจราชการกรุงเทพมหานคร" ||
|
||||
// // position == "ผู้ตรวจราชการ"
|
||||
// // ) {
|
||||
// // competencyType.value = competencyType.value.filter(
|
||||
// // (x: DataOptions) => x.id == "HEAD" || x.id == "INSPECTOR"
|
||||
// // );
|
||||
// // } else if (position == "ผู้อำนวยการเขต") {
|
||||
// // competencyType.value = competencyType.value.filter(
|
||||
// // (x: DataOptions) => x.id == "HEAD" || x.id == "DIRECTOR"
|
||||
// // );
|
||||
// // } else {
|
||||
// if (posTypeName == "อำนวยการ" || posTypeName == "บริหาร") {
|
||||
// competencyType.value = await competencyType.value.filter(
|
||||
// (x: DataOptions) =>
|
||||
// x.id == "HEAD" ||
|
||||
// x.id == "EXECUTIVE" ||
|
||||
// x.id == "INSPECTOR" ||
|
||||
// x.id == "DIRECTOR"
|
||||
// );
|
||||
// } else {
|
||||
// competencyType.value = await competencyType.value.filter(
|
||||
// (x: DataOptions) => x.id == "HEAD" || x.id == "GROUP"
|
||||
// );
|
||||
// }
|
||||
// // }
|
||||
// }
|
||||
|
||||
const defaultCompetencyCoreLevel = ref<number>();
|
||||
const defaultCompetencyGroupLevel = ref<number | null>(null);
|
||||
|
|
@ -356,46 +358,46 @@ export const useKpiDataStore = defineStore("KPIDate", () => {
|
|||
const indicatorScoreVal = ref<number>(0); // สรุปผลการประเมินผลสัมฤทธิ์ของงานที่ได้
|
||||
const competencyScoreVal = ref<number>(0); // ผลการประเมินสมรรถนะที่ได้กี่คะแนน
|
||||
|
||||
function getDataWork() {
|
||||
showLoader();
|
||||
http
|
||||
.get(config.API.orgPosition + `/${dataProfile.value.profileId}`)
|
||||
.then((res) => {
|
||||
const data = res.data.result.isProbation;
|
||||
work.value = data;
|
||||
if (data) {
|
||||
indicatorScore.value = 50;
|
||||
competencyScore.value = 40;
|
||||
excusiveCompetencyScore.value = 40;
|
||||
competencyDevScore.value = 10;
|
||||
} else {
|
||||
indicatorScore.value = 70;
|
||||
competencyScore.value = 20;
|
||||
excusiveCompetencyScore.value = 20;
|
||||
competencyDevScore.value = 30;
|
||||
}
|
||||
})
|
||||
.catch((e) => {
|
||||
messageError($q, e);
|
||||
})
|
||||
.finally(() => {
|
||||
hideLoader();
|
||||
});
|
||||
}
|
||||
// function getDataWork() {
|
||||
// showLoader();
|
||||
// http
|
||||
// .get(config.API.orgPosition + `/${dataProfile.value.profileId}`)
|
||||
// .then((res) => {
|
||||
// const data = res.data.result.isProbation;
|
||||
// work.value = data;
|
||||
// if (data) {
|
||||
// indicatorScore.value = 50;
|
||||
// competencyScore.value = 40;
|
||||
// excusiveCompetencyScore.value = 40;
|
||||
// competencyDevScore.value = 10;
|
||||
// } else {
|
||||
// indicatorScore.value = 70;
|
||||
// competencyScore.value = 20;
|
||||
// excusiveCompetencyScore.value = 20;
|
||||
// competencyDevScore.value = 30;
|
||||
// }
|
||||
// })
|
||||
// .catch((e) => {
|
||||
// messageError($q, e);
|
||||
// })
|
||||
// .finally(() => {
|
||||
// hideLoader();
|
||||
// });
|
||||
// }
|
||||
|
||||
watch(
|
||||
() => tabMain.value,
|
||||
() => {
|
||||
if (tabMain.value == "3" && tabOpen.value == 3) {
|
||||
getDataWork();
|
||||
} else {
|
||||
indicatorScore.value = 70;
|
||||
competencyScore.value = 20;
|
||||
excusiveCompetencyScore.value = 20;
|
||||
competencyDevScore.value = 30;
|
||||
}
|
||||
}
|
||||
);
|
||||
// watch(
|
||||
// () => tabMain.value,
|
||||
// () => {
|
||||
// if (tabMain.value == "3" && tabOpen.value == 3) {
|
||||
// getDataWork();
|
||||
// } else {
|
||||
// indicatorScore.value = 70;
|
||||
// competencyScore.value = 20;
|
||||
// excusiveCompetencyScore.value = 20;
|
||||
// competencyDevScore.value = 30;
|
||||
// }
|
||||
// }
|
||||
// );
|
||||
|
||||
return {
|
||||
tabMain,
|
||||
|
|
@ -405,7 +407,7 @@ export const useKpiDataStore = defineStore("KPIDate", () => {
|
|||
convertCompetencyType,
|
||||
convertStatus,
|
||||
convertResults,
|
||||
checkCompetency,
|
||||
// checkCompetency,
|
||||
checkCompetencyDefaultCompetencyLevel,
|
||||
defaultCompetencyCoreLevel,
|
||||
defaultCompetencyGroupLevel,
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue