Broker System for Supercredit
您最多选择25个主题 主题必须以字母或数字开头,可以包含连字符 (-),并且长度不得超过35个字符

40 行
1.6KB

  1. import {Component, Input, OnInit} from '@angular/core';
  2. import {LoanSummaryService} from '../service/loan_summary.service';
  3. import {CompositeFilterDescriptor, SortDescriptor} from '@progress/kendo-data-query';
  4. import {PeopleModel} from '../models/people.model';
  5. import {AppConfig} from '../app.config';
  6. import {SessionService} from '../service/session.service';
  7. @Component({
  8. selector: 'app-broker-loan-list',
  9. templateUrl: './broker-loan-list.component.html',
  10. styleUrls: ['./broker-loan-list.component.scss']
  11. })
  12. export class BrokerLoanListComponent implements OnInit {
  13. @Input() public broker: PeopleModel = PeopleModel.EmptyNew();
  14. public brokerLoans: LoanSummaryService;
  15. constructor( private lss: LoanSummaryService, private ss: SessionService, private config: AppConfig) { }
  16. ngOnInit(): void {
  17. this.brokerLoans = this.lss;
  18. this.broker = this.ss.loggedIn.User;
  19. this.loadData();
  20. }
  21. private loadData(): void {
  22. const sort: Array <SortDescriptor> = [{dir: 'desc', field: 'Settlement'}];
  23. const filter: CompositeFilterDescriptor = {logic: 'or', filters: [] };
  24. filter.filters.push({field:'client_ids', operator: 'contains', value: this.broker.Id, ignoreCase: true})
  25. filter.filters.push({field:'broker_ids', operator: 'contains', value: this.broker.Id, ignoreCase: true})
  26. filter.filters.push({field:'other_rewarder_ids', operator: 'contains', value: this.broker.Id, ignoreCase: true})
  27. this.lss.query({ skip: 0, take: 1000, sort, filter});
  28. }
  29. private photoURL(peopleId: any): string {
  30. const url = this.config.getUrl('avatar/') + peopleId;
  31. return 'url("' + url + '")';
  32. }
  33. }