Commit 57da5b5f by Nattana Chaiyamat

ประเมินผล

parent c8b731f0
# See http://help.github.com/ignore-files/ for more about ignoring files.
# Compiled output
/dist
# /dist
*.zip
/tmp
/out-tsc
......@@ -42,3 +42,4 @@ testem.log
# System files
.DS_Store
Thumbs.db
dist/
......@@ -8,16 +8,13 @@
[attr.aria-controls]="'hs-tab-js-vertical-'+i">
<div class="w-full flex items-center " style="justify-content :space-between;">
{{appraisalCompentency.comType}}
<svg class="flex-shrink-0 h-6 w-6 text-white" width="16" height="16" viewBox="0 0 16 16" fill="none"
xmlns="http://www.w3.org/2000/svg">
<path
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"
fill="currentColor" [class.fill-mute]="!onFormCompleted(i)" [class.fill-success]="onFormCompleted(i)">
</path>
<path
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 class="d-flex align-items-center justify-content-center rounded-circle text-white"
[class.bg-danger]="formRemain(i)" [class.bg-success]="!formRemain(i)">
<ng-container *ngIf="formRemain(i)">
{{formRemain(i)}}
</ng-container>
<i *ngIf="!formRemain(i)" class="ti ti-check"></i>
</span>
</div>
</button>
</nav>
......@@ -62,23 +59,20 @@
<div class="pb-2rem px-2rem">
<div *ngIf="appraisalCompentencyFilter().length">
<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
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">
<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"
[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"
fill="none" xmlns="http://www.w3.org/2000/svg">
<path
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"
fill="currentColor" [class.fill-mute]="!onInFormCompleted(item2)"
[class.fill-success]="onInFormCompleted(item2)"></path>
<path
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 class="d-flex align-items-center justify-content-center rounded-circle text-white"
[class.bg-danger]="inFormRemain(item2)" [class.bg-success]="!inFormRemain(item2)">
<ng-container *ngIf="inFormRemain(item2)">
{{inFormRemain(item2)}}
</ng-container>
<i *ngIf="!inFormRemain(item2)" class="ti ti-check"></i>
</span>
<span>
{{item2.groupAssessment1.competencyIndicatorsCourses1Mini.competencyIndicatorsCourses0.competencyTopic.competencyTopicId}}
:
......@@ -98,7 +92,7 @@
</svg>
</button>
<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">
<div class="box-body">
<div class="space-y-4">
......@@ -126,7 +120,6 @@
</div>
</div>
</div>
</div>
</div>
</div>
......@@ -249,7 +242,7 @@
</table>
</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="col-span-1">ผู้รับการประเมิน</div>
<div class="col-span-1">
......@@ -404,7 +397,7 @@
อนุมัติ
</ng-container>
</button>
</div>
</div> -->
</ng-container>
</div>
</div>
......
......@@ -19,12 +19,13 @@ export class PmsCompetencyComponent {
@Input() appraisalCompentencyList: Competency[] = []
appraisalCompentencyIndex = 0
@Output() sendReturnPath: EventEmitter<any> = new EventEmitter<any>();
@Output() allFormCompleted: EventEmitter<any> = new EventEmitter<any>();
canEdit = false
canSave = false
@Output() compentencyFormRemain: EventEmitter<any> = new EventEmitter<any>();
@Output() compentencyForm: EventEmitter<any> = new EventEmitter<any>();
@Input() canEdit = false
@Input() currentStep = ""
@Input() dateIso = ""
hoveredCode: string | null = null;
hoveredCode2: string | null = null;
currentDate = new Date()
setting: { loading: boolean, data: SettingAssessmentModel } = { loading: false, data: new MySettingAssessmentModel() }
......@@ -85,48 +86,32 @@ export class PmsCompetencyComponent {
this.appraisalCompentencyIndex = index
this.currentTap = this.appraisalCompentencyList[this.appraisalCompentencyIndex].comType
this.cdr.detectChanges()
if (this.appraisalCompentencyList[this.appraisalCompentencyIndex]?.masfromEvaluationAssessment1lList[0]) {
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'
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'
switch (this.appraisalCompentencyList[this.appraisalCompentencyIndex]?.currentStep) {
case ("0"): {
if (this.canSave) {
this.appraisalCompentencyList[this.appraisalCompentencyIndex].masfromEvaluationAssessment1lList[0].apsassessyDate = this.currentDate.toISOString().split('T')[0];
}
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 }
switch (this.currentStep) {
case ("0"): {
this.appraisalCompentencyList[this.appraisalCompentencyIndex].masfromEvaluationAssessment1lList[0].apsassessyDate = this.dateIso
break
}
case ("1"): {
this.appraisalCompentencyList[this.appraisalCompentencyIndex].masfromEvaluationAssessment1lList[0].apsapprove1Date = this.dateIso
break
}
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.cdr.detectChanges()
......@@ -423,23 +408,25 @@ export class PmsCompetencyComponent {
// })
}
onInFormCompleted(data: MasfromEvaluationAssessment2List) {
return data.groupAssessment1.competencyIndicatorsCourses1Mini.behavioralIndicatorsList.every(x => x.competencyBehavioral.scoreTopicExpectation != 0)
inFormRemain(data: MasfromEvaluationAssessment2List) {
const remain = data.groupAssessment1.competencyIndicatorsCourses1Mini.behavioralIndicatorsList.filter(x => x.competencyBehavioral.scoreTopicExpectation == 0).length
return remain
}
onFormCompleted(index: number) {
const formCompleted = this.appraisalCompentencyList[index]?.masfromEvaluationAssessment1lList[0].masfromEvaluationAssessment2List.every(data =>
data.groupAssessment1.competencyIndicatorsCourses1Mini.behavioralIndicatorsList.every(x => x.competencyBehavioral.scoreTopicExpectation != 0)
)
this.onAllFormCompleted()
return formCompleted
formRemain(index: number) {
const remain = this.appraisalCompentencyList[index]?.masfromEvaluationAssessment1lList[0].masfromEvaluationAssessment2List.map(data =>
this.inFormRemain(data)
).filter(data => data != 0).length
this.allFormRemain()
return remain
}
onAllFormCompleted() {
const formCompleted = this.appraisalCompentencyList.every(data => {
data.masfromEvaluationAssessment1lList[0].masfromEvaluationAssessment2List.every(data =>
data.groupAssessment1.competencyIndicatorsCourses1Mini.behavioralIndicatorsList.every(x => x.competencyBehavioral.scoreTopicExpectation != 0)
)
})
this.allFormCompleted.emit(formCompleted)
allFormRemain() {
const remain = this.appraisalCompentencyList.map((_, i) =>
this.appraisalCompentencyList[i]?.masfromEvaluationAssessment1lList[0].masfromEvaluationAssessment2List.map(data =>
this.inFormRemain(data)
).filter(data => data != 0).length
).filter(data => data != 0).length
this.compentencyForm.emit(this.appraisalCompentencyList)
this.compentencyFormRemain.emit(remain)
}
scrollToTable(event: MouseEvent) {
......
......@@ -108,10 +108,7 @@
<div class="flex justify-center">
<button type="button" class="ti-btn rounded-sm "
*ngFor="let type of item.typeList"
[class.ti-btn-soft-mute]="type.statusType == 'Not_evaluating_yet'"
[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'"
[class]="statusButtonClass(item.statusPms.statusType)"
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">
{{type.shortName}}
......@@ -121,10 +118,7 @@
<td class="text-center">
<div class="flex justify-center">
<button type="button" class="ti-btn rounded-sm"
[class.ti-btn-soft-mute]="item.statusIdp.statusType == 'Not_evaluating_yet'"
[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'"
[class]="statusButtonClass(item.statusPms.statusType)"
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'">
IDP
......@@ -133,11 +127,8 @@
</td>
<td class="text-center" *ngIf="subordinate.select?.showPms">
<div class="flex justify-center" *ngIf="item.statusPms">
<button type="button" class="ti-btn rounded-sm ti-btn-soft-mute"
[class.ti-btn-soft-mute]="item.statusPms.statusType == 'Not_evaluating_yet'"
[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'"
<button type="button" class="ti-btn rounded-sm"
[class]="statusButtonClass(item.statusPms.statusType)"
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'">
PMS
......
......@@ -23,7 +23,21 @@ export class SupervisorEvaluationComponent {
allCompetencyTypeId: <TypeList[]>[],
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,
private cdr: ChangeDetectorRef) {
}
......
......@@ -3,9 +3,34 @@ export interface CompetencyModel {
idp: Idp
pms: Pms
statusAll: StatusAll
evaluationRoundId: string,
tdesc: string,
edesc: string,
evaluationRoundId: string
tdesc: 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 {
......
......@@ -19,6 +19,9 @@ export class AppraisalService {
getCompentencyAll(apsassessy: string, bossId?: string): Observable<CompetencyModel[]> {
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> {
return this.http.get<AppraisalCompentencyModel2>(this.urlApi + "/competency/" + evaluationRoundId + "/" + apsassessy + "/" + typeId)
}
......
......@@ -25046,5 +25046,23 @@ div:where(.swal2-container) div:where(.swal2-validation-message) {
white-space: nowrap;
overflow: hidden;
text-overflow: ellipsis;
max-width: 100%
}
\ No newline at end of file
max-width: 100%;
}
.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