import { Component, OnInit } from "@angular/core"; import { ActivatedRoute, Router } from "@angular/router"; import { NzMessageService } from "ng-zorro-antd"; import { MainService } from "src/app/services/main.service"; import { ToolService } from "src/app/services/tool.service"; @Component({ selector: "app-worker-statistics-detail", templateUrl: "./worker-statistics-detail.component.html", styleUrls: ["./worker-statistics-detail.component.less"], }) export class WorkerStatisticsDetailComponent implements OnInit { loading1 = false; //获取选中支助人员的工单列表loading hosId; //当前院区id currentPersonId; //当前支助人员id startTime; //当前开始时间 endTime; //当前结束时间 groupId; //当前组ID listOfData = []; //获取选中支助人员的工单列表 pageIndex: number = 1; //页码 listLength: number = 0; //总数据条目数 pageSize: number = 10; //每页条数 isFiveOrder: boolean = false; //是否执行时长五分钟以内工单 constructor( private mainService: MainService, private tool: ToolService, private message: NzMessageService, private route: ActivatedRoute, private router: Router ) {} ngOnInit() { this.hosId = this.tool.getCurrentHospital().id; this.currentPersonId = this.route.snapshot.params.workerId; this.startTime = this.route.snapshot.params.startTime; this.endTime = this.route.snapshot.params.endTime; this.groupId = this.route.snapshot.params.groupId; this.getOrdersByPerson(this.hosId, this.currentPersonId); } // resetPageSize(hosId, currentPersonId){ // this.pageIndex = 1; // this.getOrdersByPerson(hosId, currentPersonId); // } // 是否剖执行时长五分钟以内工单 changeIsFiveOrder(e: boolean) { this.isFiveOrder = e; this.pageIndex = 1; if (e) { this.getOrdersByPerson(this.hosId, this.currentPersonId); } else { this.getOrdersByPerson(this.hosId, this.currentPersonId); } } //获取选中支助人员的工单列表 getOrdersByPerson( hosId: number, currentPersonId: number, ) { this.loading1 = true; let postData:any = { idx: this.pageIndex - 1, sum: this.pageSize, startTime: this.startTime, endTime: this.endTime, hosId, groupId: this.groupId == "null" ? "" : this.groupId, worker: currentPersonId, }; if(this.isFiveOrder){ postData.difLong = true; } this.mainService.postCustom("report", "userDetails", postData).subscribe( (result) => { this.loading1 = false; if (result.status == 200) { this.listOfData = result.list; this.listLength = result.totalNum; } else { this.message.error("获取数据失败"); } }, (err) => { this.loading1 = false; this.message.error("获取数据失败"); } ); } //查看积分详情 integralDetail(obj) { this.router.navigateByUrl( `/main/workerStatistics/workerStatisticsDetail/${this.currentPersonId}/${this.startTime}/${this.endTime}/${this.groupId}/orderDetail/${obj.id}/3` ); } //关闭 close() { this.router.navigateByUrl("/main/workerStatistics"); } }