- | Details |
+
Material Name |
- Estimation |
- Collected |
+
+ Cost Per unit |
Qty |
-
- | {{schoolInfo.cat_name}} |
- {{schoolInfo.material_name}} |
- {{schoolInfo.total_cost}} |
- {{schoolInfo.total_recevied}} |
- {{schoolInfo.qty}} |
+
+
+ | {{item.material_name}} |
+
+ {{item.cost_per_unit}} |
+ {{item.qty}} |
diff --git a/ng8-seed/src/app/components/project-detail/project-detail.component.ts b/ng8-seed/src/app/components/project-detail/project-detail.component.ts
index 838895b..c9760e0 100644
--- a/ng8-seed/src/app/components/project-detail/project-detail.component.ts
+++ b/ng8-seed/src/app/components/project-detail/project-detail.component.ts
@@ -2,9 +2,8 @@ import { Component, OnInit, ViewChild } from '@angular/core';
import { environment } from 'environments/environment';
import { ApiService } from 'app/shared/api.service';
import { FormBuilder } from '@angular/forms';
-import { Router } from '@angular/router';
-import { SchoolDetailsService } from 'app/shared/school-details.service';
-import { MatDialogRef, MatDialogConfig, MatDialog } from '@angular/material';
+import { Router, ActivatedRoute } from '@angular/router';
+import { SchoolDetailsService } from 'app/shared/school-details.service';
@Component({
selector: 'app-project-detail',
@@ -12,30 +11,45 @@ import { MatDialogRef, MatDialogConfig, MatDialog } from '@angular/material';
styleUrls: ['./project-detail.component.scss']
})
export class ProjectDetailComponent implements OnInit {
-
@ViewChild('slider',{static:false}) sliderimg
- imageSources=[];
+ imageSources=[];
+ school_list : any [];
- schoolInfo: any ;
+ schoolInfo: any ;
+ all_material_list: any;
// types_of_funds=['State Fund','District Fund','School common Fund','For this Project']
- constructor(public restApi:ApiService,public fb:FormBuilder,public router:Router,public schInfo:SchoolDetailsService,public dialog: MatDialog) { }
+ constructor(public restApi:ApiService,public fb:FormBuilder,public router:Router,public schInfo:SchoolDetailsService,private activatedRoute:ActivatedRoute) { }
-
ngOnInit() {
-
+ let data=this.activatedRoute.snapshot.paramMap.get('schoolreqid')
+ // console.log(this.activatedRoute.snapshot.paramMap(''))
+ console.log("State",data)
this.schInfo.SchoolDetails.subscribe(schDetl=>this.schoolInfo = schDetl);
this.imageSources = this.schoolInfo.images;
+ if( data != ''){
+ this.getIndividualSchoolReqData(data)
+ this.getSchoolReqList(data)
+ }
+ else{
this.getSchoolReqList();
+ }
}
-
- getSchoolReqList()
+getIndividualSchoolReqData(id){
+ this.restApi.getIndividualSchoolReqData(id).subscribe(res=>{
+ if(res['dataStatus']){
+ this.schoolInfo=res['records'][0]
+ this.imageSources=res['records'][0].images
+ }
+ })
+}
+ getSchoolReqList(id?)
{
let url = `${environment.apiUrl}${'getSchoolReqList'}`;
let data = {
- schoold_id: '',
+ schoold_id: id || null,
district_id: '',
cad_id: '',
mat_id: ''
@@ -44,7 +58,7 @@ export class ProjectDetailComponent implements OnInit {
if (schDet.dataStatus == true) {
// console.log(schDet);
-
+ this.all_material_list=schDet.records
let projectList = schDet.records.filter(sch=>sch.school_id==this.schoolInfo.school_id)[0];
// console.log(projectList);
@@ -81,7 +95,4 @@ export class ProjectDetailComponent implements OnInit {
this.sliderimg.goToSlide(index);
}
-
-
}
-
\ No newline at end of file