round-robin-detail.component.ts 1.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748
  1. import { Component, OnInit } from "@angular/core";
  2. import { Router, ActivatedRoute } from "@angular/router";
  3. import { NzMessageService } from "ng-zorro-antd";
  4. import { MainService } from "../../services/main.service";
  5. @Component({
  6. selector: "app-round-robin-detail",
  7. templateUrl: "./round-robin-detail.component.html",
  8. styleUrls: ["./round-robin-detail.component.less"],
  9. })
  10. export class RoundRobinDetailComponent implements OnInit {
  11. constructor(
  12. private message: NzMessageService,
  13. private router: Router,
  14. private mainService: MainService,
  15. private routerInfo: ActivatedRoute
  16. ) {}
  17. id: number;
  18. userInfo: any = null;
  19. dayType = ["全部", "节假日", "工作日"]; //执行策略里的复选框数据字典
  20. ngOnInit() {
  21. this.getDetail();
  22. }
  23. hideModal() {
  24. this.router.navigateByUrl("/main/roundRobin");
  25. }
  26. // 获取详情
  27. maskFlag: any = false;
  28. getDetail() {
  29. this.id = this.routerInfo.snapshot.params["id"];
  30. this.maskFlag = this.message.loading("正在加载中..", {
  31. nzDuration: 0,
  32. }).messageId;
  33. this.mainService
  34. .getFetchData("api", "orderPlan", this.id)
  35. .subscribe((data) => {
  36. this.message.remove(this.maskFlag);
  37. this.maskFlag = false;
  38. if (data.status == 200) {
  39. this.userInfo = data.data;
  40. }
  41. });
  42. }
  43. }