123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899 |
- 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");
- }
- }
|