ปรับ ประเมินบุคคล

This commit is contained in:
DESKTOP-1R2VSQH\Lenovo ThinkPad E490 2024-12-18 10:52:04 +07:00
parent 420b6e9639
commit d775776608
4 changed files with 141 additions and 14 deletions

View file

@ -40,7 +40,7 @@ export default {
dataUserSalary: `${profileOrg}/salary/user`,
dataUserSalaryByType: (type: string) => `${org}/profile${type}/salary/user`,
dataUserHonor: `${profileOrg}/honor/user`,
dataUserAssessments: `${profileOrg}/assessments/user`,
dataUserNopaid: `${profileOrg}/nopaid/user`,
dataUserNopaidByType: (type: string) => `${org}/profile${type}/nopaid/user`,

View file

@ -281,6 +281,17 @@ async function saveStep1() {
other: e.other,
startDate: e.startDate,
}));
const assessments = formDetail.value.assessments.map((e: any) => ({
date: e.date,
point1: e.point1,
point1Total: e.point1Total,
point2: e.point2,
point2Total: e.point2Total,
pointSum: e.pointSum,
pointSumTotal: e.pointSumTotal,
}));
const evaluateType = route.params.type.toString();
const form = {
userId: formDetail.value.id,
@ -308,7 +319,7 @@ async function saveStep1() {
certificates: [...formDetail.value.certificates],
salaries: [...salaries],
trainings: [...formDetail.value.trainings],
assessments: [...formDetail.value.assessments],
assessments: [...assessments],
};
await http

View file

@ -28,6 +28,7 @@ const {
columnSalaries,
columnTraining,
columnProjectsProposed,
columnAssessments,
} = store;
const props = defineProps({
@ -125,16 +126,17 @@ async function fetchDetail() {
}));
});
http.get(config.API.dataUserHonor).then((res) => {
formDetail.honor = res.data.result.map((e: any) => ({
receivedDate: e.createdAt,
authority: e.issuer,
detail: e.detail,
orderNumber: e.refCommandNo,
doce: e.refCommandDate,
}));
http.get(config.API.dataUserAssessments).then((res) => {
// formDetail.honor = res.data.result
// res.data.result.map((e: any) => ({
// receivedDate: e.createdAt,
// authority: e.issuer,
// detail: e.detail,
// orderNumber: e.refCommandNo,
// doce: e.refCommandDate,
formDetail.assessments = res.data.result;
});
// formDetail.assessments = data.assessments;
// }));
emit("update:formDeital", formDetail);
})
.catch((err) => {
@ -578,8 +580,8 @@ onMounted(async () => {
<div class="col-12"><q-separator /></div>
<div class="col-10">
<TableData
:columns="columnProjectsProposed"
:row="formDetail.honor"
:columns="columnAssessments"
:row="formDetail.assessments"
/>
</div>
</q-card>

View file

@ -222,7 +222,6 @@ export const useEvaluateDetailStore = defineStore("evaluateDetailStore", () => {
name: "receivedDate",
align: "center",
label: "วันที่ได้รับ",
sortable: true,
field: (value) => date2Thai(value),
headerStyle: "font-size: 14px",
@ -266,10 +265,125 @@ export const useEvaluateDetailStore = defineStore("evaluateDetailStore", () => {
},
]);
/** ผลงานที่เคยเสนอขอประเมิน (ถ้ามี)*/
const columnAssessments = ref<QTableProps["columns"]>([
{
name: "date",
align: "left",
label: "วันที่ได้รับ",
sortable: true,
field: "date",
headerStyle: "font-size: 14px",
style: "font-size: 14px",
format: (v) => date2Thai(v),
},
{
name: "point1Total",
align: "left",
label: "ส่วนที่1 (น้ำหนัก)",
sortable: true,
field: "point1Total",
headerStyle: "font-size: 14px",
style: "font-size: 14px",
sort: (a: string, b: string) =>
a.localeCompare(b, undefined, { numeric: true, sensitivity: "base" }),
},
{
name: "point1",
align: "left",
label: "ผลประเมินส่วนที่1 (คะแนน)",
sortable: true,
field: "point1",
headerStyle: "font-size: 14px",
style: "font-size: 14px",
sort: (a: string, b: string) =>
a.localeCompare(b, undefined, { numeric: true, sensitivity: "base" }),
},
{
name: "point2Total",
align: "left",
label: "ส่วนที่2 (น้ำหนัก)",
sortable: true,
field: "point2Total",
headerStyle: "font-size: 14px",
style: "font-size: 14px",
sort: (a: string, b: string) =>
a.localeCompare(b, undefined, { numeric: true, sensitivity: "base" }),
},
{
name: "point2",
align: "left",
label: "ผลประเมินส่วนที่2 (คะแนน)",
sortable: true,
field: "point2",
headerStyle: "font-size: 14px",
style: "font-size: 14px",
sort: (a: string, b: string) =>
a.localeCompare(b, undefined, { numeric: true, sensitivity: "base" }),
},
{
name: "pointSumTotal",
align: "left",
label: "ผลรวม (น้ำหนัก)",
sortable: true,
field: "pointSumTotal",
headerStyle: "font-size: 14px",
style: "font-size: 14px",
sort: (a: string, b: string) =>
a.localeCompare(b, undefined, { numeric: true, sensitivity: "base" }),
},
{
name: "pointSum",
align: "left",
label: "ผลประเมินรวม (คะแนน)",
sortable: true,
field: "pointSum",
headerStyle: "font-size: 14px",
style: "font-size: 14px",
sort: (a: string, b: string) =>
a.localeCompare(b, undefined, { numeric: true, sensitivity: "base" }),
},
{
name: "name",
align: "left",
label: "ผลประเมิน",
sortable: true,
field: "name",
format(val, row) {
return `${textPoint(row.pointSum)} ${textRangePoint(row.pointSum)}`;
},
headerStyle: "font-size: 14px",
style: "font-size: 14px",
sort: (a: string, b: string) =>
a.localeCompare(b, undefined, { numeric: true, sensitivity: "base" }),
},
]);
function textRangePoint(val: number | undefined) {
if (val == undefined) val = -1;
if (val < 60.0) return "(คะแนนต่ำกว่าร้อยละ 60.00)";
if (val >= 60.0 && val <= 69.99) return "(คะแนนร้อยละ 60.00 - 69.99)";
if (val >= 70.0 && val <= 79.99) return "(คะแนนร้อยละ 70.00 - 79.99)";
if (val >= 80.0 && val <= 89.99) return " (คะแนนร้อยละ 80.00 - 89.99)";
if (val >= 90.0) return " (คะแนนร้อยละ 90.00 ขึ้นไป)";
else return "";
}
function textPoint(val: number | undefined) {
if (val == undefined) val = -1;
if (val < 60.0) return "ต้องปรับปรุง";
if (val >= 60.0 && val <= 69.99) return "พอใช้";
if (val >= 70.0 && val <= 79.99) return "ดี";
if (val >= 80.0 && val <= 89.99) return "ดีมาก";
if (val >= 90.0) return "ดีเด่น";
else return "-";
}
return {
columnsCertificates,
columnSalaries,
columnTraining,
columnProjectsProposed,
columnAssessments,
};
});