This commit is contained in:
Warunee Tamkoo 2024-06-18 17:48:47 +07:00
parent 6d7547d14f
commit d1b1701b58
6 changed files with 56 additions and 48 deletions

View file

@ -119,7 +119,11 @@ function onClickApprove(type: string = "") {
:visible-columns="visibleColumns"
v-model:pagination="pagination"
@update:pagination="props.updatePagination"
selection="multiple"
:selection="
store.tabMainevaluator === '5' || store.tabMainevaluator === '6'
? 'none'
: 'multiple'
"
v-model:selected="store.selected"
>
<template v-slot:header-selection="scope">
@ -218,17 +222,7 @@ function onClickApprove(type: string = "") {
</div>
<div class="row justify-end q-mt-md q-gutter-sm">
<q-btn
v-if="store.tabMainevaluator === '5'"
color="orange"
label="ไม่ผ่านการประเมิน"
@click="onClickApprove('NOTPASSED')"
/>
<q-btn
:color="store.tabMainevaluator === '5' ? 'green' : 'public'"
:label="store.tabMainevaluator === '5' ? 'ผ่านการประเมิน' : 'อนุมัติ'"
@click="onClickApprove('PASSED')"
/>
<q-btn color="public" label="อนุมัติ" @click="onClickApprove('PASSED')" />
</div>
</template>

View file

@ -0,0 +1,3 @@
<template>
<div class="q-pa-md">สรปผลการประเม</div>
</template>

View file

@ -4,7 +4,7 @@ import { useKpiDataStore } from "@/modules/08_KPI/store";
import { useRoute } from "vue-router";
import Assessment from "@/modules/08_KPI/components/Tab/01_Assessment.vue";
import Evaluator from "@/modules/08_KPI/components/Tab/02_Evaluator.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";
@ -25,6 +25,10 @@ const itemsTab = ref<any>([
name: "3",
label: "รายงานผลสำเร็จของงาน",
},
{
name: "4",
label: "สรุปผลการประเมิน",
},
{
name: "5",
label: "ไฟล์เอกสาร",
@ -59,6 +63,7 @@ const splitterModel = ref<number>(12);
label="รายงานผลสำเร็จของงาน"
:disable="store.tabOpen < 3"
/>
<q-tab name="4" label="สรุปผลการประเมิน" />
<q-tab name="5" label="ไฟล์เอกสาร" />
</q-tabs>
</template>
@ -81,7 +86,7 @@ const splitterModel = ref<number>(12);
<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'" />
<Result v-if="store.tabMain === '4'" :type="'result'" />
<File v-if="store.tabMain === '5'" />
</q-tab-panel>
</q-tab-panels>

View file

@ -47,7 +47,7 @@ const visibleColumns = ref<string[]>(
"achievement",
"evaluationResults",
]
: ["includingName", "target", "weight"]
: ["includingName", "target", "point", "weight"]
);
const columns = ref<QTableProps["columns"]>([
{

View file

@ -108,7 +108,7 @@ const columns = ref<QTableProps["columns"]>([
const visibleColumns = ref<string[]>(
store.tabOpen === 3 && store.tabMain === "3"
? ["name", "level", "point", "weight", "summary"]
: ["name", "level", "weight"]
: ["name", "level", "point", "weight"]
);
const typeCompetency = ref<string>("");

View file

@ -130,31 +130,37 @@ export const useKpiDataStore = defineStore("KPIDate", () => {
}
async function checkCompetency() {
const position = await dataEvaluation.value.position;
const executiveName = await dataEvaluation.value.posExecutiveName;
// const position = await dataEvaluation.value.position;
// const executiveName = await dataEvaluation.value.posExecutiveName;
const posTypeName = dataEvaluation.value.posTypeName;
const posLevelName = dataEvaluation.value.posLevelName;
if (
position == "ผู้ตรวจราชการกรุงเทพมหานคร" ||
position == "ผู้ตรวจราชการ"
) {
// if (
// position == "ผู้ตรวจราชการกรุงเทพมหานคร" ||
// position == "ผู้ตรวจราชการ"
// ) {
// competencyType.value = competencyType.value.filter(
// (x: DataOptions) => x.id == "HEAD" || x.id == "INSPECTOR"
// );
// } else if (position == "ผู้อำนวยการเขต") {
// competencyType.value = competencyType.value.filter(
// (x: DataOptions) => x.id == "HEAD" || x.id == "DIRECTOR"
// );
// } else {
if (posTypeName == "อำนวยการ" || posTypeName == "บริหาร") {
competencyType.value = competencyType.value.filter(
(x: DataOptions) => x.id == "HEAD" || x.id == "INSPECTOR"
);
} else if (position == "ผู้อำนวยการเขต") {
competencyType.value = competencyType.value.filter(
(x: DataOptions) => x.id == "HEAD" || x.id == "DIRECTOR"
(x: DataOptions) =>
x.id == "HEAD" ||
x.id == "EXECUTIVE" ||
x.id == "INSPECTOR" ||
x.id == "DIRECTOR"
);
} else {
if (executiveName == null) {
competencyType.value = competencyType.value.filter(
(x: DataOptions) => x.id == "HEAD" || x.id == "GROUP"
);
} else {
competencyType.value = competencyType.value.filter(
(x: DataOptions) => x.id == "HEAD" || x.id == "EXECUTIVE"
);
}
}
// }
}
const defaultCompetencyCoreLevel = ref<number>();
@ -231,18 +237,18 @@ export const useKpiDataStore = defineStore("KPIDate", () => {
const rolePerson = ref<string>("USER"); //"USER" | "EVALUATOR" | "COMMANDER", "COMMANDERHIGH"
const tabOpen = ref<number>(1);
async function checkStep() {
const role =
dataEvaluation.value.profileId == await dataProfile.value.profileId
const role = await (dataEvaluation.value.profileId ==
dataProfile.value.profileId
? "USER"
: dataEvaluation.value.evaluatorId == await dataProfile.value.profileId
: dataEvaluation.value.evaluatorId == (await dataProfile.value.profileId)
? "EVALUATOR"
: dataEvaluation.value.commanderId == await dataProfile.value.profileId
: dataEvaluation.value.commanderId == (await dataProfile.value.profileId)
? "COMMANDER"
: dataEvaluation.value.commanderHighId == await dataProfile.value.profileId
: dataEvaluation.value.commanderHighId ==
(await dataProfile.value.profileId)
? "COMMANDERHIGH"
: "";
console.log("🚀 ~ checkStep ~ role:", role)
: "");
// console.log("🚀 ~ checkStep ~ role:", role);
rolePerson.value = role;
switch (dataEvaluation.value.evaluationStatus) {