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() { getAlltabledate() {
let paramsdata: any = { let paramsdata: any = {
Operation: this.level || [], Operation: this.level || [],
ContentType: Number(this.projectlevel) || [], 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 bianzhi = false
radioClick(e, item) { radioClick(e, item) {
this.selectedItem = item this.selectedItem = item
console.log(item) //console.log(item)
// console.log('当前选择的信息',JSON.parse(this.selectedItem.differentContent) ) // console.log('当前选择的信息',JSON.parse(this.selectedItem.differentContent) )
if (item.contentType == 11 && this.selectedItem.differentContent) { if (item.contentType == 11 && this.selectedItem.differentContent) {
let differentContent = JSON.parse(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 => { this.differentContentOfBuildingsInfo.childrens.forEach(element => {
element.difData = resolveDiff(element.childrens) 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])) let differentContentOfFunction = JSON.parse(JSON.stringify(differentContent.filter(item => item.propertyName == 'buildings')[0]))
this.differentContentOfFunction = [] this.differentContentOfFunction = []
@ -296,7 +296,7 @@ export class WaitExamineerComponent implements OnInit {
}) })
} else { } else {
this.http.get(`/api/PlanComponents/${item.itemId}`).subscribe((data: any) => { this.http.get(`/api/PlanComponents/${item.itemId}`).subscribe((data: any) => {
console.log('预案信息',data) //console.log('预案信息',data)
this.companyId = data.companyId this.companyId = data.companyId
this.companyName = data.companyName this.companyName = data.companyName
if (data.planType != 2 && data.planType != 1) { 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> <mat-divider></mat-divider>
<div class="body"> <div class="body">
<div class="tablebox" id="table"> <div class="tablebox" id="table">
<!-- <table mat-table [dataSource]="tabledataSource" class="mat-elevation-z8" id="table"> <table cellpadding="0" cellspacing="0" *ngIf="preparelevels==0&&!tableDataNull">
<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">
<thead> <thead>
<th *ngFor="let item of displayedColumns;let i=index">{{item}}</th> <th *ngFor="let item of displayedColumns;let i=index">{{item}}</th>
</thead> </thead>
@ -125,7 +117,7 @@
</tr> </tr>
</tbody> </tbody>
</table> </table>
<table cellpadding="0" cellspacing="0" *ngIf="preparelevels==1"> <table cellpadding="0" cellspacing="0" *ngIf="preparelevels==1&&!tableDataNull">
<thead> <thead>
<th *ngFor="let item of yuanColumns;let i=index">{{item}}</th> <th *ngFor="let item of yuanColumns;let i=index">{{item}}</th>
</thead> </thead>
@ -135,7 +127,7 @@
</tr> </tr>
</tbody> </tbody>
</table> </table>
<span *ngIf="tableDataNull">暂无数据</span>
</div> </div>
</div> </div>
</ng-template> </ng-template>

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

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

Loading…
Cancel
Save