Commit aaaf6be8 by Nakarin Luankla

Merge branch 'DEV' of https://mygit.myhr.co.th/angular/myAppraisal into DEV

# Conflicts:
#	src/app/authentication/login-page/login-page.component.ts
parents 976d149a a3ed4a16
...@@ -26,8 +26,8 @@ export class LoginPageComponent { ...@@ -26,8 +26,8 @@ export class LoginPageComponent {
} }
ngOnInit(): void { ngOnInit(): void {
this.loginForm = this.formBuilder.group({ this.loginForm = this.formBuilder.group({
username: ['programmer', [Validators.required, Validators.email]], username: ['', [Validators.required, Validators.email]],
password: ['147@P', Validators.required], password: ['', Validators.required],
}); });
const authe: any = document.querySelector('.auth'); const authe: any = document.querySelector('.auth');
authe.setAttribute('class', 'h-full'); authe.setAttribute('class', 'h-full');
......
...@@ -62,7 +62,8 @@ ...@@ -62,7 +62,8 @@
<td>{{item.data.employee.lname}}</td> <td>{{item.data.employee.lname}}</td>
<td class="text-center">{{item.data.status=='0'?'ไม่ใช้งาน':'ใช้งาน'}}</td> <td class="text-center">{{item.data.status=='0'?'ไม่ใช้งาน':'ใช้งาน'}}</td>
<td class="flex justify-center"> <td class="flex justify-center">
<i class="ti ti-edit cursor-pointer i-gray fs-l px-1" (click)="selectUser(item.data)" <i class="ti ti-edit cursor-pointer i-gray fs-l px-1"
(click)="changePassword=false;selectUser(item.data)"
data-hs-overlay="#manage-user-modal"></i> data-hs-overlay="#manage-user-modal"></i>
</td> </td>
</tr> </tr>
......
...@@ -322,7 +322,7 @@ ...@@ -322,7 +322,7 @@
</div> </div>
<div class="flex justify-center mt-2rem mb-1rem space-x-4"> <div class="flex justify-center mt-2rem mb-1rem space-x-4">
<button type="submit" class="ti-btn ti-btn-secondary" <button type="submit" class="ti-btn ti-btn-secondary"
data-hs-overlay="#position-unit-component-upload-modal" [class.ti-btn-disabled]="!selectedFile" data-hs-overlay="#company-registration-page-upload-modal" [class.ti-btn-disabled]="!selectedFile"
(click)="uploadFile()" [disabled]="!selectedFile" [disabled]="!selectedFile"> (click)="uploadFile()" [disabled]="!selectedFile" [disabled]="!selectedFile">
อัปโหลด อัปโหลด
</button> </button>
......
...@@ -73,6 +73,7 @@ export class CompanyRegistrationPageComponent { ...@@ -73,6 +73,7 @@ export class CompanyRegistrationPageComponent {
addCompany() { addCompany() {
const body = new MyCompanyModel({ companyId: this.dataSelect.code, tdesc: this.dataSelect.tdesc, edesc: this.dataSelect.edesc, addressText: this.dataSelect.address, contactText: this.dataSelect.contact }) const body = new MyCompanyModel({ companyId: this.dataSelect.code, tdesc: this.dataSelect.tdesc, edesc: this.dataSelect.edesc, addressText: this.dataSelect.address, contactText: this.dataSelect.contact })
this.dataLoading = true
this.companyService.post(body).subscribe({ this.companyService.post(body).subscribe({
next: response => { next: response => {
if (response.success) { if (response.success) {
...@@ -80,9 +81,13 @@ export class CompanyRegistrationPageComponent { ...@@ -80,9 +81,13 @@ export class CompanyRegistrationPageComponent {
this.getCompanyList() this.getCompanyList()
} else { } else {
this.showAlert(response.message, 'error') this.showAlert(response.message, 'error')
this.dataLoading = false
this.cdr.detectChanges()
} }
}, error: error => { }, error: error => {
this.showAlert(error.message, 'error') this.showAlert(error.message, 'error')
this.cdr.detectChanges()
this.dataLoading = false
} }
}) })
} }
...@@ -93,6 +98,7 @@ export class CompanyRegistrationPageComponent { ...@@ -93,6 +98,7 @@ export class CompanyRegistrationPageComponent {
} else { } else {
body = this.dataList.filter(x => x.check && x.data.code != '100').map(x => new MyCompanyModel({ companyId: x.data.code, tdesc: x.data.tdesc, edesc: x.data.edesc, addressText: x.data.address, contactText: x.data.contact })) body = this.dataList.filter(x => x.check && x.data.code != '100').map(x => new MyCompanyModel({ companyId: x.data.code, tdesc: x.data.tdesc, edesc: x.data.edesc, addressText: x.data.address, contactText: x.data.contact }))
} }
this.dataLoading = true
this.companyService.delete(body).subscribe({ this.companyService.delete(body).subscribe({
next: response => { next: response => {
if (response.success) { if (response.success) {
...@@ -100,9 +106,13 @@ export class CompanyRegistrationPageComponent { ...@@ -100,9 +106,13 @@ export class CompanyRegistrationPageComponent {
this.getCompanyList() this.getCompanyList()
} else { } else {
this.showAlert(response.message, 'error') this.showAlert(response.message, 'error')
this.dataLoading = false
this.cdr.detectChanges()
} }
}, error: error => { }, error: error => {
this.showAlert(error.message, 'error') this.showAlert(error.message, 'error')
this.cdr.detectChanges()
this.dataLoading = false
} }
}) })
} }
......
...@@ -116,7 +116,7 @@ export class SubEmployeeRegistrationComponent { ...@@ -116,7 +116,7 @@ export class SubEmployeeRegistrationComponent {
}) })
} }
downloadFile() { downloadFile() {
const fileName = 'IMPORT_MPOSITION.xlsx' const fileName = '.xlsx'
this.fileService.downloadTemplate(fileName).subscribe({ this.fileService.downloadTemplate(fileName).subscribe({
next: response => { next: response => {
const url = window.URL.createObjectURL(response); const url = window.URL.createObjectURL(response);
...@@ -304,6 +304,7 @@ export class SubEmployeeRegistrationComponent { ...@@ -304,6 +304,7 @@ export class SubEmployeeRegistrationComponent {
break; break;
} }
} }
this.employee.loading = true
this.employeeService[type](body).subscribe({ this.employeeService[type](body).subscribe({
next: response => { next: response => {
if (response.success) { if (response.success) {
...@@ -311,9 +312,13 @@ export class SubEmployeeRegistrationComponent { ...@@ -311,9 +312,13 @@ export class SubEmployeeRegistrationComponent {
this.getEmployeeList() this.getEmployeeList()
} else { } else {
this.showAlert(response.message, 'error') this.showAlert(response.message, 'error')
this.employee.loading = false
this.cdr.detectChanges()
} }
}, error: error => { }, error: error => {
this.showAlert(error.message, 'error') this.showAlert(error.message, 'error')
this.employee.loading = false
this.cdr.detectChanges()
} }
}) })
} }
...@@ -385,4 +390,23 @@ export class SubEmployeeRegistrationComponent { ...@@ -385,4 +390,23 @@ export class SubEmployeeRegistrationComponent {
this.isDataListChecked = Boolean(this.numDataListChecked) this.isDataListChecked = Boolean(this.numDataListChecked)
} }
checkEmployeeModel() {
let disable = false
if (!this.employee.select.employeeId ||
!this.employee.select.fname ||
!this.employee.select.lname ||
!this.employee.select.empGroup.groupId ||
!this.employee.select.firstHireDate ||
!this.employee.select.bu1.bu1id ||
!this.employee.select.position.positionId ||
!this.employee.select.jobCode.jobcodeId ||
!this.employee.select.branch.branchId ||
!this.employee.select.empType.codeId ||
!this.employee.select.personalLevel.plId
) {
disable = true
}
return disable
}
} }
...@@ -10,15 +10,15 @@ ...@@ -10,15 +10,15 @@
<nav class="-mb-0.5 flex space-x-6 rtl:space-x-reverse"> <nav class="-mb-0.5 flex space-x-6 rtl:space-x-reverse">
<a class="text-base font-medium hs-tab-active:border-secondary hs-tab-active:text-secondary pb-3 inline-flex items-center gap-2 border-b-[3px] border-transparent whitespace-nowrap text-gray-500 dark:text-white/70 hover:text-secondary active" <a class="text-base font-medium hs-tab-active:border-secondary hs-tab-active:text-secondary pb-3 inline-flex items-center gap-2 border-b-[3px] border-transparent whitespace-nowrap text-gray-500 dark:text-white/70 hover:text-secondary active"
href="javascript:void(0);" id="underline-item-1" data-hs-tab="#underline-1" href="javascript:void(0);" id="underline-item-1" data-hs-tab="#underline-1"
aria-controls="underline-1" (click)="pathTitle = ['การประเมินสมรรถนะ','ทะเบียนหลักสูตร','หลักสูตรการพัฒนา']"> aria-controls="underline-1"
(click)="pathTitle = ['การประเมินสมรรถนะ','ทะเบียนหลักสูตร','หลักสูตรการพัฒนา']">
หลักสูตรการพัฒนา หลักสูตรการพัฒนา
</a> </a>
</nav> </nav>
</div> </div>
<div class="mt-3 px-3rem !-mt-3 pt-50px"> <div class="mt-3 px-2rem !-mt-3 pt-50px">
<div id="underline-1" role="tabpanel" aria-labelledby="underline-item-1"> <div id="underline-1" role="tabpanel" aria-labelledby="underline-item-1">
<app-development-course [pathTitle]="pathTitle" <app-development-course></app-development-course>
(sendPathTitle)="pathTitle=$event"></app-development-course>
</div> </div>
</div> </div>
</div> </div>
......
...@@ -5,6 +5,7 @@ export interface CompetencyCourseModel { ...@@ -5,6 +5,7 @@ export interface CompetencyCourseModel {
tdesc: string tdesc: string
courseDetail: string courseDetail: string
courseTopic: string courseTopic: string
courseLinkMylearn: string
} }
export class MyCompetencyCourseModel implements CompetencyCourseModel { export class MyCompetencyCourseModel implements CompetencyCourseModel {
competencyCourseId: string competencyCourseId: string
...@@ -13,13 +14,15 @@ export class MyCompetencyCourseModel implements CompetencyCourseModel { ...@@ -13,13 +14,15 @@ export class MyCompetencyCourseModel implements CompetencyCourseModel {
tdesc: string tdesc: string
courseDetail: string courseDetail: string
courseTopic: string courseTopic: string
constructor(data: Partial<CompetencyCourseModel>) { courseLinkMylearn: string
this.competencyCourseId = data.competencyCourseId || "" constructor(data?: Partial<CompetencyCourseModel>) {
this.tdesc = data.tdesc || "" this.competencyCourseId = data?.competencyCourseId || ""
this.edesc = data.edesc || "" this.tdesc = data?.tdesc || ""
this.companyId = data.companyId || "" this.edesc = data?.edesc || ""
this.courseDetail = data.courseDetail || "" this.companyId = data?.companyId || ""
this.courseTopic = data.courseTopic || "" this.courseDetail = data?.courseDetail || ""
this.courseTopic = data?.courseTopic || ""
this.courseLinkMylearn = data?.courseLinkMylearn || ""
} }
} }
...@@ -3,6 +3,7 @@ import { Injectable } from '@angular/core'; ...@@ -3,6 +3,7 @@ import { Injectable } from '@angular/core';
import { Observable } from 'rxjs'; import { Observable } from 'rxjs';
import { environment } from 'src/environments/environment'; import { environment } from 'src/environments/environment';
import { CompetencycourseModel } from '../model/competencycourse.model'; import { CompetencycourseModel } from '../model/competencycourse.model';
import { AlertModel } from '../model/alert.model';
@Injectable({ @Injectable({
providedIn: 'root' providedIn: 'root'
}) })
...@@ -17,16 +18,16 @@ export class CompetencycourseService { ...@@ -17,16 +18,16 @@ export class CompetencycourseService {
getList(): Observable<CompetencycourseModel[]> { getList(): Observable<CompetencycourseModel[]> {
return this.http.get<CompetencycourseModel[]>(this.urlApi + "/lists") return this.http.get<CompetencycourseModel[]>(this.urlApi + "/lists")
} }
post(body: CompetencycourseModel) { post(body: CompetencycourseModel): Observable<AlertModel> {
return this.http.post(this.urlApi, body) return this.http.post<AlertModel>(this.urlApi, body)
} }
delete(body: CompetencycourseModel) { delete(body: CompetencycourseModel): Observable<AlertModel> {
const options = { const options = {
headers: new HttpHeaders({ headers: new HttpHeaders({
"Content-Type": "application/json", "Content-Type": "application/json",
}), }),
body: body body: body
}; };
return this.http.delete(this.urlApi, options) return this.http.delete<AlertModel>(this.urlApi, options)
} }
} }
\ No newline at end of file
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