Browse Source

[修改]统计报表返回值为空判断

tangshan
陈敬瑜 3 years ago
parent
commit
dac791648e
  1. 1
      src/app/plan-audit/plan-record/plan-record.component.ts
  2. 8
      src/app/plan-audit/wait-examineer/wait-examineer.component.ts
  3. 14
      src/app/statistic-analysis/combined-query/combined-query.component.html
  4. 27
      src/app/statistic-analysis/combined-query/combined-query.component.ts

1
src/app/plan-audit/plan-record/plan-record.component.ts

@ -96,7 +96,6 @@ export class PlanRecordComponent implements OnInit {
//获取表格数据
getAlltabledate() {
let paramsdata: any = {
Operation: this.level || [],
ContentType: Number(this.projectlevel) || [],

8
src/app/plan-audit/wait-examineer/wait-examineer.component.ts

@ -179,14 +179,14 @@ export class WaitExamineerComponent implements OnInit {
bianzhi = false
radioClick(e, item) {
this.selectedItem = item
console.log(item)
//console.log(item)
// console.log('当前选择的信息',JSON.parse(this.selectedItem.differentContent) )
if (item.contentType == 11 && this.selectedItem.differentContent) {
let differentContent = JSON.parse(this.selectedItem.differentContent)
console.log('差异信息', differentContent)
//console.log('差异信息', differentContent)
// 单位信息
@ -222,7 +222,7 @@ export class WaitExamineerComponent implements OnInit {
this.differentContentOfBuildingsInfo.childrens.forEach(element => {
element.difData = resolveDiff(element.childrens)
});
console.log('建筑信息', this.differentContentOfBuildingsInfo)
//console.log('建筑信息', this.differentContentOfBuildingsInfo)
//功能分区
let differentContentOfFunction = JSON.parse(JSON.stringify(differentContent.filter(item => item.propertyName == 'buildings')[0]))
this.differentContentOfFunction = []
@ -296,7 +296,7 @@ export class WaitExamineerComponent implements OnInit {
})
} else {
this.http.get(`/api/PlanComponents/${item.itemId}`).subscribe((data: any) => {
console.log('预案信息',data)
//console.log('预案信息',data)
this.companyId = data.companyId
this.companyName = data.companyName
if (data.planType != 2 && data.planType != 1) {

14
src/app/statistic-analysis/combined-query/combined-query.component.html

@ -107,15 +107,7 @@
<mat-divider></mat-divider>
<div class="body">
<div class="tablebox" id="table">
<!-- <table mat-table [dataSource]="tabledataSource" class="mat-elevation-z8" id="table">
<ng-container *ngFor="let item of displayedColumns;let i=index" [matColumnDef]="displayedColumns[i]">
<th mat-header-cell *matHeaderCellDef>{{item}}</th>
<td mat-cell *matCellDef="let element">{{element.name}}</td>
</ng-container>
<tr mat-header-row *matHeaderRowDef="displayedColumns"></tr>
<tr mat-row *matRowDef="let row; columns: displayedColumns;"></tr>
</table> -->
<table cellpadding="0" cellspacing="0" *ngIf="preparelevels==0">
<table cellpadding="0" cellspacing="0" *ngIf="preparelevels==0&&!tableDataNull">
<thead>
<th *ngFor="let item of displayedColumns;let i=index">{{item}}</th>
</thead>
@ -125,7 +117,7 @@
</tr>
</tbody>
</table>
<table cellpadding="0" cellspacing="0" *ngIf="preparelevels==1">
<table cellpadding="0" cellspacing="0" *ngIf="preparelevels==1&&!tableDataNull">
<thead>
<th *ngFor="let item of yuanColumns;let i=index">{{item}}</th>
</thead>
@ -135,7 +127,7 @@
</tr>
</tbody>
</table>
<span *ngIf="tableDataNull">暂无数据</span>
</div>
</div>
</ng-template>

27
src/app/statistic-analysis/combined-query/combined-query.component.ts

@ -92,6 +92,7 @@ export class CombinedQueryComponent implements OnInit {
this.getAllPlanInfo()
}
//获得所有预案或单位信息
tableDataNull=false
async getAllPlanInfo() {
let paramsdata:any={
QueryMode:this.preparelevels,
@ -99,22 +100,25 @@ export class CombinedQueryComponent implements OnInit {
HasChildren:this.jscheck||'',
TimeIntervalStart:this.dwaddtime||'',
TimeIntervalEnd:this.dwendtime||'',
BuildingTypeIds:this.unittype||'',
BuildingTypeIds:this.unittype||[],
CompanyStatus:this.preparelevel||''
}
let yuandata={
QueryMode:this.preparelevels,
OrganizationId:this.jsId||'',
HasChildren:this.jscheck||'',
HasChildren:this.yuanjscheck||'',
TimeIntervalStart:this.yuanaddtime||'',
TimeIntervalEnd:this.yuanendtime||'',
PlanCategory:this.planCategory||'',
PlanType:this.reservePlanType||''
PlanCategory:this.planCategory||[],
PlanType:this.reservePlanType||[]
}
let result = await new Promise((resolve, reject)=>{
this.http.get("/api/StatisticsAnalysis/ReportTable", { params:this.preparelevels==0? paramsdata:yuandata }).subscribe((data: any) => {
console.log(data)
//this.tabledataSource=data
//console.log(data)
if(data.length==0){
this.tableDataNull=true
}else{
this.tableDataNull=false
if(this.preparelevels==0){
//单位查询
this.tabledataSource=[]
@ -252,8 +256,11 @@ export class CombinedQueryComponent implements OnInit {
})
}
console.log(this.yuanColumns)
console.log(this.yuanTable)
}
//this.tabledataSource=data
//console.log(this.yuanColumns)
//console.log(this.yuanTable)
this.excelData=data
resolve(this.excelData)
}
@ -487,7 +494,7 @@ export class CombinedQueryComponent implements OnInit {
yuanjs: any //预案所选组织机构
yuanjsId: any //预案所选组织机构的id
yuanjscheck: boolean //预案所选组织机构勾选框
unittype: any //单位类型
unittype=[] //单位类型
reservePlanType=[] //预案类型
preparelevel: any //编制级别
plcheck: boolean //编制级别勾选框
@ -498,7 +505,7 @@ export class CombinedQueryComponent implements OnInit {
this.js = ''
this.jsId = ''
this.jscheck = false
this.unittype = ''
this.unittype = []
this.preparelevel = ''
this.dwaddtime = ''

Loading…
Cancel
Save