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