ประเมินบุคคล
This commit is contained in:
parent
d092e8311d
commit
4d0137749c
3 changed files with 144 additions and 40 deletions
|
|
@ -23,6 +23,23 @@ const props = defineProps({
|
|||
virtual-scroll
|
||||
class="row col-12"
|
||||
>
|
||||
<template v-slot:header="props">
|
||||
<q-tr :props="props" class="bg-grey-2">
|
||||
<q-th v-for="col in props.cols" :key="col.name" :props="props">
|
||||
<span class="text-body2 text-black">{{ col.label }}</span>
|
||||
</q-th>
|
||||
</q-tr>
|
||||
</template>
|
||||
|
||||
<template v-slot:body="props">
|
||||
<q-tr :props="props">
|
||||
<q-td v-for="col in props.cols" :key="col.name" :props="props">
|
||||
<div>
|
||||
{{ !col.value ? "-" : col.value }}
|
||||
</div>
|
||||
</q-td>
|
||||
</q-tr>
|
||||
</template>
|
||||
</q-table>
|
||||
</template>
|
||||
|
||||
|
|
|
|||
|
|
@ -20,7 +20,7 @@ const {
|
|||
columnsCertificates,
|
||||
columnSalaries,
|
||||
columnTraining,
|
||||
columnProjectsProposed,
|
||||
columnAssessments,
|
||||
} = store;
|
||||
const { date2Thai, showLoader, hideLoader } = mixin;
|
||||
|
||||
|
|
@ -42,7 +42,7 @@ const formDetail = reactive({
|
|||
position: "", //ตำแหน่ง
|
||||
oc: "", //สังกัด
|
||||
salary: "", //เงินเดือน
|
||||
positionLevel: "", //ระดับปัจจุบัน,ระดับที่ประเมิน
|
||||
positionLevel: "", //ระดับปัจจุบัน,ระดับที่ประเมิน
|
||||
posNo: "", //ตำแหน่งเลขที่
|
||||
birthDate: "", //วันเดือนปีเกิด
|
||||
govAge: "", //อายุราชการ
|
||||
|
|
@ -60,20 +60,20 @@ function formattedNumber(x: number) {
|
|||
onMounted(() => {
|
||||
if (props.data) {
|
||||
showLoader();
|
||||
formDetail.prefix = props.data.prefix;
|
||||
formDetail.fullName = props.data.fullName;
|
||||
formDetail.position = props.data.position;
|
||||
formDetail.oc = props.data.oc;
|
||||
formDetail.prefix = props.data.prefix ?? "-";
|
||||
formDetail.fullName = props.data.fullName ?? "-";
|
||||
formDetail.position = props.data.position ?? "-";
|
||||
formDetail.oc = props.data.oc ?? "-";
|
||||
formDetail.salary = props.data.salary
|
||||
? formattedNumber(props.data.salary)
|
||||
: "-";
|
||||
formDetail.positionLevel = props.data.positionLevel;
|
||||
formDetail.posNo = props.data.posNo;
|
||||
formDetail.birthDate =
|
||||
props.data.birthDate && date2Thai(props.data.birthDate);
|
||||
formDetail.govAge = props.data.govAge;
|
||||
formDetail.positionLevel = props.data.positionLevel ?? "-";
|
||||
formDetail.posNo = props.data.posNo ?? "-";
|
||||
formDetail.birthDate = props.data.birthDate
|
||||
? date2Thai(props.data.birthDate)
|
||||
: "-";
|
||||
formDetail.govAge = props.data.govAge ?? "-";
|
||||
formDetail.educations = props.data.educations;
|
||||
|
||||
formDetail.certificates = props.data.certificates
|
||||
? props.data.certificates.map((e: CertificatesForm) => ({
|
||||
certificateNo: e.certificateNo,
|
||||
|
|
@ -255,7 +255,9 @@ onMounted(() => {
|
|||
<q-input
|
||||
borderless
|
||||
readonly
|
||||
:model-value="education.educationLevel"
|
||||
:model-value="
|
||||
education.educationLevel ? education.educationLevel : '-'
|
||||
"
|
||||
label="ระดับศึกษา"
|
||||
/>
|
||||
</div>
|
||||
|
|
@ -264,7 +266,7 @@ onMounted(() => {
|
|||
<q-input
|
||||
borderless
|
||||
readonly
|
||||
:model-value="education.institute"
|
||||
:model-value="education.institute ? education.institute : '-'"
|
||||
label="สถานศึกษา"
|
||||
/>
|
||||
</div>
|
||||
|
|
@ -272,7 +274,9 @@ onMounted(() => {
|
|||
<div class="col-xs-6 col-sm-4 col-md-3">
|
||||
<q-input
|
||||
borderless
|
||||
:model-value="date2Thai(education.startDate)"
|
||||
:model-value="
|
||||
education.startDate ? date2Thai(education.startDate) : '-'
|
||||
"
|
||||
readonly
|
||||
label="ตั้งแต่"
|
||||
>
|
||||
|
|
@ -282,7 +286,9 @@ onMounted(() => {
|
|||
<div class="col-xs-6 col-sm-4 col-md-3">
|
||||
<q-input
|
||||
borderless
|
||||
:model-value="date2Thai(education.endDate)"
|
||||
:model-value="
|
||||
education.endDate ? date2Thai(education.endDate) : '-'
|
||||
"
|
||||
readonly
|
||||
label="ถึง"
|
||||
>
|
||||
|
|
@ -291,7 +297,9 @@ onMounted(() => {
|
|||
<div class="col-xs-6 col-sm-4 col-md-3">
|
||||
<q-input
|
||||
borderless
|
||||
:model-value="date2Thai(education.finishDate)"
|
||||
:model-value="
|
||||
education.finishDate ? date2Thai(education.finishDate) : '-'
|
||||
"
|
||||
readonly
|
||||
label="วันที่สำเร็จการศึกษา"
|
||||
>
|
||||
|
|
@ -311,7 +319,7 @@ onMounted(() => {
|
|||
<q-input
|
||||
borderless
|
||||
readonly
|
||||
:model-value="education.degree"
|
||||
:model-value="education.degree ? education.degree:'-'"
|
||||
label="วุฒิการศึกษา"
|
||||
/>
|
||||
</div>
|
||||
|
|
@ -320,7 +328,7 @@ onMounted(() => {
|
|||
<q-input
|
||||
borderless
|
||||
readonly
|
||||
:model-value="education.field"
|
||||
:model-value="education.field ? education.field : '-'"
|
||||
label="สาขาวิชา/ทาง"
|
||||
/>
|
||||
</div>
|
||||
|
|
@ -328,7 +336,7 @@ onMounted(() => {
|
|||
<q-input
|
||||
borderless
|
||||
readonly
|
||||
:model-value="education.fundName"
|
||||
:model-value="education.fundName? education.fundName:'-'"
|
||||
label="ทุน"
|
||||
/>
|
||||
</div>
|
||||
|
|
@ -337,7 +345,7 @@ onMounted(() => {
|
|||
<q-input
|
||||
borderless
|
||||
readonly
|
||||
:model-value="education.gpa"
|
||||
:model-value="education.gpa ? education.gpa :'-'"
|
||||
label="เกรดเฉลี่ย"
|
||||
/>
|
||||
</div>
|
||||
|
|
@ -346,10 +354,16 @@ onMounted(() => {
|
|||
<q-input
|
||||
borderless
|
||||
readonly
|
||||
:model-value="education.country"
|
||||
:model-value="education.country ? education.country : '-'"
|
||||
label="ประเทศ"
|
||||
/>
|
||||
</div>
|
||||
<div
|
||||
v-if="index + 1 !== formDetail.educations.length"
|
||||
class="col-12"
|
||||
>
|
||||
<q-separator size="2px" />
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div v-else class="row col-12 q-pa-md">ไม่มีประวัติการศึกษา</div>
|
||||
|
|
@ -403,7 +417,10 @@ onMounted(() => {
|
|||
</div>
|
||||
<div class="col-12"><q-separator /></div>
|
||||
<div class="col-10">
|
||||
<TableData :columns="columnProjectsProposed" />
|
||||
<TableData
|
||||
:columns="columnAssessments"
|
||||
:row="formDetail.assessments"
|
||||
/>
|
||||
</div>
|
||||
</q-card>
|
||||
</div>
|
||||
|
|
|
|||
|
|
@ -1,8 +1,13 @@
|
|||
import { defineStore } from "pinia";
|
||||
import { ref } from "vue";
|
||||
|
||||
import { useCounterMixin } from "@/stores/mixin";
|
||||
|
||||
import type { QTableProps } from "quasar";
|
||||
|
||||
const mixin = useCounterMixin();
|
||||
const { date2Thai } = mixin;
|
||||
|
||||
export const useEvaluateDetailStore = defineStore("evaluateDetailStore", () => {
|
||||
const tabMenu = ref<string>("1");
|
||||
const step = ref<number>(1);
|
||||
|
|
@ -237,54 +242,119 @@ export const useEvaluateDetailStore = defineStore("evaluateDetailStore", () => {
|
|||
]);
|
||||
|
||||
/** คอลัมน์ ผลงานที่เคยเสนอขอประเมิน*/
|
||||
const columnProjectsProposed = ref<QTableProps["columns"]>([
|
||||
const columnAssessments = ref<QTableProps["columns"]>([
|
||||
{
|
||||
name: "receivedDate",
|
||||
align: "center",
|
||||
name: "date",
|
||||
align: "left",
|
||||
label: "วันที่ได้รับ",
|
||||
sortable: true,
|
||||
field: "receivedDate",
|
||||
field: "date",
|
||||
headerStyle: "font-size: 14px",
|
||||
style: "font-size: 14px",
|
||||
format: (v) => date2Thai(v),
|
||||
},
|
||||
{
|
||||
name: "authority",
|
||||
name: "point1Total",
|
||||
align: "left",
|
||||
label: "ผู้มีอำนาจลงนาม",
|
||||
label: "ส่วนที่1 (น้ำหนัก)",
|
||||
sortable: true,
|
||||
field: "authority",
|
||||
field: "point1Total",
|
||||
headerStyle: "font-size: 14px",
|
||||
style: "font-size: 14px",
|
||||
sort: (a: string, b: string) =>
|
||||
a.localeCompare(b, undefined, { numeric: true, sensitivity: "base" }),
|
||||
},
|
||||
{
|
||||
name: "datail",
|
||||
name: "point1",
|
||||
align: "left",
|
||||
label: "รายละเอียด",
|
||||
label: "ผลประเมินส่วนที่1 (คะแนน)",
|
||||
sortable: true,
|
||||
field: "detail",
|
||||
field: "point1",
|
||||
headerStyle: "font-size: 14px",
|
||||
style: "font-size: 14px",
|
||||
sort: (a: string, b: string) =>
|
||||
a.localeCompare(b, undefined, { numeric: true, sensitivity: "base" }),
|
||||
},
|
||||
{
|
||||
name: "orderNumber",
|
||||
name: "point2Total",
|
||||
align: "left",
|
||||
label: "เลขที่คำสั่ง",
|
||||
label: "ส่วนที่2 (น้ำหนัก)",
|
||||
sortable: true,
|
||||
field: "orderNumber",
|
||||
field: "point2Total",
|
||||
headerStyle: "font-size: 14px",
|
||||
style: "font-size: 14px",
|
||||
sort: (a: string, b: string) =>
|
||||
a.localeCompare(b, undefined, { numeric: true, sensitivity: "base" }),
|
||||
},
|
||||
{
|
||||
name: "doc",
|
||||
name: "point2",
|
||||
align: "left",
|
||||
label: "เอกสารอ้างอิง",
|
||||
label: "ผลประเมินส่วนที่2 (คะแนน)",
|
||||
sortable: true,
|
||||
field: "doc",
|
||||
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 {
|
||||
tabMenu,
|
||||
step,
|
||||
|
|
@ -294,7 +364,7 @@ export const useEvaluateDetailStore = defineStore("evaluateDetailStore", () => {
|
|||
columnsCertificates,
|
||||
columnSalaries,
|
||||
columnTraining,
|
||||
columnProjectsProposed,
|
||||
columnAssessments,
|
||||
pdfSrcStore,
|
||||
urlDownloadFile,
|
||||
numOfPagesStore,
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue