made fixes to imports and supplier list

This commit is contained in:
Finn 2019-07-12 20:18:28 +01:00
parent 8202cdfdb1
commit 75ba91379d
No known key found for this signature in database
GPG key ID: 7455B4B17685B598
4 changed files with 62 additions and 53 deletions

View file

@ -9,7 +9,6 @@ import { CustBarSnippetComponent } from '../snippets/cust-snippet-bar.component'
import { PiePanel } from '../panels/pie-panel.component'; import { PiePanel } from '../panels/pie-panel.component';
import { DataType } from '../shared/data-types.enum'; import { DataType } from '../shared/data-types.enum';
import * as moment from 'moment'; import * as moment from 'moment';
import { SuppliersComponent } from '../dashboard/suppliers.component';
import { MoreStuffComponent } from '../dashboard/more-graphs-and-tables.component'; import { MoreStuffComponent } from '../dashboard/more-graphs-and-tables.component';
// import { StackedBarChartComponent } from '../panels/stacked-bar.component'; // import { StackedBarChartComponent } from '../panels/stacked-bar.component';

View file

@ -1,6 +1,12 @@
<script type="text/javascript" charset="utf8" src=""></script>
<div class="animated fadeIn"> <div class="animated fadeIn">
<div class="form-group row"> <div class="row">
<div class="col-lg-12">
<div class="card">
<div class="card-header">
<strong>List of Suppliers</strong>
<small>This lists all suppliers that have been submitted.</small>
</div>
<div *ngIf="supplierListAvailable" class="card-block">
<table class="table table-striped table-hover"> <table class="table table-striped table-hover">
<thead> <thead>
<tr> <tr>
@ -43,4 +49,10 @@
</ul> </ul>
</pagination-template> </pagination-template>
</div> </div>
</div><!--/.col--> <div *ngIf="!supplierListAvailable" class="card-block">
No Suppliers available.
</div>
</div>
</div>
</div>
</div>

View file

@ -3,16 +3,12 @@ import { ApiService } from '../providers/api-service';
import { AgmCoreModule } from '@agm/core'; import { AgmCoreModule } from '@agm/core';
import { BsModalService, ModalDirective } from 'ngx-bootstrap/modal'; import { BsModalService, ModalDirective } from 'ngx-bootstrap/modal';
import { BsModalRef } from 'ngx-bootstrap/modal/bs-modal-ref.service'; import { BsModalRef } from 'ngx-bootstrap/modal/bs-modal-ref.service';
import { PaginationInstance } from 'ngx-pagination';
interface SuppliersComponent {
name : string;
}
@Component({ @Component({
templateUrl: 'suppliers.component.html', templateUrl: 'suppliers.component.html',
}) })
export class SuppliersComponent implements OnInit, AfterViewInit { export class SuppliersComponent implements OnInit, AfterViewInit {
@Input() public recurList: Array<RecurSupplierData>;
@Output() public onClick = new EventEmitter(); @Output() public onClick = new EventEmitter();
@Input() public categories: any; @Input() public categories: any;
@ -44,9 +40,11 @@ export class SuppliersComponent implements OnInit, AfterViewInit {
this.api.externalSuppliers(logPage, this.sortBy, this.sortDir).subscribe( this.api.externalSuppliers(logPage, this.sortBy, this.sortDir).subscribe(
result => { result => {
this.supplierList = result.suppliers; this.supplierList = result.suppliers;
if (this.supplierList) {
this.supplierListAvailable = true;
}
this.paginateConfig.totalItems = result.page_no; this.paginateConfig.totalItems = result.page_no;
this.paginateConfig.currentPage = logPage; this.paginateConfig.currentPage = logPage;
this.noTransactionList = false;
}, },
error => { error => {
console.log('Retrieval Error'); console.log('Retrieval Error');

View file

@ -3,7 +3,7 @@ import { Component, OnInit, Input, Output, EventEmitter } from '@angular/core';
interface SupplierData { interface SupplierData {
name: string; name: string;
postcode: string; postcode: string;
spend: number = 0; spend: number;
} }
@Component({ @Component({