hrms-user/src/modules/08_KPI/components/Tab/01_Assessment.vue

148 lines
4.3 KiB
Vue
Raw Normal View History

2024-04-09 15:22:23 +07:00
<script setup lang="ts">
import { ref, onMounted } from "vue";
import { useQuasar } from "quasar";
import { useRoute } from "vue-router";
import config from "@/app.config";
import http from "@/plugins/http";
2024-04-09 15:22:23 +07:00
2024-04-22 18:14:48 +07:00
import Work from "@/modules/08_KPI/components/Tab/Topic/01_Indicator.vue";
import Competency from "@/modules/08_KPI/components/Tab/Topic/02_Competency.vue";
2024-04-09 15:22:23 +07:00
import { useCounterMixin } from "@/stores/mixin";
import { useKpiDataStore } from "@/modules/08_KPI/store";
const $q = useQuasar();
const route = useRoute();
const { showLoader, hideLoader, messageError } = useCounterMixin();
const store = useKpiDataStore();
const evaluationId = ref<string>(route.params.id.toString());
2024-04-09 15:22:23 +07:00
const rows_01 = ref<any[]>();
const rows_02 = ref<any[]>();
const rows_03 = ref<any[]>();
const total = ref<number>(0);
const resultWork = ref<number>(0);
const resultEvaluation = ref<number>(0);
function fetchListPlanned() {
showLoader();
http
.get(config.API.kpiAchievement("planned") + `?id=${evaluationId.value}`)
.then((res) => {
const data = res.data.result;
rows_01.value = data;
})
.catch((err) => {
messageError($q, err);
})
.finally(() => {
hideLoader();
});
}
2024-04-09 15:22:23 +07:00
function fetchListRole() {
showLoader();
http
.get(config.API.kpiAchievement("role") + `?id=${evaluationId.value}`)
.then((res) => {
const data = res.data.result;
rows_02.value = data;
})
.catch((err) => {
messageError($q, err);
})
.finally(() => {
hideLoader();
});
2024-04-09 15:22:23 +07:00
}
function fetchAssigned() {
const data = [
{
includingName: "name",
target: "เป่า",
point: "12",
weight: "12",
achievement: "12",
evaluationResults: "12",
},
];
rows_03.value = data;
}
2024-04-09 15:22:23 +07:00
onMounted(() => {
fetchListPlanned();
fetchListRole();
fetchAssigned();
2024-04-09 15:22:23 +07:00
});
</script>
2024-04-22 18:14:48 +07:00
2024-04-09 15:22:23 +07:00
<template>
<q-scroll-area
style="height: 100vh"
class="bg-white row col-12 text-dark q-pa-md"
>
2024-04-19 15:30:39 +07:00
<div class="text-weight-bold text-body2">
<span class="txt-under text-blue-6">องคประกอบท 1</span>
<span class="q-ml-sm"> ผลสมฤทธของงาน</span>
2024-04-09 15:22:23 +07:00
</div>
<div class="q-gutter-md q-mt-sm">
<!-- องคประกอบท 1 -->
<Work
v-model:data="rows_01"
:title="`1. งานตามแผนปฏิบัติราชการประจำปี`"
:page="1"
:fetchList="fetchListPlanned"
/>
<Work
v-model:data="rows_02"
:title="`2. งานตามหน้าที่ความรับผิดชอบหลัก`"
:page="2"
:fetchList="fetchListRole"
/>
<Work
v-model:data="rows_03"
:title="`3. งานที่ได้รับมอบหมายพิเศษ`"
:page="3"
:fetchList="fetchAssigned"
/>
2024-04-19 15:30:39 +07:00
<div class="row text-body2 text-weight-bold">
<div class="col-6 text-center row justify-center">
2024-04-09 15:22:23 +07:00
<span>รวมผลการประเม (อยละ) 100</span>
2024-04-19 15:30:39 +07:00
<div class="text-primary q-pl-md">{{ total }}</div>
2024-04-09 15:22:23 +07:00
</div>
2024-04-19 15:30:39 +07:00
<div class="col-6 text-center row justify-center">
2024-04-09 15:22:23 +07:00
<span>สรปผลการประเมนผลสมฤทธของงาน (คะแนนเต 70 คะแนน)</span>
<div class="text-primary q-pl-md">{{ resultWork }}</div>
2024-04-09 15:22:23 +07:00
</div>
</div>
2024-04-19 15:30:39 +07:00
<q-separator size="3px" class="q-my-lg" />
2024-04-09 15:22:23 +07:00
<!-- องคประกอบท 2 -->
2024-04-19 15:30:39 +07:00
<div class="text-weight-bold text-body2 q-mb-sm">
<span class="txt-under text-blue-6">องคประกอบท 2</span>
<span class="q-ml-sm"> พฤตกรรมการปฎราชการ (สมรรถนะ)</span>
2024-04-09 15:22:23 +07:00
</div>
2024-04-22 18:14:48 +07:00
<Competency />
2024-04-09 15:22:23 +07:00
2024-04-19 15:30:39 +07:00
<div class="row text-body2 text-weight-bold justify-center">
<span>ผลการประเมนสมรรถนะ (20 คะแนน)</span>
<div class="text-primary q-pl-md">{{ resultEvaluation }}</div>
2024-04-09 15:22:23 +07:00
</div>
</div>
</q-scroll-area>
</template>
2024-04-22 18:14:48 +07:00
2024-04-09 15:22:23 +07:00
<style scoped>
.txt-under {
text-decoration: underline;
}
</style>