view.component.ts 5.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131
  1. import { Component, OnInit, ViewChild } from '@angular/core';
  2. import { NzModalRef, NzMessageService, NzDrawerRef } from 'ng-zorro-antd';
  3. import { _HttpClient } from '@delon/theme';
  4. import { ProjectManageArchivesService } from 'app/services/project-manage-archives/project-manage-archives.service';
  5. import { ProjectManageArchivesViewEssentialInformationComponent } from './essential-information/essential-information.component';
  6. import { ProjectManageArchivesViewBusinessAffairsComponent } from './business-affairs/business-affairs.component';
  7. import { ProjectManageArchivesViewImplementationComponent } from './implementation/implementation.component';
  8. import { ProjectManageArchivesViewDevelopmentComponent } from './development/development.component';
  9. import { ProjectManageArchivesViewServicetaComponent } from './serviceta/serviceta.component';
  10. @Component({
  11. selector: 'app-project-manage-archives-view',
  12. templateUrl: './view.component.html',
  13. styles: [
  14. `
  15. .base {
  16. position: absolute;
  17. bottom: 0px;
  18. width: 100%;
  19. border-top: 1px solid rgb(232, 232, 232);
  20. padding: 6px 16px;
  21. text-align: right;
  22. left: 0px;
  23. background: #fff;
  24. z-index: 99;
  25. }
  26. `,
  27. ],
  28. })
  29. export class ProjectManageArchivesViewComponent implements OnInit {
  30. constructor(
  31. private projectManageArchivesService:ProjectManageArchivesService,
  32. private drawerRef:NzDrawerRef
  33. ) { }
  34. isLoadingSave=false;
  35. //基本信息
  36. @ViewChild('essentialInformation') essentialInformation: ProjectManageArchivesViewEssentialInformationComponent;
  37. //商务
  38. @ViewChild('businessAffairs') businessAffairs: ProjectManageArchivesViewBusinessAffairsComponent;
  39. //实施
  40. @ViewChild('implementation') implementation: ProjectManageArchivesViewImplementationComponent;
  41. //开发
  42. @ViewChild('development') development: ProjectManageArchivesViewDevelopmentComponent;
  43. //服务
  44. @ViewChild('serviceta') serviceta: ProjectManageArchivesViewServicetaComponent;
  45. ngOnInit(): void {
  46. this.isLoadingSave=true;
  47. this.getById().then(()=>{
  48. this.isLoadingSave=false;
  49. });
  50. }
  51. close() {
  52. this.drawerRef.close(true);
  53. }
  54. /**
  55. * 根据类型id回写数据到实施、开发、服务页签的汇款信息
  56. * @param data 计划对象
  57. */
  58. remittanceInformationChange(data) {
  59. //实施页签
  60. if (data.planName.indexOf("实施")!==-1) {
  61. this.implementation.remittanceInformation = data;
  62. } else if (data.planName.indexOf("开发")!==-1) {
  63. //开发
  64. this.development.remittanceInformation = data;
  65. } else if (data.planName.indexOf("服务")!==-1) {
  66. //服务
  67. this.serviceta.remittanceInformation = data;
  68. }
  69. }
  70. /**
  71. * 修改根据id获取所有数据
  72. */
  73. id = '';
  74. getById() {
  75. return new Promise(resolve => {
  76. this.projectManageArchivesService.getListById(this.id).then(response => {
  77. if (response.result) {
  78. let projectManageArchives = JSON.parse(JSON.stringify(response.result));
  79. // //基本信息
  80. // this.projectManageArchivesaEntiy(projectManageArchives);
  81. // ///////////////基本信息页签
  82. this.essentialInformation.projectManageArchivesa = projectManageArchives;
  83. ///////////////商务页签
  84. //主表数据
  85. this.businessAffairs.projectManageArchives = projectManageArchives;
  86. //收款计划
  87. if (projectManageArchives.bsInfo.coPlanList) {
  88. this.businessAffairs.collectionPlanList = projectManageArchives.bsInfo.coPlanList;
  89. }
  90. //回款情况
  91. if (projectManageArchives.bsInfo.coSituationList) {
  92. this.businessAffairs.paymentCollectionList = projectManageArchives.bsInfo.coSituationList;
  93. }
  94. //付款计划
  95. if (projectManageArchives.bsInfo.payPlanList) {
  96. this.businessAffairs.paymentPlanList = projectManageArchives.bsInfo.payPlanList;
  97. }
  98. //付款情况
  99. if (projectManageArchives.bsInfo.paySituationList) {
  100. this.businessAffairs.paymentStatusList = projectManageArchives.bsInfo.paySituationList;
  101. }
  102. //对应的收款情况
  103. this.businessAffairs.paymentCollectionList.forEach(element => {
  104. this.remittanceInformationChange(element);
  105. });
  106. /////////////////实施
  107. //主表基本数据
  108. this.implementation.projectManageArchives=projectManageArchives
  109. //里程碑明细
  110. this.implementation.listOfMapData = projectManageArchives.ipInfo.planList;
  111. this.implementation.getLoding();
  112. ////////////////开发
  113. this.development.projectManageArchives=projectManageArchives
  114. this.development.listOfMapData = projectManageArchives.deInfo.planList;
  115. this.development.getLoding();
  116. // ////////////////服务
  117. this.serviceta.projectManageArchives=projectManageArchives
  118. this.serviceta.listOfMapData = projectManageArchives.seInfo.planList;
  119. this.serviceta.getLoding();
  120. resolve();
  121. }
  122. });
  123. });
  124. }
  125. }