Merge branch 'develop' into dev
* develop: fix(retirement-detail):send Type fix:filter evaluator commander commanderHigh fix: fix status EVALUATING
This commit is contained in:
commit
10b7ddf6e9
3 changed files with 52 additions and 65 deletions
|
|
@ -85,6 +85,7 @@ const totalList = ref<number>(0);
|
|||
|
||||
// fecth profile
|
||||
async function fecthProfile() {
|
||||
rows.value = [];
|
||||
showLoader();
|
||||
if (props?.dataProfile?.type === "OFFICER") {
|
||||
formPagePersonList.keyword =
|
||||
|
|
@ -122,6 +123,7 @@ async function fecthProfile() {
|
|||
page: formPagePersonList.page,
|
||||
pageSize: formPagePersonList.pageSize,
|
||||
keyword: formPagePersonList.keyword,
|
||||
type: "EMPLOYEE",
|
||||
})
|
||||
.then((res) => {
|
||||
maxPage.value = Math.ceil(
|
||||
|
|
@ -295,7 +297,7 @@ watch(modal, () => {
|
|||
</q-tr>
|
||||
</template>
|
||||
<template v-slot:pagination="scope">
|
||||
ทั้งหมด {{ totalList }} รายการ
|
||||
ทั้งหมด {{ totalList.toLocaleString() }} รายการ
|
||||
<q-pagination
|
||||
v-model="formPagePersonList.page"
|
||||
active-color="primary"
|
||||
|
|
@ -316,35 +318,4 @@ watch(modal, () => {
|
|||
</q-dialog>
|
||||
</template>
|
||||
|
||||
<style lang="scss">
|
||||
.custom-header-table {
|
||||
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;
|
||||
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>
|
||||
<style lang="scss"></style>
|
||||
|
|
|
|||
|
|
@ -67,6 +67,12 @@ const formRound = reactive({
|
|||
posExecutiveName: "",
|
||||
});
|
||||
|
||||
const FILTER_TYPES = {
|
||||
EVALUATOR: "evaluatorIdOp",
|
||||
COMMANDER: "commanderIdOp",
|
||||
COMMANDER_HIGH: "commanderHighOp",
|
||||
} as const;
|
||||
|
||||
const evaluatorIdOp = ref<DataOption[]>([]);
|
||||
const commanderIdOp = ref<DataOption[]>([]);
|
||||
const commanderHighOp = ref<DataOption[]>([]);
|
||||
|
|
@ -199,31 +205,38 @@ function fetchRoundOption() {
|
|||
* @param refData เเยกประเภท
|
||||
*/
|
||||
function filterOption(val: string, update: Function, refData: string) {
|
||||
switch (refData) {
|
||||
case "evaluatorIdOp":
|
||||
update(() => {
|
||||
evaluatorIdOp.value = evaluatorIdMainOp.value.filter(
|
||||
(v: DataOption) => v.name.indexOf(val) > -1
|
||||
);
|
||||
});
|
||||
break;
|
||||
case "commanderIdOp":
|
||||
update(() => {
|
||||
commanderIdOp.value = commanderIdMainOp.value.filter(
|
||||
(v: DataOption) => v.name.indexOf(val) > -1
|
||||
);
|
||||
});
|
||||
break;
|
||||
case "commanderHighOp":
|
||||
update(() => {
|
||||
commanderHighOp.value = commanderHighMainOp.value.filter(
|
||||
(v: DataOption) => v.name.indexOf(val) > -1
|
||||
);
|
||||
});
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
const filterConfig = {
|
||||
[FILTER_TYPES.EVALUATOR]: {
|
||||
sourceData: evaluatorIdMainOp.value,
|
||||
targetRef: evaluatorIdOp,
|
||||
excludeIds: [formRound.commanderId, formRound.commanderHighId],
|
||||
},
|
||||
[FILTER_TYPES.COMMANDER]: {
|
||||
sourceData: commanderIdMainOp.value,
|
||||
targetRef: commanderIdOp,
|
||||
excludeIds: [formRound.evaluatorId, formRound.commanderHighId],
|
||||
},
|
||||
[FILTER_TYPES.COMMANDER_HIGH]: {
|
||||
sourceData: commanderHighMainOp.value,
|
||||
targetRef: commanderHighOp,
|
||||
excludeIds: [formRound.evaluatorId, formRound.commanderId],
|
||||
},
|
||||
};
|
||||
|
||||
const config = filterConfig[refData as keyof typeof filterConfig];
|
||||
|
||||
if (!config) return;
|
||||
|
||||
// กรองข้อมูลโดยเอา excludeIds ออก
|
||||
const filteredData = config.sourceData.filter(
|
||||
(item: DataOption) => !config.excludeIds.includes(item.id)
|
||||
);
|
||||
|
||||
update(() => {
|
||||
config.targetRef.value = filteredData.filter((item: DataOption) =>
|
||||
item.name.toLowerCase().includes(val.toLowerCase())
|
||||
);
|
||||
});
|
||||
}
|
||||
|
||||
/** เช็ครอบการประเมินที่ปิดรอบ */
|
||||
|
|
|
|||
|
|
@ -178,7 +178,7 @@ function onSubmit() {
|
|||
}
|
||||
|
||||
async function getOrgOp() {
|
||||
showLoader()
|
||||
showLoader();
|
||||
await http
|
||||
.get(config.API.Kpiorg + `/${store.dataProfile.profileId}`)
|
||||
.then((res) => {
|
||||
|
|
@ -214,7 +214,7 @@ async function getOrgOp() {
|
|||
name: `${i.prefix}${i.firstName} ${i.lastName}`,
|
||||
}))
|
||||
.find((i: any) => i.id == store.dataEvaluation.commanderHighId);
|
||||
hideLoader()
|
||||
hideLoader();
|
||||
})
|
||||
.catch((e) => {
|
||||
messageError($q, e);
|
||||
|
|
@ -351,7 +351,7 @@ function openStatus() {
|
|||
router.push(`/probation-detail/${store.dataEvaluation.id}`);
|
||||
}
|
||||
|
||||
function sendToEvauator() {
|
||||
function sendToEvaluator() {
|
||||
dialogConfirm($q, () => {
|
||||
showLoader();
|
||||
http
|
||||
|
|
@ -672,6 +672,7 @@ onUnmounted(() => {
|
|||
>*น้ำหนัก(ร้อยละ) ผลสัมฤทธิ์ของงานไม่ถูกต้อง</span
|
||||
>
|
||||
<br v-if="!$q.screen.gt.xs" />
|
||||
|
||||
<q-btn
|
||||
v-if="
|
||||
store.rolePerson == 'USER' &&
|
||||
|
|
@ -695,12 +696,14 @@ onUnmounted(() => {
|
|||
>
|
||||
<q-tooltip>ส่งให้ผู้ประเมินอนุมัติ</q-tooltip>
|
||||
</q-btn>
|
||||
|
||||
<q-btn
|
||||
v-if="
|
||||
!checkRoutePermisson &&
|
||||
store.rolePerson == 'USER' &&
|
||||
store.tabMain == '2' &&
|
||||
store.dataEvaluation.evaluationStatus == 'APPROVE'
|
||||
store.rolePerson === 'USER' &&
|
||||
store.tabMain === '2' &&
|
||||
store.dataEvaluation.evaluationStatus === 'APPROVE' &&
|
||||
store.dataEvaluation.evaluationReqEdit !== 'EVALUATOR'
|
||||
"
|
||||
unelevated
|
||||
round
|
||||
|
|
@ -708,7 +711,7 @@ onUnmounted(() => {
|
|||
color="grey-2"
|
||||
text-color="blue-6"
|
||||
size="md"
|
||||
@click="sendToEvauator"
|
||||
@click="sendToEvaluator"
|
||||
>
|
||||
<q-tooltip>ทำการประเมิน</q-tooltip>
|
||||
</q-btn>
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue