worker-statistics-detail.component.ts 3.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899
  1. import { Component, OnInit } from "@angular/core";
  2. import { ActivatedRoute, Router } from "@angular/router";
  3. import { NzMessageService } from "ng-zorro-antd";
  4. import { MainService } from "src/app/services/main.service";
  5. import { ToolService } from "src/app/services/tool.service";
  6. @Component({
  7. selector: "app-worker-statistics-detail",
  8. templateUrl: "./worker-statistics-detail.component.html",
  9. styleUrls: ["./worker-statistics-detail.component.less"],
  10. })
  11. export class WorkerStatisticsDetailComponent implements OnInit {
  12. loading1 = false; //获取选中支助人员的工单列表loading
  13. hosId; //当前院区id
  14. currentPersonId; //当前支助人员id
  15. startTime; //当前开始时间
  16. endTime; //当前结束时间
  17. groupId; //当前组ID
  18. listOfData = []; //获取选中支助人员的工单列表
  19. pageIndex: number = 1; //页码
  20. listLength: number = 0; //总数据条目数
  21. pageSize: number = 10; //每页条数
  22. isFiveOrder: boolean = false; //是否执行时长五分钟以内工单
  23. constructor(
  24. private mainService: MainService,
  25. private tool: ToolService,
  26. private message: NzMessageService,
  27. private route: ActivatedRoute,
  28. private router: Router
  29. ) {}
  30. ngOnInit() {
  31. this.hosId = this.tool.getCurrentHospital().id;
  32. this.currentPersonId = this.route.snapshot.params.workerId;
  33. this.startTime = this.route.snapshot.params.startTime;
  34. this.endTime = this.route.snapshot.params.endTime;
  35. this.groupId = this.route.snapshot.params.groupId;
  36. this.getOrdersByPerson(this.hosId, this.currentPersonId);
  37. }
  38. // resetPageSize(hosId, currentPersonId){
  39. // this.pageIndex = 1;
  40. // this.getOrdersByPerson(hosId, currentPersonId);
  41. // }
  42. // 是否剖执行时长五分钟以内工单
  43. changeIsFiveOrder(e: boolean) {
  44. this.isFiveOrder = e;
  45. this.pageIndex = 1;
  46. if (e) {
  47. this.getOrdersByPerson(this.hosId, this.currentPersonId);
  48. } else {
  49. this.getOrdersByPerson(this.hosId, this.currentPersonId);
  50. }
  51. }
  52. //获取选中支助人员的工单列表
  53. getOrdersByPerson(
  54. hosId: number,
  55. currentPersonId: number,
  56. ) {
  57. this.loading1 = true;
  58. let postData:any = {
  59. idx: this.pageIndex - 1,
  60. sum: this.pageSize,
  61. startTime: this.startTime,
  62. endTime: this.endTime,
  63. hosId,
  64. groupId: this.groupId == "null" ? "" : this.groupId,
  65. worker: currentPersonId,
  66. };
  67. if(this.isFiveOrder){
  68. postData.difLong = true;
  69. }
  70. this.mainService.postCustom("report", "userDetails", postData).subscribe(
  71. (result) => {
  72. this.loading1 = false;
  73. if (result.status == 200) {
  74. this.listOfData = result.list;
  75. this.listLength = result.totalNum;
  76. } else {
  77. this.message.error("获取数据失败");
  78. }
  79. },
  80. (err) => {
  81. this.loading1 = false;
  82. this.message.error("获取数据失败");
  83. }
  84. );
  85. }
  86. //查看积分详情
  87. integralDetail(obj) {
  88. this.router.navigateByUrl(
  89. `/main/workerStatistics/workerStatisticsDetail/${this.currentPersonId}/${this.startTime}/${this.endTime}/${this.groupId}/orderDetail/${obj.id}/3`
  90. );
  91. }
  92. //关闭
  93. close() {
  94. this.router.navigateByUrl("/main/workerStatistics");
  95. }
  96. }