updated
This commit is contained in:
parent
5e8c8589cb
commit
11e5e13039
11 changed files with 118 additions and 149 deletions
|
|
@ -1,11 +1,13 @@
|
|||
<script setup lang="ts">
|
||||
import { ref } from "vue";
|
||||
import { useRouter } from "vue-router";
|
||||
import { useKpiDataStore } from "@/modules/08_KPI/store";
|
||||
|
||||
import type { QTableProps } from "quasar";
|
||||
import type { ResEvaluatorAssessor } from "@/modules/08_KPI/interface/response/index";
|
||||
import type { FormQuery } from "@/modules/08_KPI/interface/request/index";
|
||||
|
||||
const store = useKpiDataStore();
|
||||
const router = useRouter();
|
||||
const visibleColumns = defineModel<string[]>("visibleColumns", {
|
||||
required: true,
|
||||
|
|
@ -23,7 +25,8 @@ const props = defineProps({
|
|||
fetchList: { type: Function },
|
||||
});
|
||||
|
||||
function redirectViewDetail(id: string) {
|
||||
async function redirectViewDetail(id: string) {
|
||||
store.tabMain = await "";
|
||||
router.push(`/KPI-evaluator/${id}`);
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -21,14 +21,8 @@ const dataListCriteria = ref<ListCriteria[]>([]);
|
|||
const modalCriteria = ref<boolean>(false);
|
||||
const $q = useQuasar();
|
||||
const route = useRoute();
|
||||
const {
|
||||
hideLoader,
|
||||
messageError,
|
||||
date2Thai,
|
||||
success,
|
||||
showLoader,
|
||||
dialogRemove,
|
||||
} = useCounterMixin();
|
||||
const { hideLoader, messageError, success, showLoader, dialogRemove } =
|
||||
useCounterMixin();
|
||||
const store = useKpiDataStore();
|
||||
|
||||
const evaluationId = ref<string>(route.params.id.toString());
|
||||
|
|
@ -165,7 +159,7 @@ function getCriteria() {
|
|||
}
|
||||
|
||||
const isShowScore = computed(() => {
|
||||
return store.tabOpen === 3 && store.tabMain === "3";
|
||||
return store.tabMain === "3";
|
||||
});
|
||||
|
||||
watch(
|
||||
|
|
@ -192,15 +186,13 @@ watch(
|
|||
store.indicatorScoreVal =
|
||||
store.indicatorPercentVal * (store.indicatorScore / 100);
|
||||
|
||||
if (
|
||||
store.isUpdate &&
|
||||
store.tabMain === "3" &&
|
||||
(store.dataEvaluation.evaluationStatus === "EVALUATOR" ||
|
||||
store.dataEvaluation.evaluationStatus === "EVALUATING_EVALUATOR")
|
||||
) {
|
||||
if (store.isUpdate && store.tabMain === "3") {
|
||||
http
|
||||
.put(config.API.updatePoint(evaluationId.value), {
|
||||
totalPoint1: store.indicatorScoreVal.toFixed(2),
|
||||
totalPoint1: (
|
||||
store.indicatorPercentVal *
|
||||
(store.indicatorScore / 100)
|
||||
).toFixed(2),
|
||||
summaryPoint: (
|
||||
store.indicatorScoreVal +
|
||||
store.competencyScoreVal +
|
||||
|
|
|
|||
|
|
@ -1,6 +1,5 @@
|
|||
<script setup lang="ts">
|
||||
import { computed, ref, onMounted } from "vue";
|
||||
import DialogHeader from "@/components/DialogHeader.vue";
|
||||
import { ref, onMounted } from "vue";
|
||||
import { useQuasar } from "quasar";
|
||||
import { useCounterMixin } from "@/stores/mixin";
|
||||
import { useKpiDataStore } from "@/modules/08_KPI/store";
|
||||
|
|
@ -41,52 +40,9 @@ const weight1 = ref<number>(0);
|
|||
const result1 = ref<number>(0);
|
||||
const weight2 = ref<number>(0);
|
||||
const result2 = ref<number>(0);
|
||||
const sumWeight = computed(() => {
|
||||
return weight1.value + weight2.value;
|
||||
});
|
||||
const sumResult = computed(() => {
|
||||
return result1.value + result2.value;
|
||||
});
|
||||
|
||||
const group = computed(() => {
|
||||
return convert(sumResult.value);
|
||||
});
|
||||
// const options = ref<any[]>([
|
||||
// {
|
||||
// label: "ดีเด่น (คะแนนร้อยละ ๙๐.๐๐ ขึ้นไป)",
|
||||
// value: "EXCELLENT",
|
||||
// },
|
||||
// {
|
||||
// label: "ดีมาก (คะแนนร้อยละ ๘๐.๐๐ - ๘๙.๙๙)",
|
||||
// value: "VERYGOOD",
|
||||
// },
|
||||
// {
|
||||
// label: "ดี (คะแนนร้อยละ ๗๐.๐๐ - ๗๙.๙๙)",
|
||||
// value: "GOOD",
|
||||
// },
|
||||
// {
|
||||
// label: "พอใช้ (คะแนนร้อยละ ๖๐.๐๐ - ๖๙.๙๙)",
|
||||
// value: "FAIR",
|
||||
// },
|
||||
// {
|
||||
// label: "ต้องปรับปรุง (คะแนนต่ำกว่าร้อยละ ๖๐.๐๐)",
|
||||
// value: "IMPROVEMENT",
|
||||
// },
|
||||
// ]);
|
||||
|
||||
function convert(score: any): string {
|
||||
if (score >= 90) {
|
||||
return "EXCELLENT";
|
||||
} else if (score >= 80) {
|
||||
return "VERYGOOD";
|
||||
} else if (score >= 70) {
|
||||
return "GOOD";
|
||||
} else if (score >= 60) {
|
||||
return "FAIR";
|
||||
} else {
|
||||
return "IMPROVEMENT";
|
||||
}
|
||||
}
|
||||
const sumWeight = ref<number>(0);
|
||||
const sumResult = ref<number>(0);
|
||||
const result = ref<string>("");
|
||||
|
||||
function onSubmit() {
|
||||
dialogConfirm($q, () => {
|
||||
|
|
@ -173,14 +129,22 @@ function resetCommanderHigh() {
|
|||
additionalSuperiorCommentRef.value.resetValidation();
|
||||
}
|
||||
|
||||
/**
|
||||
* ดึงข้อมูลการประเมิน
|
||||
*/
|
||||
async function fetchEvaluation() {
|
||||
await http
|
||||
.get(config.API.kpiEvaluation + `/${id.value}`)
|
||||
.then(async (res) => {
|
||||
const data = res.data.result;
|
||||
// เก็บข้อมูลการประเมินเข้า store
|
||||
store.dataEvaluation = await data;
|
||||
|
||||
if (data.profileId == store.dataProfile.profileId) {
|
||||
// เช็คว่าถ้าผู้รับการประเมินเปิดการประเมินไปแล้วจะไม่ยิงอัปเดตสถานะการเปิดดูอีก แต่ถ้ายังไม่เคยเปิดจะยิงเพื่ออัปเดต
|
||||
if (
|
||||
!store.dataEvaluation.isOpen &&
|
||||
data.profileId == store.dataProfile.profileId
|
||||
) {
|
||||
userOpen();
|
||||
}
|
||||
})
|
||||
|
|
@ -207,25 +171,26 @@ function getData() {
|
|||
developmentMethod.value = data.developEvaluator;
|
||||
developmentPeriod.value = data.timeEvaluator;
|
||||
evaluatorComment.value = data.reasonEvaluator;
|
||||
superiorCommentCheck.value = data.isReasonCommander
|
||||
? data.isReasonCommander.toString()
|
||||
: "";
|
||||
superiorCommentCheck.value = data.isReasonCommander.toString();
|
||||
|
||||
superiorComment.value = data.reasonCommander;
|
||||
|
||||
additionalSuperiorCheck.value = data.isReasonCommanderHigh
|
||||
? data.isReasonCommanderHigh.toString()
|
||||
: "";
|
||||
additionalSuperiorCheck.value = data.isReasonCommanderHigh.toString();
|
||||
additionalSuperiorComment.value = data.reasonCommanderHigh;
|
||||
result1.value = data.totalPoint1;
|
||||
result2.value = data.totalPoint2_1 + data.totalPoint2_2;
|
||||
weight1.value = data.weightPoint1;
|
||||
weight2.value = data.weightPoint2;
|
||||
sumWeight.value = data.weightPoint1 + data.weightPoint2;
|
||||
sumResult.value = data.summaryPoint;
|
||||
result.value = data.evaluationResults;
|
||||
})
|
||||
.catch((e) => {
|
||||
messageError($q, e);
|
||||
})
|
||||
.finally(() => {});
|
||||
}
|
||||
|
||||
onMounted(() => {
|
||||
getData();
|
||||
fetchEvaluation();
|
||||
|
|
@ -292,35 +257,35 @@ onMounted(() => {
|
|||
<div class="col-12 no-pointer">
|
||||
<div class="column">
|
||||
<q-radio
|
||||
v-model="group"
|
||||
v-model="result"
|
||||
checked-icon="task_alt"
|
||||
unchecked-icon="panorama_fish_eye"
|
||||
val="EXCELLENT"
|
||||
label="ดีเด่น (คะแนนร้อยละ 90.00 ขึ้นไป)"
|
||||
/>
|
||||
<q-radio
|
||||
v-model="group"
|
||||
v-model="result"
|
||||
checked-icon="task_alt"
|
||||
unchecked-icon="panorama_fish_eye"
|
||||
val="VERYGOOD"
|
||||
val="VERY_GOOD"
|
||||
label="ดีมาก (คะแนนร้อยละ 80.00 - 89.99)"
|
||||
/>
|
||||
<q-radio
|
||||
v-model="group"
|
||||
v-model="result"
|
||||
checked-icon="task_alt"
|
||||
unchecked-icon="panorama_fish_eye"
|
||||
val="GOOD"
|
||||
label="ดี (คะแนนร้อยละ 70.00 - 79.99)"
|
||||
/>
|
||||
<q-radio
|
||||
v-model="group"
|
||||
v-model="result"
|
||||
checked-icon="task_alt"
|
||||
unchecked-icon="panorama_fish_eye"
|
||||
val="FAIR"
|
||||
label="พอใช้ (คะแนนร้อยละ 60.00 - 69.99)"
|
||||
/>
|
||||
<q-radio
|
||||
v-model="group"
|
||||
v-model="result"
|
||||
checked-icon="task_alt"
|
||||
unchecked-icon="panorama_fish_eye"
|
||||
val="IMPROVEMENT"
|
||||
|
|
|
|||
|
|
@ -196,7 +196,7 @@ function onSubmit() {
|
|||
function getData() {
|
||||
showLoader();
|
||||
http
|
||||
.get(config.API.KpiCapacity + `?type=${type.value}`)
|
||||
.get(config.API.KpiCapacity + `?type=${type.value}&pageSize=100`)
|
||||
.then((res) => {
|
||||
const data = res.data.result.data;
|
||||
listTarget.value = data;
|
||||
|
|
|
|||
|
|
@ -1,16 +1,12 @@
|
|||
<script setup lang="ts">
|
||||
import { onMounted, ref } from "vue";
|
||||
import { ref } from "vue";
|
||||
import { useKpiDataStore } from "@/modules/08_KPI/store";
|
||||
import { useRoute } from "vue-router";
|
||||
|
||||
import Assessment from "@/modules/08_KPI/components/Tab/01_Assessment.vue";
|
||||
import Result from "@/modules/08_KPI/components/Tab/04_Result.vue";
|
||||
// import CommanderAbove from "@/modules/08_KPI/components/Tab/03_CommanderAbove.vue";
|
||||
// import CommanderAboveOneStep from "@/modules/08_KPI/components/Tab/04_CommanderAboveOneStep.vue";
|
||||
import File from "@/modules/08_KPI/components/Tab/05_File.vue";
|
||||
|
||||
const store = useKpiDataStore();
|
||||
const route = useRoute();
|
||||
|
||||
const itemsTab = ref<any>([
|
||||
{
|
||||
|
|
@ -52,11 +48,11 @@ const splitterModel = ref<number>(12);
|
|||
class="text-grey-7 text-weight-light"
|
||||
active-class="bg-blue-1 text-blue-8 text-weight-bold"
|
||||
>
|
||||
<q-tab name="1" label="จัดทำข้อตกลง" />
|
||||
<q-tab name="1" label="จัดทำข้อตกลง" :disable="store.tabOpen != 1" />
|
||||
<q-tab
|
||||
name="2"
|
||||
label="รายงานความก้าวหน้า"
|
||||
:disable="store.tabOpen < 2"
|
||||
:disable="store.tabOpen != 2"
|
||||
/>
|
||||
<q-tab
|
||||
name="3"
|
||||
|
|
|
|||
|
|
@ -213,9 +213,6 @@ const isEditStep3 = computed(() => {
|
|||
store.rolePerson === "USER" &&
|
||||
store.tabMain === "3") ||
|
||||
(store.dataEvaluation.evaluationStatus === "EVALUATING_EVALUATOR" &&
|
||||
store.rolePerson === "EVALUATOR" &&
|
||||
store.tabMain === "3")||
|
||||
(store.dataEvaluation.evaluationStatus === "EVALUATING" &&
|
||||
store.rolePerson === "EVALUATOR" &&
|
||||
store.tabMain === "3")
|
||||
);
|
||||
|
|
|
|||
|
|
@ -315,7 +315,7 @@ onMounted(() => {
|
|||
<div class="col">
|
||||
<span class="text-weight-medium">{{ item.name }}</span>
|
||||
<q-btn
|
||||
v-if="!isEditStep1"
|
||||
v-if="isEditStep1 && item.id != 'HEAD' && item.id != 'GROUP'"
|
||||
class="q-ml-xs"
|
||||
flat
|
||||
round
|
||||
|
|
@ -460,8 +460,12 @@ onMounted(() => {
|
|||
<q-btn
|
||||
flat
|
||||
round
|
||||
icon="edit"
|
||||
color="edit"
|
||||
:icon="
|
||||
item.id == 'HEAD' || item.id == 'GROUP'
|
||||
? 'mdi-eye'
|
||||
: 'edit'
|
||||
"
|
||||
color="info"
|
||||
@click.stop.pervent="onEdit(props.row, item.id)"
|
||||
>
|
||||
<q-tooltip>แก้ไข </q-tooltip>
|
||||
|
|
|
|||
|
|
@ -203,9 +203,6 @@ const isEditStep3 = computed(() => {
|
|||
store.rolePerson === "USER" &&
|
||||
store.tabMain === "3") ||
|
||||
(store.dataEvaluation.evaluationStatus === "EVALUATING_EVALUATOR" &&
|
||||
store.rolePerson === "EVALUATOR" &&
|
||||
store.tabMain === "3") ||
|
||||
(store.dataEvaluation.evaluationStatus === "EVALUATING" &&
|
||||
store.rolePerson === "EVALUATOR" &&
|
||||
store.tabMain === "3")
|
||||
);
|
||||
|
|
|
|||
|
|
@ -10,16 +10,7 @@ import { useQuasar } from "quasar";
|
|||
export const useKpiDataStore = defineStore("KPIDate", () => {
|
||||
const $q = useQuasar();
|
||||
const mixin = useCounterMixin();
|
||||
const {
|
||||
dialogConfirm,
|
||||
success,
|
||||
showLoader,
|
||||
hideLoader,
|
||||
messageError,
|
||||
findPosMasterNoOld,
|
||||
findOrgNameOld,
|
||||
date2Thai,
|
||||
} = mixin;
|
||||
const { showLoader, hideLoader, messageError } = mixin;
|
||||
|
||||
const isUpdate = ref<boolean>(false);
|
||||
const tabMainevaluator = ref<string>("1");
|
||||
|
|
@ -32,7 +23,7 @@ export const useKpiDataStore = defineStore("KPIDate", () => {
|
|||
});
|
||||
const selected = ref([]);
|
||||
const work = ref<boolean>(false);
|
||||
const tabMain = ref<string>("1");
|
||||
const tabMain = ref<string>("");
|
||||
const dataProfile = ref<any>({
|
||||
profileId: null,
|
||||
prefix: "",
|
||||
|
|
@ -138,14 +129,18 @@ export const useKpiDataStore = defineStore("KPIDate", () => {
|
|||
|
||||
function convertResults(val: string) {
|
||||
switch (val) {
|
||||
case "PENDING":
|
||||
return "รอดำเนินการ";
|
||||
case "PASSED":
|
||||
return "ผ่านการประเมิน";
|
||||
case "NOTPASSED":
|
||||
return "ไม่ผ่านการประเมิน";
|
||||
case "EXCELLENT":
|
||||
return "ดีเด่น";
|
||||
case "VERY_GOOD":
|
||||
return "ดีมาก";
|
||||
case "GOOD":
|
||||
return "ดี";
|
||||
case "FAIR":
|
||||
return "พอใช้";
|
||||
case "IMPROVEMENT":
|
||||
return "ต้องปรับปรุง";
|
||||
default:
|
||||
break;
|
||||
return "รอดำเนินการ";
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -103,11 +103,22 @@ async function getProfile() {
|
|||
|
||||
async function fetchProfile(id: string) {
|
||||
await http
|
||||
.get(
|
||||
config.API.fileByFile("ทะเบียนประวัติ", "โปรไฟล์", id, `profile-${id}`)
|
||||
)
|
||||
.get(config.API.orgCheckAvatar(id))
|
||||
.then(async (res) => {
|
||||
store.dataEvaluation.avartar = res.data.downloadUrl;
|
||||
if (res.data.result.avatarName) {
|
||||
http
|
||||
.get(
|
||||
config.API.fileByFile(
|
||||
"ทะเบียนประวัติ",
|
||||
"โปรไฟล์",
|
||||
id,
|
||||
res.data.result.avatarName
|
||||
)
|
||||
)
|
||||
.then(async (res) => {
|
||||
store.dataEvaluation.avartar = res.data.downloadUrl;
|
||||
});
|
||||
}
|
||||
})
|
||||
.catch(() => {
|
||||
// profilePicture.value = avatar;
|
||||
|
|
@ -119,7 +130,6 @@ function close() {
|
|||
evaluatorId.value = null;
|
||||
commanderId.value = null;
|
||||
commanderHighId.value = null;
|
||||
getAll();
|
||||
}
|
||||
|
||||
function onSubmit() {
|
||||
|
|
@ -135,8 +145,10 @@ function onSubmit() {
|
|||
: null,
|
||||
})
|
||||
.then((res) => {
|
||||
success($q, "บันทึกสำเร็จ");
|
||||
fetchEvaluation();
|
||||
getOrgOp();
|
||||
close();
|
||||
success($q, "บันทึกสำเร็จ");
|
||||
})
|
||||
.catch((e) => {
|
||||
messageError($q, e);
|
||||
|
|
@ -268,7 +280,7 @@ function sendToEvaluatore() {
|
|||
})
|
||||
.then((res) => {
|
||||
success($q, "ส่งข้อตกลงให้ผู้ประเมินอนุมัติสำเร็จ");
|
||||
close();
|
||||
fetchEvaluation();
|
||||
})
|
||||
.catch((e) => {
|
||||
messageError($q, e);
|
||||
|
|
@ -295,7 +307,7 @@ function sendToEvaluateEvaluatore() {
|
|||
})
|
||||
.then((res) => {
|
||||
success($q, "ส่งให้ผู้ประเมินรายงานผลสำเร็จของงานสำเร็จ");
|
||||
close();
|
||||
fetchEvaluation();
|
||||
})
|
||||
.catch((e) => {
|
||||
messageError($q, e);
|
||||
|
|
@ -346,7 +358,7 @@ function requireEdit() {
|
|||
})
|
||||
.then((res) => {
|
||||
success($q, "ขอแก้ไขสำเร็จ");
|
||||
close();
|
||||
fetchEvaluation();
|
||||
})
|
||||
.catch((e) => {
|
||||
messageError($q, e);
|
||||
|
|
@ -397,8 +409,9 @@ function goToSummary() {
|
|||
http
|
||||
.get(config.API.sendToSummary(store.dataEvaluation.id))
|
||||
.then(async (res) => {
|
||||
await getAll();
|
||||
await fetchEvaluation();
|
||||
store.tabMain = "4";
|
||||
store.tabOpen = 4;
|
||||
})
|
||||
.catch((e) => {
|
||||
messageError($q, e);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue