import { Component, OnInit } from '@angular/core'; import { NzModalRef, NzMessageService, NzNotificationService, NzDrawerRef } from 'ng-zorro-antd'; import { _HttpClient } from '@delon/theme'; import { FbsWarehouse } from 'app/entity/fbs/fbs-warehouse'; import { FbsWarehouseService } from 'app/services/fbs/fbs-warehouse.service'; import { DatePipe } from '@angular/common'; @Component({ selector: 'app-fbs-warehouse-view', templateUrl: './view.component.html', styles: [ ` .base{ position: absolute; bottom: 0px; width: 100%; border-top: 1px solid rgb(232, 232, 232); padding: 10px 16px; text-align: right; left: 0px; background: #fff; z-index:99; } ` ] }) export class FbsWarehouseViewComponent implements OnInit { constructor( private fbsWarehouseService: FbsWarehouseService, private datePipe: DatePipe, private nzNotificationService: NzNotificationService, private drawerRef: NzDrawerRef, ) {} ngOnInit(): void { this.getById(); } saveLoading = false; fbsWarehouse: FbsWarehouse = {}; /** * 根据id查询主表数据 */ id = ''; getById() { return new Promise(resolve => { this.saveLoading = true; this.fbsWarehouseService.getById(this.id).then(response => { if (response.success) { //查询成功 this.fbsWarehouse = response.result; this.saveLoading = false; resolve(); } else { this.nzNotificationService.error('查询失败', response.message); this.saveLoading = false; } }); }); } close() { //抽屉关闭 this.drawerRef.close(); } }