Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
M
myAppraisal
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Registry
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
angular
myAppraisal
Commits
667fe2ee
Commit
667fe2ee
authored
Feb 24, 2025
by
Nattana Chaiyamat
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
แบบประเมินสมรรถนะพนักงาน competency
parent
4c6d793f
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
260 additions
and
94 deletions
+260
-94
self-evaluation.component.html
...evaluation/self-evaluation/self-evaluation.component.html
+84
-33
self-evaluation.component.ts
...e-evaluation/self-evaluation/self-evaluation.component.ts
+172
-58
appraisal.service.ts
src/app/shared/services/appraisal.service.ts
+4
-3
No files found.
src/app/components/performance-evaluation/self-evaluation/self-evaluation.component.html
View file @
667fe2ee
...
@@ -344,7 +344,7 @@
...
@@ -344,7 +344,7 @@
<input
type=
"radio"
[
name
]="'
radio
'+
i
+''+
i2
"
class=
"ti-form-radio cursor-pointer"
<input
type=
"radio"
[
name
]="'
radio
'+
i
+''+
i2
"
class=
"ti-form-radio cursor-pointer"
[
id
]="'
radio
'+
i
+''+
i2
+''+
i3
"
[
value
]="
value
"
[
id
]="'
radio
'+
i
+''+
i2
+''+
i3
"
[
value
]="
value
"
[(
ngModel
)]="
bi
.
competencyBehavioral
.
scoreTopicExpectation
"
[(
ngModel
)]="
bi
.
competencyBehavioral
.
scoreTopicExpectation
"
(
ngModelChange
)="
caltargetScore
(
value
)"
>
(
ngModelChange
)="
caltargetScore
()"
>
</td>
</td>
</tr>
</tr>
</ng-container>
</ng-container>
...
@@ -355,13 +355,7 @@
...
@@ -355,13 +355,7 @@
<div
class=
"pb-1rem px-2rem"
>
<div
class=
"pb-1rem px-2rem"
>
<div
class=
"py-2 grid grid-cols-11"
>
<div
class=
"py-2 grid grid-cols-11"
>
<div
class=
"col-span-8"
></div>
<div
class=
"col-span-8"
>
ระดับความสามารถ (Target Degree)
</div>
<div
class=
"col-span-3 grid grid-cols-5"
>
<div
class=
"col-span-5 text-center"
>
ระดับความสามารถ (Target Degree)
</div>
</div>
</div>
<div
class=
"py-2 grid grid-cols-11"
>
<div
class=
"col-span-8"
></div>
<div
class=
"col-span-3 grid grid-cols-5"
>
<div
class=
"col-span-3 grid grid-cols-5"
>
<div
class=
"col-span-1 text-center"
*
ngFor=
"let item of [5,4,3,2,1]"
>
{{item}}
</div>
<div
class=
"col-span-1 text-center"
*
ngFor=
"let item of [5,4,3,2,1]"
>
{{item}}
</div>
</div>
</div>
...
@@ -395,13 +389,13 @@
...
@@ -395,13 +389,13 @@
<div
class=
"py-2 grid grid-cols-11"
>
<div
class=
"py-2 grid grid-cols-11"
>
<div
class=
"col-span-8"
>
คะแนนรวมหลังถ่วงน้ำ
</div>
<div
class=
"col-span-8"
>
คะแนนรวมหลังถ่วงน้ำ
</div>
<div
class=
"col-span-3 grid grid-cols-5"
>
<div
class=
"col-span-3 grid grid-cols-5"
>
<div
class=
"col-span-5 text-center"
>
18.80
</div>
<div
class=
"col-span-5 text-center"
>
{{appraisalCompentencyForm.data.weightedTotal}}
</div>
</div>
</div>
</div>
</div>
<div
class=
"py-2 grid grid-cols-11"
>
<div
class=
"py-2 grid grid-cols-11"
>
<div
class=
"col-span-8"
>
คะแนนเฉลี่ยคิดเป็น
</div>
<div
class=
"col-span-8"
>
คะแนนเฉลี่ยคิดเป็น
</div>
<div
class=
"col-span-3 grid grid-cols-5"
>
<div
class=
"col-span-3 grid grid-cols-5"
>
<div
class=
"col-span-5 text-center"
>
94.00
</div>
<div
class=
"col-span-5 text-center"
>
{{showNumber(appraisalCompentencyForm.data.averageScore)}}
</div>
</div>
</div>
</div>
</div>
</div>
</div>
...
@@ -412,7 +406,7 @@
...
@@ -412,7 +406,7 @@
<thead
class=
"height-50px"
>
<thead
class=
"height-50px"
>
<tr
class=
"font-size-12px"
>
<tr
class=
"font-size-12px"
>
<ng-container
<ng-container
*
ngFor=
"let item of ['เกณฑ์การให้คะแนนการประประเมิน Check Sheet E01','
ความคาดหวัง (E)','
ผลประเมิน (A)','สรุปผล Gap'];let f = first ;let l = last"
>
*
ngFor=
"let item of ['เกณฑ์การให้คะแนนการประประเมิน Check Sheet E01','ผลประเมิน (A)','สรุปผล Gap'];let f = first ;let l = last"
>
<th
scope=
"col"
[
attr
.
rowspan
]="
f
?'
1
'
:
'
2
'"
[
attr
.
colspan
]="
f
?'
2
'
:
'
1
'"
<th
scope=
"col"
[
attr
.
rowspan
]="
f
?'
1
'
:
'
2
'"
[
attr
.
colspan
]="
f
?'
2
'
:
'
1
'"
class=
"relative px-10px py-10px bg-soft-secondary text-primary !text-center"
>
class=
"relative px-10px py-10px bg-soft-secondary text-primary !text-center"
>
<span
class=
"font-size-12px font-weight-700 "
>
{{ item }}
</span>
<span
class=
"font-size-12px font-weight-700 "
>
{{ item }}
</span>
...
@@ -451,13 +445,10 @@
...
@@ -451,13 +445,10 @@
</td>
</td>
<td
class=
"!p-0"
></td>
<td
class=
"!p-0"
></td>
<td
class=
"align-start text-center"
>
<td
class=
"align-start text-center"
>
???
{{calAverage(appraisalCompentencyForm.data.averageScore)}}
</td>
</td>
<td
class=
"align-start text-center"
>
<td
class=
"align-start text-center"
>
???
{{calGap(appraisalCompentencyForm.data.averageScore)}}
</td>
<td
class=
"align-start text-center"
>
{{idp.data.score}}
</td>
</td>
</tr>
</tr>
<tr>
<tr>
...
@@ -472,11 +463,12 @@
...
@@ -472,11 +463,12 @@
</div>
</div>
<div
class=
"py-1rem px-2rem"
>
<div
class=
"py-1rem px-2rem"
>
<div
class=
"py-2 grid grid-cols-7 gap-3"
>
<div
class=
"py-2 grid grid-cols-7 gap-3"
>
<div
class=
"col-span-1"
>
ผู้
ประเมิน1
</div>
<div
class=
"col-span-1"
>
ผู้
ถูกประเมิน
</div>
<div
class=
"col-span-1"
>
{{appraisalCompentencyForm.data.apsassessy.thFullName}}
</div>
<div
class=
"col-span-1"
>
{{appraisalCompentencyForm.data.apsassessy.thFullName}}
</div>
<div
class=
"col-span-1"
>
<div
class=
"col-span-1"
>
<input
type=
"checkbox"
id=
"hs-basic-usage1"
class=
"ti-switch checked:bg-none checked:bg-green-600 checked:hover:bg-green-600 checked:focus:bg-green-600 focus:border-green-600 focus:ring-green-600 dark:checked:bg-green-600
<input
type=
"checkbox"
id=
"hs-basic-usage1"
class=
"ti-switch checked:bg-none checked:bg-green-600 checked:hover:bg-green-600 checked:focus:bg-green-600 focus:border-green-600 focus:ring-green-600 dark:checked:bg-green-600
checked:before:bg-green-200 dark:checked:before:bg-green-200"
>
checked:before:bg-green-200 dark:checked:before:bg-green-200 pointer-events-none "
[
checked
]="
appraisalCompentencyForm
.
data
.
apsassessyStatus=
='1'"
>
<label
for=
"hs-basic-usage1"
class=
"sr-only"
>
ยืนยันผล
</label>
<label
for=
"hs-basic-usage1"
class=
"sr-only"
>
ยืนยันผล
</label>
</div>
</div>
<div
class=
"col-span-2"
>
<div
class=
"col-span-2"
>
...
@@ -486,38 +478,97 @@
...
@@ -486,38 +478,97 @@
</span>
</span>
</div>
</div>
</div>
</div>
<div
class=
"py-2 grid grid-cols-7 gap-3"
>
<div
class=
"py-2 grid grid-cols-7 gap-3"
*
ngIf=
"appraisalCompentencyForm.data.apsapprove1.employeeId"
>
<div
class=
"col-span-1"
>
ผู้ประเมิน2
</div>
<div
class=
"col-span-1"
>
{{appraisalCompentencyForm.data.apsapprove2.employeeId?'ผู้ประเมิน1':'ผู้อนุมัติ'}}
</div>
<div
class=
"col-span-1"
>
{{appraisalCompentencyForm.data.apsapprove1.thFullName}}
</div>
<div
class=
"col-span-1"
>
<input
type=
"checkbox"
id=
"hs-basic-usage1"
class=
"ti-switch checked:bg-none checked:bg-green-600 checked:hover:bg-green-600 checked:focus:bg-green-600 focus:border-green-600 focus:ring-green-600 dark:checked:bg-green-600
checked:before:bg-green-200 dark:checked:before:bg-green-200 pointer-events-none"
[
checked
]="
appraisalCompentencyForm
.
data
.
apsapprove1Status=
='1'"
>
<label
for=
"hs-basic-usage1"
class=
"sr-only"
>
ยืนยันผล
</label>
</div>
<div
class=
"col-span-2"
>
<textarea
type=
"text"
rows=
"2"
class=
"ti-form-input mb-2"
placeholder=
"ใส่ Comment ที่นี่"
[(
ngModel
)]="
appraisalCompentencyForm
.
data
.
apsapprove1Comment
"
></textarea>
<span
class=
"pt-2"
>
วันที่ : {{convertDate(currentDate)}}
</span>
</div>
</div>
<div
class=
"py-2 grid grid-cols-7 gap-3"
*
ngIf=
"appraisalCompentencyForm.data.apsapprove2.employeeId"
>
<div
class=
"col-span-1"
>
{{appraisalCompentencyForm.data.apsapprove3.employeeId?'ผู้ประเมิน2':'ผู้อนุมัติ'}}
</div>
<div
class=
"col-span-1"
>
{{appraisalCompentencyForm.data.apsapprove2.thFullName}}
</div>
<div
class=
"col-span-1"
>
{{appraisalCompentencyForm.data.apsapprove2.thFullName}}
</div>
<div
class=
"col-span-1"
>
<div
class=
"col-span-1"
>
<input
type=
"checkbox"
id=
"hs-basic-usage2"
class=
"ti-switch checked:bg-none checked:bg-green-600 checked:hover:bg-green-600 checked:focus:bg-green-600 focus:border-green-600 focus:ring-green-600 dark:checked:bg-green-600
<input
type=
"checkbox"
id=
"hs-basic-usage1"
class=
"ti-switch checked:bg-none checked:bg-green-600 checked:hover:bg-green-600 checked:focus:bg-green-600 focus:border-green-600 focus:ring-green-600 dark:checked:bg-green-600
checked:before:bg-green-200 dark:checked:before:bg-green-200"
checked:before:bg-green-200 dark:checked:before:bg-green-200 pointer-events-none"
(
click
)="
appraisalCompentencyForm
.
data
.
apsapprove2Status=
='0'?appraisalCompentencyForm.data.apsapprove2Status='1':appraisalCompentencyForm.data.apsapprove2Status='0'"
[
checked
]="
appraisalCompentencyForm
.
data
.
apsapprove2Status=
='1'"
>
[
checked
]="
appraisalCompentencyForm
.
data
.
apsapprove2Status=
='1'"
>
<label
for=
"hs-basic-usage
2"
class=
"sr-only"
>
ตรวจสอบ
</label>
<label
for=
"hs-basic-usage
1"
class=
"sr-only"
>
ยืนยันผล
</label>
</div>
</div>
<div
class=
"col-span-2"
>
<div
class=
"col-span-2"
>
<textarea
type=
"text"
rows=
"2"
class=
"ti-form-input mb-2"
placeholder=
"ใส่ Comment ที่นี่"
<textarea
type=
"text"
rows=
"2"
class=
"ti-form-input mb-2"
placeholder=
"ใส่ Comment ที่นี่"
[(
ngModel
)]="
appraisalCompentencyForm
.
data
.
apsapprove2Comment
"
></textarea>
[(
ngModel
)]="
appraisalCompentencyForm
.
data
.
apsapprove2Comment
"
></textarea>
<span>
<span
class=
"pt-2"
>
วันที่ : {{convertDate(currentDate)}}
วันที่ : {{convertDate(currentDate)}}
</span>
</span>
</div>
</div>
</div>
</div>
<div
class=
"py-2 grid grid-cols-7 gap-3"
>
<div
class=
"py-2 grid grid-cols-7 gap-3"
*
ngIf=
"appraisalCompentencyForm.data.apsapprove3.employeeId"
>
<div
class=
"col-span-1"
>
ผู้อนุมัติ
</div>
<div
class=
"col-span-1"
>
{{appraisalCompentencyForm.data.apsapprove4.employeeId?'ผู้ประเมิน3':'ผู้อนุมัติ'}}
</div>
<div
class=
"col-span-1"
>
{{appraisalCompentencyForm.data.apsapprove3.thFullName}}
</div>
<div
class=
"col-span-1"
>
{{appraisalCompentencyForm.data.apsapprove3.thFullName}}
</div>
<div
class=
"col-span-1"
>
<div
class=
"col-span-1"
>
<input
type=
"checkbox"
id=
"hs-basic-usage3"
class=
"ti-switch checked:bg-none checked:bg-green-600 checked:hover:bg-green-600 checked:focus:bg-green-600 focus:border-green-600 focus:ring-green-600 dark:checked:bg-green-600
<input
type=
"checkbox"
id=
"hs-basic-usage1"
class=
"ti-switch checked:bg-none checked:bg-green-600 checked:hover:bg-green-600 checked:focus:bg-green-600 focus:border-green-600 focus:ring-green-600 dark:checked:bg-green-600
checked:before:bg-green-200 dark:checked:before:bg-green-200"
checked:before:bg-green-200 dark:checked:before:bg-green-200 pointer-events-none"
(
click
)="
appraisalCompentencyForm
.
data
.
apsapprove3Status=
='0'?appraisalCompentencyForm.data.apsapprove3Status='1':appraisalCompentencyForm.data.apsapprove3Status='0'"
[
checked
]="
appraisalCompentencyForm
.
data
.
apsapprove3Status=
='1'"
>
[
checked
]="
appraisalCompentencyForm
.
data
.
apsapprove3Status=
='1'"
>
<label
for=
"hs-basic-usage
3"
class=
"sr-only"
>
อนุมัติ
</label>
<label
for=
"hs-basic-usage
1"
class=
"sr-only"
>
ยืนยันผล
</label>
</div>
</div>
<div
class=
"col-span-2"
>
<div
class=
"col-span-2"
>
<textarea
type=
"text"
rows=
"2"
class=
"ti-form-input mb-2"
placeholder=
"ใส่ Comment ที่นี่"
<textarea
type=
"text"
rows=
"2"
class=
"ti-form-input mb-2"
placeholder=
"ใส่ Comment ที่นี่"
[(
ngModel
)]="
appraisalCompentencyForm
.
data
.
apsapprove3Comment
"
></textarea>
[(
ngModel
)]="
appraisalCompentencyForm
.
data
.
apsapprove3Comment
"
></textarea>
<span>
<span
class=
"pt-2"
>
วันที่ : {{convertDate(currentDate)}}
</span>
</div>
</div>
<div
class=
"py-2 grid grid-cols-7 gap-3"
*
ngIf=
"appraisalCompentencyForm.data.apsapprove4.employeeId"
>
<div
class=
"col-span-1"
>
{{appraisalCompentencyForm.data.apsapprove5.employeeId?'ผู้ประเมิน4':'ผู้อนุมัติ'}}
</div>
<div
class=
"col-span-1"
>
{{appraisalCompentencyForm.data.apsapprove4.thFullName}}
</div>
<div
class=
"col-span-1"
>
<input
type=
"checkbox"
id=
"hs-basic-usage1"
class=
"ti-switch checked:bg-none checked:bg-green-600 checked:hover:bg-green-600 checked:focus:bg-green-600 focus:border-green-600 focus:ring-green-600 dark:checked:bg-green-600
checked:before:bg-green-200 dark:checked:before:bg-green-200 pointer-events-none"
[
checked
]="
appraisalCompentencyForm
.
data
.
apsapprove4Status=
='1'"
>
<label
for=
"hs-basic-usage1"
class=
"sr-only"
>
ยืนยันผล
</label>
</div>
<div
class=
"col-span-2"
>
<textarea
type=
"text"
rows=
"2"
class=
"ti-form-input mb-2"
placeholder=
"ใส่ Comment ที่นี่"
[(
ngModel
)]="
appraisalCompentencyForm
.
data
.
apsapprove4Comment
"
></textarea>
<span
class=
"pt-2"
>
วันที่ : {{convertDate(currentDate)}}
</span>
</div>
</div>
<div
class=
"py-2 grid grid-cols-7 gap-3"
*
ngIf=
"appraisalCompentencyForm.data.apsapprove5.employeeId"
>
<div
class=
"col-span-1"
>
ผู้อนุมัติ
</div>
<div
class=
"col-span-1"
>
{{appraisalCompentencyForm.data.apsapprove5.thFullName}}
</div>
<div
class=
"col-span-1"
>
<input
type=
"checkbox"
id=
"hs-basic-usage1"
class=
"ti-switch checked:bg-none checked:bg-green-600 checked:hover:bg-green-600 checked:focus:bg-green-600 focus:border-green-600 focus:ring-green-600 dark:checked:bg-green-600
checked:before:bg-green-200 dark:checked:before:bg-green-200 pointer-events-none"
[
checked
]="
appraisalCompentencyForm
.
data
.
apsapprove5Status=
='1'"
>
<label
for=
"hs-basic-usage1"
class=
"sr-only"
>
ยืนยันผล
</label>
</div>
<div
class=
"col-span-2"
>
<textarea
type=
"text"
rows=
"2"
class=
"ti-form-input mb-2"
placeholder=
"ใส่ Comment ที่นี่"
[(
ngModel
)]="
appraisalCompentencyForm
.
data
.
apsapprove5Comment
"
></textarea>
<span
class=
"pt-2"
>
วันที่ : {{convertDate(currentDate)}}
วันที่ : {{convertDate(currentDate)}}
</span>
</span>
</div>
</div>
...
@@ -528,7 +579,7 @@
...
@@ -528,7 +579,7 @@
<button
type=
"submit"
class=
"ti-btn ti-btn-success mx-2rem"
(
click
)="
saveDraft
()"
>
<button
type=
"submit"
class=
"ti-btn ti-btn-success mx-2rem"
(
click
)="
saveDraft
()"
>
บันทึกร่าง
บันทึกร่าง
</button>
</button>
<button
type=
"submit"
class=
"ti-btn ti-btn-success mx-2rem"
>
<button
type=
"submit"
class=
"ti-btn ti-btn-success mx-2rem"
(
click
)="
save
()"
>
บันทึกข้อมูล
บันทึกข้อมูล
</button>
</button>
</div>
</div>
...
...
src/app/components/performance-evaluation/self-evaluation/self-evaluation.component.ts
View file @
667fe2ee
...
@@ -28,7 +28,7 @@ export class SelfEvaluationComponent implements OnInit {
...
@@ -28,7 +28,7 @@ export class SelfEvaluationComponent implements OnInit {
score
:
string
[],
score
:
string
[],
condition
:
string
[]
condition
:
string
[]
}[]
=
[{
}[]
=
[{
score
:
[
"หากได้คะแนน 90 - 100% ถือว่า Gap +1"
,
"หากได้คะแนน 80 - 89% ถือว่า ไม่มี Gap"
,
"หากได้คะแนน 60 - 79% ถือว่า Gap - 1"
,
"หากได้คะแนน 40 - 59% ถือว่า Gap -"
,
"หากได้คะแนน 0 - 39% ถือว่า Gap - 3"
],
score
:
[
"หากได้คะแนน 90 - 100% ถือว่า Gap +1"
,
"หากได้คะแนน 80 - 89% ถือว่า ไม่มี Gap"
,
"หากได้คะแนน 60 - 79% ถือว่า Gap - 1"
,
"หากได้คะแนน 40 - 59% ถือว่า Gap -
2
"
,
"หากได้คะแนน 0 - 39% ถือว่า Gap - 3"
],
condition
:
[
"1.หากได้คะแนนสูงกว่า 80% แต่มี 3 2 หรือ 1 ด้วย ถือว่า Gap -1"
,
"2.หากได้คะแนนต่ำกว่า 80% แต่มี 4 และ 5 ให้คิด Gap ตาม %"
,
"3.คะแนนต่ำกว่า 80% แต่มี 2 และ 1 ให้คิด Gap ตาม %"
],
condition
:
[
"1.หากได้คะแนนสูงกว่า 80% แต่มี 3 2 หรือ 1 ด้วย ถือว่า Gap -1"
,
"2.หากได้คะแนนต่ำกว่า 80% แต่มี 4 และ 5 ให้คิด Gap ตาม %"
,
"3.คะแนนต่ำกว่า 80% แต่มี 2 และ 1 ให้คิด Gap ตาม %"
],
}]
}]
@
ViewChild
(
'selfEvaluation1_2'
,
{
static
:
true
})
selfEvaluation1_2
!
:
TemplateRef
<
any
>
;
@
ViewChild
(
'selfEvaluation1_2'
,
{
static
:
true
})
selfEvaluation1_2
!
:
TemplateRef
<
any
>
;
...
@@ -40,13 +40,11 @@ export class SelfEvaluationComponent implements OnInit {
...
@@ -40,13 +40,11 @@ export class SelfEvaluationComponent implements OnInit {
appraisalPms
:
{
loading
:
boolean
,
select
:
AppraisalModel
,
dataList
:
{
check
:
boolean
,
data
:
AppraisalModel
}[]
}
=
{
loading
:
false
,
select
:
new
MyAppraisalModel
(),
dataList
:
[]
}
appraisalPms
:
{
loading
:
boolean
,
select
:
AppraisalModel
,
dataList
:
{
check
:
boolean
,
data
:
AppraisalModel
}[]
}
=
{
loading
:
false
,
select
:
new
MyAppraisalModel
(),
dataList
:
[]
}
employee
:
{
loading
:
boolean
,
data
:
EmployeeModel
}
=
{
loading
:
false
,
data
:
new
MyEmployeeModel
()
}
employee
:
{
loading
:
boolean
,
data
:
EmployeeModel
}
=
{
loading
:
false
,
data
:
new
MyEmployeeModel
()
}
setting
:
{
loading
:
boolean
,
data
:
SettingAssessmentModel
}
=
{
loading
:
false
,
data
:
new
MySettingAssessmentModel
()
}
setting
:
{
loading
:
boolean
,
data
:
SettingAssessmentModel
}
=
{
loading
:
false
,
data
:
new
MySettingAssessmentModel
()
}
idp
:
{
loading
:
boolean
,
data
:
IdpDevelopmentModel
}
=
{
loading
:
false
,
data
:
new
MyIdpDevelopmentModel
()
}
currentDate
=
new
Date
()
currentDate
=
new
Date
()
constructor
(
private
appraisalService
:
AppraisalService
,
constructor
(
private
appraisalService
:
AppraisalService
,
private
employeeService
:
EmployeeService
,
private
employeeService
:
EmployeeService
,
private
cdr
:
ChangeDetectorRef
,
private
cdr
:
ChangeDetectorRef
,
private
settingAssessmentService
:
SettingAssessmentService
,
private
settingAssessmentService
:
SettingAssessmentService
private
idpDevelopmentService
:
IdpDevelopmentService
)
{
)
{
}
}
ngOnInit
():
void
{
ngOnInit
():
void
{
...
@@ -54,23 +52,9 @@ export class SelfEvaluationComponent implements OnInit {
...
@@ -54,23 +52,9 @@ export class SelfEvaluationComponent implements OnInit {
this
.
getProfile
()
this
.
getProfile
()
this
.
getAppraisalCompentencyList
()
this
.
getAppraisalCompentencyList
()
this
.
getSettingList
()
this
.
getSettingList
()
this
.
getIdpData
()
}
}
getIdpData
()
{
this
.
idp
.
loading
=
true
this
.
idpDevelopmentService
.
getList
().
subscribe
({
next
:
response
=>
{
this
.
idp
.
data
=
new
MyIdpDevelopmentModel
(
response
)
this
.
idp
.
data
.
developmentPlan
.
sort
((
a
,
b
)
=>
+
a
.
planId
-
+
b
.
planId
)
this
.
idp
.
loading
=
false
this
.
cdr
.
detectChanges
()
},
error
:
error
=>
{
this
.
idp
.
loading
=
false
this
.
cdr
.
detectChanges
()
}
})
}
getSettingList
()
{
getSettingList
()
{
this
.
setting
.
loading
=
true
this
.
setting
.
loading
=
true
this
.
settingAssessmentService
.
get
().
subscribe
({
this
.
settingAssessmentService
.
get
().
subscribe
({
...
@@ -99,7 +83,7 @@ export class SelfEvaluationComponent implements OnInit {
...
@@ -99,7 +83,7 @@ export class SelfEvaluationComponent implements OnInit {
}
}
getAppraisalCompentencyList
()
{
getAppraisalCompentencyList
()
{
this
.
appraisalCompentency
.
loading
=
true
this
.
appraisalCompentency
.
loading
=
true
this
.
appraisalService
.
getList
().
subscribe
({
this
.
appraisalService
.
get
Competency
List
().
subscribe
({
next
:
response
=>
{
next
:
response
=>
{
this
.
appraisalCompentency
.
dataList
=
response
.
map
(
x
=>
({
check
:
false
,
data
:
new
MyAppraisalModel
(
x
)
}))
this
.
appraisalCompentency
.
dataList
=
response
.
map
(
x
=>
({
check
:
false
,
data
:
new
MyAppraisalModel
(
x
)
}))
this
.
appraisalCompentency
.
loading
=
false
this
.
appraisalCompentency
.
loading
=
false
...
@@ -123,10 +107,7 @@ export class SelfEvaluationComponent implements OnInit {
...
@@ -123,10 +107,7 @@ export class SelfEvaluationComponent implements OnInit {
this
.
appraisalService
.
getFormCompentencyById
(
this
.
appraisalCompentency
.
select
.
masfromEvaluationRoundModel
.
evaluationRoundId
,
this
.
employee
.
data
.
employeeId
).
subscribe
({
this
.
appraisalService
.
getFormCompentencyById
(
this
.
appraisalCompentency
.
select
.
masfromEvaluationRoundModel
.
evaluationRoundId
,
this
.
employee
.
data
.
employeeId
).
subscribe
({
next
:
response
=>
{
next
:
response
=>
{
this
.
appraisalCompentencyForm
.
data
=
new
MyAppraisalFormModel
(
response
)
this
.
appraisalCompentencyForm
.
data
=
new
MyAppraisalFormModel
(
response
)
console
.
log
(
" 🐒 this.appraisalCompentencyForm.data:"
,
this
.
appraisalCompentencyForm
.
data
.
masfromEvaluationAssessment1lList
)
this
.
caltargetScore
()
for
(
let
i
=
1
;
i
<=
5
;
i
++
)
{
this
.
caltargetScore
(
i
)
}
this
.
appraisalCompentencyForm
.
loading
=
false
this
.
appraisalCompentencyForm
.
loading
=
false
this
.
cdr
.
detectChanges
()
this
.
cdr
.
detectChanges
()
},
error
:
error
=>
{
},
error
:
error
=>
{
...
@@ -179,6 +160,10 @@ export class SelfEvaluationComponent implements OnInit {
...
@@ -179,6 +160,10 @@ export class SelfEvaluationComponent implements OnInit {
},
},
}).
then
((
result
)
=>
{
}).
then
((
result
)
=>
{
if
(
result
.
isConfirmed
)
{
if
(
result
.
isConfirmed
)
{
const
body
=
new
MyAppraisalFormModel
({
...
this
.
appraisalCompentencyForm
.
data
,
apsassessyStatus
:
'1'
})
this
.
appraisalService
.
postCompetency
(
body
).
subscribe
({
next
:
response
=>
{
if
(
response
.
success
)
{
Swal
.
fire
({
Swal
.
fire
({
title
:
'บันทึกสำเร็จ!'
,
title
:
'บันทึกสำเร็จ!'
,
text
:
'การประเมินของคุณถูกบันทึกแล้ว'
,
text
:
'การประเมินของคุณถูกบันทึกแล้ว'
,
...
@@ -187,7 +172,7 @@ export class SelfEvaluationComponent implements OnInit {
...
@@ -187,7 +172,7 @@ export class SelfEvaluationComponent implements OnInit {
confirmButton
:
'!swal2-button-bg-green'
,
confirmButton
:
'!swal2-button-bg-green'
,
}
}
});
});
}
else
if
(
result
.
dismiss
===
Swal
.
DismissReason
.
cancel
)
{
}
else
{
Swal
.
fire
({
Swal
.
fire
({
title
:
'ยกเลิก!'
,
title
:
'ยกเลิก!'
,
text
:
'การบันทึกถูกยกเลิก'
,
text
:
'การบันทึกถูกยกเลิก'
,
...
@@ -197,49 +182,123 @@ export class SelfEvaluationComponent implements OnInit {
...
@@ -197,49 +182,123 @@ export class SelfEvaluationComponent implements OnInit {
}
}
});
});
}
}
},
error
:
error
=>
{
Swal
.
fire
({
title
:
'ยกเลิก!'
,
text
:
'การบันทึกถูกยกเลิก'
,
icon
:
'error'
,
customClass
:
{
confirmButton
:
'!swal2-button-bg-danger'
,
}
});
});
}
}
})
convertDate
(
dateInput
:
string
|
Date
):
string
{
}
else
if
(
result
.
dismiss
===
Swal
.
DismissReason
.
cancel
)
{
const
date
=
typeof
dateInput
===
'string'
?
new
Date
(
dateInput
)
:
dateInput
;
Swal
.
fire
({
return
date
.
toLocaleDateString
(
'th-TH'
,
{
day
:
'numeric'
,
month
:
'long'
,
year
:
'numeric'
});
title
:
'ยกเลิก!'
,
text
:
'การบันทึกถูกยกเลิก'
,
icon
:
'error'
,
customClass
:
{
confirmButton
:
'!swal2-button-bg-danger'
,
}
}
});
caltargetScore
(
targetScore
:
number
)
{
console
.
log
(
" 🐒 targetScore:"
,
this
.
appraisalCompentencyForm
.
data
.
masfromEvaluationAssessment1lList
.
filter
(
x
=>
x
.
groupAssessment1
.
competencyIndicatorsCourses1Mini
.
behavioralIndicatorsList
.
filter
(
y
=>
y
.
competencyBehavioral
.
scoreTopicExpectation
==
1
)))
switch
(
targetScore
)
{
case
(
1
):
{
this
.
appraisalCompentencyForm
.
data
.
targetScore1
=
this
.
appraisalCompentencyForm
.
data
.
masfromEvaluationAssessment1lList
.
filter
(
x
=>
x
.
groupAssessment1
.
competencyIndicatorsCourses1Mini
.
behavioralIndicatorsList
.
filter
(
y
=>
y
.
competencyBehavioral
.
scoreTopicExpectation
==
1
).
length
).
length
console
.
log
(
" 🐒 1:"
,
this
.
appraisalCompentencyForm
.
data
.
targetScore1
)
this
.
cdr
.
detectChanges
()
break
;
}
}
case
(
2
):
{
});
this
.
appraisalCompentencyForm
.
data
.
targetScore2
=
this
.
appraisalCompentencyForm
.
data
.
masfromEvaluationAssessment1lList
.
filter
(
x
=>
x
.
groupAssessment1
.
competencyIndicatorsCourses1Mini
.
behavioralIndicatorsList
.
filter
(
y
=>
y
.
competencyBehavioral
.
scoreTopicExpectation
==
2
).
length
).
length
*
2
console
.
log
(
" 🐒 2:"
,
this
.
appraisalCompentencyForm
.
data
.
targetScore2
)
this
.
cdr
.
detectChanges
()
break
;
}
}
case
(
3
):
{
save
()
{
this
.
appraisalCompentencyForm
.
data
.
targetScore3
=
this
.
appraisalCompentencyForm
.
data
.
masfromEvaluationAssessment1lList
.
filter
(
x
=>
x
.
groupAssessment1
.
competencyIndicatorsCourses1Mini
.
behavioralIndicatorsList
.
filter
(
y
=>
y
.
competencyBehavioral
.
scoreTopicExpectation
==
3
).
length
).
length
*
3
Swal
.
fire
({
console
.
log
(
" 🐒 3:"
,
this
.
appraisalCompentencyForm
.
data
.
targetScore3
)
iconHtml
:
`
this
.
cdr
.
detectChanges
()
<div class="flex items-center justify-center rounded-full !h-80px !w-80px" style="background-color: #E8F8EE;">
break
;
<svg width="39" height="39" viewBox="0 0 39 39" fill="none" xmlns="http://www.w3.org/2000/svg">
<rect width="39" height="39" fill="#D2D2D2"/>
<g id="Component">
<g id="alert cart">
<g id="mdi:file-export">
<circle cx="22.5" cy="19.5" r="33.5" fill="#E8F8EE"/>
<path d="M9.75 3.25C8.88805 3.25 8.0614 3.59241 7.4519 4.2019C6.84241 4.8114 6.5 5.63805 6.5 6.5V32.5C6.5 33.362 6.84241 34.1886 7.4519 34.7981C8.0614 35.4076 8.88805 35.75 9.75 35.75H29.25C30.112 35.75 30.9386 35.4076 31.5481 34.7981C32.1576 34.1886 32.5 33.362 32.5 32.5V13L22.75 3.25M21.125 5.6875L30.0625 14.625H21.125M14.5113 19.8575H26V31.3463L22.555 27.9013L17.9563 32.5L13.3575 27.9013L17.9563 23.3188"
fill="#1DBE5A"/>
</g>
</g>
</g>
</svg>
</div>
`
,
title
:
'บันทึกแบบร่าง'
,
text
:
'คุณต้องการบันทึกแบบร่างของการประเมินนี้ใช่หรือไม่'
,
showCancelButton
:
true
,
confirmButtonText
:
'ยืนยันการบันทึก'
,
cancelButtonText
:
'ย้อนกลับ'
,
customClass
:
{
title
:
'!swal2-title-mt-20px'
,
actions
:
'!swal2-actions-mt-20px'
,
icon
:
'!swal2-icon-no-border'
,
confirmButton
:
'!swal2-button-bg-green'
,
cancelButton
:
'!swal2-button-bg-gray'
,
},
}).
then
((
result
)
=>
{
if
(
result
.
isConfirmed
)
{
const
body
=
new
MyAppraisalFormModel
({
...
this
.
appraisalCompentencyForm
.
data
,
apsassessyStatus
:
'2'
})
this
.
appraisalService
.
postCompetency
(
body
).
subscribe
({
next
:
response
=>
{
if
(
response
.
success
)
{
Swal
.
fire
({
title
:
'บันทึกสำเร็จ!'
,
text
:
'การประเมินของคุณถูกบันทึกแล้ว'
,
icon
:
'success'
,
customClass
:
{
confirmButton
:
'!swal2-button-bg-green'
,
}
}
case
(
4
):
{
});
this
.
appraisalCompentencyForm
.
data
.
targetScore4
=
this
.
appraisalCompentencyForm
.
data
.
masfromEvaluationAssessment1lList
.
filter
(
x
=>
x
.
groupAssessment1
.
competencyIndicatorsCourses1Mini
.
behavioralIndicatorsList
.
filter
(
y
=>
y
.
competencyBehavioral
.
scoreTopicExpectation
==
4
).
length
).
length
*
4
}
else
{
console
.
log
(
" 🐒 4:"
,
this
.
appraisalCompentencyForm
.
data
.
targetScore4
)
Swal
.
fire
({
this
.
cdr
.
detectChanges
()
title
:
'ยกเลิก!'
,
break
;
text
:
'การบันทึกถูกยกเลิก'
,
icon
:
'error'
,
customClass
:
{
confirmButton
:
'!swal2-button-bg-danger'
,
}
}
case
(
5
):
{
});
this
.
appraisalCompentencyForm
.
data
.
targetScore5
=
this
.
appraisalCompentencyForm
.
data
.
masfromEvaluationAssessment1lList
.
filter
(
x
=>
x
.
groupAssessment1
.
competencyIndicatorsCourses1Mini
.
behavioralIndicatorsList
.
filter
(
y
=>
y
.
competencyBehavioral
.
scoreTopicExpectation
==
5
).
length
).
length
*
5
console
.
log
(
" 🐒 5:"
,
this
.
appraisalCompentencyForm
.
data
.
targetScore5
)
this
.
cdr
.
detectChanges
()
break
;
}
}
default
:
{
return
}
},
error
:
error
=>
{
Swal
.
fire
({
title
:
'ยกเลิก!'
,
text
:
'การบันทึกถูกยกเลิก'
,
icon
:
'error'
,
customClass
:
{
confirmButton
:
'!swal2-button-bg-danger'
,
}
});
}
}
})
}
else
if
(
result
.
dismiss
===
Swal
.
DismissReason
.
cancel
)
{
Swal
.
fire
({
title
:
'ยกเลิก!'
,
text
:
'การบันทึกถูกยกเลิก'
,
icon
:
'error'
,
customClass
:
{
confirmButton
:
'!swal2-button-bg-danger'
,
}
});
}
});
}
convertDate
(
dateInput
:
string
|
Date
):
string
{
const
date
=
typeof
dateInput
===
'string'
?
new
Date
(
dateInput
)
:
dateInput
;
return
date
.
toLocaleDateString
(
'th-TH'
,
{
day
:
'numeric'
,
month
:
'long'
,
year
:
'numeric'
});
}
caltargetScore
()
{
this
.
appraisalCompentencyForm
.
data
.
targetScore1
=
this
.
appraisalCompentencyForm
.
data
.
masfromEvaluationAssessment1lList
.
map
(
x
=>
x
.
groupAssessment1
.
competencyIndicatorsCourses1Mini
.
behavioralIndicatorsList
.
filter
(
y
=>
y
.
competencyBehavioral
.
scoreTopicExpectation
==
1
).
length
).
reduce
((
acc
,
num
)
=>
acc
+
num
,
0
)
this
.
appraisalCompentencyForm
.
data
.
targetScore2
=
this
.
appraisalCompentencyForm
.
data
.
masfromEvaluationAssessment1lList
.
map
(
x
=>
x
.
groupAssessment1
.
competencyIndicatorsCourses1Mini
.
behavioralIndicatorsList
.
filter
(
y
=>
y
.
competencyBehavioral
.
scoreTopicExpectation
==
2
).
length
).
reduce
((
acc
,
num
)
=>
acc
+
num
,
0
)
this
.
appraisalCompentencyForm
.
data
.
targetScore3
=
this
.
appraisalCompentencyForm
.
data
.
masfromEvaluationAssessment1lList
.
map
(
x
=>
x
.
groupAssessment1
.
competencyIndicatorsCourses1Mini
.
behavioralIndicatorsList
.
filter
(
y
=>
y
.
competencyBehavioral
.
scoreTopicExpectation
==
3
).
length
).
reduce
((
acc
,
num
)
=>
acc
+
num
,
0
)
this
.
appraisalCompentencyForm
.
data
.
targetScore4
=
this
.
appraisalCompentencyForm
.
data
.
masfromEvaluationAssessment1lList
.
map
(
x
=>
x
.
groupAssessment1
.
competencyIndicatorsCourses1Mini
.
behavioralIndicatorsList
.
filter
(
y
=>
y
.
competencyBehavioral
.
scoreTopicExpectation
==
4
).
length
).
reduce
((
acc
,
num
)
=>
acc
+
num
,
0
)
this
.
appraisalCompentencyForm
.
data
.
targetScore5
=
this
.
appraisalCompentencyForm
.
data
.
masfromEvaluationAssessment1lList
.
map
(
x
=>
x
.
groupAssessment1
.
competencyIndicatorsCourses1Mini
.
behavioralIndicatorsList
.
filter
(
y
=>
y
.
competencyBehavioral
.
scoreTopicExpectation
==
5
).
length
).
reduce
((
acc
,
num
)
=>
acc
+
num
,
0
)
this
.
calWeightTotal
()
this
.
cdr
.
detectChanges
()
}
}
calWeightScore
(
targetScore
:
number
)
{
calWeightScore
(
targetScore
:
number
)
{
switch
(
targetScore
)
{
switch
(
targetScore
)
{
...
@@ -261,4 +320,58 @@ export class SelfEvaluationComponent implements OnInit {
...
@@ -261,4 +320,58 @@ export class SelfEvaluationComponent implements OnInit {
default
:
{
return
}
default
:
{
return
}
}
}
}
}
calWeightTotal
()
{
this
.
appraisalCompentencyForm
.
data
.
weightedTotal
=
0
this
.
appraisalCompentencyForm
.
data
.
weightedTotal
=
(
this
.
calWeightScore
(
1
)
??
0
)
+
(
this
.
calWeightScore
(
2
)
??
0
)
+
(
this
.
calWeightScore
(
3
)
??
0
)
+
(
this
.
calWeightScore
(
4
)
??
0
)
+
(
this
.
calWeightScore
(
5
)
??
0
)
this
.
cdr
.
detectChanges
()
this
.
calAverageScore
()
}
calAverageScore
()
{
const
total
=
this
.
appraisalCompentencyForm
.
data
.
masfromEvaluationAssessment1lList
.
map
(
x
=>
x
.
groupAssessment1
.
competencyIndicatorsCourses1Mini
.
behavioralIndicatorsList
.
length
).
reduce
((
acc
,
num
)
=>
acc
+
num
,
0
)
*
5
if
(
total
)
{
this
.
appraisalCompentencyForm
.
data
.
averageScore
=
0
this
.
appraisalCompentencyForm
.
data
.
averageScore
=
(
this
.
appraisalCompentencyForm
.
data
.
weightedTotal
/
total
)
*
100
this
.
cdr
.
detectChanges
()
}
}
showNumber
(
text
:
number
|
string
)
{
const
num
=
Number
(
text
);
return
isNaN
(
num
)
?
0
:
+
num
.
toFixed
(
2
);
}
calGap
(
score
:
number
|
string
)
{
const
roundedScore
=
this
.
showNumber
(
score
)
%
1
<=
0.5
?
Math
.
floor
(
this
.
showNumber
(
score
))
:
Math
.
round
(
this
.
showNumber
(
score
));
if
(
roundedScore
>=
90
&&
roundedScore
<=
100
)
{
if
(
this
.
appraisalCompentencyForm
.
data
.
targetScore1
||
this
.
appraisalCompentencyForm
.
data
.
targetScore2
||
this
.
appraisalCompentencyForm
.
data
.
targetScore3
)
{
return
"-1"
;
}
return
"+1"
;
}
else
if
(
roundedScore
>=
80
&&
roundedScore
<=
89
)
{
if
(
this
.
appraisalCompentencyForm
.
data
.
targetScore1
||
this
.
appraisalCompentencyForm
.
data
.
targetScore2
||
this
.
appraisalCompentencyForm
.
data
.
targetScore3
)
{
return
"-1"
;
}
return
"0"
;
}
else
if
(
roundedScore
>=
60
&&
roundedScore
<=
79
)
{
return
"-1"
;
}
else
if
(
roundedScore
>=
40
&&
roundedScore
<=
59
)
{
return
"-2"
;
}
else
{
return
"-3"
;
}
}
calAverage
(
score
:
number
|
string
)
{
const
roundedScore
=
this
.
showNumber
(
score
)
%
1
<=
0.5
?
Math
.
floor
(
this
.
showNumber
(
score
))
:
Math
.
round
(
this
.
showNumber
(
score
));
if
(
roundedScore
>=
90
&&
roundedScore
<=
100
)
{
return
"5"
;
}
else
if
(
roundedScore
>=
80
&&
roundedScore
<=
89
)
{
return
"4"
;
}
else
if
(
roundedScore
>=
60
&&
roundedScore
<=
79
)
{
return
"3"
;
}
else
if
(
roundedScore
>=
40
&&
roundedScore
<=
59
)
{
return
"2"
;
}
else
{
return
"1"
;
}
}
}
}
\ No newline at end of file
src/app/shared/services/appraisal.service.ts
View file @
667fe2ee
...
@@ -17,10 +17,10 @@ export class AppraisalService {
...
@@ -17,10 +17,10 @@ export class AppraisalService {
getFormCompentencyById
(
evaluationRoundId
:
string
,
apsassessy
:
string
):
Observable
<
AppraisalFormModel
>
{
getFormCompentencyById
(
evaluationRoundId
:
string
,
apsassessy
:
string
):
Observable
<
AppraisalFormModel
>
{
return
this
.
http
.
get
<
AppraisalFormModel
>
(
this
.
urlApi
+
"/competency/"
+
evaluationRoundId
+
"/"
+
apsassessy
)
return
this
.
http
.
get
<
AppraisalFormModel
>
(
this
.
urlApi
+
"/competency/"
+
evaluationRoundId
+
"/"
+
apsassessy
)
}
}
getList
():
Observable
<
AppraisalModel
[]
>
{
get
Competency
List
():
Observable
<
AppraisalModel
[]
>
{
return
this
.
http
.
get
<
AppraisalModel
[]
>
(
this
.
urlApi
+
"/competency/emp"
)
return
this
.
http
.
get
<
AppraisalModel
[]
>
(
this
.
urlApi
+
"/competency/emp"
)
}
}
post
(
body
:
Appraisal
Model
):
Observable
<
AlertModel
>
{
post
Competency
(
body
:
AppraisalForm
Model
):
Observable
<
AlertModel
>
{
return
this
.
http
.
post
<
AlertModel
>
(
this
.
urlApi
,
body
)
return
this
.
http
.
post
<
AlertModel
>
(
this
.
urlApi
+
"/competency"
,
body
)
}
}
}
}
\ No newline at end of file
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment