kpi updated
This commit is contained in:
parent
56a38622e5
commit
6c532a0202
8 changed files with 266 additions and 182 deletions
|
|
@ -16,19 +16,6 @@ import { useCounterMixin } from "@/stores/mixin";
|
|||
import { useKpiDataStore } from "@/modules/08_KPI/store";
|
||||
|
||||
import type { ListCriteria } from "@/modules/08_KPI/interface/request/index";
|
||||
|
||||
const indicatorWeightTotal = defineModel("indicatorWeightTotal", {
|
||||
type: Number,
|
||||
default: 0,
|
||||
});
|
||||
const indicatorWeight1Total = defineModel("indicatorWeight1Total", {
|
||||
type: Number,
|
||||
default: 0,
|
||||
});
|
||||
const indicatorWeight2Total = defineModel("indicatorWeight2Total", {
|
||||
type: Number,
|
||||
default: 0,
|
||||
});
|
||||
const dataListCriteria = ref<ListCriteria[]>([]);
|
||||
|
||||
const modalCriteria = ref<boolean>(false);
|
||||
|
|
@ -58,6 +45,9 @@ const totalResults3 = ref<number>(0);
|
|||
const weightPlanned = ref<number>(0);
|
||||
const weightRole = ref<number>(0);
|
||||
const weightAssigned = ref<number>(0);
|
||||
const resultPlanned = ref<number>(0);
|
||||
const resultRole = ref<number>(0);
|
||||
const resultAssigned = ref<number>(0);
|
||||
function fetchListPlanned() {
|
||||
http
|
||||
.get(config.API.kpiAchievement("planned") + `?id=${evaluationId.value}`)
|
||||
|
|
@ -70,21 +60,23 @@ function fetchListPlanned() {
|
|||
rows_01.value = newRow;
|
||||
|
||||
if (newRow.length > 0) {
|
||||
const result = newRow.reduce(
|
||||
resultPlanned.value = newRow.reduce(
|
||||
(sum: number, e: any) => sum + e.evaluationResults,
|
||||
0
|
||||
);
|
||||
store.excusiveIndicator1PercentVal = resultPlanned.value;
|
||||
|
||||
const weight = newRow.reduce(
|
||||
(sum: number, e: any) => sum + e.weight,
|
||||
0
|
||||
);
|
||||
|
||||
weightPlanned.value = weight;
|
||||
indicatorWeight1Total.value = Number(weight);
|
||||
store.indicatorScoreVal = result;
|
||||
store.indicatorWeight1Total = Number(weight);
|
||||
|
||||
totalResults1.value =
|
||||
(result * store.dataEvaluation.plannedPoint) / weight;
|
||||
(resultPlanned.value * store.excusiveIndicator1Weight) / weight;
|
||||
store.excusiveIndicator1ScoreVal = totalResults1.value;
|
||||
}
|
||||
})
|
||||
.catch((err) => {
|
||||
|
|
@ -104,20 +96,17 @@ function fetchListRole() {
|
|||
rows_02.value = newRow;
|
||||
|
||||
if (newRow.length > 0) {
|
||||
const result = newRow.reduce(
|
||||
resultRole.value = newRow.reduce(
|
||||
(sum: number, e: any) => sum + e.evaluationResults,
|
||||
0
|
||||
);
|
||||
|
||||
const weight = newRow.reduce(
|
||||
(sum: number, e: any) => sum + e.weight,
|
||||
0
|
||||
);
|
||||
|
||||
weightRole.value = weight;
|
||||
indicatorWeight1Total.value = Number(weight);
|
||||
|
||||
totalResults2.value =
|
||||
(result * store.dataEvaluation.rolePoint) / weight;
|
||||
}
|
||||
})
|
||||
.catch((err) => {
|
||||
|
|
@ -138,19 +127,24 @@ function fetchAssigned() {
|
|||
rows_03.value = newRow;
|
||||
|
||||
if (newRow.length > 0) {
|
||||
const result = newRow.reduce(
|
||||
resultAssigned.value = newRow.reduce(
|
||||
(sum: number, e: any) => sum + e.evaluationResults,
|
||||
0
|
||||
);
|
||||
|
||||
store.excusiveIndicator2PercentVal = resultAssigned.value;
|
||||
|
||||
const weight = newRow.reduce(
|
||||
(sum: number, e: any) => sum + e.weight,
|
||||
0
|
||||
);
|
||||
|
||||
weightAssigned.value = weight;
|
||||
store.indicatorWeight2Total = Number(weight);
|
||||
|
||||
totalResults3.value =
|
||||
(result * store.dataEvaluation.specialPoint) / weight;
|
||||
(resultAssigned.value * store.excusiveIndicator2Weight) / weight;
|
||||
store.excusiveIndicator2ScoreVal = totalResults3.value;
|
||||
}
|
||||
})
|
||||
.catch((err) => {
|
||||
|
|
@ -162,11 +156,6 @@ function onInfo() {
|
|||
modalCriteria.value = true;
|
||||
}
|
||||
|
||||
const resultWork = computed(() => {
|
||||
const total = totalResults1.value + totalResults2.value + totalResults3.value;
|
||||
return total.toFixed(2);
|
||||
});
|
||||
|
||||
function getCriteria() {
|
||||
http
|
||||
.get(config.API.KpiEvaluationInfo)
|
||||
|
|
@ -182,6 +171,7 @@ function getCriteria() {
|
|||
const isShowScore = computed(() => {
|
||||
return (
|
||||
store.tabOpen === 3 &&
|
||||
store.tabMain === "3" &&
|
||||
store.dataEvaluation.evaluationStatus === "EVALUATING"
|
||||
);
|
||||
});
|
||||
|
|
@ -190,7 +180,7 @@ watch(
|
|||
[weightPlanned, weightRole, weightAssigned],
|
||||
([newA, newB, newC], [prevA, prevB, prevC]) => {
|
||||
if (newA !== prevA || newB !== prevB || newC !== prevC) {
|
||||
indicatorWeightTotal.value =
|
||||
store.indicatorWeightTotal =
|
||||
Number(weightPlanned.value) +
|
||||
Number(weightAssigned.value) +
|
||||
Number(weightRole.value);
|
||||
|
|
@ -198,12 +188,20 @@ watch(
|
|||
}
|
||||
);
|
||||
|
||||
async function getAll() {
|
||||
await getCriteria();
|
||||
await fetchListPlanned();
|
||||
await fetchListRole();
|
||||
await fetchAssigned();
|
||||
}
|
||||
watch(
|
||||
[resultPlanned, resultRole, resultAssigned],
|
||||
([newA, newB, newC], [prevA, prevB, prevC]) => {
|
||||
if (newA !== prevA || newB !== prevB || newC !== prevC) {
|
||||
store.indicatorPercentVal =
|
||||
Number(resultPlanned.value) +
|
||||
Number(resultRole.value) +
|
||||
Number(resultAssigned.value);
|
||||
|
||||
store.indicatorScoreVal =
|
||||
store.indicatorPercentVal * (store.indicatorScore / 100);
|
||||
}
|
||||
}
|
||||
);
|
||||
|
||||
onMounted(() => {
|
||||
getCriteria();
|
||||
|
|
@ -225,7 +223,6 @@ onMounted(() => {
|
|||
<span class="txt-under text-blue-6">องค์ประกอบที่ 1 </span>
|
||||
<span class="q-ml-sm"> ผลสัมฤทธิ์ของงาน</span>
|
||||
</div>
|
||||
|
||||
<div class="q-gutter-md q-mt-sm">
|
||||
<!-- องค์ประกอบที่ 1 -->
|
||||
<div v-if="store.dataProfile.posExecutiveName != null">
|
||||
|
|
@ -245,11 +242,11 @@ onMounted(() => {
|
|||
:rows="[
|
||||
{
|
||||
name: 'รวมผลการประเมิน (ร้อยละ)',
|
||||
value: store.excusiveIndicator1PercentVal,
|
||||
value: store.excusiveIndicator1PercentVal.toFixed(2),
|
||||
},
|
||||
{
|
||||
name: 'ผลการประเมินมิติที่ 1 (คะแนน)',
|
||||
value: store.excusiveIndicator1ScoreVal,
|
||||
value: store.excusiveIndicator1ScoreVal.toFixed(2),
|
||||
},
|
||||
]"
|
||||
:columns="[
|
||||
|
|
@ -289,13 +286,13 @@ onMounted(() => {
|
|||
dense
|
||||
bordered
|
||||
:rows="[
|
||||
{
|
||||
name: 'รวมผลการประเมิน (ร้อยละ)',
|
||||
value: store.excusiveIndicator2PercentVal,
|
||||
},
|
||||
// {
|
||||
// name: 'รวมผลการประเมิน (ร้อยละ)',
|
||||
// value: store.excusiveIndicator2PercentVal.toFixed(2),
|
||||
// },
|
||||
{
|
||||
name: 'ผลการประเมินมิติที่ 2 (คะแนน)',
|
||||
value: store.excusiveIndicator2ScoreVal,
|
||||
value: store.excusiveIndicator2ScoreVal.toFixed(2),
|
||||
},
|
||||
]"
|
||||
:columns="[
|
||||
|
|
@ -327,7 +324,12 @@ onMounted(() => {
|
|||
คะแนน)</span
|
||||
>
|
||||
<div class="text-primary q-pl-md">
|
||||
{{ store.indicatorScoreVal }}
|
||||
{{
|
||||
(
|
||||
store.excusiveIndicator1ScoreVal +
|
||||
store.excusiveIndicator2ScoreVal
|
||||
).toFixed(2)
|
||||
}}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
|
@ -365,7 +367,7 @@ onMounted(() => {
|
|||
:rows="[
|
||||
{
|
||||
name: 'รวมผลการประเมิน (ร้อยละ)',
|
||||
value: store.indicatorPercentVal,
|
||||
value: store.indicatorPercentVal.toFixed(2),
|
||||
},
|
||||
]"
|
||||
:columns="[
|
||||
|
|
@ -396,7 +398,7 @@ onMounted(() => {
|
|||
คะแนน)</span
|
||||
>
|
||||
<div class="text-primary q-pl-md">
|
||||
{{ store.indicatorScoreVal }}
|
||||
{{ store.indicatorScoreVal.toFixed(2) }}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
|
@ -435,7 +437,7 @@ onMounted(() => {
|
|||
? store.competencyScore
|
||||
: store.excusiveCompetencyScore
|
||||
} คะแนน)`,
|
||||
value: store.competencyScoreVal,
|
||||
value: store.competencyScoreVal.toFixed(2),
|
||||
},
|
||||
]"
|
||||
:columns="[
|
||||
|
|
@ -469,7 +471,7 @@ onMounted(() => {
|
|||
:rows="[
|
||||
{
|
||||
name: `ผลการประเมินการพัฒนาตนเอง (คะแนนเต็ม ${store.devScore} คะแนน)`,
|
||||
value: store.devScoreVal,
|
||||
value: store.devScoreVal.toFixed(2),
|
||||
},
|
||||
]"
|
||||
:columns="[
|
||||
|
|
@ -492,9 +494,11 @@ onMounted(() => {
|
|||
class="q-mt-xs q-mb-md"
|
||||
/>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div v-if="isShowScore">
|
||||
<div
|
||||
v-if="isShowScore && !store.dataProfile.posExecutiveName"
|
||||
v-if="store.dataProfile.posExecutiveName == null"
|
||||
class="row text-body2 text-weight-bold"
|
||||
>
|
||||
<div class="col-12 text-center row justify-center">
|
||||
|
|
@ -503,7 +507,7 @@ onMounted(() => {
|
|||
(คะแนนเต็ม {{ store.competencyDevScore }} คะแนน)</span
|
||||
>
|
||||
<div class="text-primary q-pl-md">
|
||||
{{ store.competencyDevScoreVal }}
|
||||
{{ (store.competencyScoreVal + store.devScoreVal).toFixed(2) }}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
|
@ -514,7 +518,7 @@ onMounted(() => {
|
|||
{{ store.competencyScore }} คะแนน)</span
|
||||
>
|
||||
<div class="text-primary q-pl-md">
|
||||
{{ store.competencyScoreVal }}
|
||||
{{ store.competencyScoreVal.toFixed(2) }}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
|
|
|||
|
|
@ -16,6 +16,10 @@ const store = useKpiDataStore();
|
|||
const { showLoader, hideLoader, messageError, dialogConfirm, success } =
|
||||
useCounterMixin();
|
||||
|
||||
const props = defineProps({
|
||||
fetchList: { type: Function, required: true },
|
||||
});
|
||||
|
||||
const modal = defineModel<boolean>("modal", { required: true });
|
||||
const rows = defineModel<any>("data", { required: true });
|
||||
const numpage = defineModel<number>("numpage", { required: true });
|
||||
|
|
@ -142,7 +146,9 @@ function onSubmit() {
|
|||
: numpage.value === 3
|
||||
? config.API.kpiAchievementPoint("special")
|
||||
: "";
|
||||
await http.post(url, formData);
|
||||
await http.post(url, formData).then((res) => {
|
||||
props.fetchList();
|
||||
});
|
||||
success($q, "บันทึกข้อมูลสำเร็จ");
|
||||
} catch (err) {
|
||||
messageError($q, err);
|
||||
|
|
|
|||
|
|
@ -11,18 +11,6 @@ import File from "@/modules/08_KPI/components/Tab/05_File.vue";
|
|||
|
||||
const store = useKpiDataStore();
|
||||
const route = useRoute();
|
||||
const indicatorWeightTotal = defineModel("indicatorWeightTotal", {
|
||||
type: Number,
|
||||
default: 0,
|
||||
});
|
||||
const indicatorWeight1Total = defineModel("indicatorWeight1Total", {
|
||||
type: Number,
|
||||
default: 0,
|
||||
});
|
||||
const indicatorWeight2Total = defineModel("indicatorWeight2Total", {
|
||||
type: Number,
|
||||
default: 0,
|
||||
});
|
||||
|
||||
const itemsTab = ref<any>([
|
||||
{
|
||||
|
|
@ -37,14 +25,6 @@ const itemsTab = ref<any>([
|
|||
name: "3",
|
||||
label: "รายงานผลสำเร็จของงาน",
|
||||
},
|
||||
// {
|
||||
// name: "3",
|
||||
// label: "ผู้บังคับบัญชาเหนือขึ้นไป",
|
||||
// },
|
||||
// {
|
||||
// name: "4",
|
||||
// label: "ผู้บังคับบัญชาเหนือขึ้นไปอีกชั้นหนึ่ง",
|
||||
// },
|
||||
{
|
||||
name: "5",
|
||||
label: "ไฟล์เอกสาร",
|
||||
|
|
@ -107,12 +87,7 @@ const splitterModel = ref<number>(12);
|
|||
:name="tab.name"
|
||||
class="q-pa-none"
|
||||
>
|
||||
<Assessment
|
||||
v-if="store.tabMain === '1'"
|
||||
v-model:indicatorWeightTotal="indicatorWeightTotal"
|
||||
v-model:indicatorWeight1Total="indicatorWeight1Total"
|
||||
v-model:indicatorWeight2Total="indicatorWeight2Total"
|
||||
/>
|
||||
<Assessment v-if="store.tabMain === '1'" />
|
||||
<Assessment v-if="store.tabMain === '2'" :type="'evaluator'" />
|
||||
<Assessment v-if="store.tabMain === '3'" :type="'commander'" />
|
||||
<Assessment v-if="store.tabMain === '4'" :type="'commanderHigh'" />
|
||||
|
|
|
|||
|
|
@ -29,18 +29,16 @@ const {
|
|||
success,
|
||||
} = useCounterMixin();
|
||||
|
||||
const isReadonly = <boolean>(route.name === "KPIEditEvaluator" ? true : false);
|
||||
const title = defineModel<string>("title", { required: true });
|
||||
const rows = defineModel<any>("data", { required: true });
|
||||
const numpage = defineModel<number>("page", { required: true });
|
||||
const evaluationTotal = defineModel<number>("total", { required: true });
|
||||
|
||||
const props = defineProps({
|
||||
fetchList: { type: Function, required: true },
|
||||
});
|
||||
|
||||
const visibleColumns = ref<string[]>(
|
||||
store.tabOpen === 3
|
||||
store.tabOpen === 3 && store.tabMain === "3"
|
||||
? [
|
||||
"includingName",
|
||||
"target",
|
||||
|
|
@ -143,7 +141,7 @@ function onClickView(id: string) {
|
|||
modalViewInfo.value = true;
|
||||
}
|
||||
|
||||
function onEvaluate() {
|
||||
async function onEvaluate() {
|
||||
modalEvaluate.value = true;
|
||||
}
|
||||
|
||||
|
|
@ -198,6 +196,28 @@ watch(
|
|||
}
|
||||
);
|
||||
|
||||
const isEditStep1 = computed(() => {
|
||||
return (
|
||||
(store.dataEvaluation.evaluationStatus === "NEW" &&
|
||||
store.rolePerson === "USER" &&
|
||||
store.tabMain === "1") ||
|
||||
(store.dataEvaluation.evaluationStatus === "NEW_EVALUATOR" &&
|
||||
store.rolePerson === "EVALUATOR" &&
|
||||
store.tabMain === "1")
|
||||
);
|
||||
});
|
||||
|
||||
const isEditStep3 = computed(() => {
|
||||
return (
|
||||
(store.dataEvaluation.evaluationStatus === "EVALUATING" &&
|
||||
store.rolePerson === "USER" &&
|
||||
store.tabMain === "3") ||
|
||||
(store.dataEvaluation.evaluationStatus === "EVALUATING_EVALUATOR" &&
|
||||
store.rolePerson === "EVALUATOR" &&
|
||||
store.tabMain === "3")
|
||||
);
|
||||
});
|
||||
|
||||
// watch(
|
||||
// () => modalAssigned.value,
|
||||
// () => {
|
||||
|
|
@ -216,6 +236,7 @@ watch(
|
|||
// }
|
||||
// );
|
||||
</script>
|
||||
|
||||
<template>
|
||||
<q-card bordered style="border-radius: 5px" class="no-shadow">
|
||||
<q-card-section class="bg-grey-2 q-py-sm">
|
||||
|
|
@ -223,10 +244,7 @@ watch(
|
|||
<div class="col">
|
||||
<span class="text-weight-medium">{{ title }}</span>
|
||||
<q-btn
|
||||
v-if="
|
||||
store.dataEvaluation.evaluationStatus === 'NEW' &&
|
||||
store.rolePerson === 'USER'
|
||||
"
|
||||
v-if="isEditStep1"
|
||||
class="q-ml-xs"
|
||||
flat
|
||||
round
|
||||
|
|
@ -241,10 +259,7 @@ watch(
|
|||
</div>
|
||||
<div class="col-auto">
|
||||
<q-btn
|
||||
v-if="
|
||||
store.rolePerson === 'USER' &&
|
||||
store.dataEvaluation.evaluationStatus === 'EVALUATING'
|
||||
"
|
||||
v-if="isEditStep3"
|
||||
flat
|
||||
round
|
||||
icon="mdi-clipboard-check-outline"
|
||||
|
|
@ -388,13 +403,7 @@ watch(
|
|||
</q-btn>
|
||||
</div>
|
||||
|
||||
<div
|
||||
v-if="
|
||||
store.dataEvaluation.evaluationStatus === 'NEW' &&
|
||||
store.rolePerson === 'USER' &&
|
||||
store.tabMain === '1'
|
||||
"
|
||||
>
|
||||
<div v-if="isEditStep1">
|
||||
<q-btn
|
||||
flat
|
||||
round
|
||||
|
|
@ -408,10 +417,6 @@ watch(
|
|||
</q-btn>
|
||||
|
||||
<q-btn
|
||||
v-if="
|
||||
store.dataEvaluation.evaluationStatus === 'NEW' &&
|
||||
store.rolePerson === 'USER'
|
||||
"
|
||||
flat
|
||||
round
|
||||
icon="delete"
|
||||
|
|
@ -448,6 +453,7 @@ watch(
|
|||
v-model:modal="modalEvaluate"
|
||||
:data="rows"
|
||||
:numpage="numpage"
|
||||
:fetchList="fetchList"
|
||||
/>
|
||||
|
||||
<DialogViewInfo
|
||||
|
|
|
|||
|
|
@ -2,6 +2,8 @@
|
|||
import { onMounted, ref, computed, watch } from "vue";
|
||||
import Dialog from "@/modules/08_KPI/components/Tab/Dialog/04_FormCompetency.vue";
|
||||
import DialogEvaluate from "@/modules/08_KPI/components/Tab/DialogEvaluate/02_Competenct.vue";
|
||||
import DialogProgress from "@/modules/08_KPI/components/Tab/Dialog/DialogCommentProgress.vue";
|
||||
import DialogProblem from "@/modules/08_KPI/components/Tab/Dialog/DialogCommentProblem.vue";
|
||||
|
||||
import { useQuasar, type QTableProps } from "quasar";
|
||||
import { useCounterMixin } from "@/stores/mixin";
|
||||
|
|
@ -104,7 +106,7 @@ const columns = ref<QTableProps["columns"]>([
|
|||
]);
|
||||
|
||||
const visibleColumns = ref<string[]>(
|
||||
store.tabOpen === 3
|
||||
store.tabOpen === 3 && store.tabMain === "3"
|
||||
? ["name", "level", "point", "weight", "summary"]
|
||||
: ["name", "level", "weight"]
|
||||
);
|
||||
|
|
@ -159,11 +161,18 @@ function getData(type: string) {
|
|||
if (total > 0) {
|
||||
let weightAvg = weight / total;
|
||||
let resultAvg = result / total;
|
||||
let sum =
|
||||
weightAvg != 0
|
||||
? (resultAvg / weightAvg) * store.dataEvaluation.capacityPoint
|
||||
: 0;
|
||||
// resultEvaluation.value = sum.toFixed(2);
|
||||
|
||||
if (store.dataProfile.posExecutiveName != null) {
|
||||
store.competencyScoreVal =
|
||||
weightAvg != 0
|
||||
? (resultAvg / weightAvg) * store.excusiveCompetencyScore
|
||||
: 0;
|
||||
} else {
|
||||
store.competencyScoreVal =
|
||||
weightAvg != 0
|
||||
? (resultAvg / weightAvg) * store.competencyScore
|
||||
: 0;
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
|
|
@ -200,16 +209,41 @@ function onEvaluate(type: string) {
|
|||
const modalProgress = ref<boolean>(false);
|
||||
const modalProblem = ref<boolean>(false);
|
||||
const type = ref<string>("");
|
||||
function openPopupProgress() {
|
||||
const idList = ref<string>("");
|
||||
function openPopupProgress(id: string) {
|
||||
modalProgress.value = true;
|
||||
type.value = rows.value ? "plan" : rows.value ? "role" : "special";
|
||||
type.value = "capacity";
|
||||
idList.value = id;
|
||||
}
|
||||
|
||||
function openPopupProblem() {
|
||||
function openPopupProblem(id: string) {
|
||||
modalProblem.value = true;
|
||||
type.value = rows.value ? "plan" : rows.value ? "role" : "special";
|
||||
type.value = "capacity";
|
||||
idList.value = id;
|
||||
}
|
||||
|
||||
const isEditStep1 = computed(() => {
|
||||
return (
|
||||
(store.dataEvaluation.evaluationStatus === "NEW" &&
|
||||
store.rolePerson === "USER" &&
|
||||
store.tabMain === "1") ||
|
||||
(store.dataEvaluation.evaluationStatus === "NEW_EVALUATOR" &&
|
||||
store.rolePerson === "EVALUATOR" &&
|
||||
store.tabMain === "1")
|
||||
);
|
||||
});
|
||||
|
||||
const isEditStep3 = computed(() => {
|
||||
return (
|
||||
(store.dataEvaluation.evaluationStatus === "EVALUATING" &&
|
||||
store.rolePerson === "USER" &&
|
||||
store.tabMain === "3") ||
|
||||
(store.dataEvaluation.evaluationStatus === "EVALUATING_EVALUATOR" &&
|
||||
store.rolePerson === "EVALUATOR" &&
|
||||
store.tabMain === "3")
|
||||
);
|
||||
});
|
||||
|
||||
watch(
|
||||
() => store.dataEvaluation.capacityPoint,
|
||||
(newValue, oldValue) => {
|
||||
|
|
@ -238,10 +272,7 @@ onMounted(() => {
|
|||
<div class="col">
|
||||
<span class="text-weight-medium">{{ item.name }}</span>
|
||||
<q-btn
|
||||
v-if="
|
||||
store.dataEvaluation.evaluationStatus === 'NEW' &&
|
||||
store.rolePerson === 'USER'
|
||||
"
|
||||
v-if="isEditStep1"
|
||||
class="q-ml-xs"
|
||||
flat
|
||||
round
|
||||
|
|
@ -257,7 +288,7 @@ onMounted(() => {
|
|||
|
||||
<q-space />
|
||||
<q-btn
|
||||
v-if="store.dataEvaluation.evaluationStatus == 'EVALUATING'"
|
||||
v-if="isEditStep3"
|
||||
flat
|
||||
round
|
||||
icon="mdi-clipboard-check-outline"
|
||||
|
|
@ -366,7 +397,7 @@ onMounted(() => {
|
|||
color="blue-6"
|
||||
size="12px"
|
||||
dense
|
||||
@click="openPopupProgress()"
|
||||
@click="openPopupProgress(props.row.id)"
|
||||
>
|
||||
<q-tooltip>รายงานความก้าวหน้า</q-tooltip>
|
||||
</q-btn>
|
||||
|
|
@ -378,19 +409,13 @@ onMounted(() => {
|
|||
size="12px"
|
||||
dense
|
||||
main="problem"
|
||||
@click="openPopupProblem()"
|
||||
@click="openPopupProblem(props.row.id)"
|
||||
>
|
||||
<q-tooltip>รายงานปัญหา</q-tooltip>
|
||||
</q-btn>
|
||||
</div>
|
||||
|
||||
<div
|
||||
v-if="
|
||||
store.dataEvaluation.evaluationStatus === 'NEW' &&
|
||||
store.rolePerson === 'USER' &&
|
||||
store.tabMain === '1'
|
||||
"
|
||||
>
|
||||
<div v-if="isEditStep1">
|
||||
<q-btn
|
||||
flat
|
||||
round
|
||||
|
|
@ -401,10 +426,6 @@ onMounted(() => {
|
|||
<q-tooltip>แก้ไข </q-tooltip>
|
||||
</q-btn>
|
||||
<q-btn
|
||||
v-if="
|
||||
store.dataEvaluation.evaluationStatus === 'NEW' &&
|
||||
store.rolePerson === 'USER'
|
||||
"
|
||||
flat
|
||||
round
|
||||
icon="delete"
|
||||
|
|
@ -437,7 +458,16 @@ onMounted(() => {
|
|||
:get-data="getData"
|
||||
/>
|
||||
|
||||
|
||||
<DialogProgress
|
||||
v-model:modal="modalProgress"
|
||||
v-model:type="type"
|
||||
:idList="idList"
|
||||
/>
|
||||
<DialogProblem
|
||||
v-model:modal="modalProblem"
|
||||
v-model:type="type"
|
||||
:idList="idList"
|
||||
/>
|
||||
</template>
|
||||
|
||||
<style scoped>
|
||||
|
|
|
|||
|
|
@ -2,6 +2,8 @@
|
|||
import { onMounted, ref, computed, watch, reactive } from "vue";
|
||||
import DialogDevelop from "@/modules/08_KPI/components/Tab/Dialog/DialogDevelop.vue";
|
||||
import DialogEvalutionDevelop from "@/modules/08_KPI/components/Tab/DialogEvaluate/03_DialogEvalutionDevelop.vue";
|
||||
import DialogProgress from "@/modules/08_KPI/components/Tab/Dialog/DialogCommentProgress.vue";
|
||||
import DialogProblem from "@/modules/08_KPI/components/Tab/Dialog/DialogCommentProblem.vue";
|
||||
|
||||
import { useQuasar, type QTableProps } from "quasar";
|
||||
import { useCounterMixin } from "@/stores/mixin";
|
||||
|
|
@ -94,7 +96,7 @@ const columns = ref<QTableProps["columns"]>([
|
|||
]);
|
||||
|
||||
const visibleColumns = ref<string[]>(
|
||||
store.tabOpen === 3
|
||||
store.tabOpen === 3 && store.tabMain === "3"
|
||||
? ["name", "develop", "target", "achievement", "summary"]
|
||||
: ["name", "develop", "target"]
|
||||
);
|
||||
|
|
@ -114,6 +116,11 @@ function getDevelop() {
|
|||
.then((res) => {
|
||||
const data = res.data.result;
|
||||
rows.value = data;
|
||||
|
||||
store.devScoreVal = rows.value.reduce(
|
||||
(sum: number, e: any) => sum + e.summary,
|
||||
0
|
||||
);
|
||||
});
|
||||
}
|
||||
|
||||
|
|
@ -142,16 +149,42 @@ function onDelete(id: string) {
|
|||
const modalProgress = ref<boolean>(false);
|
||||
const modalProblem = ref<boolean>(false);
|
||||
const type = ref<string>("");
|
||||
function openPopupProgress() {
|
||||
const idList = ref<string>("");
|
||||
function openPopupProgress(id: string) {
|
||||
modalProgress.value = true;
|
||||
type.value = rows.value ? "plan" : rows.value ? "role" : "special";
|
||||
type.value = "develop";
|
||||
idList.value = id;
|
||||
}
|
||||
|
||||
function openPopupProblem() {
|
||||
function openPopupProblem(id: string) {
|
||||
modalProblem.value = true;
|
||||
type.value = rows.value ? "plan" : rows.value ? "role" : "special";
|
||||
|
||||
type.value = "develop";
|
||||
idList.value = id;
|
||||
}
|
||||
|
||||
const isEditStep1 = computed(() => {
|
||||
return (
|
||||
(store.dataEvaluation.evaluationStatus === "NEW" &&
|
||||
store.rolePerson === "USER" &&
|
||||
store.tabMain === "1") ||
|
||||
(store.dataEvaluation.evaluationStatus === "NEW_EVALUATOR" &&
|
||||
store.rolePerson === "EVALUATOR" &&
|
||||
store.tabMain === "1")
|
||||
);
|
||||
});
|
||||
|
||||
const isEditStep3 = computed(() => {
|
||||
return (
|
||||
(store.dataEvaluation.evaluationStatus === "EVALUATING" &&
|
||||
store.rolePerson === "USER" &&
|
||||
store.tabMain === "3") ||
|
||||
(store.dataEvaluation.evaluationStatus === "EVALUATING_EVALUATOR" &&
|
||||
store.rolePerson === "EVALUATOR" &&
|
||||
store.tabMain === "3")
|
||||
);
|
||||
});
|
||||
|
||||
onMounted(() => {
|
||||
getDevelop();
|
||||
});
|
||||
|
|
@ -164,10 +197,7 @@ onMounted(() => {
|
|||
<div class="col">
|
||||
<span class="text-weight-medium">การพัฒนาตนเอง</span>
|
||||
<q-btn
|
||||
v-if="
|
||||
store.dataEvaluation.evaluationStatus === 'NEW' &&
|
||||
store.rolePerson === 'USER'
|
||||
"
|
||||
v-if="isEditStep1"
|
||||
class="q-ml-xs"
|
||||
flat
|
||||
round
|
||||
|
|
@ -183,10 +213,7 @@ onMounted(() => {
|
|||
|
||||
<q-space />
|
||||
<q-btn
|
||||
v-if="
|
||||
store.dataEvaluation.evaluationStatus === 'NEW' &&
|
||||
store.rolePerson === 'USER'
|
||||
"
|
||||
v-if="isEditStep3"
|
||||
flat
|
||||
round
|
||||
icon="mdi-clipboard-check-outline"
|
||||
|
|
@ -300,7 +327,7 @@ onMounted(() => {
|
|||
color="blue-6"
|
||||
size="12px"
|
||||
dense
|
||||
@click="openPopupProgress()"
|
||||
@click="openPopupProgress(props.row.id)"
|
||||
>
|
||||
<q-tooltip>รายงานความก้าวหน้า</q-tooltip>
|
||||
</q-btn>
|
||||
|
|
@ -312,19 +339,13 @@ onMounted(() => {
|
|||
size="12px"
|
||||
dense
|
||||
main="problem"
|
||||
@click="openPopupProblem()"
|
||||
@click="openPopupProblem(props.row.id)"
|
||||
>
|
||||
<q-tooltip>รายงานปัญหา</q-tooltip>
|
||||
</q-btn>
|
||||
</div>
|
||||
|
||||
<div
|
||||
v-if="
|
||||
store.dataEvaluation.evaluationStatus === 'NEW' &&
|
||||
store.rolePerson === 'USER' &&
|
||||
store.tabMain === '2'
|
||||
"
|
||||
>
|
||||
<div v-if="isEditStep1">
|
||||
<q-btn
|
||||
flat
|
||||
round
|
||||
|
|
@ -362,6 +383,17 @@ onMounted(() => {
|
|||
v-model:data="rows"
|
||||
:get-all="getDevelop"
|
||||
/>
|
||||
|
||||
<DialogProgress
|
||||
v-model:modal="modalProgress"
|
||||
v-model:type="type"
|
||||
:idList="idList"
|
||||
/>
|
||||
<DialogProblem
|
||||
v-model:modal="modalProblem"
|
||||
v-model:type="type"
|
||||
:idList="idList"
|
||||
/>
|
||||
</template>
|
||||
|
||||
<style scoped>
|
||||
|
|
|
|||
|
|
@ -307,6 +307,10 @@ export const useKpiDataStore = defineStore("KPIDate", () => {
|
|||
}
|
||||
|
||||
// SUMMARY GENERAL CASE
|
||||
const indicatorWeightTotal = ref<number>(0); // น้ำหนักรวมกรณีทั่วไป
|
||||
const indicatorWeight1Total = ref<number>(0); // น้ำหนักรวมมิติที่ 1 ต้องไม่เกิน 100%
|
||||
const indicatorWeight2Total = ref<number>(0); // น้ำหนักรวมมิติที่ 2 ต้องไม่เกิน 20
|
||||
|
||||
const indicatorPercent = ref<number>(100); // รวมผลการประเมิน (ร้อยละ)
|
||||
const indicatorPercentVal = ref<number>(0); // รวมผลการประเมิน (ร้อยละ) ที่ได้จริง
|
||||
const indicatorScore = ref<number>(70); // สรุปผลการประเมินผลสัมฤทธิ์ของงาน ( คะแนนเต็ม indicatorScore คะแนน)
|
||||
|
|
@ -348,6 +352,9 @@ export const useKpiDataStore = defineStore("KPIDate", () => {
|
|||
rolePerson,
|
||||
|
||||
// score
|
||||
indicatorWeightTotal,
|
||||
indicatorWeight1Total,
|
||||
indicatorWeight2Total,
|
||||
indicatorPercent,
|
||||
indicatorPercentVal,
|
||||
indicatorScore,
|
||||
|
|
|
|||
|
|
@ -291,7 +291,7 @@ async function getAll() {
|
|||
await getOrgOp();
|
||||
}
|
||||
|
||||
function sendToEvaluatore() {
|
||||
function sendToEvaluatore(status: string) {
|
||||
dialogConfirm(
|
||||
$q,
|
||||
() => {
|
||||
|
|
@ -299,7 +299,7 @@ function sendToEvaluatore() {
|
|||
showLoader();
|
||||
http
|
||||
.put(config.API.kpiSendToStatus(id.value), {
|
||||
status: "NEW_EVALUATOR",
|
||||
status: status,
|
||||
})
|
||||
.then((res) => {
|
||||
success($q, "ส่งข้อตกลงให้ผู้ประเมินอนุมัติสำเร็จ");
|
||||
|
|
@ -345,9 +345,6 @@ function requireEdit() {
|
|||
);
|
||||
}
|
||||
|
||||
const indicatorWeightTotal = ref<number>(0);
|
||||
const indicatorWeight1Total = ref<number>(0);
|
||||
const indicatorWeight2Total = ref<number>(0);
|
||||
onMounted(async () => {
|
||||
showLoader();
|
||||
await getAll();
|
||||
|
|
@ -355,8 +352,6 @@ onMounted(async () => {
|
|||
</script>
|
||||
|
||||
<template>
|
||||
<!-- evaluationStatus={{ store.dataEvaluation.evaluationStatus }} | tabOpen =
|
||||
{{ store.tabOpen }} | rolePerson = {{ store.rolePerson }} | -->
|
||||
<div class="col-12 row justify-center">
|
||||
<div class="col-xs-12 col-sm-12 col-md-11">
|
||||
<div class="toptitle text-white col-12 row items-center">
|
||||
|
|
@ -400,14 +395,18 @@ onMounted(async () => {
|
|||
}}</span>
|
||||
<q-space />
|
||||
<div class="q-gutter-x-sm">
|
||||
<!-- {{
|
||||
store.dataProfile.posExecutiveName == null &&
|
||||
store.indicatorWeightTotal != 100
|
||||
}}
|
||||
| {{ store.indicatorWeightTotal }} | -->
|
||||
<span
|
||||
v-if="
|
||||
(store.dataProfile.posExecutiveName == null &&
|
||||
indicatorWeightTotal > 0 &&
|
||||
indicatorWeightTotal != 100) ||
|
||||
(store.dataEvaluation.evaluatorId != null &&
|
||||
indicatorWeight1Total != 100 &&
|
||||
indicatorWeight2Total != 20)
|
||||
store.indicatorWeightTotal != 100) ||
|
||||
(store.dataEvaluation.posExecutiveName != null &&
|
||||
(store.indicatorWeight1Total != 100 ||
|
||||
store.indicatorWeight2Total != 20))
|
||||
"
|
||||
class="text-red"
|
||||
>*น้ำหนัก(ร้อยละ) ผลสัมฤทธิ์ของงานไม่ถูกต้อง</span
|
||||
|
|
@ -419,11 +418,10 @@ onMounted(async () => {
|
|||
"
|
||||
:disabled="
|
||||
(store.dataProfile.posExecutiveName == null &&
|
||||
indicatorWeightTotal > 0 &&
|
||||
indicatorWeightTotal != 100) ||
|
||||
(store.dataEvaluation.evaluatorId != null &&
|
||||
indicatorWeight1Total != 100 &&
|
||||
indicatorWeight2Total != 20)
|
||||
store.indicatorWeightTotal != 100) ||
|
||||
(store.dataEvaluation.posExecutiveName != null &&
|
||||
(store.indicatorWeight1Total != 100 ||
|
||||
store.indicatorWeight2Total != 20))
|
||||
"
|
||||
unelevated
|
||||
round
|
||||
|
|
@ -431,10 +429,27 @@ onMounted(async () => {
|
|||
color="grey-2"
|
||||
text-color="blue-6"
|
||||
size="md"
|
||||
@click="sendToEvaluatore()"
|
||||
@click="sendToEvaluatore('NEW_EVALUATOR')"
|
||||
>
|
||||
<q-tooltip>ส่งให้ผู้ประเมินอนุมัติ</q-tooltip>
|
||||
</q-btn>
|
||||
|
||||
<q-btn
|
||||
v-if="
|
||||
store.rolePerson == 'USER' &&
|
||||
store.dataEvaluation.evaluationStatus == 'EVALUATING'
|
||||
"
|
||||
unelevated
|
||||
round
|
||||
icon="mdi-send"
|
||||
color="grey-2"
|
||||
text-color="blue-6"
|
||||
size="md"
|
||||
@click="sendToEvaluatore('EVALUATING_EVALUATOR')"
|
||||
>
|
||||
<q-tooltip>ส่งให้ผู้ประเมินอนุมัติผลการประเมิน</q-tooltip>
|
||||
</q-btn>
|
||||
|
||||
<q-btn
|
||||
v-if="
|
||||
store.rolePerson == 'USER' &&
|
||||
|
|
@ -468,7 +483,10 @@ onMounted(async () => {
|
|||
<q-tooltip>แก้ไขคะแนนเต็ม</q-tooltip>
|
||||
</q-btn> -->
|
||||
<q-btn
|
||||
v-if="!isReadonly"
|
||||
v-if="
|
||||
store.dataEvaluation.evaluationStatus === 'NEW' &&
|
||||
store.rolePerson === 'USER'
|
||||
"
|
||||
unelevated
|
||||
round
|
||||
icon="edit"
|
||||
|
|
@ -550,9 +568,21 @@ onMounted(async () => {
|
|||
<div class="col-2">
|
||||
<div class="column">
|
||||
<span class="text-grey-6">คะแนนประเมิน</span>
|
||||
<span class="text-weight-medium text-primary">{{
|
||||
(indicatorScore + competencyScore).toFixed(2)
|
||||
}}</span>
|
||||
<span class="text-weight-medium text-primary">
|
||||
{{
|
||||
store.dataProfile.posExecutiveName == null
|
||||
? (
|
||||
store.indicatorScoreVal +
|
||||
store.competencyScoreVal +
|
||||
store.devScoreVal
|
||||
).toFixed(2)
|
||||
: (
|
||||
store.excusiveIndicator1ScoreVal +
|
||||
store.excusiveIndicator2ScoreVal +
|
||||
store.competencyScore
|
||||
).toFixed(2)
|
||||
}}
|
||||
</span>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
|
@ -562,13 +592,7 @@ onMounted(async () => {
|
|||
</q-card>
|
||||
|
||||
<q-card class="q-mt-md rounded">
|
||||
<TabMain
|
||||
v-model:indicatorScore="indicatorScore"
|
||||
v-model:competencyScore="competencyScore"
|
||||
v-model:indicatorWeightTotal="indicatorWeightTotal"
|
||||
v-model:indicatorWeight1Total="indicatorWeight1Total"
|
||||
v-model:indicatorWeight2Total="indicatorWeight2Total"
|
||||
/>
|
||||
<TabMain />
|
||||
</q-card>
|
||||
</div>
|
||||
</div>
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue