Commit f9078521 by Nattana Chaiyamat

ทะเบียนพนักงาน

parent 10d7dbbf
...@@ -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
}
} }
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