|
@@ -48,6 +48,10 @@ export class EmployeeDetailComponent implements OnInit {
|
|
|
|
|
|
employee = signal<Employee | null>(null);
|
|
|
screeningForm: FormGroup;
|
|
|
+ // 新增:审核弹窗相关状态
|
|
|
+ showReviewDialog = false;
|
|
|
+ reviewResult: 'approved' | 'rejected' | null = null;
|
|
|
+ reviewComment = '';
|
|
|
|
|
|
// 模拟员工数据
|
|
|
private mockEmployees: Employee[] = [
|
|
@@ -266,13 +270,17 @@ export class EmployeeDetailComponent implements OnInit {
|
|
|
}
|
|
|
|
|
|
approveScreening() {
|
|
|
- this.screeningForm.patchValue({ status: 'approved' });
|
|
|
- this.openScreeningDialog();
|
|
|
+ // 改为打开审核弹窗
|
|
|
+ this.reviewResult = 'approved';
|
|
|
+ this.reviewComment = '';
|
|
|
+ this.showReviewDialog = true;
|
|
|
}
|
|
|
|
|
|
rejectScreening() {
|
|
|
- this.screeningForm.patchValue({ status: 'rejected' });
|
|
|
- this.openScreeningDialog();
|
|
|
+ // 改为打开审核弹窗
|
|
|
+ this.reviewResult = 'rejected';
|
|
|
+ this.reviewComment = '';
|
|
|
+ this.showReviewDialog = true;
|
|
|
}
|
|
|
|
|
|
private openScreeningDialog() {
|
|
@@ -300,6 +308,31 @@ export class EmployeeDetailComponent implements OnInit {
|
|
|
}
|
|
|
}
|
|
|
|
|
|
+ // 新增:模板绑定的方法
|
|
|
+ closeReviewDialog() {
|
|
|
+ this.showReviewDialog = false;
|
|
|
+ }
|
|
|
+
|
|
|
+ submitReview() {
|
|
|
+ if (!this.reviewResult) {
|
|
|
+ this.showSnackBar('请选择审核结果');
|
|
|
+ return;
|
|
|
+ }
|
|
|
+ const currentEmployee = this.employee();
|
|
|
+ if (currentEmployee) {
|
|
|
+ const updatedEmployee: Employee = {
|
|
|
+ ...currentEmployee,
|
|
|
+ screeningStatus: this.reviewResult,
|
|
|
+ screeningComment: this.reviewComment,
|
|
|
+ screeningTime: new Date()
|
|
|
+ } as Employee;
|
|
|
+ this.employee.set(updatedEmployee);
|
|
|
+ this.showSnackBar('审核结果已保存');
|
|
|
+ }
|
|
|
+ this.showReviewDialog = false;
|
|
|
+ this.reviewComment = '';
|
|
|
+ }
|
|
|
+
|
|
|
viewAttendance() {
|
|
|
this.router.navigate(['/hr/attendance'], {
|
|
|
queryParams: { employee: this.employee()?.id }
|