This commit is contained in:
heqinghang
2022-04-01 11:15:45 +08:00
parent 9128d9f9a5
commit 09e4aae936
9 changed files with 174 additions and 146 deletions

View File

@ -4,6 +4,8 @@ import { SFSchema } from '@delon/form';
import { DatePipe, ModalHelper, _HttpClient } from '@delon/theme';
import { DataService } from '../../services/data.service';
import { differenceInCalendarDays } from 'date-fns';
import { OperationCurveComponent } from '../operationtable/curve/curve.component';
import { OperationPillarComponent } from '../operationtable/pillar/pillar.component';
@Component({
selector: 'app-datatable-financetable',
@ -12,6 +14,8 @@ import { differenceInCalendarDays } from 'date-fns';
providers: [DatePipe]
})
export class DatatableFinancetableComponent implements OnInit {
@ViewChild('curve') private readonly curve!: OperationCurveComponent;
@ViewChild('pillar') private readonly pillar!: OperationPillarComponent;
@ViewChild('st') private readonly st!: STComponent;
type = 1;
mode = 'year';
@ -24,8 +28,9 @@ export class DatatableFinancetableComponent implements OnInit {
timeNext: any = ['2022-01-01 00:00:00']
today = new Date();
enterpriseInfoId = ''
enterpriseInfoIdPie = ''
interManlist: any = []
chartData: any = {}
flag = false;
columns: STColumn[] = [
{ title: '运营主体', index: 'networkTransporterName', className: 'text-center' },
{ title: '客户预存款', index: 'czcgje',render: 'czcgje', className: 'text-center' },
@ -63,13 +68,37 @@ export class DatatableFinancetableComponent implements OnInit {
constructor(public service: DataService, private datePipe: DatePipe) { }
ngOnInit(): void {
this.initData()
this.initData();
this.initPillarData();
}
initPillarData(){
let type = 1
if(this.mode === 'year') {
type = 1
} else if(this.mode === 'month') {
type = 2
}
const params: any = {
time: this.timeNext,
type,
enterpriseInfoId: this.enterpriseInfoId
};
this.flag = true
this.service.request(this.service.$api_operationalReportHistogram, params).subscribe(res => {
if (res) {
this.chartData = res
if(this.flag) {
this.pillar.reRender()
this.curve.reRender()
}
}
})
}
initData() {
this.service.getNetworkFreightForwarder().subscribe(res => {
this.interManlist = res
this.enterpriseInfoId = res[0].value
this.enterpriseInfoIdPie = res[0].value
})
}