Merge branch 'develop' into devTee
This commit is contained in:
commit
55182b688d
23 changed files with 1461 additions and 652 deletions
|
|
@ -185,22 +185,6 @@ watch(
|
|||
|
||||
store.indicatorScoreVal =
|
||||
store.indicatorPercentVal * (store.indicatorScore / 100);
|
||||
|
||||
if (store.isUpdate && store.tabMain === "3") {
|
||||
http
|
||||
.put(config.API.updatePoint(evaluationId.value), {
|
||||
totalPoint1: (
|
||||
store.indicatorPercentVal *
|
||||
(store.indicatorScore / 100)
|
||||
).toFixed(2),
|
||||
summaryPoint: (
|
||||
store.indicatorScoreVal +
|
||||
store.competencyScoreVal +
|
||||
store.devScoreVal
|
||||
).toFixed(2),
|
||||
})
|
||||
.then((res) => {});
|
||||
}
|
||||
}
|
||||
}
|
||||
);
|
||||
|
|
@ -229,7 +213,7 @@ onMounted(() => {
|
|||
<!-- องค์ประกอบที่ 1 -->
|
||||
<div
|
||||
v-if="
|
||||
store.dataEvaluation.posTypeName == 'อำนวยการ' &&
|
||||
store.dataEvaluation.posTypeName == 'อำนวยการ' ||
|
||||
store.dataEvaluation.posTypeName == 'บริหาร'
|
||||
"
|
||||
>
|
||||
|
|
|
|||
|
|
@ -6,6 +6,7 @@ import { useKpiDataStore } from "@/modules/08_KPI/store";
|
|||
import http from "@/plugins/http";
|
||||
import config from "@/app.config";
|
||||
import { useRoute } from "vue-router";
|
||||
import genReport from "@/plugins/genreport";
|
||||
|
||||
const store = useKpiDataStore();
|
||||
const $q = useQuasar();
|
||||
|
|
@ -191,6 +192,33 @@ function getData() {
|
|||
.finally(() => {});
|
||||
}
|
||||
|
||||
/**
|
||||
* ฟังก์ชันดาวน์โหลดรายงาน
|
||||
*/
|
||||
async function downloadReport() {
|
||||
showLoader();
|
||||
await http
|
||||
.get(config.API.kpiReport(id.value))
|
||||
.then(async (res) => {
|
||||
console.log(res.data.result.data);
|
||||
const data = res.data.result;
|
||||
await genReport(
|
||||
data,
|
||||
"แบบรายงานผลการปฏิบัติราชการ " +
|
||||
store.dataEvaluation.prefix +
|
||||
store.dataEvaluation.fileName +
|
||||
" " +
|
||||
store.dataEvaluation.lastName
|
||||
);
|
||||
})
|
||||
.catch((e) => {
|
||||
messageError($q, e);
|
||||
})
|
||||
.finally(() => {
|
||||
hideLoader();
|
||||
});
|
||||
}
|
||||
|
||||
onMounted(() => {
|
||||
getData();
|
||||
fetchEvaluation();
|
||||
|
|
@ -206,6 +234,21 @@ onMounted(() => {
|
|||
<q-toolbar-title class="text-subtitle2 text-bold"
|
||||
>สรุปผลการประเมิน</q-toolbar-title
|
||||
>
|
||||
<q-space />
|
||||
|
||||
<q-btn
|
||||
v-if="store.dataEvaluation.evaluationStatus === 'COMPLETE'"
|
||||
outline
|
||||
flat
|
||||
dense
|
||||
color="blue"
|
||||
icon="mdi-download"
|
||||
size="12px"
|
||||
class="q-mr-md"
|
||||
@click="downloadReport"
|
||||
>
|
||||
<q-tooltip>ดาวน์โหลดแบบรายงานผลการปฏิบัติราชการ</q-tooltip>
|
||||
</q-btn>
|
||||
</q-toolbar>
|
||||
<q-separator />
|
||||
<q-card-section>
|
||||
|
|
|
|||
|
|
@ -277,12 +277,22 @@ watch(
|
|||
<q-dialog v-model="modal" persistent>
|
||||
<q-card class="col-12" style="width: 85%">
|
||||
<q-form greedy @submit.prevent @validation-success="onSubmit">
|
||||
<DialogHeader :tittle="`เพิ่มสมรรถนะ`" :close="closeDialog" />
|
||||
<DialogHeader
|
||||
:tittle="
|
||||
competencyType == 'HEAD' || competencyType == 'GROUP'
|
||||
? `รายละเอียดสมรรถนะ`
|
||||
: `เพิ่มสมรรถนะ`
|
||||
"
|
||||
:close="closeDialog"
|
||||
/>
|
||||
<q-separator />
|
||||
|
||||
<q-card-section class="q-pa-none scroll" style="max-height: 80vh">
|
||||
<div class="row">
|
||||
<div class="bg-grey-1 q-pa-md col-xs-12 col-md-3 row lineRight">
|
||||
<div
|
||||
v-if="competencyType != 'HEAD' && competencyType != 'GROUP'"
|
||||
class="bg-grey-1 q-pa-md col-xs-12 col-md-3 row lineRight"
|
||||
>
|
||||
<div class="col-12 q-col-gutter-sm fit">
|
||||
<div class="col-12">
|
||||
<q-select
|
||||
|
|
@ -362,7 +372,13 @@ watch(
|
|||
</div>
|
||||
</div>
|
||||
|
||||
<div class="col-xs-12 col-md-9 q-pa-md q-col-gutter-sm">
|
||||
<div
|
||||
:class="
|
||||
competencyType == 'HEAD' || competencyType == 'GROUP'
|
||||
? `col-xs-12 col-md-12 q-pa-md q-col-gutter-sm`
|
||||
: `col-xs-12 col-md-9 q-pa-md q-col-gutter-sm`
|
||||
"
|
||||
>
|
||||
<span class="text-body2 text-weight-medium"
|
||||
>รายละเอียดสมรรถนะ</span
|
||||
>
|
||||
|
|
|
|||
|
|
@ -19,6 +19,7 @@ import type {
|
|||
import DialogListCriteria from "@/modules/08_KPI/components/Tab/Dialog/DialogListCriteria.vue";
|
||||
import DialogCompetncyByRow from "@/modules/08_KPI/components/Tab/Dialog/DialogCompetncyByRow.vue";
|
||||
import DialogLevel from "@/modules/08_KPI/components/Tab/Dialog/DialogLevel.vue";
|
||||
import type { DataOptions } from "@/modules/08_KPI/interface/index/Main";
|
||||
|
||||
const modalLevel = ref<boolean>(false);
|
||||
const modalCompetncyByRow = ref<boolean>(false);
|
||||
|
|
@ -146,8 +147,8 @@ function getData(type: string) {
|
|||
let result = 0;
|
||||
let weight = 0;
|
||||
let total = 0;
|
||||
for (let index = 0; index < store.competencyType.length; index++) {
|
||||
const element = await store.competencyType[index];
|
||||
for (let index = 0; index < competencyType.value.length; index++) {
|
||||
const element = await competencyType.value[index];
|
||||
|
||||
const dataArr = await lists.value.find(
|
||||
(x: any) => x.type == element.id
|
||||
|
|
@ -171,7 +172,7 @@ function getData(type: string) {
|
|||
let resultAvg = result / total;
|
||||
|
||||
if (
|
||||
store.dataEvaluation.posTypeName == "อำนวยการ" &&
|
||||
store.dataEvaluation.posTypeName == "อำนวยการ" ||
|
||||
store.dataEvaluation.posTypeName == "บริหาร"
|
||||
) {
|
||||
store.competencyScoreVal =
|
||||
|
|
@ -184,24 +185,6 @@ function getData(type: string) {
|
|||
? (resultAvg / weightAvg) * store.competencyScore
|
||||
: 0;
|
||||
}
|
||||
|
||||
if (
|
||||
store.isUpdate &&
|
||||
store.tabMain === "3" &&
|
||||
(store.dataEvaluation.evaluationStatus === "EVALUATOR" ||
|
||||
store.dataEvaluation.evaluationStatus === "EVALUATING_EVALUATOR")
|
||||
) {
|
||||
http
|
||||
.put(config.API.updatePoint(store.dataEvaluation.id), {
|
||||
totalPoint2_1: store.competencyScoreVal.toFixed(2),
|
||||
summaryPoint: (
|
||||
store.indicatorScoreVal +
|
||||
store.competencyScoreVal +
|
||||
store.devScoreVal
|
||||
).toFixed(2),
|
||||
})
|
||||
.then((res) => {});
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
|
|
@ -273,18 +256,6 @@ const isEditStep3 = computed(() => {
|
|||
);
|
||||
});
|
||||
|
||||
watch(
|
||||
() => store.dataEvaluation.capacityPoint,
|
||||
(newValue, oldValue) => {
|
||||
if (newValue !== oldValue) {
|
||||
for (let index = 0; index < store.competencyType.length; index++) {
|
||||
const element = store.competencyType[index];
|
||||
getData(element.id);
|
||||
}
|
||||
}
|
||||
}
|
||||
);
|
||||
|
||||
function onInfo() {
|
||||
modalCriteria.value = true;
|
||||
}
|
||||
|
|
@ -299,16 +270,32 @@ function onLevel(num: number, list: any) {
|
|||
modalLevel.value = true;
|
||||
}
|
||||
|
||||
onMounted(() => {
|
||||
for (let index = 0; index < store.competencyType.length; index++) {
|
||||
const element = store.competencyType[index];
|
||||
getData(element.id);
|
||||
}
|
||||
const competencyType = ref<DataOptions[]>([]);
|
||||
onMounted(async () => {
|
||||
setTimeout(async () => {
|
||||
competencyType.value = await (store.dataEvaluation.posTypeName ==
|
||||
"อำนวยการ" || store.dataEvaluation.posTypeName == "บริหาร"
|
||||
? store.competencyType.filter(
|
||||
(x: DataOptions) =>
|
||||
x.id == "HEAD" ||
|
||||
x.id == "EXECUTIVE" ||
|
||||
x.id == "INSPECTOR" ||
|
||||
x.id == "DIRECTOR"
|
||||
)
|
||||
: store.competencyType.filter(
|
||||
(x: DataOptions) => x.id == "HEAD" || x.id == "GROUP"
|
||||
));
|
||||
|
||||
for (let index = 0; index < competencyType.value.length; index++) {
|
||||
const element = competencyType.value[index];
|
||||
getData(element.id);
|
||||
}
|
||||
}, 1000);
|
||||
});
|
||||
</script>
|
||||
|
||||
<template>
|
||||
<div v-for="(item, index) in store.competencyType" :key="index">
|
||||
<div v-for="(item, index) in competencyType" :key="index">
|
||||
<q-card bordered style="border-radius: 5px" class="no-shadow q-mt-sm">
|
||||
<q-card-section class="bg-grey-2 q-py-sm">
|
||||
<div class="row items-center">
|
||||
|
|
@ -468,7 +455,10 @@ onMounted(() => {
|
|||
color="info"
|
||||
@click.stop.pervent="onEdit(props.row, item.id)"
|
||||
>
|
||||
<q-tooltip>แก้ไข </q-tooltip>
|
||||
<q-tooltip v-if="item.id == 'HEAD' || item.id == 'GROUP'"
|
||||
>ดูรายละเอียด</q-tooltip
|
||||
>
|
||||
<q-tooltip v-else>แก้ไข</q-tooltip>
|
||||
</q-btn>
|
||||
<q-btn
|
||||
flat
|
||||
|
|
|
|||
|
|
@ -126,24 +126,6 @@ function getDevelop() {
|
|||
(sum: number, e: any) => sum + e.summary,
|
||||
0
|
||||
);
|
||||
|
||||
if (
|
||||
store.isUpdate &&
|
||||
store.tabMain === "3" &&
|
||||
(store.dataEvaluation.evaluationStatus === "EVALUATOR" ||
|
||||
store.dataEvaluation.evaluationStatus === "EVALUATING_EVALUATOR")
|
||||
) {
|
||||
http
|
||||
.put(config.API.updatePoint(store.dataEvaluation.id), {
|
||||
totalPoint2_2: store.devScoreVal.toFixed(2),
|
||||
summaryPoint: (
|
||||
store.indicatorScoreVal +
|
||||
store.competencyScoreVal +
|
||||
store.devScoreVal
|
||||
).toFixed(2),
|
||||
})
|
||||
.then((res) => {});
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue