ปรับ kpi
This commit is contained in:
parent
56fae384bf
commit
b832a6e2a4
6 changed files with 174 additions and 127 deletions
|
|
@ -32,7 +32,7 @@ const {
|
|||
const title = defineModel<string>("title", { required: true });
|
||||
const rows = defineModel<any[]>("data", { required: true });
|
||||
const numpage = defineModel<number>("page", { required: true });
|
||||
|
||||
const checkDetail = ref<boolean>(false);
|
||||
const props = defineProps({
|
||||
fetchList: { type: Function, required: true },
|
||||
});
|
||||
|
|
@ -137,8 +137,9 @@ function onAdd(edit: boolean = false, id: string = "") {
|
|||
}
|
||||
|
||||
function onClickView(id: string) {
|
||||
checkDetail.value = true;
|
||||
kpiUserPlannedId.value = id;
|
||||
modalViewInfo.value = true;
|
||||
modal.value = true;
|
||||
}
|
||||
|
||||
async function onEvaluate() {
|
||||
|
|
@ -310,7 +311,7 @@ const isEditStep3 = computed(() => {
|
|||
dense
|
||||
@click="onClickView(props.row.id)"
|
||||
>
|
||||
<q-tooltip>คำอธิบายผลสำเร็จของงาน</q-tooltip>
|
||||
<q-tooltip>รายละเอียด</q-tooltip>
|
||||
</q-btn></q-td
|
||||
>
|
||||
<q-td v-for="col in props.cols" :key="col.id">
|
||||
|
|
@ -334,7 +335,10 @@ const isEditStep3 = computed(() => {
|
|||
<div v-else-if="col.name === 'achievement'">
|
||||
{{ props.row.point ? `ระดับ ${props.row.point}` : "" }}
|
||||
</div>
|
||||
<div v-else-if="col.name === 'includingName'" style="width: 200px; white-space: normal;">
|
||||
<div
|
||||
v-else-if="col.name === 'includingName'"
|
||||
style="width: 200px; white-space: normal"
|
||||
>
|
||||
{{ props.row.includingName ? props.row.includingName : "-" }}
|
||||
</div>
|
||||
<div v-else-if="col.name === 'evaluationResults'">
|
||||
|
|
@ -350,7 +354,7 @@ const isEditStep3 = computed(() => {
|
|||
</q-td>
|
||||
<td>
|
||||
<div
|
||||
v-if="
|
||||
v-if="
|
||||
(store.dataEvaluation.evaluationStatus == 'APPROVE' &&
|
||||
store.tabMain === '2') ||
|
||||
store.tabMain === '3'
|
||||
|
|
@ -506,8 +510,9 @@ const isEditStep3 = computed(() => {
|
|||
<Dialog
|
||||
v-model:modal="modal"
|
||||
:numpage="numpage"
|
||||
:isStatusEdit="isStatusEdit"
|
||||
v-model:isStatusEdit="isStatusEdit"
|
||||
:kpiUserPlannedId="kpiUserPlannedId"
|
||||
v-model:checkDetail="checkDetail"
|
||||
/>
|
||||
|
||||
<!-- <Dialog03
|
||||
|
|
|
|||
|
|
@ -15,6 +15,7 @@ import { useRoute } from "vue-router";
|
|||
import type {
|
||||
FormCapacityList,
|
||||
ListCriteria,
|
||||
DataOptions,
|
||||
} from "@/modules/14_KPI/interface/request/index";
|
||||
|
||||
import DialogListCriteria from "@/modules/14_KPI/components/Tab/Dialog/DialogListCriteria.vue";
|
||||
|
|
@ -126,8 +127,8 @@ function onAdd(type: string) {
|
|||
modal.value = true;
|
||||
}
|
||||
|
||||
const rows = ref<any[]>([]);
|
||||
const lists = ref<any[]>([]);
|
||||
const rows = ref<any>([]);
|
||||
const lists = ref<any>([]);
|
||||
// const resultEvaluation = ref<string | 0>(0);
|
||||
|
||||
function getData(type: any) {
|
||||
|
|
@ -147,8 +148,8 @@ function getData(type: any) {
|
|||
let result = 0;
|
||||
let weight = 0;
|
||||
let total = 0;
|
||||
for (let index = 0; index < store.competencyType.length; index++) {
|
||||
const element = await store.competencyType[index];
|
||||
for (let index = 0; index < competencyType.value.length; index++) {
|
||||
const element = await competencyType.value[index];
|
||||
|
||||
const dataArr = await lists.value.find(
|
||||
(x: any) => x.type == element.id
|
||||
|
|
@ -274,18 +275,6 @@ const isEditStep3 = computed(() => {
|
|||
);
|
||||
});
|
||||
|
||||
watch(
|
||||
() => store.dataEvaluation.capacityPoint,
|
||||
(newValue, oldValue) => {
|
||||
if (newValue !== oldValue) {
|
||||
for (let index = 0; index < store.competencyType.length; index++) {
|
||||
const element = store.competencyType[index];
|
||||
getData(element.id);
|
||||
}
|
||||
}
|
||||
}
|
||||
);
|
||||
|
||||
function onInfo() {
|
||||
modalCriteria.value = true;
|
||||
}
|
||||
|
|
@ -300,16 +289,35 @@ function onLevel(num: number, list: any) {
|
|||
modalLevel.value = true;
|
||||
}
|
||||
|
||||
const competencyType = ref<DataOptions[]>([]);
|
||||
onMounted(() => {
|
||||
for (let index = 0; index < store.competencyType.length; index++) {
|
||||
const element = store.competencyType[index];
|
||||
getData(element.id);
|
||||
}
|
||||
setTimeout(async () => {
|
||||
// console.log("posTypeName===>", store.dataEvaluation.posTypeName);
|
||||
|
||||
competencyType.value =
|
||||
store.dataEvaluation.posTypeName == "อำนวยการ" ||
|
||||
store.dataEvaluation.posTypeName == "บริหาร"
|
||||
? store.competencyType.filter(
|
||||
(x: DataOptions) =>
|
||||
x.id == "HEAD" ||
|
||||
x.id == "EXECUTIVE" ||
|
||||
x.id == "INSPECTOR" ||
|
||||
x.id == "DIRECTOR"
|
||||
)
|
||||
: store.competencyType.filter(
|
||||
(x: DataOptions) => x.id == "HEAD" || x.id == "GROUP"
|
||||
);
|
||||
|
||||
for (let index = 0; index < competencyType.value.length; index++) {
|
||||
const element = competencyType.value[index];
|
||||
getData(element.id);
|
||||
}
|
||||
}, 1000);
|
||||
});
|
||||
</script>
|
||||
|
||||
<template>
|
||||
<div v-for="(item, index) in store.competencyType" :key="index">
|
||||
<div v-for="(item, index) in competencyType" :key="index">
|
||||
<q-card bordered style="border-radius: 5px" class="no-shadow q-mt-sm">
|
||||
<q-card-section class="bg-grey-2 q-py-sm">
|
||||
<div class="row items-center">
|
||||
|
|
@ -349,7 +357,7 @@ onMounted(() => {
|
|||
<d-table
|
||||
ref="table"
|
||||
:columns="columns"
|
||||
:rows="rows[item.id]?.length !== 0 ? rows[item.id]:[]"
|
||||
:rows="rows[item.id]"
|
||||
row-key="id"
|
||||
flat
|
||||
bordered
|
||||
|
|
@ -384,14 +392,19 @@ onMounted(() => {
|
|||
<q-tr :props="props" class="cursor-pointer">
|
||||
<q-td auto-width>
|
||||
<q-btn
|
||||
v-if="isEditStep1"
|
||||
flat
|
||||
icon="mdi-eye"
|
||||
color="info"
|
||||
round
|
||||
class="q-ml-xs"
|
||||
@click="onAchievement(props.row.achievement)"
|
||||
:icon="
|
||||
item.id == 'HEAD' || item.id == 'GROUP' ? 'mdi-eye' : 'edit'
|
||||
"
|
||||
color="info"
|
||||
@click.stop.pervent="onEdit(props.row, item.id)"
|
||||
>
|
||||
<q-tooltip>พฤติกรรมที่คาดหวัง/พฤติกรรมย่อย</q-tooltip>
|
||||
<q-tooltip v-if="item.id == 'HEAD' || item.id == 'GROUP'"
|
||||
>รายละเอียด</q-tooltip
|
||||
>
|
||||
<q-tooltip v-else>แก้ไข</q-tooltip>
|
||||
</q-btn>
|
||||
</q-td>
|
||||
<q-td v-for="col in props.cols" :key="col.id">
|
||||
|
|
@ -439,7 +452,7 @@ onMounted(() => {
|
|||
</q-td>
|
||||
<q-td>
|
||||
<div
|
||||
v-if="
|
||||
v-if="
|
||||
(store.dataEvaluation.evaluationStatus == 'APPROVE' &&
|
||||
store.tabMain === '2') ||
|
||||
store.tabMain === '3'
|
||||
|
|
@ -459,22 +472,6 @@ onMounted(() => {
|
|||
</div>
|
||||
|
||||
<div v-if="isEditStep1">
|
||||
<q-btn
|
||||
flat
|
||||
round
|
||||
:icon="
|
||||
item.id == 'HEAD' || item.id == 'GROUP'
|
||||
? 'mdi-eye'
|
||||
: 'edit'
|
||||
"
|
||||
color="info"
|
||||
@click.stop.pervent="onEdit(props.row, item.id)"
|
||||
>
|
||||
<q-tooltip v-if="item.id == 'HEAD' || item.id == 'GROUP'"
|
||||
>ดูรายละเอียด</q-tooltip
|
||||
>
|
||||
<q-tooltip v-else>แก้ไข</q-tooltip>
|
||||
</q-btn>
|
||||
<q-btn
|
||||
flat
|
||||
round
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue