|
|
|
@ -10,6 +10,7 @@ import { MatDialogRef, MatDialog, MAT_DIALOG_DATA } from '@angular/material/dial
|
|
|
|
|
import { MatSnackBar, MatSnackBarConfig } from '@angular/material/snack-bar'; |
|
|
|
|
import { TreeService } from '../../http-interceptors/tree.service' |
|
|
|
|
import { Viewer } from 'photo-sphere-viewer'; |
|
|
|
|
import { timeStamp } from 'console'; |
|
|
|
|
|
|
|
|
|
@Component({ |
|
|
|
|
selector: 'app-combined-query', |
|
|
|
@ -94,6 +95,8 @@ export class CombinedQueryComponent implements OnInit {
|
|
|
|
|
//获得所有预案或单位信息
|
|
|
|
|
tableDataNull=false |
|
|
|
|
async getAllPlanInfo() { |
|
|
|
|
/* this.planCategory=new Array<number>(); |
|
|
|
|
this.reservePlanType=new Array<number>(); */ |
|
|
|
|
let paramsdata:any={ |
|
|
|
|
QueryMode:this.preparelevels, |
|
|
|
|
OrganizationId:this.jsId||'', |
|
|
|
@ -101,31 +104,42 @@ export class CombinedQueryComponent implements OnInit {
|
|
|
|
|
TimeIntervalStart:this.dwaddtime||'', |
|
|
|
|
TimeIntervalEnd:this.dwendtime||'', |
|
|
|
|
BuildingTypeIds:this.unittype||[], |
|
|
|
|
CompanyStatus:this.preparelevel||'' |
|
|
|
|
CompanyStatus:this.preparelevel||[], |
|
|
|
|
SortBy:'totalCount', |
|
|
|
|
SortType:this.integritySort |
|
|
|
|
} |
|
|
|
|
let yuandata={ |
|
|
|
|
QueryMode:this.preparelevels, |
|
|
|
|
OrganizationId:this.jsId||'', |
|
|
|
|
OrganizationId:this.yuanjsId||'', |
|
|
|
|
HasChildren:this.yuanjscheck||'', |
|
|
|
|
TimeIntervalStart:this.yuanaddtime||'', |
|
|
|
|
TimeIntervalEnd:this.yuanendtime||'', |
|
|
|
|
PlanCategory:this.planCategory||[], |
|
|
|
|
PlanType:this.reservePlanType||[] |
|
|
|
|
PlanCategories:this.planCategory||[], |
|
|
|
|
PlanTypes:this.reservePlanType||[], |
|
|
|
|
SortBy:'totalCount', |
|
|
|
|
SortType:this.yuanintegritySort |
|
|
|
|
} |
|
|
|
|
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)
|
|
|
|
|
console.log(data) |
|
|
|
|
if(data.length==0){ |
|
|
|
|
this.tableDataNull=true |
|
|
|
|
}else{ |
|
|
|
|
this.tableDataNull=false |
|
|
|
|
if(this.preparelevels==0){ |
|
|
|
|
//单位查询
|
|
|
|
|
if(this.preparelevel.length==0){ |
|
|
|
|
//必须选择单位状态
|
|
|
|
|
let config = new MatSnackBarConfig(); |
|
|
|
|
config.verticalPosition = 'top'; |
|
|
|
|
config.duration = 3000 |
|
|
|
|
this.snackBar.open('请选择单位状态', '确定', config); |
|
|
|
|
}else{ |
|
|
|
|
this.tabledataSource=[] |
|
|
|
|
this.displayedColumns=['组织名称', '总数'] |
|
|
|
|
data.forEach((element,i,value) => { |
|
|
|
|
this.tabledataSource.push({name:[element.orgName,element.companyStatistics.totalCount]}) |
|
|
|
|
if(value[0].companyStatistics.buildingTypesCounts.length>0){ |
|
|
|
|
if(value[0].companyStatistics.buildingTypesCounts!=null){ |
|
|
|
|
value[i].companyStatistics.buildingTypesCounts.forEach((build,bi,bvalue) => { |
|
|
|
|
if(i==0){ |
|
|
|
|
this.displayedColumns.push(value[0].companyStatistics.buildingTypesCounts[bi].buildingTypeName) |
|
|
|
@ -140,52 +154,30 @@ export class CombinedQueryComponent implements OnInit {
|
|
|
|
|
|
|
|
|
|
} |
|
|
|
|
}); |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
else if(this.preparelevels==1){ |
|
|
|
|
//预案查询
|
|
|
|
|
this.yuanColumns=['组织名称', '总数'] |
|
|
|
|
this.yuanTable=[{name:[0,0]}] |
|
|
|
|
//console.log(this.planCategory,this.reservePlanType)
|
|
|
|
|
if(this.planCategory.length==0&&this.reservePlanType.length!=0){ |
|
|
|
|
this.yuanColumns.push('Ⅰ级预案','Ⅱ级预案','Ⅲ级预案','Ⅳ级预案','Ⅴ级预案') |
|
|
|
|
this.yuanTable[0].name.push(0,0,0,0,0) |
|
|
|
|
if(this.reservePlanType.length!=0){ |
|
|
|
|
this.reservePlanType.forEach(element => { |
|
|
|
|
if(element==1){ |
|
|
|
|
this.yuanColumns.push('二维预案') |
|
|
|
|
this.yuanColumns.push('二维') |
|
|
|
|
this.yuanTable[0].name.push(0) |
|
|
|
|
}else if(element==2){ |
|
|
|
|
this.yuanColumns.push('三维预案') |
|
|
|
|
this.yuanColumns.push('三维') |
|
|
|
|
this.yuanTable[0].name.push(0) |
|
|
|
|
}else if(element==4){ |
|
|
|
|
this.yuanColumns.push('其他预案') |
|
|
|
|
this.yuanColumns.push('其他') |
|
|
|
|
this.yuanTable[0].name.push(0) |
|
|
|
|
}else if(element==16){ |
|
|
|
|
this.yuanColumns.push('文本预案') |
|
|
|
|
this.yuanColumns.push('文本') |
|
|
|
|
this.yuanTable[0].name.push(0) |
|
|
|
|
} |
|
|
|
|
}); |
|
|
|
|
}else if(this.planCategory.length!=0&&this.reservePlanType.length==0){ |
|
|
|
|
this.yuanColumns.push('文本预案','二维预案','三维预案','其他预案') |
|
|
|
|
this.yuanTable[0].name.push(0,0,0,0) |
|
|
|
|
this.planCategory.forEach(element=>{ |
|
|
|
|
if(element==1){ |
|
|
|
|
this.yuanColumns.push('Ⅰ级预案') |
|
|
|
|
this.yuanTable[0].name.push(0) |
|
|
|
|
}else if(element==2){ |
|
|
|
|
this.yuanColumns.push('Ⅱ级预案') |
|
|
|
|
this.yuanTable[0].name.push(0) |
|
|
|
|
}else if(element==3){ |
|
|
|
|
this.yuanColumns.push('Ⅲ级预案') |
|
|
|
|
this.yuanTable[0].name.push(0) |
|
|
|
|
}else if(element==4){ |
|
|
|
|
this.yuanColumns.push('Ⅳ级预案') |
|
|
|
|
this.yuanTable[0].name.push(0) |
|
|
|
|
}else if(element==5){ |
|
|
|
|
this.yuanColumns.push('Ⅴ级预案') |
|
|
|
|
this.yuanTable[0].name.push(0) |
|
|
|
|
} |
|
|
|
|
}) |
|
|
|
|
}else if(this.planCategory.length!=0&&this.reservePlanType.length!=0){ |
|
|
|
|
} |
|
|
|
|
if(this.planCategory.length!=0){ |
|
|
|
|
this.planCategory.forEach(element=>{ |
|
|
|
|
if(element==1){ |
|
|
|
|
this.yuanColumns.push('Ⅰ级预案') |
|
|
|
@ -204,23 +196,8 @@ export class CombinedQueryComponent implements OnInit {
|
|
|
|
|
this.yuanTable[0].name.push(0) |
|
|
|
|
} |
|
|
|
|
}) |
|
|
|
|
this.reservePlanType.forEach(element => { |
|
|
|
|
if(element==1){ |
|
|
|
|
this.yuanColumns.push('二维预案') |
|
|
|
|
this.yuanTable[0].name.push(0) |
|
|
|
|
}else if(element==2){ |
|
|
|
|
this.yuanColumns.push('三维预案') |
|
|
|
|
this.yuanTable[0].name.push(0) |
|
|
|
|
}else if(element==4){ |
|
|
|
|
this.yuanColumns.push('其他预案') |
|
|
|
|
this.yuanTable[0].name.push(0) |
|
|
|
|
}else if(element==16){ |
|
|
|
|
this.yuanColumns.push('文本预案') |
|
|
|
|
this.yuanTable[0].name.push(0) |
|
|
|
|
} |
|
|
|
|
}); |
|
|
|
|
} |
|
|
|
|
//console.log(this.yuanTable)
|
|
|
|
|
|
|
|
|
|
data.forEach((element,i,value) => { |
|
|
|
|
if(i==0){ |
|
|
|
|
this.yuanTable[0].name[0]=value[0].orgName |
|
|
|
@ -240,17 +217,22 @@ export class CombinedQueryComponent implements OnInit {
|
|
|
|
|
this.yuanColumns.forEach((th,thi,thvalu)=>{ |
|
|
|
|
data.forEach((element,i,value) => { |
|
|
|
|
//预案级别数据
|
|
|
|
|
value[i].planStatistics.planCategoryStatistics.planCategories.forEach((jibie,ji,jval) => { |
|
|
|
|
if(thvalu[thi].indexOf(jval[ji].planCategoryName)!=-1&&yuani==i){ |
|
|
|
|
yuanval[yuani].name[thi]=jval[ji].count |
|
|
|
|
} |
|
|
|
|
}); |
|
|
|
|
//预案类型数据
|
|
|
|
|
value[i].planStatistics.planTypeStatistics.planTypes.forEach((planlx,lxi,lxval) => { |
|
|
|
|
if(value[i].planStatistics.planCategoryStatistics!=null){ |
|
|
|
|
value[i].planStatistics.planCategoryStatistics.planCategories.forEach((jibie,ji,jval) => { |
|
|
|
|
if(thvalu[thi].indexOf(jval[ji].planCategoryName)!=-1&&yuani==i){ |
|
|
|
|
yuanval[yuani].name[thi]=jval[ji].count |
|
|
|
|
} |
|
|
|
|
}); |
|
|
|
|
} |
|
|
|
|
if(value[i].planStatistics.planTypeStatistics!=null){ |
|
|
|
|
//预案类型数据
|
|
|
|
|
value[i].planStatistics.planTypeStatistics.planTypes.forEach((planlx,lxi,lxval) => { |
|
|
|
|
if(thvalu[thi].indexOf(lxval[lxi].planTypeName)!=-1&&yuani==i){ |
|
|
|
|
yuanval[yuani].name[thi]=lxval[lxi].count |
|
|
|
|
} |
|
|
|
|
}); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
}); |
|
|
|
|
}) |
|
|
|
|
|
|
|
|
@ -259,8 +241,8 @@ export class CombinedQueryComponent implements OnInit {
|
|
|
|
|
} |
|
|
|
|
//this.tabledataSource=data
|
|
|
|
|
|
|
|
|
|
//console.log(this.yuanColumns)
|
|
|
|
|
//console.log(this.yuanTable)
|
|
|
|
|
console.log(this.yuanColumns) |
|
|
|
|
console.log(this.yuanTable) |
|
|
|
|
this.excelData=data |
|
|
|
|
resolve(this.excelData) |
|
|
|
|
} |
|
|
|
@ -482,7 +464,7 @@ export class CombinedQueryComponent implements OnInit {
|
|
|
|
|
let config = new MatSnackBarConfig(); |
|
|
|
|
config.verticalPosition = 'top'; |
|
|
|
|
config.duration = 3000 |
|
|
|
|
if(this.dwendtime<this.dwaddtime||this.yuanaddtime<this.yuanendtime){ |
|
|
|
|
if(this.dwendtime<this.dwaddtime||this.yuanaddtime>this.yuanendtime){ |
|
|
|
|
this.snackBar.open('开始时间不能早于结束时间', '确定', config); |
|
|
|
|
} |
|
|
|
|
this.getAllPlanInfo(); |
|
|
|
@ -496,9 +478,11 @@ export class CombinedQueryComponent implements OnInit {
|
|
|
|
|
yuanjscheck: boolean //预案所选组织机构勾选框
|
|
|
|
|
unittype=[] //单位类型
|
|
|
|
|
reservePlanType=[] //预案类型
|
|
|
|
|
preparelevel: any //编制级别
|
|
|
|
|
preparelevel=[1] //单位状态
|
|
|
|
|
plcheck: boolean //编制级别勾选框
|
|
|
|
|
planCategory = []//预案级别
|
|
|
|
|
planCategory=[] //预案级别
|
|
|
|
|
integritySort=1 //单位排序字段
|
|
|
|
|
yuanintegritySort=1 //预案排序字段
|
|
|
|
|
//重置
|
|
|
|
|
reset() { |
|
|
|
|
if(this.preparelevels==0){ |
|
|
|
@ -506,8 +490,7 @@ export class CombinedQueryComponent implements OnInit {
|
|
|
|
|
this.jsId = '' |
|
|
|
|
this.jscheck = false |
|
|
|
|
this.unittype = [] |
|
|
|
|
|
|
|
|
|
this.preparelevel = '' |
|
|
|
|
this.preparelevel = [0] |
|
|
|
|
this.dwaddtime = '' |
|
|
|
|
this.dwendtime = '' |
|
|
|
|
}else if(this.preparelevels==1){ |
|
|
|
@ -523,11 +506,6 @@ export class CombinedQueryComponent implements OnInit {
|
|
|
|
|
//重新获取初始化列表
|
|
|
|
|
this.getAllPlanInfo(); |
|
|
|
|
} |
|
|
|
|
//导出
|
|
|
|
|
tableToexcel(){ |
|
|
|
|
this.exal()(document.getElementById("table"), "导出表格") |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
exal(){ |
|
|
|
|
var uri = 'data:application/vnd.ms-excel;base64,', |
|
|
|
|
|
|
|
|
@ -575,7 +553,7 @@ export class CombinedQueryComponent implements OnInit {
|
|
|
|
|
const link = document.createElement('a'); |
|
|
|
|
const blob = new Blob([data], {type: 'application/vnd.ms-excel'}); |
|
|
|
|
link.setAttribute('href', window.URL.createObjectURL(blob)); |
|
|
|
|
link.setAttribute('download', '统计信息'+'.xls'); |
|
|
|
|
link.setAttribute('download', '报表统计'+'.xls'); |
|
|
|
|
link.style.visibility = 'hidden'; |
|
|
|
|
document.body.appendChild(link); |
|
|
|
|
link.click(); |
|
|
|
|