This commit is contained in:
Warunee Tamkoo 2024-06-26 22:15:23 +07:00
parent c7cda1c7ba
commit 8b2819d634
6 changed files with 109 additions and 54 deletions

View file

@ -66,8 +66,8 @@ async function fetchEvaluation() {
store.dataEvaluation = await data;
formProfile.status = store.convertStatus(data.evaluationStatus);
formProfile.result = store.convertResults(data.evaluationResults);
await store.checkCompetency();
await store.checkCompetencyDefaultCompetencyLevel();
store.checkCompetency();
store.checkCompetencyDefaultCompetencyLevel();
fetchProfile(data.profileId);
@ -91,6 +91,7 @@ async function getProfile() {
.then(async (res) => {
const data = await res.data.result;
store.dataProfile = await data;
await store.checkStep();
})
.catch((e) => {
messageError($q, e);
@ -251,12 +252,11 @@ function filterOption(val: any, update: Function, refData: string) {
async function getAll() {
await fetchEvaluation();
await getProfile();
await getOrgOp();
await store.checkStep();
getProfile();
getOrgOp();
}
function sendToEvaluatore(status: string) {
function sendToEvaluatore() {
dialogConfirm(
$q,
() => {
@ -264,7 +264,7 @@ function sendToEvaluatore(status: string) {
showLoader();
http
.put(config.API.kpiSendToStatus(id.value), {
status: status,
status: "NEW_EVALUATOR",
})
.then((res) => {
success($q, "ส่งข้อตกลงให้ผู้ประเมินอนุมัติสำเร็จ");
@ -283,6 +283,32 @@ function sendToEvaluatore(status: string) {
);
}
function sendToEvaluateEvaluatore() {
dialogConfirm(
$q,
() => {
if (id.value) {
showLoader();
http
.put(config.API.kpiSendToStatus(id.value), {
status: "EVALUATING_EVALUATOR",
})
.then((res) => {
success($q, "ส่งให้ผู้ประเมินรายงานผลสำเร็จของงานสำเร็จ");
close();
})
.catch((e) => {
messageError($q, e);
})
.finally(() => {
hideLoader();
});
}
},
"ยืนยันการส่งให้ผู้ประเมินรายงานผลสำเร็จของงาน",
"ต้องการยืนยันส่งให้ผู้ประเมินรายงานผลสำเร็จของงานใช่หรือไม่?"
);
}
// function sendToSummary(status: string) {
// dialogConfirm(
// $q,
@ -347,7 +373,7 @@ function sendToEvauator() {
showLoader();
http
.post(config.API.sendToCommander, {
evaluationStatus: "EVALUATING",
status: "EVALUATING",
id: [store.dataEvaluation.id],
})
.then(async (res) => {
@ -454,7 +480,9 @@ onMounted(async () => {
>
<div class="row col-12 items-center justify-center">
<span class="text-h6 text-weight-medium text-primary">{{
`${store.dataEvaluation.prefix}${store.dataEvaluation.firstName} ${store.dataEvaluation.lastName}`
store.dataEvaluation.firstName
? `${store.dataEvaluation.prefix}${store.dataEvaluation.firstName} ${store.dataEvaluation.lastName}`
: ""
}}</span>
<q-space v-if="$q.screen.gt.xs" />
@ -495,12 +523,13 @@ onMounted(async () => {
color="grey-2"
text-color="blue-6"
size="md"
@click="sendToEvaluatore('NEW_EVALUATOR')"
@click="sendToEvaluatore()"
>
<q-tooltip>งใหประเมนอน</q-tooltip>
</q-btn>
<q-btn
v-if="
store.rolePerson == 'USER' &&
store.tabMain == '2' &&
store.dataEvaluation.evaluationStatus == 'APPROVE'
"
@ -526,7 +555,7 @@ onMounted(async () => {
color="grey-2"
text-color="blue-6"
size="md"
@click="sendToEvaluatore('EVALUATING_EVALUATOR')"
@click="sendToEvaluateEvaluatore()"
>
<q-tooltip
>งใหประเมนรายงานผลสำเรจของงาน</q-tooltip
@ -577,8 +606,10 @@ onMounted(async () => {
'EVALUATING_EVALUATOR'
"
:disabled="
store.dataEvaluation.evaluatorId == null ||
store.dataEvaluation.summaryPoint <= 0
store.indicatorScoreVal +
store.competencyScoreVal +
store.devScoreVal <=
0
"
unelevated
round
@ -592,6 +623,7 @@ onMounted(async () => {
</q-btn>
<q-btn
v-if="store.rolePerson == 'USER'"
unelevated
round
icon="mdi-account"

View file

@ -273,10 +273,10 @@ function getProfile() {
http
.get(config.API.profilePosition())
.then(async (res) => {
const data = res.data.result;
const data = await res.data.result;
store.dataProfile = data;
await store.checkCompetency();
await store.checkCompetencyDefaultCompetencyLevel();
store.checkCompetency();
store.checkCompetencyDefaultCompetencyLevel();
formRound.profileId = data.profileId;
formRound.prefix = data.prefix;