รายการขอรับประเมินผลการปฏิบัติราชการระดับบุคคล
This commit is contained in:
parent
95ac852446
commit
0adb7ae187
6 changed files with 786 additions and 304 deletions
10
src/api/KPI/api.KPI.ts
Normal file
10
src/api/KPI/api.KPI.ts
Normal file
|
|
@ -0,0 +1,10 @@
|
||||||
|
import env from "../index";
|
||||||
|
|
||||||
|
const kpiPeriod = `${env.API_URI}/kpi/period`;
|
||||||
|
const kpiEvaluation = `${env.API_URI}/kpi/user/evaluation`;
|
||||||
|
const kpiPlan = `${env.API_URI}/kpi/plan`;
|
||||||
|
export default {
|
||||||
|
kpiPeriod,
|
||||||
|
kpiEvaluation,
|
||||||
|
kpiPlan,
|
||||||
|
};
|
||||||
|
|
@ -10,6 +10,7 @@ import evaluate from "./api/evaluate/api.evaluate";
|
||||||
import support from "./api/support/api.support";
|
import support from "./api/support/api.support";
|
||||||
import org from "./api/org/api.org";
|
import org from "./api/org/api.org";
|
||||||
import scholarship from "./api/scholarship/api.scholarship";
|
import scholarship from "./api/scholarship/api.scholarship";
|
||||||
|
import KPI from "./api/KPI/api.KPI";
|
||||||
|
|
||||||
const API = {
|
const API = {
|
||||||
...testtest,
|
...testtest,
|
||||||
|
|
@ -21,6 +22,7 @@ const API = {
|
||||||
...support,
|
...support,
|
||||||
...org,
|
...org,
|
||||||
...scholarship,
|
...scholarship,
|
||||||
|
...KPI,
|
||||||
};
|
};
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
|
|
|
||||||
|
|
@ -36,7 +36,10 @@ onMounted(() => {
|
||||||
});
|
});
|
||||||
</script>
|
</script>
|
||||||
<template>
|
<template>
|
||||||
<q-scroll-area style="height: 56vh" class="bg-white row col-12 text-dark q-pa-md">
|
<q-scroll-area
|
||||||
|
style="height: 56vh"
|
||||||
|
class="bg-white row col-12 text-dark q-pa-md"
|
||||||
|
>
|
||||||
<div class="text-weight-bold text-body2">
|
<div class="text-weight-bold text-body2">
|
||||||
<span class="txt-under text-blue-6">องค์ประกอบที่ 1</span>
|
<span class="txt-under text-blue-6">องค์ประกอบที่ 1</span>
|
||||||
<span class="q-ml-sm"> ผลสัมฤทธิ์ของงาน</span>
|
<span class="q-ml-sm"> ผลสัมฤทธิ์ของงาน</span>
|
||||||
|
|
@ -44,18 +47,30 @@ onMounted(() => {
|
||||||
|
|
||||||
<div class="q-gutter-md q-mt-sm">
|
<div class="q-gutter-md q-mt-sm">
|
||||||
<!-- องค์ประกอบที่ 1 -->
|
<!-- องค์ประกอบที่ 1 -->
|
||||||
<Work v-model:data="rows_01" :title="`1. งานตามแผนปฏิบัติราชการประจำปี`" :page="1" />
|
<Work
|
||||||
<Work v-model:data="rows_02" :title="`2. งานตามหน้าที่ความรับผิดชอบหลัก`" :page="2" />
|
v-model:data="rows_01"
|
||||||
<Work v-model:data="rows_03" :title="`3. งานที่ได้รับมอบหมาย`" :page="3" />
|
:title="`1. งานตามแผนปฏิบัติราชการประจำปี`"
|
||||||
|
:page="1"
|
||||||
|
/>
|
||||||
|
<Work
|
||||||
|
v-model:data="rows_02"
|
||||||
|
:title="`2. งานตามหน้าที่ความรับผิดชอบหลัก`"
|
||||||
|
:page="2"
|
||||||
|
/>
|
||||||
|
<Work
|
||||||
|
v-model:data="rows_03"
|
||||||
|
:title="`3. งานที่ได้รับมอบหมายพิเศษ`"
|
||||||
|
:page="3"
|
||||||
|
/>
|
||||||
<div class="row text-body2 text-weight-bold">
|
<div class="row text-body2 text-weight-bold">
|
||||||
<div class="col-6 text-center row justify-center">
|
<div class="col-6 text-center row justify-center">
|
||||||
<span>รวมผลการประเมิน (ร้อยละ) 100</span>
|
<span>รวมผลการประเมิน (ร้อยละ) 100</span>
|
||||||
<div class="text-primary q-pl-md">{{ total }}</div>
|
<div class="text-primary q-pl-md">{{ total }}</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="col-6 text-center row justify-center">
|
<div class="col-6 text-center row justify-center">
|
||||||
<span>สรุปผลการประเมินผลสัมฤทธิ์ของงาน (คะแนนเต็ม 70 คะแนน)</span>
|
<span>สรุปผลการประเมินผลสัมฤทธิ์ของงาน (คะแนนเต็ม 70 คะแนน)</span>
|
||||||
<div class="text-primary q-pl-md">{{ resultWork }}</div>
|
<div class="text-primary q-pl-md">{{ resultWork }}</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
|
@ -68,7 +83,11 @@ onMounted(() => {
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<Capacity v-model:data="rows_04" :title="`1. สมรรถนะหลัก`" :page="1" />
|
<Capacity v-model:data="rows_04" :title="`1. สมรรถนะหลัก`" :page="1" />
|
||||||
<Capacity v-model:data="rows_05" :title="`2. สมรรถนะประจำกลุ่ม`" :page="2" />
|
<Capacity
|
||||||
|
v-model:data="rows_05"
|
||||||
|
:title="`2. สมรรถนะประจำกลุ่ม`"
|
||||||
|
:page="2"
|
||||||
|
/>
|
||||||
|
|
||||||
<div class="row text-body2 text-weight-bold justify-center">
|
<div class="row text-body2 text-weight-bold justify-center">
|
||||||
<span>ผลการประเมินสมรรถนะ (20 คะแนน)</span>
|
<span>ผลการประเมินสมรรถนะ (20 คะแนน)</span>
|
||||||
|
|
|
||||||
|
|
@ -1,82 +1,136 @@
|
||||||
<script setup lang="ts">
|
<script setup lang="ts">
|
||||||
import { ref, reactive } from "vue";
|
import { ref, reactive, watch } from "vue";
|
||||||
|
import { useQuasar } from "quasar";
|
||||||
|
import config from "@/app.config";
|
||||||
|
import http from "@/plugins/http";
|
||||||
|
|
||||||
import DialogHeader from "@/components/DialogHeader.vue";
|
import DialogHeader from "@/components/DialogHeader.vue";
|
||||||
|
|
||||||
|
import { useCounterMixin } from "@/stores/mixin";
|
||||||
|
import { useKpiDataStore } from "@/modules/08_KPI/store";
|
||||||
|
|
||||||
|
const $q = useQuasar();
|
||||||
|
const mixin = useCounterMixin();
|
||||||
|
const store = useKpiDataStore();
|
||||||
|
|
||||||
|
const { showLoader, hideLoader, messageError, dialogConfirm } = mixin;
|
||||||
|
|
||||||
const modal = defineModel<boolean>("modal", { required: true });
|
const modal = defineModel<boolean>("modal", { required: true });
|
||||||
const numpage = defineModel<number>("numpage", { required: true });
|
const numpage = defineModel<number>("numpage", { required: true });
|
||||||
const splitterModel = ref<number>(25);
|
|
||||||
const search = ref<string>("");
|
const search = ref<string>("");
|
||||||
|
const listCheck = ref<number | null>(null);
|
||||||
const define = ref<string>("");
|
const listTarget = ref<any>([]);
|
||||||
const formula = ref<string>("");
|
|
||||||
|
|
||||||
const listCheck = ref<number | null>();
|
|
||||||
const listTarget = ref<any>([
|
|
||||||
{
|
|
||||||
id: "ID1",
|
|
||||||
metricCode: "1กก",
|
|
||||||
indicatorName: "ตัวชี้วัด 1",
|
|
||||||
},
|
|
||||||
{
|
|
||||||
id: "ID2",
|
|
||||||
metricCode: "2กก",
|
|
||||||
indicatorName: "ตัวชี้วัด 2",
|
|
||||||
},
|
|
||||||
]);
|
|
||||||
|
|
||||||
const formDetail = reactive<any>({
|
const formDetail = reactive<any>({
|
||||||
oc: `สำนักงานคณะกรรมการข้าราชการกรุงเทพมหานคร/กองบริหารทั่วไป/กลุ่มงานช่วยนักบริหาร`,
|
orgRevisionId: "",
|
||||||
indicators: "1",
|
id: "",
|
||||||
code: "1กก",
|
year: null,
|
||||||
name: "ตัวชี้วัด 1",
|
round: "",
|
||||||
|
kpiPeriodId: "",
|
||||||
|
includingName: "",
|
||||||
|
including: "",
|
||||||
target: "",
|
target: "",
|
||||||
unit: "",
|
unit: null,
|
||||||
weight: "100",
|
weight: null,
|
||||||
});
|
achievement1: "",
|
||||||
const formScore = reactive<any>({
|
achievement2: "",
|
||||||
score5: "5",
|
achievement3: "",
|
||||||
score4: "4",
|
achievement4: "",
|
||||||
score3: "3",
|
achievement5: "",
|
||||||
score2: "2",
|
meaning: "",
|
||||||
score1: "1",
|
formula: "",
|
||||||
|
node: null,
|
||||||
|
nodeId: "",
|
||||||
|
strategy: null,
|
||||||
|
strategyId: "",
|
||||||
});
|
});
|
||||||
|
|
||||||
const fieldDetailLabels = {
|
function fetchIndicators() {
|
||||||
oc: "หน่วยงาน/ส่วนราชการ",
|
const nodeId = store.dataProfile.nodeId;
|
||||||
indicators: "ลำดับตัวชี้วัด",
|
const node = store.dataProfile.node;
|
||||||
code: "รหัสตัวชี้วัด",
|
const kpiPeriodId = store.dataEvaluation.kpiPeriodId;
|
||||||
name: "ชื่อตัวชี้วัด",
|
|
||||||
target: "ค่าเป้าหมาย",
|
|
||||||
unit: "หน่วยนับ",
|
|
||||||
weight: "น้ำหนัก (ร้อยละ)",
|
|
||||||
};
|
|
||||||
|
|
||||||
const fieldLabels = {
|
showLoader();
|
||||||
score5: "5",
|
http
|
||||||
score4: "4",
|
.get(
|
||||||
score3: "3",
|
config.API.kpiPlan +
|
||||||
score2: "2",
|
`?page=${1}&pageSize=${50}&kpiPeriodId=${kpiPeriodId}&nodeId=${nodeId}&node=${node}&keyword=${""}`
|
||||||
score1: "1",
|
)
|
||||||
};
|
.then((res) => {
|
||||||
|
listTarget.value = res.data.result.data;
|
||||||
|
})
|
||||||
|
.catch((err) => {
|
||||||
|
messageError($q, err);
|
||||||
|
})
|
||||||
|
.finally(() => {
|
||||||
|
hideLoader();
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
function clickList(index: number, data: any) {
|
function clickList(index: number, id: string) {
|
||||||
listCheck.value = index;
|
showLoader();
|
||||||
// dataList.value = data.map((i: any) => ({
|
http
|
||||||
// commandNo: i.commandNo,
|
.get(config.API.kpiPlan + `/${id}`)
|
||||||
// duty: i.duty,
|
.then((res) => {
|
||||||
// prefix: i.prefix,
|
listCheck.value = index;
|
||||||
// firstName: i.firstName,
|
const data = res.data.result;
|
||||||
// lastName: i.lastName,
|
formDetail.orgRevisionId = data.corgRevisionId;
|
||||||
// fullName:`${i.prefix}${i.firstName} ${i.lastName}`
|
formDetail.id = data.id;
|
||||||
// }));
|
formDetail.year = data.year;
|
||||||
|
formDetail.round = data.round;
|
||||||
|
formDetail.kpiPeriodId = data.kpiPeriodId;
|
||||||
|
formDetail.includingName = data.includingName;
|
||||||
|
formDetail.including = data.including;
|
||||||
|
formDetail.target = data.target;
|
||||||
|
formDetail.unit = data.unit;
|
||||||
|
formDetail.weight = data.weight;
|
||||||
|
formDetail.achievement1 = data.achievement1;
|
||||||
|
formDetail.achievement2 = data.achievement2;
|
||||||
|
formDetail.achievement3 = data.achievement3;
|
||||||
|
formDetail.achievement4 = data.achievement4;
|
||||||
|
formDetail.achievement5 = data.achievement5;
|
||||||
|
formDetail.meaning = data.meaning;
|
||||||
|
formDetail.formula = data.formula;
|
||||||
|
formDetail.node = data.node;
|
||||||
|
formDetail.nodeId = data.nodeId;
|
||||||
|
formDetail.strategy = data.strategy;
|
||||||
|
formDetail.strategyId = data.strategyId;
|
||||||
|
})
|
||||||
|
.catch((err) => {
|
||||||
|
messageError($q, err);
|
||||||
|
})
|
||||||
|
.finally(() => {
|
||||||
|
hideLoader();
|
||||||
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
/** ปิด dialog */
|
/** ปิด dialog */
|
||||||
function closeDialog() {
|
function closeDialog() {
|
||||||
modal.value = false;
|
modal.value = false;
|
||||||
search.value = ''
|
search.value = "";
|
||||||
define.value = ''
|
listCheck.value = null;
|
||||||
formula.value = ''
|
formDetail.orgRevisionId = "";
|
||||||
|
formDetail.id = "";
|
||||||
|
formDetail.year = "";
|
||||||
|
formDetail.round = "";
|
||||||
|
formDetail.kpiPeriodId = "";
|
||||||
|
formDetail.includingName = "";
|
||||||
|
formDetail.including = "";
|
||||||
|
formDetail.target = "";
|
||||||
|
formDetail.unit = "";
|
||||||
|
formDetail.weight = "";
|
||||||
|
formDetail.achievement1 = "";
|
||||||
|
formDetail.achievement2 = "";
|
||||||
|
formDetail.achievement3 = "";
|
||||||
|
formDetail.achievement4 = "";
|
||||||
|
formDetail.achievement5 = "";
|
||||||
|
formDetail.meaning = "";
|
||||||
|
formDetail.formula = "";
|
||||||
|
formDetail.node = "";
|
||||||
|
formDetail.nodeId = "";
|
||||||
|
formDetail.strategy = "";
|
||||||
|
formDetail.strategyId = "";
|
||||||
}
|
}
|
||||||
|
|
||||||
/** เรียกใช้ class */
|
/** เรียกใช้ class */
|
||||||
|
|
@ -84,27 +138,40 @@ function getclass() {
|
||||||
return "inputgreen";
|
return "inputgreen";
|
||||||
}
|
}
|
||||||
|
|
||||||
function onSubmit() {}
|
function onSubmit() {
|
||||||
|
dialogConfirm($q, () => {});
|
||||||
|
}
|
||||||
|
|
||||||
|
watch(
|
||||||
|
() => modal.value,
|
||||||
|
() => {
|
||||||
|
if (modal.value) {
|
||||||
|
fetchIndicators();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
);
|
||||||
</script>
|
</script>
|
||||||
<template>
|
<template>
|
||||||
<q-dialog v-model="modal" persistent>
|
<q-dialog v-model="modal" persistent>
|
||||||
<q-card class="col-12" style="width: 85%">
|
<q-card class="col-12" style="width: 70%">
|
||||||
<q-form greedy @submit.prevent @validation-success="onSubmit">
|
<q-form greedy @submit.prevent @validation-success="onSubmit">
|
||||||
<DialogHeader
|
<DialogHeader
|
||||||
:tittle="
|
:tittle="
|
||||||
numpage == 1
|
numpage == 1
|
||||||
? 'เพิ่มตัวชี้วัดตามแผนปฏิบัติราชการประจําปี'
|
? 'เพิ่มตัวชี้วัดตามแผนปฏิบัติราชการประจําปี'
|
||||||
: 'เพิ่มตัวชี้วัดตามหน้าที่ความรับผิดชอบ'
|
: 'เพิ่มตัวชี้วัดตามหน้าที่ความรับผิดชอบ'
|
||||||
"
|
"
|
||||||
:close="closeDialog"
|
:close="closeDialog"
|
||||||
/>
|
/>
|
||||||
<q-separator />
|
<q-separator />
|
||||||
|
|
||||||
<q-card-section class="q-pa-none scroll" style="max-height: 80vh">
|
<q-card-section class="q-pa-none scroll" style="max-height: 75vh">
|
||||||
<div class="col-12 row">
|
<div class="col-12 row">
|
||||||
<div class="bg-grey-1 q-pa-md col-xs-12 col-sm-4 col-md-3 row lineRight">
|
<div
|
||||||
|
class="bg-grey-1 q-pa-md col-xs-12 col-sm-4 col-md-3 row lineRight"
|
||||||
|
>
|
||||||
<div class="col-12 fit">
|
<div class="col-12 fit">
|
||||||
<div class="col-12 ">
|
<div class="col-12">
|
||||||
<q-input
|
<q-input
|
||||||
v-model="search"
|
v-model="search"
|
||||||
outlined
|
outlined
|
||||||
|
|
@ -122,47 +189,44 @@ function onSubmit() {}
|
||||||
/>
|
/>
|
||||||
</template>
|
</template>
|
||||||
</q-input>
|
</q-input>
|
||||||
</div>
|
|
||||||
<q-card bordered flat class="q-mt-sm no-shadow bg-white col-12">
|
|
||||||
<div class="row q-px-md q-py-sm items-center bg-grey-1">
|
|
||||||
<div class="col-4">
|
|
||||||
<span>รหัสตัวชี้วัด</span>
|
|
||||||
</div>
|
|
||||||
<div class="col-4">
|
|
||||||
<span>ชื่อตัวชี้วัด</span>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
<q-separator/>
|
|
||||||
|
|
||||||
<q-card-section class="q-pa-none">
|
|
||||||
<q-list
|
|
||||||
separator
|
|
||||||
dense
|
|
||||||
>
|
|
||||||
<q-item
|
|
||||||
v-for="(item, index) in listTarget"
|
|
||||||
:key="index"
|
|
||||||
clickable
|
|
||||||
v-ripple
|
|
||||||
:active="listCheck === index"
|
|
||||||
active-class="my-menu-link"
|
|
||||||
@click="clickList(index, item.id)"
|
|
||||||
>
|
|
||||||
<q-item-section class="q-pa-none">
|
|
||||||
<div class="row items-center" style="height: 20px">
|
|
||||||
<div class="col-4">
|
|
||||||
<span>{{ item.metricCode }}</span>
|
|
||||||
</div>
|
|
||||||
<div class="col-4">
|
|
||||||
<span>{{ item.indicatorName }}</span>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</q-item-section>
|
|
||||||
</q-item>
|
|
||||||
</q-list>
|
|
||||||
</q-card-section>
|
|
||||||
</q-card>
|
|
||||||
</div>
|
</div>
|
||||||
|
<q-card bordered flat class="q-mt-sm no-shadow bg-white col-12">
|
||||||
|
<div class="row q-px-md q-py-sm items-center bg-grey-1">
|
||||||
|
<div class="col-4">
|
||||||
|
<span>รหัสตัวชี้วัด</span>
|
||||||
|
</div>
|
||||||
|
<div class="col-4">
|
||||||
|
<span>ชื่อตัวชี้วัด</span>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<q-separator />
|
||||||
|
|
||||||
|
<q-card-section class="q-pa-none">
|
||||||
|
<q-list separator dense>
|
||||||
|
<q-item
|
||||||
|
v-for="(item, index) in listTarget"
|
||||||
|
:key="index"
|
||||||
|
clickable
|
||||||
|
v-ripple
|
||||||
|
:active="listCheck === index"
|
||||||
|
active-class="my-menu-link"
|
||||||
|
@click="clickList(index, item.id)"
|
||||||
|
>
|
||||||
|
<q-item-section class="q-pa-none">
|
||||||
|
<div class="row items-center" style="height: 20px">
|
||||||
|
<div class="col-4">
|
||||||
|
<span>{{ item.including }}</span>
|
||||||
|
</div>
|
||||||
|
<div class="col-4">
|
||||||
|
<span>{{ item.includingName }}</span>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</q-item-section>
|
||||||
|
</q-item>
|
||||||
|
</q-list>
|
||||||
|
</q-card-section>
|
||||||
|
</q-card>
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="col-xs-12 col-sm-8 col-md-9 row">
|
<div class="col-xs-12 col-sm-8 col-md-9 row">
|
||||||
|
|
@ -174,57 +238,123 @@ function onSubmit() {}
|
||||||
</div>
|
</div>
|
||||||
<div class="col-8">
|
<div class="col-8">
|
||||||
<q-card bordered class="full-height q-pa-sm">
|
<q-card bordered class="full-height q-pa-sm">
|
||||||
<div
|
<div class="q-pa-sm q-col-gutter-lg">
|
||||||
v-for="(field, index) in Object.keys(fieldDetailLabels)"
|
<div class="col-12 row">
|
||||||
:key="index + 1"
|
<div class="col-4 text-grey-6">หน่วยงาน/ส่วนราชการ</div>
|
||||||
>
|
<div class="col-8">{{ formDetail.nodeId }}</div>
|
||||||
<div class="row q-pa-sm q-col-gutter-lg col-12">
|
</div>
|
||||||
<div class="col-4 text-grey-6">
|
<div class="col-12 row">
|
||||||
{{
|
<div class="col-4 text-grey-6">ยุทธศาสตร์ / แผน</div>
|
||||||
fieldDetailLabels[
|
<div class="col-8">{{ formDetail.strategyId }}</div>
|
||||||
field as keyof typeof fieldDetailLabels
|
</div>
|
||||||
]
|
|
||||||
}}
|
<div class="col-12 row">
|
||||||
</div>
|
<div class="col-4 text-grey-6">รหัสตัวชี้วัด</div>
|
||||||
|
<div class="col-8">{{ formDetail.including }}</div>
|
||||||
|
</div>
|
||||||
|
<div class="col-12 row">
|
||||||
|
<div class="col-4 text-grey-6">ชื่อตัวชี้วัด</div>
|
||||||
|
<div class="col-8">{{ formDetail.includingName }}</div>
|
||||||
|
</div>
|
||||||
|
<div class="col-12 row">
|
||||||
|
<div class="col-4 text-grey-6">ค่าเป้าหมาย</div>
|
||||||
<div class="col-8">
|
<div class="col-8">
|
||||||
<span>{{
|
<q-input
|
||||||
formDetail[field] ? formDetail[field] : "-"
|
outlined
|
||||||
}}</span>
|
v-model="formDetail.target"
|
||||||
|
bg-color="white"
|
||||||
|
dense
|
||||||
|
class="inputgreen"
|
||||||
|
:rules="[
|
||||||
|
(val) => !!val || `${'กรุณากรอกค่าเป้าหมาย'}`,
|
||||||
|
]"
|
||||||
|
hide-bottom-space
|
||||||
|
/>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div class="col-12 row">
|
||||||
|
<div class="col-4 text-grey-6">หน่วยนับ</div>
|
||||||
|
<div class="col-8">
|
||||||
|
<q-input
|
||||||
|
outlined
|
||||||
|
v-model="formDetail.unit"
|
||||||
|
bg-color="white"
|
||||||
|
dense
|
||||||
|
class="inputgreen"
|
||||||
|
:rules="[
|
||||||
|
(val) => !!val || `${'กรุณากรอกหน่วยนับ'}`,
|
||||||
|
]"
|
||||||
|
hide-bottom-space
|
||||||
|
mask="#"
|
||||||
|
reverse-fill-mask
|
||||||
|
/>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div class="col-12 row">
|
||||||
|
<div class="col-4 text-grey-6">น้ำหนัก (ร้อยละ)</div>
|
||||||
|
<div class="col-8">
|
||||||
|
<q-input
|
||||||
|
outlined
|
||||||
|
v-model="formDetail.weight"
|
||||||
|
bg-color="white"
|
||||||
|
dense
|
||||||
|
class="inputgreen"
|
||||||
|
:rules="[
|
||||||
|
(val) =>
|
||||||
|
!!val || `${'กรุณากรอกน้ำหนัก (ร้อยละ)'}`,
|
||||||
|
]"
|
||||||
|
hide-bottom-space
|
||||||
|
mask="#"
|
||||||
|
reverse-fill-mask
|
||||||
|
/>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</q-card>
|
</q-card>
|
||||||
</div>
|
</div>
|
||||||
<div class="col-4 row ">
|
<div class="col-4 row">
|
||||||
<div class="row col-12 card-box">
|
<div class="row col-12 card-box">
|
||||||
<div class="col-12 bg-grey-2 row items-center text-weight-medium">
|
<div
|
||||||
|
class="col-12 bg-grey-2 row items-center text-weight-medium"
|
||||||
|
>
|
||||||
<div class="col-6 text-center">ระดับคะแนน</div>
|
<div class="col-6 text-center">ระดับคะแนน</div>
|
||||||
<div class="col-6 text-center">ผลสำเร็จของงาน</div>
|
<div class="col-6 text-center">ผลสำเร็จของงาน</div>
|
||||||
</div>
|
</div>
|
||||||
|
<div class="row col-12 items-center lineTop">
|
||||||
<div
|
<div class="col-6 text-center text-body2">5</div>
|
||||||
v-for="(field, index) in Object.keys(fieldLabels)"
|
<div class="col-6 text-center text-primary">
|
||||||
:key="index + 1"
|
{{ formDetail.achievement5 }}
|
||||||
class="row col-12 items-center lineTop"
|
</div>
|
||||||
>
|
</div>
|
||||||
<div
|
<div class="row col-12 items-center lineTop">
|
||||||
class="col-6 text-center text-body2"
|
<div class="col-6 text-center text-body2">4</div>
|
||||||
>
|
<div class="col-6 text-center text-primary">
|
||||||
{{ fieldLabels[field as keyof typeof fieldLabels] }}
|
{{ formDetail.achievement4 }}
|
||||||
</div>
|
</div>
|
||||||
<div class="col-6 text-center text-primary">
|
</div>
|
||||||
<span>{{
|
<div class="row col-12 items-center lineTop">
|
||||||
formScore[field] ? formScore[field] : "-"
|
<div class="col-6 text-center text-body2">3</div>
|
||||||
}}</span>
|
<div class="col-6 text-center text-primary">
|
||||||
</div>
|
{{ formDetail.achievement3 }}
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div class="row col-12 items-center lineTop">
|
||||||
|
<div class="col-6 text-center text-body2">2</div>
|
||||||
|
<div class="col-6 text-center text-primary">
|
||||||
|
{{ formDetail.achievement2 }}
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div class="row col-12 items-center lineTop">
|
||||||
|
<div class="col-6 text-center text-body2">1</div>
|
||||||
|
<div class="col-6 text-center text-primary">
|
||||||
|
{{ formDetail.achievement1 }}
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="col-12">
|
<div class="col-12">
|
||||||
<q-input
|
<q-input
|
||||||
v-model="define"
|
v-model="formDetail.meaning"
|
||||||
label="นิยามหรือความหมายของตัวชี้วัด"
|
label="นิยามหรือความหมายของตัวชี้วัด"
|
||||||
type="textarea"
|
type="textarea"
|
||||||
outlined
|
outlined
|
||||||
|
|
@ -237,7 +367,7 @@ function onSubmit() {}
|
||||||
</div>
|
</div>
|
||||||
<div class="col-12">
|
<div class="col-12">
|
||||||
<q-input
|
<q-input
|
||||||
v-model="formula"
|
v-model="formDetail.formula"
|
||||||
label="สูตรคำนวณ"
|
label="สูตรคำนวณ"
|
||||||
type="textarea"
|
type="textarea"
|
||||||
outlined
|
outlined
|
||||||
|
|
@ -251,18 +381,15 @@ function onSubmit() {}
|
||||||
</div>
|
</div>
|
||||||
</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">
|
||||||
<q-btn
|
<q-btn label="บันทึก" color="secondary" type="submit"
|
||||||
label="บันทึก"
|
><q-tooltip>บันทึกข้อมูล</q-tooltip></q-btn
|
||||||
color="secondary"
|
>
|
||||||
type="submit"
|
</q-card-actions>
|
||||||
><q-tooltip>บันทึกข้อมูล</q-tooltip></q-btn
|
</q-form>
|
||||||
>
|
|
||||||
</q-card-actions>
|
|
||||||
</q-form>
|
|
||||||
</q-card>
|
</q-card>
|
||||||
</q-dialog>
|
</q-dialog>
|
||||||
</template>
|
</template>
|
||||||
|
|
@ -272,17 +399,17 @@ function onSubmit() {}
|
||||||
background: #ebf9f7 !important;
|
background: #ebf9f7 !important;
|
||||||
color: #1bb19ab8 !important;
|
color: #1bb19ab8 !important;
|
||||||
}
|
}
|
||||||
.no-shadow{
|
.no-shadow {
|
||||||
box-shadow:none !important;
|
box-shadow: none !important;
|
||||||
}
|
}
|
||||||
.lineRight{
|
.lineRight {
|
||||||
border-right: 1px solid #EDEDED !important;
|
border-right: 1px solid #ededed !important;
|
||||||
}
|
}
|
||||||
.lineTop{
|
.lineTop {
|
||||||
border-top: 1px solid #EDEDED !important;
|
border-top: 1px solid #ededed !important;
|
||||||
}
|
}
|
||||||
.card-box{
|
.card-box {
|
||||||
border: 1px solid #EDEDED !important;
|
border: 1px solid #ededed !important;
|
||||||
border-radius: 8px;
|
border-radius: 8px;
|
||||||
}
|
}
|
||||||
</style>
|
</style>
|
||||||
|
|
|
||||||
|
|
@ -1,18 +1,19 @@
|
||||||
<script setup lang="ts">
|
<script setup lang="ts">
|
||||||
import { ref, onMounted, reactive } from "vue";
|
import { ref, onMounted, reactive } from "vue";
|
||||||
import { useRoute, useRouter } from "vue-router";
|
import { useRoute, useRouter } from "vue-router";
|
||||||
import TabMain from "@/modules/08_KPI/views/TabMain.vue";
|
|
||||||
import http from "@/plugins/http";
|
import http from "@/plugins/http";
|
||||||
import config from "@/app.config";
|
import config from "@/app.config";
|
||||||
|
import TabMain from "@/modules/08_KPI/views/TabMain.vue";
|
||||||
|
import { useQuasar } from "quasar";
|
||||||
|
|
||||||
import { useCounterMixin } from "@/stores/mixin";
|
import { useCounterMixin } from "@/stores/mixin";
|
||||||
import { useQuasar } from "quasar";
|
import { useKpiDataStore } from "@/modules/08_KPI/store";
|
||||||
|
|
||||||
import type { FormProfile } from "@/modules/08_KPI/interface/request/index";
|
import type { FormProfile } from "@/modules/08_KPI/interface/request/index";
|
||||||
|
|
||||||
const route = useRoute();
|
const route = useRoute();
|
||||||
const id = route.params.id as string;
|
const id = ref<string>(route.params.id as string);
|
||||||
|
const store = useKpiDataStore();
|
||||||
const $q = useQuasar();
|
const $q = useQuasar();
|
||||||
const mixin = useCounterMixin();
|
const mixin = useCounterMixin();
|
||||||
const { showLoader, hideLoader, messageError } = mixin;
|
const { showLoader, hideLoader, messageError } = mixin;
|
||||||
|
|
@ -27,18 +28,38 @@ const formProfile = reactive<FormProfile>({
|
||||||
level: "ชำนาญการพิเศษ",
|
level: "ชำนาญการพิเศษ",
|
||||||
status: "จัดเตรียมข้อมูล",
|
status: "จัดเตรียมข้อมูล",
|
||||||
score: "100",
|
score: "100",
|
||||||
avartar:
|
avartar: "https://cdn.quasar.dev/img/boy-avatar.png",
|
||||||
"https://cdn.quasar.dev/img/boy-avatar.png",
|
|
||||||
});
|
});
|
||||||
|
|
||||||
const router = useRouter();
|
const router = useRouter();
|
||||||
|
|
||||||
|
function fetchEvaluation() {
|
||||||
|
showLoader();
|
||||||
|
http
|
||||||
|
.get(config.API.kpiEvaluation + `/${id.value}`)
|
||||||
|
.then((res) => {
|
||||||
|
const data = res.data.result;
|
||||||
|
store.dataEvaluation = data;
|
||||||
|
console.log(data);
|
||||||
|
})
|
||||||
|
.catch((e) => {
|
||||||
|
messageError($q, e);
|
||||||
|
})
|
||||||
|
.finally(() => {
|
||||||
|
hideLoader();
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
function getProfile() {
|
function getProfile() {
|
||||||
showLoader();
|
showLoader();
|
||||||
http
|
http
|
||||||
.get(config.API.profileBykeycloak())
|
.get(config.API.profilePosition())
|
||||||
.then((res) => {
|
.then((res) => {
|
||||||
const data = res.data.result;
|
const data = res.data.result;
|
||||||
|
store.dataProfile = data;
|
||||||
|
console.log(data);
|
||||||
|
|
||||||
|
formProfile.fullName = `${data.prefix}${data.firstName} ${data.lastName}`;
|
||||||
})
|
})
|
||||||
.catch((e) => {
|
.catch((e) => {
|
||||||
messageError($q, e);
|
messageError($q, e);
|
||||||
|
|
@ -52,6 +73,7 @@ function getProfile() {
|
||||||
function onSave() {}
|
function onSave() {}
|
||||||
|
|
||||||
onMounted(() => {
|
onMounted(() => {
|
||||||
|
fetchEvaluation();
|
||||||
getProfile();
|
getProfile();
|
||||||
});
|
});
|
||||||
</script>
|
</script>
|
||||||
|
|
@ -77,18 +99,18 @@ onMounted(() => {
|
||||||
>
|
>
|
||||||
</div>
|
</div>
|
||||||
<div class="col-12">
|
<div class="col-12">
|
||||||
<q-card bordered flat class="relative-position">
|
<q-card bordered flat class="relative-position">
|
||||||
<div
|
<div
|
||||||
class="absolute"
|
class="absolute"
|
||||||
style="left: 2%; top: 50%; transform: translateY(-50%)"
|
style="left: 2%; top: 50%; transform: translateY(-50%)"
|
||||||
>
|
>
|
||||||
<q-avatar size="95px">
|
<q-avatar size="95px">
|
||||||
<q-img :src="formProfile.avartar" />
|
<q-img :src="formProfile.avartar" />
|
||||||
</q-avatar>
|
</q-avatar>
|
||||||
</div>
|
</div>
|
||||||
<div class="row col-12">
|
<div class="row col-12">
|
||||||
<div class="row items-center col-12 q-pa-sm">
|
<div class="row items-center col-12 q-pa-sm">
|
||||||
<div class="col-12" style="padding-left: 12%;">
|
<div class="col-12" style="padding-left: 12%">
|
||||||
<div class="row col-12 items-center">
|
<div class="row col-12 items-center">
|
||||||
<span class="text-h6 text-weight-medium text-primary">{{
|
<span class="text-h6 text-weight-medium text-primary">{{
|
||||||
formProfile.fullName ? formProfile.fullName : "-"
|
formProfile.fullName ? formProfile.fullName : "-"
|
||||||
|
|
@ -119,10 +141,9 @@ onMounted(() => {
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
|
||||||
<div class="row items-center bg-toolbar col-12 q-pa-sm">
|
<div class="row items-center bg-toolbar col-12 q-pa-sm">
|
||||||
<div class="col-12 q-py-xs" style="padding-left: 12%;">
|
<div class="col-12 q-py-xs" style="padding-left: 12%">
|
||||||
<div class="row no-wrap">
|
<div class="row no-wrap">
|
||||||
<div class="col-2">
|
<div class="col-2">
|
||||||
<div class="column">
|
<div class="column">
|
||||||
|
|
@ -178,8 +199,7 @@ onMounted(() => {
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
<style>
|
<style>
|
||||||
.bg-toolbar{
|
.bg-toolbar {
|
||||||
background-color: #F2FBFA;
|
background-color: #f2fbfa;
|
||||||
}
|
}
|
||||||
|
|
||||||
</style>
|
</style>
|
||||||
|
|
|
||||||
|
|
@ -1,101 +1,260 @@
|
||||||
<script setup lang="ts">
|
<script setup lang="ts">
|
||||||
import { ref, onMounted } from "vue";
|
import { ref, onMounted, reactive, watch } from "vue";
|
||||||
import { useRouter } from "vue-router";
|
import { useRouter } from "vue-router";
|
||||||
|
import { useQuasar } from "quasar";
|
||||||
|
import config from "@/app.config";
|
||||||
|
import http from "@/plugins/http";
|
||||||
|
|
||||||
import type { DataOptions } from "@/modules/08_KPI/interface/index/Main";
|
import type { DataOptions } from "@/modules/08_KPI/interface/index/Main";
|
||||||
import type { QTableProps } from "quasar";
|
import type { QTableProps } from "quasar";
|
||||||
|
|
||||||
|
import DialogHeader from "@/components/DialogHeader.vue";
|
||||||
|
|
||||||
import { useCounterMixin } from "@/stores/mixin";
|
import { useCounterMixin } from "@/stores/mixin";
|
||||||
|
|
||||||
const mixin = useCounterMixin()
|
const $q = useQuasar();
|
||||||
const { date2Thai } = mixin
|
const mixin = useCounterMixin();
|
||||||
const router = useRouter();
|
const router = useRouter();
|
||||||
|
const { showLoader, hideLoader, messageError, date2Thai, dialogConfirm } =
|
||||||
|
mixin;
|
||||||
|
|
||||||
const filterKeyword = ref<string>("");
|
/** Table*/
|
||||||
|
|
||||||
const rows = ref<any>();
|
const rows = ref<any>();
|
||||||
|
const visibleColumns = ref<string[]>([
|
||||||
const round = ref<string>("ID1");
|
"createdAt",
|
||||||
const roundOp = ref<DataOptions[]>([
|
"evaluationStatus",
|
||||||
{
|
"evaluationResults",
|
||||||
id: "ID1",
|
|
||||||
name: "รอบเมษา",
|
|
||||||
},
|
|
||||||
]);
|
]);
|
||||||
|
|
||||||
const visibleColumns = ref<string[]>(["createDate", "status", "result"]);
|
|
||||||
|
|
||||||
const columns = ref<QTableProps["columns"]>([
|
const columns = ref<QTableProps["columns"]>([
|
||||||
{
|
{
|
||||||
name: "createDate",
|
name: "createdAt",
|
||||||
align: "left",
|
align: "left",
|
||||||
label: "วันที่สร้างแบบประเมิน",
|
label: "วันที่สร้างแบบประเมิน",
|
||||||
sortable: true,
|
sortable: true,
|
||||||
field: "createDate",
|
field: "createdAt",
|
||||||
headerStyle: "font-size: 14px",
|
headerStyle: "font-size: 14px",
|
||||||
style: "font-size: 14px",
|
style: "font-size: 14px",
|
||||||
|
format: (v) => date2Thai(v),
|
||||||
sort: (a: string, b: string) =>
|
sort: (a: string, b: string) =>
|
||||||
a.localeCompare(b, undefined, { numeric: true, sensitivity: "base" }),
|
a.localeCompare(b, undefined, { numeric: true, sensitivity: "base" }),
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
name: "status",
|
name: "evaluationStatus",
|
||||||
align: "left",
|
align: "left",
|
||||||
label: "สถานะการประเมิน",
|
label: "สถานะการประเมิน",
|
||||||
sortable: true,
|
sortable: true,
|
||||||
field: "status",
|
field: "evaluationStatus",
|
||||||
headerStyle: "font-size: 14px",
|
headerStyle: "font-size: 14px",
|
||||||
style: "font-size: 14px",
|
style: "font-size: 14px",
|
||||||
|
format: (v) => convertStatus(v),
|
||||||
sort: (a: string, b: string) =>
|
sort: (a: string, b: string) =>
|
||||||
a.localeCompare(b, undefined, { numeric: true, sensitivity: "base" }),
|
a.localeCompare(b, undefined, { numeric: true, sensitivity: "base" }),
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
name: "result",
|
name: "evaluationResults",
|
||||||
align: "left",
|
align: "left",
|
||||||
label: "ผลการประเมิน",
|
label: "ผลการประเมิน",
|
||||||
sortable: true,
|
sortable: true,
|
||||||
field: "result",
|
field: "evaluationResults",
|
||||||
headerStyle: "font-size: 14px",
|
headerStyle: "font-size: 14px",
|
||||||
style: "font-size: 14px",
|
style: "font-size: 14px",
|
||||||
|
format: (v) => convertResults(v),
|
||||||
sort: (a: string, b: string) =>
|
sort: (a: string, b: string) =>
|
||||||
a.localeCompare(b, undefined, { numeric: true, sensitivity: "base" }),
|
a.localeCompare(b, undefined, { numeric: true, sensitivity: "base" }),
|
||||||
},
|
},
|
||||||
]);
|
]);
|
||||||
|
|
||||||
/** ดึงข้อมูล */
|
/** List*/
|
||||||
function getData() {
|
const year = ref<number>(new Date().getFullYear());
|
||||||
const data = [
|
const round = ref<string>("");
|
||||||
{
|
const filterKeyword = ref<string>("");
|
||||||
id: "ID1",
|
const roundMainOp = ref<DataOptions[]>([]);
|
||||||
createDate: '2024-02-16T06:01:00.000Z',
|
const roundDialgOp = ref<DataOptions[]>([]);
|
||||||
status: "รอดำเนินการ",
|
|
||||||
result: "ผ่านเกณฑ์การประเมิน",
|
/** Dialog*/
|
||||||
},
|
const modalDialog = ref<boolean>(false);
|
||||||
{
|
const yearDialog = ref<number | null>(null);
|
||||||
id: "ID1",
|
const formRound = reactive({
|
||||||
createDate: '2024-02-16T06:01:00.000Z',
|
kpiPeriodId: "",
|
||||||
status: "รอดำเนินการ",
|
profileId: "",
|
||||||
result: "ผ่านเกณฑ์การประเมิน",
|
prefix: "",
|
||||||
},
|
firstName: "",
|
||||||
];
|
lastName: "",
|
||||||
rows.value = data;
|
});
|
||||||
// showLoader();
|
|
||||||
// await http
|
/** pagetion*/
|
||||||
// .get(config.API.orgPrefix)
|
const formQuery = reactive({
|
||||||
// .then(async (res) => {
|
page: 1,
|
||||||
// })
|
pageSize: 10,
|
||||||
// .catch((err) => {
|
});
|
||||||
// messageError($q, err);
|
const totalList = ref<number>(1);
|
||||||
// })
|
|
||||||
// .finally(() => {
|
function fetchRoundOption(type: string) {
|
||||||
// hideLoader();
|
const y = type === "main" ? year.value : yearDialog.value;
|
||||||
// });
|
showLoader();
|
||||||
|
http
|
||||||
|
.get(
|
||||||
|
config.API.kpiPeriod + `?page=${1}&pageSize=${10}&keyword=${""}&year=${y}`
|
||||||
|
)
|
||||||
|
.then((res) => {
|
||||||
|
const data = res.data.result.data;
|
||||||
|
const list = data.map((e: any) => ({
|
||||||
|
id: e.id,
|
||||||
|
name:
|
||||||
|
e.durationKPI === "OCT"
|
||||||
|
? "รอบตุลาคม"
|
||||||
|
: e.durationKPI === "APR"
|
||||||
|
? "รอบเมษายน"
|
||||||
|
: "",
|
||||||
|
}));
|
||||||
|
if (type === "main") {
|
||||||
|
roundMainOp.value = list;
|
||||||
|
round.value = "";
|
||||||
|
fetchList();
|
||||||
|
} else {
|
||||||
|
roundDialgOp.value = list;
|
||||||
|
formRound.kpiPeriodId = "";
|
||||||
|
}
|
||||||
|
})
|
||||||
|
.catch((err) => {
|
||||||
|
messageError($q, err);
|
||||||
|
})
|
||||||
|
.finally(() => {
|
||||||
|
hideLoader();
|
||||||
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
function onEdit(id:string){
|
/** ดึงข้อมูล */
|
||||||
router.push(`/KPI/${id}`)
|
function fetchList() {
|
||||||
|
showLoader();
|
||||||
|
http
|
||||||
|
.get(
|
||||||
|
config.API.kpiEvaluation +
|
||||||
|
`?page=${formQuery.page}&pageSize=${formQuery.pageSize}&kpiPeriodId=${round.value}`
|
||||||
|
)
|
||||||
|
.then((res) => {
|
||||||
|
const data = res.data.result;
|
||||||
|
totalList.value = Math.ceil(data.total / formQuery.pageSize);
|
||||||
|
rows.value = data.data;
|
||||||
|
})
|
||||||
|
.catch((err) => {
|
||||||
|
messageError($q, err);
|
||||||
|
})
|
||||||
|
.finally(() => {
|
||||||
|
hideLoader();
|
||||||
|
});
|
||||||
}
|
}
|
||||||
onMounted(async () => {
|
|
||||||
getData();
|
function changRound() {
|
||||||
|
formQuery.page = 1;
|
||||||
|
fetchList();
|
||||||
|
}
|
||||||
|
|
||||||
|
function redirectViewDetail(id: string) {
|
||||||
|
router.push(`/KPI/${id}`);
|
||||||
|
}
|
||||||
|
|
||||||
|
function onClickAddList() {
|
||||||
|
modalDialog.value = true;
|
||||||
|
}
|
||||||
|
|
||||||
|
function onCloseDialog() {
|
||||||
|
modalDialog.value = false;
|
||||||
|
formRound.kpiPeriodId = "";
|
||||||
|
yearDialog.value = null;
|
||||||
|
}
|
||||||
|
|
||||||
|
function onSubmit() {
|
||||||
|
dialogConfirm($q, () => {
|
||||||
|
showLoader();
|
||||||
|
http
|
||||||
|
.post(config.API.kpiEvaluation, formRound)
|
||||||
|
.then((res) => {
|
||||||
|
console.log(res);
|
||||||
|
const id = res.data.result;
|
||||||
|
redirectViewDetail(id);
|
||||||
|
onCloseDialog();
|
||||||
|
})
|
||||||
|
.catch((err) => {
|
||||||
|
messageError($q, err);
|
||||||
|
})
|
||||||
|
.finally(() => {
|
||||||
|
hideLoader();
|
||||||
|
});
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
function getProfile() {
|
||||||
|
showLoader();
|
||||||
|
http
|
||||||
|
.get(config.API.profileBykeycloak())
|
||||||
|
.then((res) => {
|
||||||
|
const data = res.data.result;
|
||||||
|
formRound.profileId = data.id;
|
||||||
|
formRound.prefix = data.prefix;
|
||||||
|
formRound.firstName = data.firstName;
|
||||||
|
formRound.lastName = data.lastName;
|
||||||
|
})
|
||||||
|
.catch((e) => {
|
||||||
|
messageError($q, e);
|
||||||
|
})
|
||||||
|
.finally(() => {
|
||||||
|
hideLoader();
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
const pagination = ref({
|
||||||
|
sortBy: "desc",
|
||||||
|
descending: false,
|
||||||
|
page: 1,
|
||||||
|
rowsPerPage: 10,
|
||||||
|
});
|
||||||
|
|
||||||
|
/**
|
||||||
|
* function updatePagination
|
||||||
|
* @param newPagination ข้อมูล Pagination ใหม่
|
||||||
|
*/
|
||||||
|
function updatePagination(newPagination: any) {
|
||||||
|
formQuery.page = 1;
|
||||||
|
formQuery.pageSize = newPagination.rowsPerPage;
|
||||||
|
}
|
||||||
|
|
||||||
|
function convertStatus(val: string) {
|
||||||
|
switch (val) {
|
||||||
|
case "PENDING":
|
||||||
|
return "รอดำเนินการ";
|
||||||
|
case "INPROGRESS":
|
||||||
|
return "กําลังดำเนินการ";
|
||||||
|
case "DONE":
|
||||||
|
return "ประเมินเสร็จสิ้น";
|
||||||
|
default:
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
function convertResults(val: string) {
|
||||||
|
switch (val) {
|
||||||
|
case "PENDING":
|
||||||
|
return "รอดำเนินการ";
|
||||||
|
case "PASSED":
|
||||||
|
return "ผ่านการประเมิน";
|
||||||
|
case "NOTPASSED":
|
||||||
|
return "ไม่ผ่านการประเมิน";
|
||||||
|
default:
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
watch(
|
||||||
|
() => formQuery.pageSize,
|
||||||
|
() => {
|
||||||
|
fetchList();
|
||||||
|
}
|
||||||
|
);
|
||||||
|
|
||||||
|
onMounted(() => {
|
||||||
|
getProfile();
|
||||||
|
fetchRoundOption("main");
|
||||||
});
|
});
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
|
|
@ -118,29 +277,73 @@ onMounted(async () => {
|
||||||
<div class="col-12">
|
<div class="col-12">
|
||||||
<q-card bordered class="q-pa-md">
|
<q-card bordered class="q-pa-md">
|
||||||
<q-toolbar style="padding: 0">
|
<q-toolbar style="padding: 0">
|
||||||
<q-select
|
<div class="row q-gutter-sm">
|
||||||
v-model="round"
|
<datepicker
|
||||||
outlined
|
menu-class-name="modalfix"
|
||||||
label="รอบการประเมิน"
|
v-model="year"
|
||||||
dense
|
:locale="'th'"
|
||||||
option-label="name"
|
autoApply
|
||||||
option-value="id"
|
year-picker
|
||||||
:options="roundOp"
|
:enableTimePicker="false"
|
||||||
style="min-width: 200px"
|
@update:model-value="fetchRoundOption('main')"
|
||||||
emit-value
|
>
|
||||||
map-options
|
<template #year="{ year }">{{ year + 543 }}</template>
|
||||||
/>
|
<template #year-overlay-value="{ value }">{{
|
||||||
<q-btn class="q-ml-sm" flat round color="primary" icon="add" @click="router.push(`/KPI/add`)">
|
parseInt(value + 543)
|
||||||
<q-tooltip> เพิ่มข้อมูล </q-tooltip>
|
}}</template>
|
||||||
</q-btn>
|
<template #trigger>
|
||||||
|
<q-input
|
||||||
|
dense
|
||||||
|
lazy-rules
|
||||||
|
outlined
|
||||||
|
class="inputgreen"
|
||||||
|
hide-bottom-space
|
||||||
|
:model-value="!!year ? year + 543 : null"
|
||||||
|
:label="`${'ปีงบประมาณ'}`"
|
||||||
|
>
|
||||||
|
<template v-slot:prepend>
|
||||||
|
<q-icon
|
||||||
|
name="event"
|
||||||
|
class="cursor-pointer"
|
||||||
|
style="color: var(--q-primary)"
|
||||||
|
>
|
||||||
|
</q-icon>
|
||||||
|
</template>
|
||||||
|
</q-input>
|
||||||
|
</template>
|
||||||
|
</datepicker>
|
||||||
|
<q-select
|
||||||
|
v-model="round"
|
||||||
|
outlined
|
||||||
|
label="รอบการประเมิน"
|
||||||
|
dense
|
||||||
|
option-label="name"
|
||||||
|
option-value="id"
|
||||||
|
:options="roundMainOp"
|
||||||
|
style="min-width: 200px"
|
||||||
|
emit-value
|
||||||
|
map-options
|
||||||
|
@update:model-value="changRound"
|
||||||
|
/>
|
||||||
|
<q-btn
|
||||||
|
flat
|
||||||
|
round
|
||||||
|
color="primary"
|
||||||
|
icon="add"
|
||||||
|
@click="onClickAddList"
|
||||||
|
>
|
||||||
|
<q-tooltip> เพิ่มข้อมูล </q-tooltip>
|
||||||
|
</q-btn>
|
||||||
|
</div>
|
||||||
|
|
||||||
<q-space />
|
<q-space />
|
||||||
<div class="row q-gutter-sm">
|
<div class="row q-gutter-sm">
|
||||||
<q-input
|
<!-- <q-input
|
||||||
outlined
|
outlined
|
||||||
dense
|
dense
|
||||||
v-model="filterKeyword"
|
v-model="filterKeyword"
|
||||||
label="ค้นหา"
|
label="ค้นหา"
|
||||||
></q-input>
|
></q-input> -->
|
||||||
<q-select
|
<q-select
|
||||||
v-model="visibleColumns"
|
v-model="visibleColumns"
|
||||||
multiple
|
multiple
|
||||||
|
|
@ -158,44 +361,145 @@ onMounted(async () => {
|
||||||
</div>
|
</div>
|
||||||
</q-toolbar>
|
</q-toolbar>
|
||||||
|
|
||||||
<q-table
|
<div class="col-12">
|
||||||
ref="table"
|
<q-table
|
||||||
:columns="columns"
|
ref="table"
|
||||||
:rows="rows"
|
:columns="columns"
|
||||||
:filter="filterKeyword"
|
:rows="rows"
|
||||||
row-key="id"
|
:filter="filterKeyword"
|
||||||
flat
|
row-key="id"
|
||||||
bordered
|
flat
|
||||||
:paging="true"
|
bordered
|
||||||
dense
|
:paging="true"
|
||||||
class="custom-table2"
|
dense
|
||||||
:visible-columns="visibleColumns"
|
class="custom-table2"
|
||||||
>
|
:rows-per-page-options="[10, 25, 50, 100]"
|
||||||
<template v-slot:header="props">
|
:visible-columns="visibleColumns"
|
||||||
<q-tr :props="props">
|
v-model:pagination="pagination"
|
||||||
<q-th v-for="col in props.cols" :key="col.name" :props="props" >
|
@update:pagination="updatePagination"
|
||||||
<span class="text-weight-medium">{{ col.label }}</span>
|
>
|
||||||
</q-th>
|
<template v-slot:header="props">
|
||||||
<q-th auto-width />
|
<q-tr :props="props">
|
||||||
</q-tr>
|
<q-th
|
||||||
</template>
|
v-for="col in props.cols"
|
||||||
<template v-slot:body="props">
|
:key="col.name"
|
||||||
<q-tr :props="props" class="cursor-pointer">
|
:props="props"
|
||||||
<q-td v-for="col in props.cols" :key="col.id" @click="onEdit(props.row.id)">
|
>
|
||||||
<div v-if="col.name == 'createDate'">
|
<span class="text-weight-medium">{{ col.label }}</span>
|
||||||
{{ col.value ? date2Thai(col.value):'-' }}
|
</q-th>
|
||||||
</div>
|
</q-tr>
|
||||||
<div v-else>
|
</template>
|
||||||
{{ col.value }}
|
<template v-slot:body="props">
|
||||||
</div>
|
<q-tr :props="props" class="cursor-pointer">
|
||||||
</q-td>
|
<q-td
|
||||||
</q-tr>
|
v-for="col in props.cols"
|
||||||
</template>
|
:key="col.id"
|
||||||
</q-table>
|
@click="redirectViewDetail(props.row.id)"
|
||||||
|
>
|
||||||
|
<div>
|
||||||
|
{{ col.value ? col.value : "-" }}
|
||||||
|
</div>
|
||||||
|
</q-td>
|
||||||
|
</q-tr>
|
||||||
|
</template>
|
||||||
|
<template v-slot:pagination="scope">
|
||||||
|
<q-pagination
|
||||||
|
v-model="formQuery.page"
|
||||||
|
active-color="primary"
|
||||||
|
color="dark"
|
||||||
|
:max="Number(totalList)"
|
||||||
|
size="sm"
|
||||||
|
boundary-links
|
||||||
|
direction-links
|
||||||
|
:max-pages="5"
|
||||||
|
@update:model-value="fetchList"
|
||||||
|
></q-pagination>
|
||||||
|
</template>
|
||||||
|
</q-table>
|
||||||
|
</div>
|
||||||
</q-card>
|
</q-card>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
<q-dialog v-model="modalDialog" persistent>
|
||||||
|
<q-card class="col-12" style="width: 18%">
|
||||||
|
<q-form greedy @submit.prevent @validation-success="onSubmit">
|
||||||
|
<DialogHeader :tittle="'สร้างแบบประเมินผลฯ'" :close="onCloseDialog" />
|
||||||
|
<q-separator />
|
||||||
|
<q-card-section class="q-pa-none scroll" style="max-height: 80vh">
|
||||||
|
<div class="row q-pa-md q-col-gutter-md">
|
||||||
|
<div class="col-12">
|
||||||
|
<datepicker
|
||||||
|
menu-class-name="modalfix"
|
||||||
|
v-model="yearDialog"
|
||||||
|
:locale="'th'"
|
||||||
|
autoApply
|
||||||
|
year-picker
|
||||||
|
:enableTimePicker="false"
|
||||||
|
@update:model-value="fetchRoundOption('dialog')"
|
||||||
|
>
|
||||||
|
<template #year="{ year }">{{ year + 543 }}</template>
|
||||||
|
<template #year-overlay-value="{ value }">{{
|
||||||
|
parseInt(value + 543)
|
||||||
|
}}</template>
|
||||||
|
<template #trigger>
|
||||||
|
<q-input
|
||||||
|
dense
|
||||||
|
lazy-rules
|
||||||
|
outlined
|
||||||
|
class="inputgreen"
|
||||||
|
hide-bottom-space
|
||||||
|
:model-value="!!yearDialog ? yearDialog + 543 : null"
|
||||||
|
:label="`${'ปีงบประมาณ'}`"
|
||||||
|
:rules="[
|
||||||
|
(val:string) =>
|
||||||
|
!!val || `${'กรุณาเลือกปีงบประมาณ'}`,
|
||||||
|
]"
|
||||||
|
>
|
||||||
|
<template v-slot:prepend>
|
||||||
|
<q-icon
|
||||||
|
name="event"
|
||||||
|
class="cursor-pointer"
|
||||||
|
style="color: var(--q-primary)"
|
||||||
|
>
|
||||||
|
</q-icon>
|
||||||
|
</template>
|
||||||
|
</q-input>
|
||||||
|
</template>
|
||||||
|
</datepicker>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="col-12">
|
||||||
|
<q-select
|
||||||
|
v-model="formRound.kpiPeriodId"
|
||||||
|
outlined
|
||||||
|
label="รอบการประเมิน"
|
||||||
|
dense
|
||||||
|
option-label="name"
|
||||||
|
option-value="id"
|
||||||
|
:options="roundDialgOp"
|
||||||
|
emit-value
|
||||||
|
map-options
|
||||||
|
hide-bottom-space
|
||||||
|
lazy-rules
|
||||||
|
:rules="[
|
||||||
|
(val:string) =>
|
||||||
|
!!val || `${'กรุณาเลือกรอบการประเมิน'}`,
|
||||||
|
]"
|
||||||
|
/>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</q-card-section>
|
||||||
|
<q-separator />
|
||||||
|
<q-card-actions align="right" class="bg-white text-teal">
|
||||||
|
<q-btn label="บันทึก" color="secondary" type="submit"
|
||||||
|
><q-tooltip>บันทึกข้อมูล</q-tooltip></q-btn
|
||||||
|
>
|
||||||
|
</q-card-actions>
|
||||||
|
</q-form>
|
||||||
|
</q-card>
|
||||||
|
</q-dialog>
|
||||||
</template>
|
</template>
|
||||||
<style scoped lang="scss">
|
<style scoped lang="scss">
|
||||||
.icon-color {
|
.icon-color {
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue