updated kpi & check token
This commit is contained in:
parent
4d8acb49a3
commit
c7d672aeda
8 changed files with 110 additions and 35 deletions
|
|
@ -138,27 +138,29 @@ const fetchlistInbox = async (index: number) => {
|
||||||
let data = res.data.result.data;
|
let data = res.data.result.data;
|
||||||
totalInbox.value = res.data.result.total;
|
totalInbox.value = res.data.result.total;
|
||||||
let listItem: any = [];
|
let listItem: any = [];
|
||||||
data.map((e: any) => {
|
if (data && data.length > 0) {
|
||||||
listItem.push({
|
data.map((e: any) => {
|
||||||
no: e.id ?? "",
|
listItem.push({
|
||||||
sender:
|
no: e.id ?? "",
|
||||||
e.createdFullName == "" || e.createdFullName == null
|
sender:
|
||||||
? "เจ้าหน้าที่"
|
e.createdFullName == "" || e.createdFullName == null
|
||||||
: e.createdFullName,
|
? "เจ้าหน้าที่"
|
||||||
subject: e.subject ?? "",
|
: e.createdFullName,
|
||||||
timereceive: date2Thai(e.createdAt),
|
subject: e.subject ?? "",
|
||||||
body: e.body ?? "-",
|
timereceive: date2Thai(e.createdAt),
|
||||||
ratingModel: 0,
|
body: e.body ?? "-",
|
||||||
receiveDate: e.receiveDate,
|
ratingModel: 0,
|
||||||
payload: e.payload,
|
receiveDate: e.receiveDate,
|
||||||
isOpen: e.isOpen,
|
payload: e.payload,
|
||||||
|
isOpen: e.isOpen,
|
||||||
|
});
|
||||||
});
|
});
|
||||||
});
|
inboxList.value.push(...listItem);
|
||||||
inboxList.value.push(...listItem);
|
}
|
||||||
})
|
|
||||||
.catch((err) => {
|
|
||||||
console.log(err);
|
|
||||||
})
|
})
|
||||||
|
// .catch((err) => {
|
||||||
|
// console.log(err);
|
||||||
|
// })
|
||||||
.finally(() => {
|
.finally(() => {
|
||||||
hideLoader();
|
hideLoader();
|
||||||
}));
|
}));
|
||||||
|
|
|
||||||
|
|
@ -184,7 +184,11 @@ watch(
|
||||||
Number(resultAssigned.value);
|
Number(resultAssigned.value);
|
||||||
|
|
||||||
store.indicatorScoreVal =
|
store.indicatorScoreVal =
|
||||||
store.indicatorPercentVal * (store.indicatorScore / 100);
|
store.indicatorPercentVal *
|
||||||
|
((store.dataProfile.isProbation
|
||||||
|
? store.indicatorProbationScore
|
||||||
|
: store.indicatorScore) /
|
||||||
|
100);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
);
|
);
|
||||||
|
|
@ -385,7 +389,11 @@ onMounted(() => {
|
||||||
<div class="col-12 text-center row justify-center">
|
<div class="col-12 text-center row justify-center">
|
||||||
<span
|
<span
|
||||||
>สรุปผลการประเมินผลสัมฤทธิ์ของงาน (คะแนนเต็ม
|
>สรุปผลการประเมินผลสัมฤทธิ์ของงาน (คะแนนเต็ม
|
||||||
{{ store.indicatorScore }}
|
{{
|
||||||
|
store.dataProfile.isProbation
|
||||||
|
? store.indicatorProbationScore
|
||||||
|
: store.indicatorScore
|
||||||
|
}}
|
||||||
คะแนน)</span
|
คะแนน)</span
|
||||||
>
|
>
|
||||||
<div class="text-primary q-pl-md">
|
<div class="text-primary q-pl-md">
|
||||||
|
|
@ -416,7 +424,9 @@ onMounted(() => {
|
||||||
name: `สรุปผลการประเมินสมรรถนะ (คะแนนเต็ม ${
|
name: `สรุปผลการประเมินสมรรถนะ (คะแนนเต็ม ${
|
||||||
store.dataEvaluation.posTypeName != 'อำนวยการ' &&
|
store.dataEvaluation.posTypeName != 'อำนวยการ' &&
|
||||||
store.dataEvaluation.posTypeName != 'บริหาร'
|
store.dataEvaluation.posTypeName != 'บริหาร'
|
||||||
? store.competencyScore
|
? store.dataProfile.isProbation
|
||||||
|
? store.competencyProbationScore
|
||||||
|
: store.competencyScore
|
||||||
: store.excusiveCompetencyScore
|
: store.excusiveCompetencyScore
|
||||||
} คะแนน)`,
|
} คะแนน)`,
|
||||||
value: store.competencyScoreVal.toFixed(2),
|
value: store.competencyScoreVal.toFixed(2),
|
||||||
|
|
@ -457,7 +467,11 @@ onMounted(() => {
|
||||||
bordered
|
bordered
|
||||||
:rows="[
|
:rows="[
|
||||||
{
|
{
|
||||||
name: `ผลการประเมินการพัฒนาตนเอง (คะแนนเต็ม ${store.devScore} คะแนน)`,
|
name: `ผลการประเมินการพัฒนาตนเอง (คะแนนเต็ม ${
|
||||||
|
store.dataProfile.isProbation
|
||||||
|
? store.devProbationScore
|
||||||
|
: store.devScore
|
||||||
|
} คะแนน)`,
|
||||||
value: store.devScoreVal.toFixed(2),
|
value: store.devScoreVal.toFixed(2),
|
||||||
},
|
},
|
||||||
]"
|
]"
|
||||||
|
|
@ -492,10 +506,16 @@ onMounted(() => {
|
||||||
class="row text-body2 text-weight-bold"
|
class="row text-body2 text-weight-bold"
|
||||||
>
|
>
|
||||||
<div class="col-12 text-center row justify-center">
|
<div class="col-12 text-center row justify-center">
|
||||||
<span
|
<span>
|
||||||
>สรุปผลการประเมินพฤติกรรมการปฏิบัติราชการ (สมรรถนะ+การพัฒนาตนเอง)
|
สรุปผลการประเมินพฤติกรรมการปฏิบัติราชการ (สมรรถนะ+การพัฒนาตนเอง)
|
||||||
(คะแนนเต็ม {{ store.competencyDevScore }} คะแนน)</span
|
(คะแนนเต็ม
|
||||||
>
|
{{
|
||||||
|
store.dataProfile.isProbation
|
||||||
|
? store.competencyDevProbationScore
|
||||||
|
: store.competencyDevScore
|
||||||
|
}}
|
||||||
|
คะแนน)
|
||||||
|
</span>
|
||||||
<div class="text-primary q-pl-md">
|
<div class="text-primary q-pl-md">
|
||||||
{{ (store.competencyScoreVal + store.devScoreVal).toFixed(2) }}
|
{{ (store.competencyScoreVal + store.devScoreVal).toFixed(2) }}
|
||||||
</div>
|
</div>
|
||||||
|
|
|
||||||
|
|
@ -353,14 +353,14 @@ function filterOptionFn(val: string, update: Function) {
|
||||||
</script>
|
</script>
|
||||||
<template>
|
<template>
|
||||||
<q-dialog persistent v-model="modal">
|
<q-dialog persistent v-model="modal">
|
||||||
<q-card style="min-width: 90vw">
|
<q-card style="min-width: 80vw">
|
||||||
<q-form greedy @submit.prevent @validation-success="onSubmit">
|
<q-form greedy @submit.prevent @validation-success="onSubmit">
|
||||||
<DialogHeader
|
<DialogHeader
|
||||||
:tittle="`${id ? 'แก้ไข' : 'เพิ่ม'}การพัฒนาตนเอง`"
|
:tittle="`${id ? 'แก้ไข' : 'เพิ่ม'}การพัฒนาตนเอง`"
|
||||||
:close="close"
|
:close="close"
|
||||||
/>
|
/>
|
||||||
<q-separator />
|
<q-separator />
|
||||||
<q-card-section>
|
<q-card-section style="max-height: 70vh" class="scroll">
|
||||||
<div class="row q-col-gutter-sm">
|
<div class="row q-col-gutter-sm">
|
||||||
<div class="col-3">
|
<div class="col-3">
|
||||||
<q-select
|
<q-select
|
||||||
|
|
@ -636,6 +636,7 @@ function filterOptionFn(val: string, update: Function) {
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</q-card-section>
|
</q-card-section>
|
||||||
|
|
||||||
<q-separator />
|
<q-separator />
|
||||||
|
|
||||||
<q-card-actions align="right" class="bg-white text-teal">
|
<q-card-actions align="right" class="bg-white text-teal">
|
||||||
|
|
|
||||||
|
|
@ -182,7 +182,10 @@ function getData(type: string) {
|
||||||
} else {
|
} else {
|
||||||
store.competencyScoreVal =
|
store.competencyScoreVal =
|
||||||
weightAvg != 0
|
weightAvg != 0
|
||||||
? (resultAvg / weightAvg) * store.competencyScore
|
? (resultAvg / weightAvg) *
|
||||||
|
(store.dataProfile.isProbation
|
||||||
|
? store.competencyProbationScore
|
||||||
|
: store.competencyScore)
|
||||||
: 0;
|
: 0;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -364,6 +364,11 @@ export const useKpiDataStore = defineStore("KPIDate", () => {
|
||||||
const indicatorScoreVal = ref<number>(0); // สรุปผลการประเมินผลสัมฤทธิ์ของงานที่ได้
|
const indicatorScoreVal = ref<number>(0); // สรุปผลการประเมินผลสัมฤทธิ์ของงานที่ได้
|
||||||
const competencyScoreVal = ref<number>(0); // ผลการประเมินสมรรถนะที่ได้กี่คะแนน
|
const competencyScoreVal = ref<number>(0); // ผลการประเมินสมรรถนะที่ได้กี่คะแนน
|
||||||
|
|
||||||
|
const indicatorProbationScore = ref<number>(50); // สรุปผลการประเมินผลสัมฤทธิ์ของงาน ( คะแนนเต็ม indicatorScore คะแนน)
|
||||||
|
const competencyProbationScore = ref<number>(40); // ผลการประเมินสมรรถนะ (competencyScore คะแนน)
|
||||||
|
const devProbationScore = ref<number>(10); // สรุปผลการประเมินพฤติกรรมการปฏิบัติราชการ (สมรรถนะ+การพัฒนาตนเอง) (คะแนนเต็ม competencyDevScore คะแนน)
|
||||||
|
const competencyDevProbationScore = ref<number>(50); // สรุปผลการประเมินพฤติกรรมการปฏิบัติราชการ (สมรรถนะ+การพัฒนาตนเอง) (คะแนนเต็ม competencyDevScore คะแนน)
|
||||||
|
|
||||||
// function getDataWork() {
|
// function getDataWork() {
|
||||||
// showLoader();
|
// showLoader();
|
||||||
// http
|
// http
|
||||||
|
|
@ -442,6 +447,11 @@ export const useKpiDataStore = defineStore("KPIDate", () => {
|
||||||
excusiveIndicator2PercentVal,
|
excusiveIndicator2PercentVal,
|
||||||
excusiveIndicator2ScoreVal,
|
excusiveIndicator2ScoreVal,
|
||||||
excusiveIndicatorScore,
|
excusiveIndicatorScore,
|
||||||
|
// isProbation
|
||||||
|
indicatorProbationScore,
|
||||||
|
competencyProbationScore,
|
||||||
|
devProbationScore,
|
||||||
|
competencyDevProbationScore,
|
||||||
|
|
||||||
//รายการการประเมินผลการปฏิบัติราชการระดับบุคคล
|
//รายการการประเมินผลการปฏิบัติราชการระดับบุคคล
|
||||||
tabMainevaluator,
|
tabMainevaluator,
|
||||||
|
|
|
||||||
|
|
@ -33,8 +33,6 @@ http.interceptors.response.use(
|
||||||
// eslint-disable-next-line no-prototype-builtins
|
// eslint-disable-next-line no-prototype-builtins
|
||||||
if (error.hasOwnProperty("response")) {
|
if (error.hasOwnProperty("response")) {
|
||||||
if (error.response.status === 401 || error.response.status === 403) {
|
if (error.response.status === 401 || error.response.status === 403) {
|
||||||
kcLogout();
|
|
||||||
|
|
||||||
// Store.commit("SET_ERROR_MESSAGE", error.response.data.message);
|
// Store.commit("SET_ERROR_MESSAGE", error.response.data.message);
|
||||||
// Store.commit("REMOVE_ACCESS_TOKEN")
|
// Store.commit("REMOVE_ACCESS_TOKEN")
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -3,6 +3,7 @@ import "moment/dist/locale/th";
|
||||||
import moment from "moment";
|
import moment from "moment";
|
||||||
import CustomComponent from "@/components/CustomDialog.vue";
|
import CustomComponent from "@/components/CustomDialog.vue";
|
||||||
import { Loading, QSpinnerCube } from "quasar";
|
import { Loading, QSpinnerCube } from "quasar";
|
||||||
|
import { kcLogout } from "@/plugins/keycloak";
|
||||||
|
|
||||||
moment.locale("th");
|
moment.locale("th");
|
||||||
export const useCounterMixin = defineStore("mixin", () => {
|
export const useCounterMixin = defineStore("mixin", () => {
|
||||||
|
|
@ -358,8 +359,6 @@ export const useCounterMixin = defineStore("mixin", () => {
|
||||||
}
|
}
|
||||||
|
|
||||||
const messageError = (q: any, e: any = "", text: string = "") => {
|
const messageError = (q: any, e: any = "", text: string = "") => {
|
||||||
console.log(e);
|
|
||||||
|
|
||||||
if (e == "" && text != "") {
|
if (e == "" && text != "") {
|
||||||
q.dialog({
|
q.dialog({
|
||||||
component: CustomComponent,
|
component: CustomComponent,
|
||||||
|
|
@ -385,6 +384,12 @@ export const useCounterMixin = defineStore("mixin", () => {
|
||||||
color: "red",
|
color: "red",
|
||||||
onlycancel: true,
|
onlycancel: true,
|
||||||
},
|
},
|
||||||
|
}).onCancel(async () => {
|
||||||
|
showLoader();
|
||||||
|
await kcLogout();
|
||||||
|
setTimeout(() => {
|
||||||
|
hideLoader();
|
||||||
|
}, 1000);
|
||||||
});
|
});
|
||||||
} else if (e.response.data.result) {
|
} else if (e.response.data.result) {
|
||||||
q.dialog({
|
q.dialog({
|
||||||
|
|
@ -421,6 +426,12 @@ export const useCounterMixin = defineStore("mixin", () => {
|
||||||
color: "red",
|
color: "red",
|
||||||
onlycancel: true,
|
onlycancel: true,
|
||||||
},
|
},
|
||||||
|
}).onCancel(async () => {
|
||||||
|
showLoader();
|
||||||
|
await kcLogout();
|
||||||
|
setTimeout(() => {
|
||||||
|
hideLoader();
|
||||||
|
}, 1000);
|
||||||
});
|
});
|
||||||
} else {
|
} else {
|
||||||
//invalid_token
|
//invalid_token
|
||||||
|
|
@ -433,6 +444,12 @@ export const useCounterMixin = defineStore("mixin", () => {
|
||||||
color: "red",
|
color: "red",
|
||||||
onlycancel: true,
|
onlycancel: true,
|
||||||
},
|
},
|
||||||
|
}).onCancel(async () => {
|
||||||
|
showLoader();
|
||||||
|
await kcLogout();
|
||||||
|
setTimeout(() => {
|
||||||
|
hideLoader();
|
||||||
|
}, 1000);
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
|
|
|
||||||
|
|
@ -6,6 +6,7 @@ import { useRoute, useRouter } from "vue-router";
|
||||||
import { useQuasar } from "quasar";
|
import { useQuasar } from "quasar";
|
||||||
import keycloak, { kcLogout } from "@/plugins/keycloak";
|
import keycloak, { kcLogout } from "@/plugins/keycloak";
|
||||||
import { useCounterMixin } from "@/stores/mixin";
|
import { useCounterMixin } from "@/stores/mixin";
|
||||||
|
import CustomComponent from "@/components/CustomDialog.vue";
|
||||||
|
|
||||||
const route = useRoute();
|
const route = useRoute();
|
||||||
const router = useRouter();
|
const router = useRouter();
|
||||||
|
|
@ -35,11 +36,33 @@ const link = ref<string>("");
|
||||||
*/
|
*/
|
||||||
onMounted(async () => {
|
onMounted(async () => {
|
||||||
await fetchTotolNotificate();
|
await fetchTotolNotificate();
|
||||||
|
checkUser();
|
||||||
if (keycloak.tokenParsed != null) {
|
if (keycloak.tokenParsed != null) {
|
||||||
fullname.value = keycloak.tokenParsed.name;
|
fullname.value = keycloak.tokenParsed.name;
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
|
async function checkUser() {
|
||||||
|
http.get(config.API.profilePosition()).catch((err) => {
|
||||||
|
$q.dialog({
|
||||||
|
component: CustomComponent,
|
||||||
|
componentProps: {
|
||||||
|
title: "ข้อความแจ้งเตือน",
|
||||||
|
message: err.response.data.message,
|
||||||
|
icon: "warning",
|
||||||
|
color: "red",
|
||||||
|
onlycancel: true,
|
||||||
|
},
|
||||||
|
}).onCancel(async () => {
|
||||||
|
showLoader();
|
||||||
|
await kcLogout();
|
||||||
|
setTimeout(() => {
|
||||||
|
hideLoader();
|
||||||
|
}, 1000);
|
||||||
|
});
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
const totalNoti = ref<number>(0);
|
const totalNoti = ref<number>(0);
|
||||||
async function fetchTotolNotificate() {
|
async function fetchTotolNotificate() {
|
||||||
await http
|
await http
|
||||||
|
|
@ -107,7 +130,7 @@ const clickDelete = async (id: string, index: number) => {
|
||||||
.delete(config.API.msgId(id))
|
.delete(config.API.msgId(id))
|
||||||
.then(() => {
|
.then(() => {
|
||||||
notiList.value.splice(index, 1);
|
notiList.value.splice(index, 1);
|
||||||
totalInbox.value--;
|
totalNoti.value--;
|
||||||
success($q, "ลบข้อมูลสำเร็จ");
|
success($q, "ลบข้อมูลสำเร็จ");
|
||||||
})
|
})
|
||||||
.catch((e) => {
|
.catch((e) => {
|
||||||
|
|
@ -174,6 +197,7 @@ function onInfo() {
|
||||||
router.push(`/retire`);
|
router.push(`/retire`);
|
||||||
}
|
}
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<!-- โครงเว็บ -->
|
<!-- โครงเว็บ -->
|
||||||
<template>
|
<template>
|
||||||
<q-layout view="hHh LpR fFr">
|
<q-layout view="hHh LpR fFr">
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue