ปรับเงื่อนไขการแสดง competency และปรับชื่อไฟล์
This commit is contained in:
parent
e8785cf385
commit
dd76936d92
8 changed files with 116 additions and 60 deletions
|
|
@ -1,7 +1,7 @@
|
||||||
<script setup lang="ts">
|
<script setup lang="ts">
|
||||||
import { ref } from "vue";
|
import { ref } from "vue";
|
||||||
import Dialog from "@/modules/08_KPI/components/Tab/Dialog/01_Dialog.vue";
|
import Dialog from "@/modules/08_KPI/components/Tab/Dialog/01_FormIndicator.vue";
|
||||||
import Dialog03 from "@/modules/08_KPI/components/Tab/Dialog/03_Dialog.vue";
|
import Dialog03 from "@/modules/08_KPI/components/Tab/Dialog/03_FormIndicatorSpecial.vue";
|
||||||
import type { QTableProps } from "quasar";
|
import type { QTableProps } from "quasar";
|
||||||
import { useCounterMixin } from "@/stores/mixin";
|
import { useCounterMixin } from "@/stores/mixin";
|
||||||
|
|
||||||
|
|
@ -106,7 +106,6 @@ function onAdd() {
|
||||||
<q-card-section class="bg-grey-2 q-py-sm">
|
<q-card-section class="bg-grey-2 q-py-sm">
|
||||||
<span class="text-weight-medium">{{ title }}</span>
|
<span class="text-weight-medium">{{ title }}</span>
|
||||||
|
|
||||||
|
|
||||||
<q-btn
|
<q-btn
|
||||||
class="q-ml-xs"
|
class="q-ml-xs"
|
||||||
flat
|
flat
|
||||||
|
|
|
||||||
|
|
@ -3,18 +3,7 @@ import { ref } from "vue";
|
||||||
import Card from "@/modules/08_KPI/components/Tab/Topic/02_CompetencyCard.vue";
|
import Card from "@/modules/08_KPI/components/Tab/Topic/02_CompetencyCard.vue";
|
||||||
import { useKpiDataStore } from "@/modules/08_KPI/store";
|
import { useKpiDataStore } from "@/modules/08_KPI/store";
|
||||||
|
|
||||||
import type { QTableProps } from "quasar";
|
|
||||||
import { useCounterMixin } from "@/stores/mixin";
|
|
||||||
|
|
||||||
const store = useKpiDataStore();
|
const store = useKpiDataStore();
|
||||||
const mixin = useCounterMixin();
|
|
||||||
const { date2Thai } = mixin;
|
|
||||||
|
|
||||||
const modal = ref<boolean>(false);
|
|
||||||
|
|
||||||
function onAdd() {
|
|
||||||
modal.value = true;
|
|
||||||
}
|
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<template>
|
<template>
|
||||||
|
|
@ -26,45 +15,4 @@ function onAdd() {
|
||||||
/>
|
/>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<style scoped>
|
<style scoped></style>
|
||||||
.custom-table2 {
|
|
||||||
max-height: 64vh;
|
|
||||||
|
|
||||||
.q-table tr:nth-child(odd) td {
|
|
||||||
background: white;
|
|
||||||
}
|
|
||||||
|
|
||||||
.q-table tr:nth-child(even) td {
|
|
||||||
background: #f8f8f8;
|
|
||||||
}
|
|
||||||
|
|
||||||
.q-table thead tr {
|
|
||||||
background: #ecebeb;
|
|
||||||
}
|
|
||||||
|
|
||||||
.q-table thead tr th {
|
|
||||||
position: sticky;
|
|
||||||
}
|
|
||||||
|
|
||||||
.q-table td:nth-of-type(2) {
|
|
||||||
z-index: 3 !important;
|
|
||||||
}
|
|
||||||
|
|
||||||
.q-table th:nth-of-type(2),
|
|
||||||
.q-table td:nth-of-type(2) {
|
|
||||||
position: sticky;
|
|
||||||
left: 0;
|
|
||||||
z-index: 1;
|
|
||||||
}
|
|
||||||
|
|
||||||
/* this will be the loading indicator */
|
|
||||||
.q-table thead tr:last-child th {
|
|
||||||
/* height of all previous header rows */
|
|
||||||
top: 48px;
|
|
||||||
}
|
|
||||||
|
|
||||||
.q-table thead tr:first-child th {
|
|
||||||
top: 0;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
</style>
|
|
||||||
|
|
|
||||||
|
|
@ -1,6 +1,6 @@
|
||||||
<script setup lang="ts">
|
<script setup lang="ts">
|
||||||
import { ref } from "vue";
|
import { ref } from "vue";
|
||||||
import Dialog from "@/modules/08_KPI/components/Tab/Dialog/04_Dialog.vue";
|
import Dialog from "@/modules/08_KPI/components/Tab/Dialog/04_FormCompetency.vue";
|
||||||
|
|
||||||
import type { QTableProps } from "quasar";
|
import type { QTableProps } from "quasar";
|
||||||
import { useCounterMixin } from "@/stores/mixin";
|
import { useCounterMixin } from "@/stores/mixin";
|
||||||
|
|
@ -14,9 +14,6 @@ const name = defineModel<any>("name", { required: true });
|
||||||
const filterKeyword = ref<string>("");
|
const filterKeyword = ref<string>("");
|
||||||
const modal = ref<boolean>(false);
|
const modal = ref<boolean>(false);
|
||||||
|
|
||||||
const modalAssigned = ref<boolean>(false);
|
|
||||||
|
|
||||||
const competencyType = ref<string>("HEAD");
|
|
||||||
const visibleColumns = ref<string[]>([
|
const visibleColumns = ref<string[]>([
|
||||||
"capacity",
|
"capacity",
|
||||||
"level",
|
"level",
|
||||||
|
|
|
||||||
|
|
@ -6,6 +6,7 @@ export const useKpiDataStore = defineStore("KPIDate", () => {
|
||||||
const tabMain = ref<string>("1");
|
const tabMain = ref<string>("1");
|
||||||
const dataProfile = ref<any>();
|
const dataProfile = ref<any>();
|
||||||
const dataEvaluation = ref<any>();
|
const dataEvaluation = ref<any>();
|
||||||
|
|
||||||
const competencyType = ref<DataOptions[]>([
|
const competencyType = ref<DataOptions[]>([
|
||||||
{
|
{
|
||||||
id: "HEAD",
|
id: "HEAD",
|
||||||
|
|
@ -62,6 +63,113 @@ export const useKpiDataStore = defineStore("KPIDate", () => {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function checkCompetency() {
|
||||||
|
const position = dataProfile.value.position;
|
||||||
|
const posTypeName = dataProfile.value.posTypeName;
|
||||||
|
const posLevelName = dataProfile.value.posLevelName;
|
||||||
|
|
||||||
|
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 {
|
||||||
|
switch (posTypeName + " " + posLevelName) {
|
||||||
|
// case "ทั่วไป ปฏิบัติงาน":
|
||||||
|
// case "ทั่วไป ชำนาญงาน":
|
||||||
|
// case "ทั่วไป อาวุโส":
|
||||||
|
// case "วิชาการ ปฏิบัติการ":
|
||||||
|
// case "วิชาการ ชำนาญการ":
|
||||||
|
// case "วิชาการ ชำนาญการพิเศษ":
|
||||||
|
// case "วิชาการ เชี่ยวชาญ":
|
||||||
|
// case "วิชาการ ทรงคุณวุฒิ":
|
||||||
|
// competencyType.value = competencyType.value.filter(
|
||||||
|
// (x: DataOptions) => x.id == "HEAD" || x.id == "GROUP"
|
||||||
|
// );
|
||||||
|
// break;
|
||||||
|
case "อำนวยการ ต้น":
|
||||||
|
case "อำนวยการ สูง":
|
||||||
|
case "บริหาร ต้น":
|
||||||
|
case "บริหาร สูง":
|
||||||
|
competencyType.value = competencyType.value.filter(
|
||||||
|
(x: DataOptions) => x.id == "HEAD" || x.id == "EXECUTIVE"
|
||||||
|
);
|
||||||
|
break;
|
||||||
|
default:
|
||||||
|
competencyType.value = competencyType.value.filter(
|
||||||
|
(x: DataOptions) => x.id == "HEAD" || x.id == "GROUP"
|
||||||
|
);
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
const defaultCompetencyCoreLevel = ref<number>();
|
||||||
|
const defaultCompetencyGroupLevel = ref<number | null>(null);
|
||||||
|
function checkCompetencyDefaultCompetencyLevel() {
|
||||||
|
const posTypeName = dataProfile.value.posTypeName;
|
||||||
|
const posLevelName = dataProfile.value.posLevelName;
|
||||||
|
|
||||||
|
switch (posTypeName + " " + posLevelName) {
|
||||||
|
case "บริหาร สูง":
|
||||||
|
defaultCompetencyCoreLevel.value = 5;
|
||||||
|
break;
|
||||||
|
case "บริหาร ต้น":
|
||||||
|
defaultCompetencyCoreLevel.value = 4;
|
||||||
|
break;
|
||||||
|
case "อำนวยการ สูง":
|
||||||
|
defaultCompetencyCoreLevel.value = 4;
|
||||||
|
break;
|
||||||
|
case "อำนวยการ ต้น":
|
||||||
|
defaultCompetencyCoreLevel.value = 3;
|
||||||
|
break;
|
||||||
|
case "วิชาการ ทรงคุณวุฒิ":
|
||||||
|
defaultCompetencyCoreLevel.value = 5;
|
||||||
|
defaultCompetencyGroupLevel.value = 5;
|
||||||
|
break;
|
||||||
|
case "วิชาการ เชี่ยวชาญ":
|
||||||
|
defaultCompetencyCoreLevel.value = 4;
|
||||||
|
defaultCompetencyGroupLevel.value = 4;
|
||||||
|
break;
|
||||||
|
case "วิชาการ ชำนาญการพิเศษ":
|
||||||
|
defaultCompetencyCoreLevel.value = 3;
|
||||||
|
defaultCompetencyGroupLevel.value = 4;
|
||||||
|
break;
|
||||||
|
case "วิชาการ ชำนาญการ":
|
||||||
|
defaultCompetencyCoreLevel.value = 2;
|
||||||
|
defaultCompetencyGroupLevel.value = 3;
|
||||||
|
break;
|
||||||
|
case "วิชาการ ปฏิบัติการ":
|
||||||
|
defaultCompetencyCoreLevel.value = 1;
|
||||||
|
defaultCompetencyGroupLevel.value = 2;
|
||||||
|
break;
|
||||||
|
case "ทั่วไป ทักษะพิเศษ":
|
||||||
|
defaultCompetencyCoreLevel.value = 4;
|
||||||
|
defaultCompetencyGroupLevel.value = 4;
|
||||||
|
break;
|
||||||
|
case "ทั่วไป อาวุโส":
|
||||||
|
defaultCompetencyCoreLevel.value = 3;
|
||||||
|
defaultCompetencyGroupLevel.value = 3;
|
||||||
|
break;
|
||||||
|
case "ทั่วไป ชำนาญงาน":
|
||||||
|
defaultCompetencyCoreLevel.value = 2;
|
||||||
|
defaultCompetencyGroupLevel.value = 2;
|
||||||
|
break;
|
||||||
|
case "ทั่วไป ปฏิบัติงาน":
|
||||||
|
defaultCompetencyCoreLevel.value = 1;
|
||||||
|
defaultCompetencyGroupLevel.value = 1;
|
||||||
|
break;
|
||||||
|
default:
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
return {
|
return {
|
||||||
tabMain,
|
tabMain,
|
||||||
dataProfile,
|
dataProfile,
|
||||||
|
|
@ -70,5 +178,7 @@ export const useKpiDataStore = defineStore("KPIDate", () => {
|
||||||
convertCompetencyType,
|
convertCompetencyType,
|
||||||
convertStatus,
|
convertStatus,
|
||||||
convertResults,
|
convertResults,
|
||||||
|
checkCompetency,
|
||||||
|
checkCompetencyDefaultCompetencyLevel,
|
||||||
};
|
};
|
||||||
});
|
});
|
||||||
|
|
|
||||||
|
|
@ -57,6 +57,8 @@ function getProfile() {
|
||||||
.then((res) => {
|
.then((res) => {
|
||||||
const data = res.data.result;
|
const data = res.data.result;
|
||||||
store.dataProfile = data;
|
store.dataProfile = data;
|
||||||
|
store.checkCompetency();
|
||||||
|
store.checkCompetencyDefaultCompetencyLevel();
|
||||||
|
|
||||||
formProfile.fullName = `${data.prefix}${data.firstName} ${data.lastName}`;
|
formProfile.fullName = `${data.prefix}${data.firstName} ${data.lastName}`;
|
||||||
formProfile.position = data.position;
|
formProfile.position = data.position;
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue