Commit 57da5b5f by Nattana Chaiyamat

ประเมินผล

parent c8b731f0
# See http://help.github.com/ignore-files/ for more about ignoring files. # See http://help.github.com/ignore-files/ for more about ignoring files.
# Compiled output # Compiled output
/dist # /dist
*.zip *.zip
/tmp /tmp
/out-tsc /out-tsc
...@@ -42,3 +42,4 @@ testem.log ...@@ -42,3 +42,4 @@ testem.log
# System files # System files
.DS_Store .DS_Store
Thumbs.db Thumbs.db
dist/
...@@ -8,16 +8,13 @@ ...@@ -8,16 +8,13 @@
[attr.aria-controls]="'hs-tab-js-vertical-'+i"> [attr.aria-controls]="'hs-tab-js-vertical-'+i">
<div class="w-full flex items-center " style="justify-content :space-between;"> <div class="w-full flex items-center " style="justify-content :space-between;">
{{appraisalCompentency.comType}} {{appraisalCompentency.comType}}
<svg class="flex-shrink-0 h-6 w-6 text-white" width="16" height="16" viewBox="0 0 16 16" fill="none" <span class="d-flex align-items-center justify-content-center rounded-circle text-white"
xmlns="http://www.w3.org/2000/svg"> [class.bg-danger]="formRemain(i)" [class.bg-success]="!formRemain(i)">
<path <ng-container *ngIf="formRemain(i)">
d="M15.1965 7.85999C15.1965 3.71785 11.8387 0.359985 7.69653 0.359985C3.5544 0.359985 0.196533 3.71785 0.196533 7.85999C0.196533 12.0021 3.5544 15.36 7.69653 15.36C11.8387 15.36 15.1965 12.0021 15.1965 7.85999Z" {{formRemain(i)}}
fill="currentColor" [class.fill-mute]="!onFormCompleted(i)" [class.fill-success]="onFormCompleted(i)"> </ng-container>
</path> <i *ngIf="!formRemain(i)" class="ti ti-check"></i>
<path </span>
d="M10.9295 4.88618C11.1083 4.67577 11.4238 4.65019 11.6343 4.82904C11.8446 5.00788 11.8702 5.32343 11.6914 5.53383L7.44139 10.5338C7.25974 10.7475 6.93787 10.77 6.72825 10.5837L4.47825 8.5837C4.27186 8.40024 4.25327 8.0842 4.43673 7.87781C4.62019 7.67142 4.93622 7.65283 5.14261 7.83629L7.01053 9.49669L10.9295 4.88618Z"
fill="currentColor"></path>
</svg>
</div> </div>
</button> </button>
</nav> </nav>
...@@ -62,23 +59,20 @@ ...@@ -62,23 +59,20 @@
<div class="pb-2rem px-2rem"> <div class="pb-2rem px-2rem">
<div *ngIf="appraisalCompentencyFilter().length"> <div *ngIf="appraisalCompentencyFilter().length">
<div class="hs-accordion-group w-full" data-hs-accordion-always-open> <div class="hs-accordion-group w-full" data-hs-accordion-always-open>
<ng-container *ngFor="let item2 of appraisalCompentencyFilter();let i = index"> <ng-container *ngFor="let item2 of appraisalCompentencyFilter();let i = index;let f= first">
<div <div
class="hs-accordion active overflow-hidden bg-white border -mt-px first:rounded-t-sm last:rounded-b-sm dark:bg-bgdark dark:border-white/10" class="hs-accordion overflow-hidden bg-white border -mt-px first:rounded-t-sm last:rounded-b-sm dark:bg-bgdark dark:border-white/10"
[id]="'hs-primary-heading-'+i"> [id]="'hs-primary-heading-'+i">
<button (click)="scrollToTable($event)" <button (click)="scrollToTable($event)"
class="hs-accordion-toggle hs-accordion-active:text-white hs-accordion-active:bg-secondary group py-4 px-5 inline-flex items-center justify-between gap-x-3 w-full font-semibold text-start text-gray-800 transition hover:text-gray-500 dark:hs-accordion-active:text-white dark:text-gray-200 dark:hover:text-white/80" class="hs-accordion-toggle hs-accordion-active:text-white hs-accordion-active:bg-secondary group py-4 px-5 inline-flex items-center justify-between gap-x-3 w-full font-semibold text-start text-gray-800 transition hover:text-gray-500 dark:hs-accordion-active:text-white dark:text-gray-200 dark:hover:text-white/80"
[attr.aria-controls]="'hs-primary-collapse-'+i" type="button"> [attr.aria-controls]="'hs-primary-collapse-'+i" type="button">
<svg class="flex-shrink-0 h-6 w-6 text-white" width="16" height="16" viewBox="0 0 16 16" <span class="d-flex align-items-center justify-content-center rounded-circle text-white"
fill="none" xmlns="http://www.w3.org/2000/svg"> [class.bg-danger]="inFormRemain(item2)" [class.bg-success]="!inFormRemain(item2)">
<path <ng-container *ngIf="inFormRemain(item2)">
d="M15.1965 7.85999C15.1965 3.71785 11.8387 0.359985 7.69653 0.359985C3.5544 0.359985 0.196533 3.71785 0.196533 7.85999C0.196533 12.0021 3.5544 15.36 7.69653 15.36C11.8387 15.36 15.1965 12.0021 15.1965 7.85999Z" {{inFormRemain(item2)}}
fill="currentColor" [class.fill-mute]="!onInFormCompleted(item2)" </ng-container>
[class.fill-success]="onInFormCompleted(item2)"></path> <i *ngIf="!inFormRemain(item2)" class="ti ti-check"></i>
<path </span>
d="M10.9295 4.88618C11.1083 4.67577 11.4238 4.65019 11.6343 4.82904C11.8446 5.00788 11.8702 5.32343 11.6914 5.53383L7.44139 10.5338C7.25974 10.7475 6.93787 10.77 6.72825 10.5837L4.47825 8.5837C4.27186 8.40024 4.25327 8.0842 4.43673 7.87781C4.62019 7.67142 4.93622 7.65283 5.14261 7.83629L7.01053 9.49669L10.9295 4.88618Z"
fill="currentColor"></path>
</svg>
<span> <span>
{{item2.groupAssessment1.competencyIndicatorsCourses1Mini.competencyIndicatorsCourses0.competencyTopic.competencyTopicId}} {{item2.groupAssessment1.competencyIndicatorsCourses1Mini.competencyIndicatorsCourses0.competencyTopic.competencyTopicId}}
: :
...@@ -98,7 +92,7 @@ ...@@ -98,7 +92,7 @@
</svg> </svg>
</button> </button>
<div [id]="'hs-primary-collapse-'+i" <div [id]="'hs-primary-collapse-'+i"
class="hs-accordion-content !w-full overflow-hidden transition-[height] duration-300" class="hs-accordion-content hidden !w-full overflow-hidden transition-[height] duration-300"
[attr.aria-labelledby]="'hs-primary-heading-'+i"> [attr.aria-labelledby]="'hs-primary-heading-'+i">
<div class="box-body"> <div class="box-body">
<div class="space-y-4"> <div class="space-y-4">
...@@ -126,7 +120,6 @@ ...@@ -126,7 +120,6 @@
</div> </div>
</div> </div>
</div> </div>
</div> </div>
</div> </div>
</div> </div>
...@@ -249,7 +242,7 @@ ...@@ -249,7 +242,7 @@
</table> </table>
</div> </div>
</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">ผู้รับการประเมิน</div> <div class="col-span-1">ผู้รับการประเมิน</div>
<div class="col-span-1"> <div class="col-span-1">
...@@ -404,7 +397,7 @@ ...@@ -404,7 +397,7 @@
อนุมัติ อนุมัติ
</ng-container> </ng-container>
</button> </button>
</div> </div> -->
</ng-container> </ng-container>
</div> </div>
</div> </div>
......
...@@ -19,12 +19,13 @@ export class PmsCompetencyComponent { ...@@ -19,12 +19,13 @@ export class PmsCompetencyComponent {
@Input() appraisalCompentencyList: Competency[] = [] @Input() appraisalCompentencyList: Competency[] = []
appraisalCompentencyIndex = 0 appraisalCompentencyIndex = 0
@Output() sendReturnPath: EventEmitter<any> = new EventEmitter<any>(); @Output() sendReturnPath: EventEmitter<any> = new EventEmitter<any>();
@Output() allFormCompleted: EventEmitter<any> = new EventEmitter<any>(); @Output() compentencyFormRemain: EventEmitter<any> = new EventEmitter<any>();
canEdit = false @Output() compentencyForm: EventEmitter<any> = new EventEmitter<any>();
canSave = false @Input() canEdit = false
@Input() currentStep = ""
@Input() dateIso = ""
hoveredCode: string | null = null; hoveredCode: string | null = null;
hoveredCode2: string | null = null; hoveredCode2: string | null = null;
currentDate = new Date()
setting: { loading: boolean, data: SettingAssessmentModel } = { loading: false, data: new MySettingAssessmentModel() } setting: { loading: boolean, data: SettingAssessmentModel } = { loading: false, data: new MySettingAssessmentModel() }
...@@ -85,48 +86,32 @@ export class PmsCompetencyComponent { ...@@ -85,48 +86,32 @@ export class PmsCompetencyComponent {
this.appraisalCompentencyIndex = index this.appraisalCompentencyIndex = index
this.currentTap = this.appraisalCompentencyList[this.appraisalCompentencyIndex].comType this.currentTap = this.appraisalCompentencyList[this.appraisalCompentencyIndex].comType
this.cdr.detectChanges() this.cdr.detectChanges()
if (this.appraisalCompentencyList[this.appraisalCompentencyIndex]?.masfromEvaluationAssessment1lList[0]) { switch (this.currentStep) {
this.canSave = (this.appraisalCompentencyList[this.appraisalCompentencyIndex].currentStep == this.appraisalCompentencyList[this.appraisalCompentencyIndex].checkStep) && this.appraisalCompentencyList[this.appraisalCompentencyIndex].masfromStatusType.code != 'Boss_finish' && this.appraisalCompentencyList[this.appraisalCompentencyIndex].masfromStatusType.code != 'Not_evaluating_yet' case ("0"): {
this.canEdit = (this.appraisalCompentencyList[this.appraisalCompentencyIndex].currentStep == this.appraisalCompentencyList[this.appraisalCompentencyIndex].checkStep && (+(this.appraisalCompentencyList[this.appraisalCompentencyIndex].checkStep) <= 1)) && this.appraisalCompentencyList[this.appraisalCompentencyIndex].masfromStatusType.code != 'Boss_finish' && this.appraisalCompentencyList[this.appraisalCompentencyIndex].masfromStatusType.code != 'Not_evaluating_yet' this.appraisalCompentencyList[this.appraisalCompentencyIndex].masfromEvaluationAssessment1lList[0].apsassessyDate = this.dateIso
switch (this.appraisalCompentencyList[this.appraisalCompentencyIndex]?.currentStep) { break
case ("0"): { }
if (this.canSave) { case ("1"): {
this.appraisalCompentencyList[this.appraisalCompentencyIndex].masfromEvaluationAssessment1lList[0].apsassessyDate = this.currentDate.toISOString().split('T')[0]; this.appraisalCompentencyList[this.appraisalCompentencyIndex].masfromEvaluationAssessment1lList[0].apsapprove1Date = this.dateIso
} break
break
}
case ("1"): {
if (this.canSave) {
this.appraisalCompentencyList[this.appraisalCompentencyIndex].masfromEvaluationAssessment1lList[0].apsapprove1Date = this.currentDate.toISOString().split('T')[0];
}
break
}
case ("2"): {
if (this.canSave) {
this.appraisalCompentencyList[this.appraisalCompentencyIndex].masfromEvaluationAssessment1lList[0].apsapprove2Date = this.currentDate.toISOString().split('T')[0];
}
break
}
case ("3"): {
if (this.canSave) {
this.appraisalCompentencyList[this.appraisalCompentencyIndex].masfromEvaluationAssessment1lList[0].apsapprove3Date = this.currentDate.toISOString().split('T')[0];
}
break
}
case ("4"): {
if (this.canSave) {
this.appraisalCompentencyList[this.appraisalCompentencyIndex].masfromEvaluationAssessment1lList[0].apsapprove4Date = this.currentDate.toISOString().split('T')[0];
}
break
}
case ("5"): {
if (this.canSave) {
this.appraisalCompentencyList[this.appraisalCompentencyIndex].masfromEvaluationAssessment1lList[0].apsapprove5Date = this.currentDate.toISOString().split('T')[0];
}
break
}
default: { return }
} }
case ("2"): {
this.appraisalCompentencyList[this.appraisalCompentencyIndex].masfromEvaluationAssessment1lList[0].apsapprove2Date = this.dateIso
break
}
case ("3"): {
this.appraisalCompentencyList[this.appraisalCompentencyIndex].masfromEvaluationAssessment1lList[0].apsapprove3Date = this.dateIso
break
}
case ("4"): {
this.appraisalCompentencyList[this.appraisalCompentencyIndex].masfromEvaluationAssessment1lList[0].apsapprove4Date = this.dateIso
break
}
case ("5"): {
this.appraisalCompentencyList[this.appraisalCompentencyIndex].masfromEvaluationAssessment1lList[0].apsapprove5Date = this.dateIso
break
}
default: { return }
} }
this.calnumberCheck() this.calnumberCheck()
this.cdr.detectChanges() this.cdr.detectChanges()
...@@ -423,23 +408,25 @@ export class PmsCompetencyComponent { ...@@ -423,23 +408,25 @@ export class PmsCompetencyComponent {
// }) // })
} }
onInFormCompleted(data: MasfromEvaluationAssessment2List) { inFormRemain(data: MasfromEvaluationAssessment2List) {
return data.groupAssessment1.competencyIndicatorsCourses1Mini.behavioralIndicatorsList.every(x => x.competencyBehavioral.scoreTopicExpectation != 0) const remain = data.groupAssessment1.competencyIndicatorsCourses1Mini.behavioralIndicatorsList.filter(x => x.competencyBehavioral.scoreTopicExpectation == 0).length
return remain
} }
onFormCompleted(index: number) { formRemain(index: number) {
const formCompleted = this.appraisalCompentencyList[index]?.masfromEvaluationAssessment1lList[0].masfromEvaluationAssessment2List.every(data => const remain = this.appraisalCompentencyList[index]?.masfromEvaluationAssessment1lList[0].masfromEvaluationAssessment2List.map(data =>
data.groupAssessment1.competencyIndicatorsCourses1Mini.behavioralIndicatorsList.every(x => x.competencyBehavioral.scoreTopicExpectation != 0) this.inFormRemain(data)
) ).filter(data => data != 0).length
this.onAllFormCompleted() this.allFormRemain()
return formCompleted return remain
} }
onAllFormCompleted() { allFormRemain() {
const formCompleted = this.appraisalCompentencyList.every(data => { const remain = this.appraisalCompentencyList.map((_, i) =>
data.masfromEvaluationAssessment1lList[0].masfromEvaluationAssessment2List.every(data => this.appraisalCompentencyList[i]?.masfromEvaluationAssessment1lList[0].masfromEvaluationAssessment2List.map(data =>
data.groupAssessment1.competencyIndicatorsCourses1Mini.behavioralIndicatorsList.every(x => x.competencyBehavioral.scoreTopicExpectation != 0) this.inFormRemain(data)
) ).filter(data => data != 0).length
}) ).filter(data => data != 0).length
this.allFormCompleted.emit(formCompleted) this.compentencyForm.emit(this.appraisalCompentencyList)
this.compentencyFormRemain.emit(remain)
} }
scrollToTable(event: MouseEvent) { scrollToTable(event: MouseEvent) {
......
...@@ -108,10 +108,7 @@ ...@@ -108,10 +108,7 @@
<div class="flex justify-center"> <div class="flex justify-center">
<button type="button" class="ti-btn rounded-sm " <button type="button" class="ti-btn rounded-sm "
*ngFor="let type of item.typeList" *ngFor="let type of item.typeList"
[class.ti-btn-soft-mute]="type.statusType == 'Not_evaluating_yet'" [class]="statusButtonClass(item.statusPms.statusType)"
[class.ti-btn-soft-secondary]="type.statusType == 'Boss'"
[class.ti-btn-soft-warning]="type.statusType == 'BossEvaluating'"
[class.ti-btn-soft-success]="type.statusType == 'Boss_finish'"
style="height: 15px; width: 45px; font-size: 12px; display: flex; align-items: center; justify-content: center;margin-left:4px;" style="height: 15px; width: 45px; font-size: 12px; display: flex; align-items: center; justify-content: center;margin-left:4px;"
(click)="selectSubordinate(item,type.competencyTypeId,subordinate.select?.evaluationRoundId);pageEvalution=type.shortName"> (click)="selectSubordinate(item,type.competencyTypeId,subordinate.select?.evaluationRoundId);pageEvalution=type.shortName">
{{type.shortName}} {{type.shortName}}
...@@ -121,10 +118,7 @@ ...@@ -121,10 +118,7 @@
<td class="text-center"> <td class="text-center">
<div class="flex justify-center"> <div class="flex justify-center">
<button type="button" class="ti-btn rounded-sm" <button type="button" class="ti-btn rounded-sm"
[class.ti-btn-soft-mute]="item.statusIdp.statusType == 'Not_evaluating_yet'" [class]="statusButtonClass(item.statusPms.statusType)"
[class.ti-btn-soft-secondary]="item.statusIdp.statusType == 'Boss'"
[class.ti-btn-soft-warning]="item.statusIdp.statusType == 'BossEvaluating'"
[class.ti-btn-soft-success]="item.statusIdp.statusType == 'Boss_finish'"
style="height: 15px; width: 45px; font-size: 12px; display: flex; align-items: center; justify-content: center;margin-left:4px;" style="height: 15px; width: 45px; font-size: 12px; display: flex; align-items: center; justify-content: center;margin-left:4px;"
(click)="selectSubordinate(item,'',subordinate.select?.evaluationRoundId,item.statusIdp.statusType);pageEvalution='idp'"> (click)="selectSubordinate(item,'',subordinate.select?.evaluationRoundId,item.statusIdp.statusType);pageEvalution='idp'">
IDP IDP
...@@ -133,11 +127,8 @@ ...@@ -133,11 +127,8 @@
</td> </td>
<td class="text-center" *ngIf="subordinate.select?.showPms"> <td class="text-center" *ngIf="subordinate.select?.showPms">
<div class="flex justify-center" *ngIf="item.statusPms"> <div class="flex justify-center" *ngIf="item.statusPms">
<button type="button" class="ti-btn rounded-sm ti-btn-soft-mute" <button type="button" class="ti-btn rounded-sm"
[class.ti-btn-soft-mute]="item.statusPms.statusType == 'Not_evaluating_yet'" [class]="statusButtonClass(item.statusPms.statusType)"
[class.ti-btn-soft-secondary]="item.statusPms.statusType == 'Boss'"
[class.ti-btn-soft-warning]="item.statusPms.statusType == 'BossEvaluating'"
[class.ti-btn-soft-success]="item.statusPms.statusType == 'Boss_finish'"
style="height: 15px; width: 45px; font-size: 12px; display: flex; align-items: center; justify-content: center;margin-left:4px;" style="height: 15px; width: 45px; font-size: 12px; display: flex; align-items: center; justify-content: center;margin-left:4px;"
(click)="selectSubordinate(item,'',subordinate.select?.evaluationRoundId,item.statusPms.statusType);pageEvalution='pms'"> (click)="selectSubordinate(item,'',subordinate.select?.evaluationRoundId,item.statusPms.statusType);pageEvalution='pms'">
PMS PMS
......
...@@ -23,7 +23,21 @@ export class SupervisorEvaluationComponent { ...@@ -23,7 +23,21 @@ export class SupervisorEvaluationComponent {
allCompetencyTypeId: <TypeList[]>[], allCompetencyTypeId: <TypeList[]>[],
masfromStatusType: "" masfromStatusType: ""
} }
statusButtonClass = (status: string) => {
if (status === "no access") {
return "ti-btn-soft-mute"
} else if (status === "pending") {
return "ti-btn-soft-secondary"
} else if (status === "evaluating") {
return "ti-btn-soft-warning"
} else if (status === "completed") {
return "ti-btn-soft-success"
} else if (status === "rejected") {
return "ti-btn-soft-danger"
} else {
return ""
}
}
constructor(private appraisalService: AppraisalService, constructor(private appraisalService: AppraisalService,
private cdr: ChangeDetectorRef) { private cdr: ChangeDetectorRef) {
} }
......
...@@ -3,9 +3,34 @@ export interface CompetencyModel { ...@@ -3,9 +3,34 @@ export interface CompetencyModel {
idp: Idp idp: Idp
pms: Pms pms: Pms
statusAll: StatusAll statusAll: StatusAll
evaluationRoundId: string, evaluationRoundId: string
tdesc: string, tdesc: string
edesc: string, edesc: string
apsassessy: ApsEmp
apsapprove1: ApsEmp
apsapprove2: ApsEmp
apsapprove3: ApsEmp
apsapprove4: ApsEmp
apsapprove5: ApsEmp
currentStep: string
statusType: string
stepReturn: string
commentAll: CommentAll[]
}
export interface ApsEmp {
employeeId: string
status: string
thFullName: string
enFullName: string
}
export interface CommentAll {
commentDate: string
currentStep: string
statusType: string
comment: string
createdBy: string
thFullName: string
engFullName: string
} }
export interface Competency { export interface Competency {
......
...@@ -19,6 +19,9 @@ export class AppraisalService { ...@@ -19,6 +19,9 @@ export class AppraisalService {
getCompentencyAll(apsassessy: string, bossId?: string): Observable<CompetencyModel[]> { getCompentencyAll(apsassessy: string, bossId?: string): Observable<CompetencyModel[]> {
return this.http.get<CompetencyModel[]>(this.urlApi + "/competencyAll/emp?apsassessy=" + apsassessy + (bossId ? "&bossId=" + bossId : '')) return this.http.get<CompetencyModel[]>(this.urlApi + "/competencyAll/emp?apsassessy=" + apsassessy + (bossId ? "&bossId=" + bossId : ''))
} }
postCompentencyAll(body: CompetencyModel): Observable<AlertModel> {
return this.http.post<AlertModel>(this.urlApi + "/appraisalcompetencyAll/emp", body)
}
getFormCompentencyById(evaluationRoundId: string, apsassessy: string, typeId: string): Observable<AppraisalCompentencyModel2> { getFormCompentencyById(evaluationRoundId: string, apsassessy: string, typeId: string): Observable<AppraisalCompentencyModel2> {
return this.http.get<AppraisalCompentencyModel2>(this.urlApi + "/competency/" + evaluationRoundId + "/" + apsassessy + "/" + typeId) return this.http.get<AppraisalCompentencyModel2>(this.urlApi + "/competency/" + evaluationRoundId + "/" + apsassessy + "/" + typeId)
} }
......
...@@ -25046,5 +25046,23 @@ div:where(.swal2-container) div:where(.swal2-validation-message) { ...@@ -25046,5 +25046,23 @@ div:where(.swal2-container) div:where(.swal2-validation-message) {
white-space: nowrap; white-space: nowrap;
overflow: hidden; overflow: hidden;
text-overflow: ellipsis; text-overflow: ellipsis;
max-width: 100% max-width: 100%;
} }
\ No newline at end of file
.rounded-circle {
border-radius: 50%;
width: 32px;
height: 32px;
display: flex;
align-items: center;
justify-content: center;
text-align: center;
overflow: hidden;
}
.bg-mute {
background-color: #cccccc;
}
.\!bg-mute {
background-color: #cccccc !important;
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment