view.component.ts 1.7 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768
  1. import { Component, OnInit } from '@angular/core';
  2. import { NzModalRef, NzMessageService, NzNotificationService, NzDrawerRef } from 'ng-zorro-antd';
  3. import { _HttpClient } from '@delon/theme';
  4. import { FbsWarehouse } from 'app/entity/fbs/fbs-warehouse';
  5. import { FbsWarehouseService } from 'app/services/fbs/fbs-warehouse.service';
  6. import { DatePipe } from '@angular/common';
  7. @Component({
  8. selector: 'app-fbs-warehouse-view',
  9. templateUrl: './view.component.html',
  10. styles: [
  11. `
  12. .base{
  13. position: absolute;
  14. bottom: 0px;
  15. width: 100%;
  16. border-top: 1px solid rgb(232, 232, 232);
  17. padding: 10px 16px;
  18. text-align: right;
  19. left: 0px;
  20. background: #fff;
  21. z-index:99;
  22. }
  23. `
  24. ]
  25. })
  26. export class FbsWarehouseViewComponent implements OnInit {
  27. constructor(
  28. private fbsWarehouseService: FbsWarehouseService,
  29. private datePipe: DatePipe,
  30. private nzNotificationService: NzNotificationService,
  31. private drawerRef: NzDrawerRef,
  32. ) {}
  33. ngOnInit(): void {
  34. this.getById();
  35. }
  36. saveLoading = false;
  37. fbsWarehouse: FbsWarehouse = {};
  38. /**
  39. * 根据id查询主表数据
  40. */
  41. id = '';
  42. getById() {
  43. return new Promise(resolve => {
  44. this.saveLoading = true;
  45. this.fbsWarehouseService.getById(this.id).then(response => {
  46. if (response.success) {
  47. //查询成功
  48. this.fbsWarehouse = response.result;
  49. this.saveLoading = false;
  50. resolve();
  51. } else {
  52. this.nzNotificationService.error('查询失败', response.message);
  53. this.saveLoading = false;
  54. }
  55. });
  56. });
  57. }
  58. close() {
  59. //抽屉关闭
  60. this.drawerRef.close();
  61. }
  62. }