view.component.ts 1.7 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667
  1. import { Component, OnInit } from '@angular/core';
  2. import { NzModalRef, NzMessageService, NzDrawerRef } from 'ng-zorro-antd';
  3. import { _HttpClient } from '@delon/theme';
  4. import { InvoiceManagePurchase } from 'app/entity/invoice-management/invoice-manage-purchase';
  5. import { InvoiceManagePurchaseService } from 'app/services/invoice-management/invoice-manage-purchase.service';
  6. @Component({
  7. selector: 'app-invoice-management-invoice-manage-purchase-view',
  8. templateUrl: './view.component.html',
  9. styles: [
  10. `
  11. .base {
  12. position: absolute;
  13. bottom: 0px;
  14. width: 100%;
  15. border-top: 1px solid rgb(232, 232, 232);
  16. padding: 6px 16px;
  17. text-align: right;
  18. left: 0px;
  19. background: #fff;
  20. z-index: 99;
  21. }
  22. `,
  23. ],
  24. })
  25. export class InvoiceManagementInvoiceManagePurchaseViewComponent implements OnInit {
  26. constructor(
  27. private invoiceManagePurchaseService:InvoiceManagePurchaseService,
  28. private drawerRef:NzDrawerRef
  29. ) { }
  30. ngOnInit(): void {
  31. this.isLoadingSave=true;
  32. this.queryById().then(()=>{
  33. this.isLoadingSave=false;
  34. })
  35. }
  36. invoiceManagePurchase: InvoiceManagePurchase = {}; //对象
  37. isLoadingSave = false;
  38. itemDataList = []; //明细表格数据集合
  39. id="";
  40. /**
  41. * 根据id查询主子表数据
  42. */
  43. queryById() {
  44. return new Promise(resolve => {
  45. this.invoiceManagePurchaseService.queryById(this.id).then(response => {
  46. if (response.success) {
  47. this.invoiceManagePurchase = response.result; //主表
  48. this.itemDataList = response.result.detailList; //子表数据
  49. resolve();
  50. } else {
  51. resolve();
  52. }
  53. });
  54. });
  55. }
  56. close() {
  57. this.drawerRef.close();
  58. }
  59. }