view.component.ts 3.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119
  1. import { Component, OnInit } from '@angular/core';
  2. import { NzModalRef, NzMessageService, NzDrawerRef, NzNotificationService } from 'ng-zorro-antd';
  3. import { _HttpClient } from '@delon/theme';
  4. import { FbsAbnormalWorkingHours } from 'app/entity/fbs/fbs-abnormal-working-hours';
  5. import { FbsAbnormalWorkingHoursDescribe } from 'app/entity/fbs/fbs-abnormal-working-hours-describe';
  6. import { FbsAbnormalWorkingHoursService } from 'app/services/fbs/fbs-abnormal-working-hours.service';
  7. import { FbsAbnormalWorkingHoursType } from 'app/entity/fbs/fbs-abnormal-working-hours-type';
  8. @Component({
  9. selector: 'app-fbs-abnormal-working-hours-view',
  10. templateUrl: './view.component.html',
  11. styles: [
  12. `
  13. .base{
  14. position: absolute;
  15. bottom: 0px;
  16. width: 100%;
  17. border-top: 1px solid rgb(232, 232, 232);
  18. padding: 10px 16px;
  19. text-align: right;
  20. left: 0px;
  21. background: #fff;
  22. z-index:99;
  23. }
  24. `
  25. ]
  26. })
  27. export class FbsAbnormalWorkingHoursViewComponent implements OnInit {
  28. constructor(
  29. private drawerRef:NzDrawerRef,
  30. private fbsAbnormalWorkingHoursService: FbsAbnormalWorkingHoursService,
  31. private nzNotificationService: NzNotificationService
  32. ) { }
  33. ngOnInit(): void {
  34. this.getById()
  35. // .then(()=>{
  36. // this.saveLoading = false;
  37. // })
  38. .then(()=>{
  39. return this.getDescribeListById()
  40. })
  41. // .then(()=>{
  42. // return this.getTypeById();
  43. // })
  44. .then(()=>{
  45. this.saveLoading=false;
  46. })
  47. }
  48. saveLoading=false;//加载效果
  49. fbsAbnormalWorkingHours:FbsAbnormalWorkingHours={}
  50. properList=[];//人员下拉选择集合
  51. describeList=[];//异常描述集合表格数据
  52. typeList=[];//异常类型集合表格数据
  53. /**
  54. * 根据id查询主表数据
  55. */
  56. id = '';
  57. getById() {
  58. return new Promise(resolve => {
  59. this.saveLoading=true;
  60. this.fbsAbnormalWorkingHoursService.getById(this.id).then(response => {
  61. if(response.success){//查询成功
  62. this.fbsAbnormalWorkingHours=response.result;
  63. resolve();
  64. }else{
  65. this.nzNotificationService.error("查询失败",response.message)
  66. this.saveLoading=false;
  67. }
  68. });
  69. });
  70. }
  71. /**
  72. * 查询异常工时描述
  73. */
  74. getDescribeListById(){
  75. return new Promise((resolve)=>{
  76. //查询条件
  77. let fbsAbnormalWorkingHoursDescribe=new FbsAbnormalWorkingHoursDescribe();
  78. fbsAbnormalWorkingHoursDescribe.pageSize=1000;
  79. fbsAbnormalWorkingHoursDescribe.abnormalWorkingHoursId=this.fbsAbnormalWorkingHours.id;//主表id
  80. //查询
  81. this.fbsAbnormalWorkingHoursService.getDescribeList(fbsAbnormalWorkingHoursDescribe).then((response)=>{
  82. this.describeList=response.result.records;
  83. resolve();
  84. })
  85. })
  86. }
  87. /**
  88. * 查询异常工时类别
  89. */
  90. getTypeById(){
  91. return new Promise((resolve)=>{
  92. //查询条件
  93. let fbsAbnormalWorkingHoursType=new FbsAbnormalWorkingHoursType();
  94. fbsAbnormalWorkingHoursType.pageSize=1000;
  95. fbsAbnormalWorkingHoursType.abnormalWorkingHoursId=this.fbsAbnormalWorkingHours.id;//主表id
  96. //查询
  97. this.fbsAbnormalWorkingHoursService.getTypeList(fbsAbnormalWorkingHoursType).then((response)=>{
  98. this.typeList=response.result.records;
  99. resolve();
  100. })
  101. })
  102. }
  103. close() {
  104. //抽屉关闭
  105. this.drawerRef.close();
  106. }
  107. }