ประเมินบุคคลตรวจสอบตำแหน่งก่อนยื่นประเมิน
This commit is contained in:
parent
0fe78727c1
commit
4103b78774
4 changed files with 69 additions and 11 deletions
|
|
@ -91,9 +91,11 @@ interface CertificatesForm {
|
|||
interface ListMenu {
|
||||
val: string;
|
||||
label: string;
|
||||
level: number;
|
||||
type: number;
|
||||
}
|
||||
|
||||
interface FormRef{
|
||||
interface FormRef {
|
||||
subject: object | null;
|
||||
author: object | null;
|
||||
commanderFullname: object | null;
|
||||
|
|
@ -111,5 +113,5 @@ export type {
|
|||
EducationForm,
|
||||
CertificatesForm,
|
||||
ListMenu,
|
||||
FormRef
|
||||
FormRef,
|
||||
};
|
||||
|
|
|
|||
|
|
@ -32,10 +32,20 @@ const listMenu = ref<ListMenu[]>([
|
|||
{
|
||||
val: "EXPERT",
|
||||
label: "ประเมินชำนาญการ",
|
||||
type: 2,
|
||||
level: 2,
|
||||
},
|
||||
{
|
||||
val: "SPECIAL_EXPERT",
|
||||
label: "ประเมินชำนาญการพิเศษ",
|
||||
type: 2,
|
||||
level: 3,
|
||||
},
|
||||
{
|
||||
val: "PROFESSIONAL",
|
||||
label: "ประเมินเชี่ยวชาญ",
|
||||
type: 2,
|
||||
level: 4,
|
||||
},
|
||||
]);
|
||||
|
||||
|
|
@ -48,8 +58,8 @@ function onclickAddEvaluate(data: ListMenu) {
|
|||
menu.value = data;
|
||||
}
|
||||
|
||||
function openExpert(){
|
||||
router.push('/evaluate/expert')
|
||||
function openExpert() {
|
||||
router.push("/evaluate/expert");
|
||||
}
|
||||
|
||||
/** ตัวแปร Paging*/
|
||||
|
|
@ -68,9 +78,10 @@ async function fetchEvaluteList() {
|
|||
};
|
||||
await http
|
||||
.put(config.API.evaluationList(), body)
|
||||
.then((res) => {
|
||||
.then(async (res) => {
|
||||
maxPage.value = Math.ceil(res.data.result.total / pageSize.value);
|
||||
store.fetchEvaluateList(res.data.result.data);
|
||||
await getProfileCheck();
|
||||
})
|
||||
.catch((err) => {
|
||||
messageError($q, err);
|
||||
|
|
@ -80,6 +91,34 @@ async function fetchEvaluteList() {
|
|||
});
|
||||
}
|
||||
|
||||
/** function เรียกรายการประเมิน*/
|
||||
const statusSubmit = ref<boolean>(true);
|
||||
async function getProfileCheck() {
|
||||
await http
|
||||
.get(config.API.profilePosition())
|
||||
.then(async (res: any) => {
|
||||
const data = res.data.result;
|
||||
// data.posTypeRank = await 2;
|
||||
// data.posLevelRank = await 4;
|
||||
// console.log("posTypeRank===>",data.posTypeRank);
|
||||
// console.log("posLevelRank===>",data.posLevelRank);
|
||||
|
||||
if (
|
||||
data.posTypeRank != 2 ||
|
||||
(data.posTypeRank == 2 && data.posLevelRank >= 4)
|
||||
) {
|
||||
statusSubmit.value = false;
|
||||
} else {
|
||||
listMenu.value = await listMenu.value.filter(
|
||||
(x: ListMenu) => x.level > data.posLevelRank
|
||||
);
|
||||
}
|
||||
})
|
||||
.catch((err) => {
|
||||
messageError($q, err);
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* function updatePaging
|
||||
* @param newPagination ข้อมูลใหม่ของ Paging
|
||||
|
|
@ -160,6 +199,7 @@ watch(
|
|||
}
|
||||
);
|
||||
</script>
|
||||
|
||||
<template>
|
||||
<div class="col-12 row justify-center">
|
||||
<div class="col-xs-12 col-sm-12 col-md-11">
|
||||
|
|
@ -183,7 +223,14 @@ watch(
|
|||
<q-card bordered class="col-12 row caedNone q-pa-md">
|
||||
<div class="row col-12 q-mb-sm q-col-gutter-sm">
|
||||
<div class="col-xs-12 col-sm-3 col-md-2">
|
||||
<q-btn size="12px" flat round color="primary" icon="mdi-plus">
|
||||
<q-btn
|
||||
v-if="statusSubmit"
|
||||
size="12px"
|
||||
flat
|
||||
round
|
||||
color="primary"
|
||||
icon="mdi-plus"
|
||||
>
|
||||
<q-menu>
|
||||
<q-list style="min-width: auto">
|
||||
<q-item
|
||||
|
|
@ -191,15 +238,15 @@ watch(
|
|||
:key="index"
|
||||
clickable
|
||||
v-close-popup
|
||||
@click.stop="onclickAddEvaluate(item)"
|
||||
@click.stop="
|
||||
item.val == 'PROFESSIONAL'
|
||||
? openExpert()
|
||||
: onclickAddEvaluate(item)
|
||||
"
|
||||
>
|
||||
<q-item-section>{{ item.label }}</q-item-section>
|
||||
<q-tooltip>{{ item.label }}</q-tooltip>
|
||||
</q-item>
|
||||
<q-item clickable v-close-popup @click.stop="openExpert">
|
||||
<q-item-section>ประเมินเชี่ยวชาญ</q-item-section>
|
||||
<q-tooltip>ประเมินเชี่ยวชาญ</q-tooltip>
|
||||
</q-item>
|
||||
</q-list>
|
||||
</q-menu>
|
||||
<q-tooltip>เพิ่มการประเมินบุคคล</q-tooltip>
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue