|
|
@ -60,6 +60,7 @@ export class CombinedQueryComponent implements OnInit { |
|
|
|
allunittype: any //所有单位类型
|
|
|
|
allunittype: any //所有单位类型
|
|
|
|
tabledataSource=[] //单位表格数据
|
|
|
|
tabledataSource=[] //单位表格数据
|
|
|
|
yuanTable=[]//预案表格数据
|
|
|
|
yuanTable=[]//预案表格数据
|
|
|
|
|
|
|
|
excelData:any |
|
|
|
url |
|
|
|
url |
|
|
|
findTj=0//查询条件
|
|
|
|
findTj=0//查询条件
|
|
|
|
|
|
|
|
|
|
|
@ -88,15 +89,16 @@ export class CombinedQueryComponent implements OnInit { |
|
|
|
selectedIndexChange(e){ |
|
|
|
selectedIndexChange(e){ |
|
|
|
this.selected.setValue(e) |
|
|
|
this.selected.setValue(e) |
|
|
|
this.preparelevels=Number(e) |
|
|
|
this.preparelevels=Number(e) |
|
|
|
|
|
|
|
this.getAllPlanInfo() |
|
|
|
} |
|
|
|
} |
|
|
|
//获得所有预案或单位信息
|
|
|
|
//获得所有预案或单位信息
|
|
|
|
getAllPlanInfo() { |
|
|
|
async getAllPlanInfo() { |
|
|
|
let paramsdata:any={ |
|
|
|
let paramsdata:any={ |
|
|
|
QueryMode:this.preparelevels, |
|
|
|
QueryMode:this.preparelevels, |
|
|
|
OrganizationId:this.jsId||'', |
|
|
|
OrganizationId:this.jsId||'', |
|
|
|
HasChildren:this.jscheck||'', |
|
|
|
HasChildren:this.jscheck||'', |
|
|
|
TimeIntervalStart:this.addtime||'', |
|
|
|
TimeIntervalStart:this.dwaddtime||'', |
|
|
|
TimeIntervalEnd:this.endtime||'', |
|
|
|
TimeIntervalEnd:this.dwendtime||'', |
|
|
|
BuildingTypeIds:this.unittype||'', |
|
|
|
BuildingTypeIds:this.unittype||'', |
|
|
|
CompanyStatus:this.preparelevel||'' |
|
|
|
CompanyStatus:this.preparelevel||'' |
|
|
|
} |
|
|
|
} |
|
|
@ -104,15 +106,17 @@ export class CombinedQueryComponent implements OnInit { |
|
|
|
QueryMode:this.preparelevels, |
|
|
|
QueryMode:this.preparelevels, |
|
|
|
OrganizationId:this.jsId||'', |
|
|
|
OrganizationId:this.jsId||'', |
|
|
|
HasChildren:this.jscheck||'', |
|
|
|
HasChildren:this.jscheck||'', |
|
|
|
TimeIntervalStart:this.addtime||'', |
|
|
|
TimeIntervalStart:this.yuanaddtime||'', |
|
|
|
TimeIntervalEnd:this.endtime||'', |
|
|
|
TimeIntervalEnd:this.yuanendtime||'', |
|
|
|
PlanCategory:this.planCategory||'', |
|
|
|
PlanCategory:this.planCategory||'', |
|
|
|
PlanType:this.reservePlanType||'' |
|
|
|
PlanType:this.reservePlanType||'' |
|
|
|
} |
|
|
|
} |
|
|
|
this.http.get("/api/StatisticsAnalysis/ReportTable", { params:this.preparelevels==0? paramsdata:yuandata }).subscribe((data: any) => { |
|
|
|
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) |
|
|
|
//this.tabledataSource=data
|
|
|
|
//this.tabledataSource=data
|
|
|
|
if(this.preparelevels==0){ |
|
|
|
if(this.preparelevels==0){ |
|
|
|
|
|
|
|
//单位查询
|
|
|
|
this.tabledataSource=[] |
|
|
|
this.tabledataSource=[] |
|
|
|
this.displayedColumns=['组织名称', '总数'] |
|
|
|
this.displayedColumns=['组织名称', '总数'] |
|
|
|
data.forEach((element,i,value) => { |
|
|
|
data.forEach((element,i,value) => { |
|
|
@ -120,7 +124,7 @@ export class CombinedQueryComponent implements OnInit { |
|
|
|
if(value[0].companyStatistics.buildingTypesCounts.length>0){ |
|
|
|
if(value[0].companyStatistics.buildingTypesCounts.length>0){ |
|
|
|
value[i].companyStatistics.buildingTypesCounts.forEach((build,bi,bvalue) => { |
|
|
|
value[i].companyStatistics.buildingTypesCounts.forEach((build,bi,bvalue) => { |
|
|
|
if(i==0){ |
|
|
|
if(i==0){ |
|
|
|
this.displayedColumns.push(value[0].companyStatistics.buildingTypesCounts[bi].buildingTypeName||'111') |
|
|
|
this.displayedColumns.push(value[0].companyStatistics.buildingTypesCounts[bi].buildingTypeName) |
|
|
|
this.tabledataSource[0].name.push(value[0].companyStatistics.buildingTypesCounts[bi].count) |
|
|
|
this.tabledataSource[0].name.push(value[0].companyStatistics.buildingTypesCounts[bi].count) |
|
|
|
}else{ |
|
|
|
}else{ |
|
|
|
this.tabledataSource[i].name.push(bvalue[bi].count) |
|
|
|
this.tabledataSource[i].name.push(bvalue[bi].count) |
|
|
@ -134,6 +138,7 @@ export class CombinedQueryComponent implements OnInit { |
|
|
|
}); |
|
|
|
}); |
|
|
|
} |
|
|
|
} |
|
|
|
else if(this.preparelevels==1){ |
|
|
|
else if(this.preparelevels==1){ |
|
|
|
|
|
|
|
//预案查询
|
|
|
|
this.yuanColumns=['组织名称', '总数'] |
|
|
|
this.yuanColumns=['组织名称', '总数'] |
|
|
|
this.yuanTable=[{name:[0,0]}] |
|
|
|
this.yuanTable=[{name:[0,0]}] |
|
|
|
//console.log(this.planCategory,this.reservePlanType)
|
|
|
|
//console.log(this.planCategory,this.reservePlanType)
|
|
|
@ -158,25 +163,60 @@ export class CombinedQueryComponent implements OnInit { |
|
|
|
}else if(this.planCategory.length!=0&&this.reservePlanType.length==0){ |
|
|
|
}else if(this.planCategory.length!=0&&this.reservePlanType.length==0){ |
|
|
|
this.yuanColumns.push('文本预案','二维预案','三维预案','其他预案') |
|
|
|
this.yuanColumns.push('文本预案','二维预案','三维预案','其他预案') |
|
|
|
this.yuanTable[0].name.push(0,0,0,0) |
|
|
|
this.yuanTable[0].name.push(0,0,0,0) |
|
|
|
}this.planCategory.forEach(element=>{ |
|
|
|
this.planCategory.forEach(element=>{ |
|
|
|
if(element==1){ |
|
|
|
if(element==1){ |
|
|
|
this.yuanColumns.push('Ⅰ级预案') |
|
|
|
this.yuanColumns.push('Ⅰ级预案') |
|
|
|
this.yuanTable[0].name.push(0) |
|
|
|
this.yuanTable[0].name.push(0) |
|
|
|
}else if(element==2){ |
|
|
|
}else if(element==2){ |
|
|
|
this.yuanColumns.push('Ⅱ级预案') |
|
|
|
this.yuanColumns.push('Ⅱ级预案') |
|
|
|
this.yuanTable[0].name.push(0) |
|
|
|
this.yuanTable[0].name.push(0) |
|
|
|
}else if(element==3){ |
|
|
|
}else if(element==3){ |
|
|
|
this.yuanColumns.push('Ⅲ级预案') |
|
|
|
this.yuanColumns.push('Ⅲ级预案') |
|
|
|
this.yuanTable[0].name.push(0) |
|
|
|
this.yuanTable[0].name.push(0) |
|
|
|
}else if(element==4){ |
|
|
|
}else if(element==4){ |
|
|
|
this.yuanColumns.push('Ⅳ级预案') |
|
|
|
this.yuanColumns.push('Ⅳ级预案') |
|
|
|
this.yuanTable[0].name.push(0) |
|
|
|
this.yuanTable[0].name.push(0) |
|
|
|
}else if(element==5){ |
|
|
|
}else if(element==5){ |
|
|
|
this.yuanColumns.push('Ⅴ级预案') |
|
|
|
this.yuanColumns.push('Ⅴ级预案') |
|
|
|
this.yuanTable[0].name.push(0) |
|
|
|
this.yuanTable[0].name.push(0) |
|
|
|
} |
|
|
|
} |
|
|
|
}) |
|
|
|
}) |
|
|
|
console.log(this.yuanTable) |
|
|
|
}else if(this.planCategory.length!=0&&this.reservePlanType.length!=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) |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
}) |
|
|
|
|
|
|
|
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) => { |
|
|
|
data.forEach((element,i,value) => { |
|
|
|
if(i==0){ |
|
|
|
if(i==0){ |
|
|
|
this.yuanTable[0].name[0]=value[0].orgName |
|
|
|
this.yuanTable[0].name[0]=value[0].orgName |
|
|
@ -184,28 +224,6 @@ export class CombinedQueryComponent implements OnInit { |
|
|
|
}else{ |
|
|
|
}else{ |
|
|
|
this.yuanTable.push({name:[value[i].orgName,value[i].planStatistics.totalCount]}) |
|
|
|
this.yuanTable.push({name:[value[i].orgName,value[i].planStatistics.totalCount]}) |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
/* if(value[0].planStatistics.planCategoryStatistics.planCategories.length>0){ |
|
|
|
|
|
|
|
value[i].planStatistics.planCategoryStatistics.planCategories.forEach((build,bi,bvalue) => { |
|
|
|
|
|
|
|
if(i==0){ |
|
|
|
|
|
|
|
this.yuanColumns.push(value[0].planStatistics.planCategoryStatistics.planCategories[bi].planCategoryName) |
|
|
|
|
|
|
|
this.yuanTable[0].name.push(value[0].planStatistics.planCategoryStatistics.planCategories[bi].count) |
|
|
|
|
|
|
|
}else{ |
|
|
|
|
|
|
|
this.yuanTable[i].name.push(bvalue[bi].count) |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
}); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
} */ |
|
|
|
|
|
|
|
/* if(value[0].planStatistics.planTypeStatistics.length>0){ |
|
|
|
|
|
|
|
value[i].planStatistics.planTypeStatistics.forEach((build,bi,bvalue) => { |
|
|
|
|
|
|
|
if(i==0){ |
|
|
|
|
|
|
|
this.yuanColumns.push(value[0].planStatistics.planTypeStatistics[bi].planCategoryName) |
|
|
|
|
|
|
|
this.yuanTable[0].name.push(value[0].planStatistics.planCategoryStatistics[bi].count) |
|
|
|
|
|
|
|
}else{ |
|
|
|
|
|
|
|
this.yuanTable[i].name.push(bvalue[bi].count) |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
}); |
|
|
|
|
|
|
|
} */ |
|
|
|
|
|
|
|
}); |
|
|
|
}); |
|
|
|
this.yuanTable.forEach((element,i,value)=>{ |
|
|
|
this.yuanTable.forEach((element,i,value)=>{ |
|
|
|
if(i>0){ |
|
|
|
if(i>0){ |
|
|
@ -214,14 +232,34 @@ export class CombinedQueryComponent implements OnInit { |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
}) |
|
|
|
}) |
|
|
|
this.yuanTable.forEach((element,index,value)=>{ |
|
|
|
this.yuanTable.forEach((yuan,yuani,yuanval)=>{ |
|
|
|
|
|
|
|
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(thvalu[thi].indexOf(lxval[lxi].planTypeName)!=-1&&yuani==i){ |
|
|
|
|
|
|
|
yuanval[yuani].name[thi]=lxval[lxi].count |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
}); |
|
|
|
|
|
|
|
}); |
|
|
|
|
|
|
|
}) |
|
|
|
|
|
|
|
|
|
|
|
}) |
|
|
|
}) |
|
|
|
} |
|
|
|
} |
|
|
|
console.log(this.yuanColumns) |
|
|
|
console.log(this.yuanColumns) |
|
|
|
console.log(this.yuanTable) |
|
|
|
console.log(this.yuanTable) |
|
|
|
|
|
|
|
this.excelData=data |
|
|
|
|
|
|
|
resolve(this.excelData) |
|
|
|
} |
|
|
|
} |
|
|
|
) |
|
|
|
) |
|
|
|
|
|
|
|
}) |
|
|
|
|
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
colorRgb(sColor) { |
|
|
|
colorRgb(sColor) { |
|
|
@ -350,8 +388,10 @@ export class CombinedQueryComponent implements OnInit { |
|
|
|
} |
|
|
|
} |
|
|
|
) |
|
|
|
) |
|
|
|
} |
|
|
|
} |
|
|
|
addtime//开始时间
|
|
|
|
dwaddtime//单位查询开始时间
|
|
|
|
endtime//结束时间
|
|
|
|
dwendtime//单位结束时间
|
|
|
|
|
|
|
|
yuanaddtime//预案查询开始时间
|
|
|
|
|
|
|
|
yuanendtime//预案查询结束时间
|
|
|
|
integrityScoreMin//完整度最小值
|
|
|
|
integrityScoreMin//完整度最小值
|
|
|
|
integrityScoreMax//完整度最大值
|
|
|
|
integrityScoreMax//完整度最大值
|
|
|
|
organizationName: any //当前单位组织机构名称
|
|
|
|
organizationName: any //当前单位组织机构名称
|
|
|
@ -409,8 +449,14 @@ export class CombinedQueryComponent implements OnInit { |
|
|
|
//点击辖区中队树,将选择的辖区中队添加到变量
|
|
|
|
//点击辖区中队树,将选择的辖区中队添加到变量
|
|
|
|
add(node) { |
|
|
|
add(node) { |
|
|
|
this.isorganizationbox = false |
|
|
|
this.isorganizationbox = false |
|
|
|
this.js = node.name |
|
|
|
if(this.preparelevels==0){ |
|
|
|
this.jsId = node.id |
|
|
|
this.js = node.name |
|
|
|
|
|
|
|
this.jsId = node.id |
|
|
|
|
|
|
|
}else if(this.preparelevels==1){ |
|
|
|
|
|
|
|
this.yuanjs=node.name |
|
|
|
|
|
|
|
this.yuanjsId=node.id |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
//关闭辖区中队隐藏框
|
|
|
|
//关闭辖区中队隐藏框
|
|
|
|
closeorganizationbox() { |
|
|
|
closeorganizationbox() { |
|
|
@ -429,15 +475,18 @@ export class CombinedQueryComponent implements OnInit { |
|
|
|
let config = new MatSnackBarConfig(); |
|
|
|
let config = new MatSnackBarConfig(); |
|
|
|
config.verticalPosition = 'top'; |
|
|
|
config.verticalPosition = 'top'; |
|
|
|
config.duration = 3000 |
|
|
|
config.duration = 3000 |
|
|
|
if(this,this.endtime<this.addtime){ |
|
|
|
if(this.dwendtime<this.dwaddtime||this.yuanaddtime<this.yuanendtime){ |
|
|
|
this.snackBar.open('开始时间不能早于结束时间', '确定', config); |
|
|
|
this.snackBar.open('开始时间不能早于结束时间', '确定', config); |
|
|
|
} |
|
|
|
} |
|
|
|
this.getAllPlanInfo(); |
|
|
|
this.getAllPlanInfo(); |
|
|
|
} |
|
|
|
} |
|
|
|
companyName: any //单位名称
|
|
|
|
companyName: any //单位名称
|
|
|
|
js: any //所选组织机构
|
|
|
|
js: any //单位所选组织机构
|
|
|
|
jsId: any //所选组织机构的id
|
|
|
|
jsId: any //单位所选组织机构的id
|
|
|
|
jscheck: boolean //所选组织机构勾选框
|
|
|
|
jscheck: boolean //单位所选组织机构勾选框
|
|
|
|
|
|
|
|
yuanjs: any //预案所选组织机构
|
|
|
|
|
|
|
|
yuanjsId: any //预案所选组织机构的id
|
|
|
|
|
|
|
|
yuanjscheck: boolean //预案所选组织机构勾选框
|
|
|
|
unittype: any //单位类型
|
|
|
|
unittype: any //单位类型
|
|
|
|
reservePlanType=[] //预案类型
|
|
|
|
reservePlanType=[] //预案类型
|
|
|
|
preparelevel: any //编制级别
|
|
|
|
preparelevel: any //编制级别
|
|
|
@ -445,18 +494,26 @@ export class CombinedQueryComponent implements OnInit { |
|
|
|
planCategory = []//预案级别
|
|
|
|
planCategory = []//预案级别
|
|
|
|
//重置
|
|
|
|
//重置
|
|
|
|
reset() { |
|
|
|
reset() { |
|
|
|
this.companyName = '' |
|
|
|
if(this.preparelevels==0){ |
|
|
|
this.js = '' |
|
|
|
this.js = '' |
|
|
|
this.jsId = '' |
|
|
|
this.jsId = '' |
|
|
|
this.jscheck = false |
|
|
|
this.jscheck = false |
|
|
|
this.unittype = '' |
|
|
|
this.unittype = '' |
|
|
|
this.reservePlanType = [] |
|
|
|
|
|
|
|
this.preparelevel = '' |
|
|
|
this.preparelevel = '' |
|
|
|
this.addtime = '' |
|
|
|
this.dwaddtime = '' |
|
|
|
this.endtime = '' |
|
|
|
this.dwendtime = '' |
|
|
|
this.plcheck = false |
|
|
|
}else if(this.preparelevels==1){ |
|
|
|
|
|
|
|
this.yuanaddtime='' |
|
|
|
|
|
|
|
this.yuanendtime='' |
|
|
|
|
|
|
|
this.yuanjs='' |
|
|
|
|
|
|
|
this.yuanjsId='' |
|
|
|
|
|
|
|
this.yuanjscheck=false |
|
|
|
|
|
|
|
this.reservePlanType = [] |
|
|
|
|
|
|
|
this.planCategory = [] |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
//重新获取初始化列表
|
|
|
|
//重新获取初始化列表
|
|
|
|
this.planCategory = [] |
|
|
|
|
|
|
|
this.getAllPlanInfo(); |
|
|
|
this.getAllPlanInfo(); |
|
|
|
} |
|
|
|
} |
|
|
|
//导出
|
|
|
|
//导出
|
|
|
@ -506,12 +563,14 @@ export class CombinedQueryComponent implements OnInit { |
|
|
|
const httpOptions = { |
|
|
|
const httpOptions = { |
|
|
|
responseType: 'blob' as 'json' |
|
|
|
responseType: 'blob' as 'json' |
|
|
|
}; |
|
|
|
}; |
|
|
|
this.http.get('/api/StatisticsAnalysis/ExportToExcel',httpOptions).subscribe((data:any) => { |
|
|
|
let formData = new FormData() |
|
|
|
|
|
|
|
console.log('000') |
|
|
|
|
|
|
|
this.http.post(`/api/StatisticsAnalysis/Excel?queryMode=${this.preparelevels}`,this.excelData).subscribe((data:any) => { |
|
|
|
// // 文件名中有中文 则对文件名进行转码
|
|
|
|
// // 文件名中有中文 则对文件名进行转码
|
|
|
|
const link = document.createElement('a'); |
|
|
|
const link = document.createElement('a'); |
|
|
|
const blob = new Blob([data], {type: 'application/vnd.ms-excel'}); |
|
|
|
const blob = new Blob([data], {type: 'application/vnd.ms-excel'}); |
|
|
|
link.setAttribute('href', window.URL.createObjectURL(blob)); |
|
|
|
link.setAttribute('href', window.URL.createObjectURL(blob)); |
|
|
|
link.setAttribute('download', '报表统计'+'.xls'); |
|
|
|
link.setAttribute('download', '统计信息'+'.xlsx'); |
|
|
|
link.style.visibility = 'hidden'; |
|
|
|
link.style.visibility = 'hidden'; |
|
|
|
document.body.appendChild(link); |
|
|
|
document.body.appendChild(link); |
|
|
|
link.click(); |
|
|
|
link.click(); |
|
|
|