|
|
|
@ -12,7 +12,7 @@ import { MatTreeFlatDataSource, MatTreeFlattener } from '@angular/material/tree'
|
|
|
|
|
import { MatPaginator } from '@angular/material/paginator'; |
|
|
|
|
import { FlatTreeControl } from '@angular/cdk/tree'; |
|
|
|
|
import { FormControl } from '@angular/forms'; |
|
|
|
|
import { Router,ActivatedRoute } from '@angular/router' |
|
|
|
|
import { Router, ActivatedRoute } from '@angular/router' |
|
|
|
|
import { PageEvent } from '@angular/material/paginator'; |
|
|
|
|
import { MatDialogRef, MatDialog, MAT_DIALOG_DATA } from '@angular/material/dialog'; |
|
|
|
|
import { MatSnackBar, MatSnackBarConfig } from '@angular/material/snack-bar'; |
|
|
|
@ -27,19 +27,19 @@ import { MatTableDataSource } from '@angular/material/table';
|
|
|
|
|
}) |
|
|
|
|
export class ExaminerNewOneComponent implements OnInit { |
|
|
|
|
|
|
|
|
|
constructor(private http:HttpClient,private router:Router,private route:ActivatedRoute,private tree: TreeService,public dialog: MatDialog,public snackBar: MatSnackBar) { } |
|
|
|
|
constructor(private http: HttpClient, private router: Router, private route: ActivatedRoute, private tree: TreeService, public dialog: MatDialog, public snackBar: MatSnackBar) { } |
|
|
|
|
|
|
|
|
|
ngOnInit(): void { |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
this.getunitdata(); |
|
|
|
|
this.getOrganizations(); |
|
|
|
|
this.getUnittype(); |
|
|
|
|
this.getAllKeyUnit(); |
|
|
|
|
} |
|
|
|
|
pattern:any = this.route.snapshot.queryParams.pattern || '' |
|
|
|
|
indexid=sessionStorage.getItem("paperId") //上个页面传过来的id
|
|
|
|
|
pattern: any = this.route.snapshot.queryParams.pattern || '' |
|
|
|
|
indexid = sessionStorage.getItem("paperId") //上个页面传过来的id
|
|
|
|
|
|
|
|
|
|
removeClass=document.getElementsByClassName("mat-form-field-underline") |
|
|
|
|
removeClass = document.getElementsByClassName("mat-form-field-underline") |
|
|
|
|
private _transformer = (node, level: number) => { //初始化tree
|
|
|
|
|
return { |
|
|
|
|
expandable: !!node.children && node.children.length > 0, |
|
|
|
@ -58,241 +58,261 @@ export class ExaminerNewOneComponent implements OnInit {
|
|
|
|
|
|
|
|
|
|
@ViewChild(MatSort) sort: MatSort; |
|
|
|
|
|
|
|
|
|
allunittype:any //获取所有的单位类型
|
|
|
|
|
allunittype: any //获取所有的单位类型
|
|
|
|
|
|
|
|
|
|
//分页
|
|
|
|
|
@ViewChild(MatPaginator, {static: true})
|
|
|
|
|
@ViewChild(MatPaginator, { static: true }) |
|
|
|
|
pageEvent: PageEvent; |
|
|
|
|
paginator: MatPaginator; |
|
|
|
|
length:any; //共多少条数据
|
|
|
|
|
pageSize:any; //每页条数
|
|
|
|
|
length: any; //共多少条数据
|
|
|
|
|
pageSize: any; //每页条数
|
|
|
|
|
pageSizeOptions: number[] = [10] //设置每页条数
|
|
|
|
|
PageNumber:any //第几页
|
|
|
|
|
|
|
|
|
|
displayedColumns: string[] = ['checked','unitname','jurisdictionsquadron', 'unittype','scc']; |
|
|
|
|
tabledataSource:any |
|
|
|
|
allorganizations:any |
|
|
|
|
oldDataSource:any; //原始表格数据
|
|
|
|
|
PageNumber: any //第几页
|
|
|
|
|
|
|
|
|
|
displayedColumns: string[] = ['checked', 'unitname', 'jurisdictionsquadron', 'unittype', 'scc']; |
|
|
|
|
tabledataSource: any |
|
|
|
|
allorganizations: any |
|
|
|
|
oldDataSource: any; //原始表格数据
|
|
|
|
|
|
|
|
|
|
//分页事件
|
|
|
|
|
chagePage(e){ |
|
|
|
|
this.PageNumber = e.pageIndex+1 |
|
|
|
|
chagePage(e) { |
|
|
|
|
this.PageNumber = e.pageIndex + 1 |
|
|
|
|
this.getAllKeyUnit(); |
|
|
|
|
} |
|
|
|
|
//获得所有重点单位
|
|
|
|
|
|
|
|
|
|
wanzhengduArr = [ |
|
|
|
|
{id:0,zong:94,details:[ |
|
|
|
|
{name:'单位信息',score:5,totalpoints:5}, |
|
|
|
|
{name:'建筑信息',score:10,totalpoints:10}, |
|
|
|
|
{name:'平面图',score:10,totalpoints:10}, |
|
|
|
|
{name:'四周毗邻',score:22,totalpoints:25}, |
|
|
|
|
{name:'消防设施',score:10,totalpoints:10}, |
|
|
|
|
{name:'重点部位',score:10,totalpoints:10}, |
|
|
|
|
{name:'功能分区',score:7,totalpoints:10}, |
|
|
|
|
{name:'实景图',score:10,totalpoints:10}, |
|
|
|
|
{name:'CAD上传',score:10,totalpoints:10}, |
|
|
|
|
]}, |
|
|
|
|
{id:1,zong:90,details:[ |
|
|
|
|
{name:'单位信息',score:4,totalpoints:5}, |
|
|
|
|
{name:'建筑信息',score:8,totalpoints:10}, |
|
|
|
|
{name:'平面图',score:10,totalpoints:10}, |
|
|
|
|
{name:'四周毗邻',score:25,totalpoints:25}, |
|
|
|
|
{name:'消防设施',score:10,totalpoints:10}, |
|
|
|
|
{name:'重点部位',score:10,totalpoints:10}, |
|
|
|
|
{name:'功能分区',score:8,totalpoints:10}, |
|
|
|
|
{name:'实景图',score:5,totalpoints:10}, |
|
|
|
|
{name:'CAD上传',score:10,totalpoints:10}, |
|
|
|
|
]}, |
|
|
|
|
{id:2,zong:89,details:[ |
|
|
|
|
{name:'单位信息',score:4,totalpoints:5}, |
|
|
|
|
{name:'建筑信息',score:10,totalpoints:10}, |
|
|
|
|
{name:'平面图',score:10,totalpoints:10}, |
|
|
|
|
{name:'四周毗邻',score:22,totalpoints:25}, |
|
|
|
|
{name:'消防设施',score:10,totalpoints:10}, |
|
|
|
|
{name:'重点部位',score:10,totalpoints:10}, |
|
|
|
|
{name:'功能分区',score:8,totalpoints:10}, |
|
|
|
|
{name:'实景图',score:5,totalpoints:10}, |
|
|
|
|
{name:'CAD上传',score:10,totalpoints:10}, |
|
|
|
|
]}, |
|
|
|
|
{id:3,zong:87,details:[ |
|
|
|
|
{name:'单位信息',score:5,totalpoints:5}, |
|
|
|
|
{name:'建筑信息',score:8,totalpoints:10}, |
|
|
|
|
{name:'平面图',score:10,totalpoints:10}, |
|
|
|
|
{name:'四周毗邻',score:20,totalpoints:25}, |
|
|
|
|
{name:'消防设施',score:10,totalpoints:10}, |
|
|
|
|
{name:'重点部位',score:10,totalpoints:10}, |
|
|
|
|
{name:'功能分区',score:6,totalpoints:10}, |
|
|
|
|
{name:'实景图',score:10,totalpoints:10}, |
|
|
|
|
{name:'CAD上传',score:8,totalpoints:10}, |
|
|
|
|
]}, |
|
|
|
|
{id:4,zong:86,details:[ |
|
|
|
|
{name:'单位信息',score:5,totalpoints:5}, |
|
|
|
|
{name:'建筑信息',score:10,totalpoints:10}, |
|
|
|
|
{name:'平面图',score:10,totalpoints:10}, |
|
|
|
|
{name:'四周毗邻',score:18,totalpoints:25}, |
|
|
|
|
{name:'消防设施',score:10,totalpoints:10}, |
|
|
|
|
{name:'重点部位',score:10,totalpoints:10}, |
|
|
|
|
{name:'功能分区',score:8,totalpoints:10}, |
|
|
|
|
{name:'实景图',score:5,totalpoints:10}, |
|
|
|
|
{name:'CAD上传',score:10,totalpoints:10}, |
|
|
|
|
]}, |
|
|
|
|
{id:5,zong:81,details:[ |
|
|
|
|
{name:'单位信息',score:5,totalpoints:5}, |
|
|
|
|
{name:'建筑信息',score:8,totalpoints:10}, |
|
|
|
|
{name:'平面图',score:10,totalpoints:10}, |
|
|
|
|
{name:'四周毗邻',score:22,totalpoints:25}, |
|
|
|
|
{name:'消防设施',score:10,totalpoints:10}, |
|
|
|
|
{name:'重点部位',score:10,totalpoints:10}, |
|
|
|
|
{name:'功能分区',score:5,totalpoints:10}, |
|
|
|
|
{name:'实景图',score:10,totalpoints:10}, |
|
|
|
|
{name:'CAD上传',score:6,totalpoints:10}, |
|
|
|
|
]}, |
|
|
|
|
{id:6,zong:80,details:[ |
|
|
|
|
{name:'单位信息',score:5,totalpoints:5}, |
|
|
|
|
{name:'建筑信息',score:8,totalpoints:10}, |
|
|
|
|
{name:'平面图',score:10,totalpoints:10}, |
|
|
|
|
{name:'四周毗邻',score:20,totalpoints:25}, |
|
|
|
|
{name:'消防设施',score:10,totalpoints:10}, |
|
|
|
|
{name:'重点部位',score:10,totalpoints:10}, |
|
|
|
|
{name:'功能分区',score:7,totalpoints:10}, |
|
|
|
|
{name:'实景图',score:0,totalpoints:10}, |
|
|
|
|
{name:'CAD上传',score:10,totalpoints:10}, |
|
|
|
|
]}, |
|
|
|
|
{id:7,zong:78,details:[ |
|
|
|
|
{name:'单位信息',score:4,totalpoints:5}, |
|
|
|
|
{name:'建筑信息',score:8,totalpoints:10}, |
|
|
|
|
{name:'平面图',score:10,totalpoints:10}, |
|
|
|
|
{name:'四周毗邻',score:22,totalpoints:25}, |
|
|
|
|
{name:'消防设施',score:10,totalpoints:10}, |
|
|
|
|
{name:'重点部位',score:10,totalpoints:10}, |
|
|
|
|
{name:'功能分区',score:6,totalpoints:10}, |
|
|
|
|
{name:'实景图',score:0,totalpoints:10}, |
|
|
|
|
{name:'CAD上传',score:8,totalpoints:10}, |
|
|
|
|
]}, |
|
|
|
|
{id:8,zong:78,details:[ |
|
|
|
|
{name:'单位信息',score:5,totalpoints:5}, |
|
|
|
|
{name:'建筑信息',score:8,totalpoints:10}, |
|
|
|
|
{name:'平面图',score:10,totalpoints:10}, |
|
|
|
|
{name:'四周毗邻',score:20,totalpoints:25}, |
|
|
|
|
{name:'消防设施',score:5,totalpoints:10}, |
|
|
|
|
{name:'重点部位',score:10,totalpoints:10}, |
|
|
|
|
{name:'功能分区',score:5,totalpoints:10}, |
|
|
|
|
{name:'实景图',score:5,totalpoints:10}, |
|
|
|
|
{name:'CAD上传',score:10,totalpoints:10}, |
|
|
|
|
]}, |
|
|
|
|
{id:9,zong:73,details:[ |
|
|
|
|
{name:'单位信息',score:5,totalpoints:5}, |
|
|
|
|
{name:'建筑信息',score:7,totalpoints:10}, |
|
|
|
|
{name:'平面图',score:10,totalpoints:10}, |
|
|
|
|
{name:'四周毗邻',score:18,totalpoints:25}, |
|
|
|
|
{name:'消防设施',score:0,totalpoints:10}, |
|
|
|
|
{name:'重点部位',score:10,totalpoints:10}, |
|
|
|
|
{name:'功能分区',score:5,totalpoints:10}, |
|
|
|
|
{name:'实景图',score:10,totalpoints:10}, |
|
|
|
|
{name:'CAD上传',score:8,totalpoints:10}, |
|
|
|
|
]} |
|
|
|
|
{ |
|
|
|
|
id: 0, zong: 94, details: [ |
|
|
|
|
{ name: '单位信息', score: 5, totalpoints: 5 }, |
|
|
|
|
{ name: '建筑信息', score: 10, totalpoints: 10 }, |
|
|
|
|
{ name: '平面图', score: 10, totalpoints: 10 }, |
|
|
|
|
{ name: '四周毗邻', score: 22, totalpoints: 25 }, |
|
|
|
|
{ name: '消防设施', score: 10, totalpoints: 10 }, |
|
|
|
|
{ name: '重点部位', score: 10, totalpoints: 10 }, |
|
|
|
|
{ name: '功能分区', score: 7, totalpoints: 10 }, |
|
|
|
|
{ name: '实景图', score: 10, totalpoints: 10 }, |
|
|
|
|
{ name: 'CAD上传', score: 10, totalpoints: 10 }, |
|
|
|
|
] |
|
|
|
|
}, |
|
|
|
|
{ |
|
|
|
|
id: 1, zong: 90, details: [ |
|
|
|
|
{ name: '单位信息', score: 4, totalpoints: 5 }, |
|
|
|
|
{ name: '建筑信息', score: 8, totalpoints: 10 }, |
|
|
|
|
{ name: '平面图', score: 10, totalpoints: 10 }, |
|
|
|
|
{ name: '四周毗邻', score: 25, totalpoints: 25 }, |
|
|
|
|
{ name: '消防设施', score: 10, totalpoints: 10 }, |
|
|
|
|
{ name: '重点部位', score: 10, totalpoints: 10 }, |
|
|
|
|
{ name: '功能分区', score: 8, totalpoints: 10 }, |
|
|
|
|
{ name: '实景图', score: 5, totalpoints: 10 }, |
|
|
|
|
{ name: 'CAD上传', score: 10, totalpoints: 10 }, |
|
|
|
|
] |
|
|
|
|
}, |
|
|
|
|
{ |
|
|
|
|
id: 2, zong: 89, details: [ |
|
|
|
|
{ name: '单位信息', score: 4, totalpoints: 5 }, |
|
|
|
|
{ name: '建筑信息', score: 10, totalpoints: 10 }, |
|
|
|
|
{ name: '平面图', score: 10, totalpoints: 10 }, |
|
|
|
|
{ name: '四周毗邻', score: 22, totalpoints: 25 }, |
|
|
|
|
{ name: '消防设施', score: 10, totalpoints: 10 }, |
|
|
|
|
{ name: '重点部位', score: 10, totalpoints: 10 }, |
|
|
|
|
{ name: '功能分区', score: 8, totalpoints: 10 }, |
|
|
|
|
{ name: '实景图', score: 5, totalpoints: 10 }, |
|
|
|
|
{ name: 'CAD上传', score: 10, totalpoints: 10 }, |
|
|
|
|
] |
|
|
|
|
}, |
|
|
|
|
{ |
|
|
|
|
id: 3, zong: 87, details: [ |
|
|
|
|
{ name: '单位信息', score: 5, totalpoints: 5 }, |
|
|
|
|
{ name: '建筑信息', score: 8, totalpoints: 10 }, |
|
|
|
|
{ name: '平面图', score: 10, totalpoints: 10 }, |
|
|
|
|
{ name: '四周毗邻', score: 20, totalpoints: 25 }, |
|
|
|
|
{ name: '消防设施', score: 10, totalpoints: 10 }, |
|
|
|
|
{ name: '重点部位', score: 10, totalpoints: 10 }, |
|
|
|
|
{ name: '功能分区', score: 6, totalpoints: 10 }, |
|
|
|
|
{ name: '实景图', score: 10, totalpoints: 10 }, |
|
|
|
|
{ name: 'CAD上传', score: 8, totalpoints: 10 }, |
|
|
|
|
] |
|
|
|
|
}, |
|
|
|
|
{ |
|
|
|
|
id: 4, zong: 86, details: [ |
|
|
|
|
{ name: '单位信息', score: 5, totalpoints: 5 }, |
|
|
|
|
{ name: '建筑信息', score: 10, totalpoints: 10 }, |
|
|
|
|
{ name: '平面图', score: 10, totalpoints: 10 }, |
|
|
|
|
{ name: '四周毗邻', score: 18, totalpoints: 25 }, |
|
|
|
|
{ name: '消防设施', score: 10, totalpoints: 10 }, |
|
|
|
|
{ name: '重点部位', score: 10, totalpoints: 10 }, |
|
|
|
|
{ name: '功能分区', score: 8, totalpoints: 10 }, |
|
|
|
|
{ name: '实景图', score: 5, totalpoints: 10 }, |
|
|
|
|
{ name: 'CAD上传', score: 10, totalpoints: 10 }, |
|
|
|
|
] |
|
|
|
|
}, |
|
|
|
|
{ |
|
|
|
|
id: 5, zong: 81, details: [ |
|
|
|
|
{ name: '单位信息', score: 5, totalpoints: 5 }, |
|
|
|
|
{ name: '建筑信息', score: 8, totalpoints: 10 }, |
|
|
|
|
{ name: '平面图', score: 10, totalpoints: 10 }, |
|
|
|
|
{ name: '四周毗邻', score: 22, totalpoints: 25 }, |
|
|
|
|
{ name: '消防设施', score: 10, totalpoints: 10 }, |
|
|
|
|
{ name: '重点部位', score: 10, totalpoints: 10 }, |
|
|
|
|
{ name: '功能分区', score: 5, totalpoints: 10 }, |
|
|
|
|
{ name: '实景图', score: 10, totalpoints: 10 }, |
|
|
|
|
{ name: 'CAD上传', score: 6, totalpoints: 10 }, |
|
|
|
|
] |
|
|
|
|
}, |
|
|
|
|
{ |
|
|
|
|
id: 6, zong: 80, details: [ |
|
|
|
|
{ name: '单位信息', score: 5, totalpoints: 5 }, |
|
|
|
|
{ name: '建筑信息', score: 8, totalpoints: 10 }, |
|
|
|
|
{ name: '平面图', score: 10, totalpoints: 10 }, |
|
|
|
|
{ name: '四周毗邻', score: 20, totalpoints: 25 }, |
|
|
|
|
{ name: '消防设施', score: 10, totalpoints: 10 }, |
|
|
|
|
{ name: '重点部位', score: 10, totalpoints: 10 }, |
|
|
|
|
{ name: '功能分区', score: 7, totalpoints: 10 }, |
|
|
|
|
{ name: '实景图', score: 0, totalpoints: 10 }, |
|
|
|
|
{ name: 'CAD上传', score: 10, totalpoints: 10 }, |
|
|
|
|
] |
|
|
|
|
}, |
|
|
|
|
{ |
|
|
|
|
id: 7, zong: 78, details: [ |
|
|
|
|
{ name: '单位信息', score: 4, totalpoints: 5 }, |
|
|
|
|
{ name: '建筑信息', score: 8, totalpoints: 10 }, |
|
|
|
|
{ name: '平面图', score: 10, totalpoints: 10 }, |
|
|
|
|
{ name: '四周毗邻', score: 22, totalpoints: 25 }, |
|
|
|
|
{ name: '消防设施', score: 10, totalpoints: 10 }, |
|
|
|
|
{ name: '重点部位', score: 10, totalpoints: 10 }, |
|
|
|
|
{ name: '功能分区', score: 6, totalpoints: 10 }, |
|
|
|
|
{ name: '实景图', score: 0, totalpoints: 10 }, |
|
|
|
|
{ name: 'CAD上传', score: 8, totalpoints: 10 }, |
|
|
|
|
] |
|
|
|
|
}, |
|
|
|
|
{ |
|
|
|
|
id: 8, zong: 78, details: [ |
|
|
|
|
{ name: '单位信息', score: 5, totalpoints: 5 }, |
|
|
|
|
{ name: '建筑信息', score: 8, totalpoints: 10 }, |
|
|
|
|
{ name: '平面图', score: 10, totalpoints: 10 }, |
|
|
|
|
{ name: '四周毗邻', score: 20, totalpoints: 25 }, |
|
|
|
|
{ name: '消防设施', score: 5, totalpoints: 10 }, |
|
|
|
|
{ name: '重点部位', score: 10, totalpoints: 10 }, |
|
|
|
|
{ name: '功能分区', score: 5, totalpoints: 10 }, |
|
|
|
|
{ name: '实景图', score: 5, totalpoints: 10 }, |
|
|
|
|
{ name: 'CAD上传', score: 10, totalpoints: 10 }, |
|
|
|
|
] |
|
|
|
|
}, |
|
|
|
|
{ |
|
|
|
|
id: 9, zong: 73, details: [ |
|
|
|
|
{ name: '单位信息', score: 5, totalpoints: 5 }, |
|
|
|
|
{ name: '建筑信息', score: 7, totalpoints: 10 }, |
|
|
|
|
{ name: '平面图', score: 10, totalpoints: 10 }, |
|
|
|
|
{ name: '四周毗邻', score: 18, totalpoints: 25 }, |
|
|
|
|
{ name: '消防设施', score: 0, totalpoints: 10 }, |
|
|
|
|
{ name: '重点部位', score: 10, totalpoints: 10 }, |
|
|
|
|
{ name: '功能分区', score: 5, totalpoints: 10 }, |
|
|
|
|
{ name: '实景图', score: 10, totalpoints: 10 }, |
|
|
|
|
{ name: 'CAD上传', score: 8, totalpoints: 10 }, |
|
|
|
|
] |
|
|
|
|
} |
|
|
|
|
] |
|
|
|
|
|
|
|
|
|
allKeyUnitInfo:any //所有的重点单位
|
|
|
|
|
getAllKeyUnit(){ |
|
|
|
|
allKeyUnitInfo: any //所有的重点单位
|
|
|
|
|
getAllKeyUnit() { |
|
|
|
|
// console.log(Boolean(Number(this.follow)))
|
|
|
|
|
let follow
|
|
|
|
|
if(this.follow == ''){ |
|
|
|
|
let follow |
|
|
|
|
if (this.follow == '') { |
|
|
|
|
follow = '' |
|
|
|
|
} |
|
|
|
|
if(this.follow == '0'){ |
|
|
|
|
if (this.follow == '0') { |
|
|
|
|
follow = false |
|
|
|
|
} |
|
|
|
|
if(this.follow == '1'){ |
|
|
|
|
if (this.follow == '1') { |
|
|
|
|
follow = true |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
let paramsdata:any = { |
|
|
|
|
let paramsdata: any = { |
|
|
|
|
Name: this.companyName || '', |
|
|
|
|
OrganizationId: this.jsId || '', |
|
|
|
|
HasChildren:this.jscheck || '', |
|
|
|
|
USCI:this.shehui || '', |
|
|
|
|
HasChildren: this.jscheck || '', |
|
|
|
|
USCI: this.shehui || '', |
|
|
|
|
IsFollowed: follow, |
|
|
|
|
BuildingTypeId: this.unittype || '', |
|
|
|
|
BuildingTypeId: this.unittype || '', |
|
|
|
|
PageNumber: this.PageNumber || '1', |
|
|
|
|
PageSize: this.pageSizeOptions[0], |
|
|
|
|
PageSize: this.pageSizeOptions[0], |
|
|
|
|
Sort: this.integritySort ? 'integrityscore' : '', |
|
|
|
|
SortType: this.integritySort || '', |
|
|
|
|
} |
|
|
|
|
//console.log(paramsdata)
|
|
|
|
|
this.http.get("/api/Companies",{params:paramsdata}).subscribe((data:any)=>{ |
|
|
|
|
this.http.get("/api/Companies", { params: paramsdata }).subscribe((data: any) => { |
|
|
|
|
//console.log(data)
|
|
|
|
|
this.length = data.totalCount |
|
|
|
|
this.allKeyUnitInfo = data |
|
|
|
|
// data.items.sort( (a,b) => {
|
|
|
|
|
// return a.usci - b.usci
|
|
|
|
|
// })
|
|
|
|
|
data.items.forEach( (item,index) => { |
|
|
|
|
data.items.forEach((item, index) => { |
|
|
|
|
item.integrity = this.wanzhengduArr[index] |
|
|
|
|
}) |
|
|
|
|
//console.log(789,data.items)
|
|
|
|
|
this.tabledataSource = new MatTableDataSource(data.items); |
|
|
|
|
//console.log(this.tabledataSource)
|
|
|
|
|
if(this.selectedunitArr.length!=0){ |
|
|
|
|
for(var i=0;i<this.tabledataSource.filteredData.length;i++){ |
|
|
|
|
for(var j=0;j<this.selectedunitArr.length;j++){ |
|
|
|
|
if(this.tabledataSource.filteredData[i].id==this.selectedunitArr[j].id){ |
|
|
|
|
this.tabledataSource.filteredData[i].checked=this.selectedunitArr[j].checked |
|
|
|
|
if (this.selectedunitArr.length != 0) { |
|
|
|
|
for (var i = 0; i < this.tabledataSource.filteredData.length; i++) { |
|
|
|
|
for (var j = 0; j < this.selectedunitArr.length; j++) { |
|
|
|
|
if (this.tabledataSource.filteredData[i].id == this.selectedunitArr[j].id) { |
|
|
|
|
this.tabledataSource.filteredData[i].checked = this.selectedunitArr[j].checked |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
}) |
|
|
|
|
//console.log(this.tabledataSource)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
} |
|
|
|
|
//得到当前单位信息
|
|
|
|
|
getunitdata(){ |
|
|
|
|
getunitdata() { |
|
|
|
|
this.http.get("/api/ExamAccounts/Profiles").subscribe( |
|
|
|
|
(data:any)=>{ |
|
|
|
|
this.organizationName = data.organizationName |
|
|
|
|
(data: any) => { |
|
|
|
|
this.organizationName = data.organizationName |
|
|
|
|
} |
|
|
|
|
) |
|
|
|
|
} |
|
|
|
|
organizationName:any //当前单位组织机构名称
|
|
|
|
|
treedata:any //组织机构树型数据
|
|
|
|
|
newArr:any = [] |
|
|
|
|
newallorganizations:any //用于存储在原始数据基础上的每个机构增加children字段
|
|
|
|
|
newallorganizations2:any |
|
|
|
|
organizationName: any //当前单位组织机构名称
|
|
|
|
|
treedata: any //组织机构树型数据
|
|
|
|
|
newArr: any = [] |
|
|
|
|
newallorganizations: any //用于存储在原始数据基础上的每个机构增加children字段
|
|
|
|
|
newallorganizations2: any |
|
|
|
|
//得到当前单位所在组织机构的tree型数据
|
|
|
|
|
getpresentOrganization(){ |
|
|
|
|
getpresentOrganization() { |
|
|
|
|
this.newallorganizations = this.allorganizations |
|
|
|
|
this.newallorganizations.forEach(item => { |
|
|
|
|
item.children = [] |
|
|
|
|
this.newallorganizations.forEach(element => { |
|
|
|
|
if(element.parentId == item.id){ |
|
|
|
|
if (element.parentId == item.id) { |
|
|
|
|
item.children.push(element) |
|
|
|
|
} |
|
|
|
|
}); |
|
|
|
|
}); |
|
|
|
|
this.http.get("/api/ExamAccounts/Profiles").subscribe( |
|
|
|
|
(data:any)=>{ |
|
|
|
|
(data: any) => { |
|
|
|
|
this.organizationName = data.organizationName |
|
|
|
|
if(this.organizationName){ |
|
|
|
|
if (this.organizationName) { |
|
|
|
|
this.newallorganizations.forEach(item => { |
|
|
|
|
if(item.name == this.organizationName){ |
|
|
|
|
if (item.name == this.organizationName) { |
|
|
|
|
this.dataSource.data = [item] |
|
|
|
|
this.newallorganizations2 = [item] |
|
|
|
|
} |
|
|
|
|
}); |
|
|
|
|
}else{ |
|
|
|
|
} else { |
|
|
|
|
this.newallorganizations2 = this.treedata |
|
|
|
|
this.dataSource.data = this.treedata |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
) |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
} |
|
|
|
|
//获得所有组织机构
|
|
|
|
|
getOrganizations(){ |
|
|
|
|
getOrganizations() { |
|
|
|
|
this.http.get('/api/Organizations').subscribe( |
|
|
|
|
(data:any)=>{ |
|
|
|
|
(data: any) => { |
|
|
|
|
this.allorganizations = data |
|
|
|
|
this.treedata = this.tree.toTree(data); |
|
|
|
|
this.getpresentOrganization(); |
|
|
|
@ -301,127 +321,122 @@ export class ExaminerNewOneComponent implements OnInit {
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
//获得所有单位类型
|
|
|
|
|
getUnittype(){ |
|
|
|
|
getUnittype() { |
|
|
|
|
this.http.get('/api/BuildingTypes/Simple').subscribe( |
|
|
|
|
data=>{ |
|
|
|
|
data => { |
|
|
|
|
this.allunittype = data |
|
|
|
|
} |
|
|
|
|
) |
|
|
|
|
} |
|
|
|
|
selectedunitArr:any =JSON.parse(sessionStorage.getItem(this.indexid))||[] //选中单位的数组
|
|
|
|
|
deleteByid=""//根据id取消选中
|
|
|
|
|
selectedunitArr: any = JSON.parse(sessionStorage.getItem(this.indexid)) || [] //选中单位的数组
|
|
|
|
|
deleteByid = ""//根据id取消选中
|
|
|
|
|
//勾选框事件
|
|
|
|
|
checkChange(e,element){ |
|
|
|
|
console.log(e,element) |
|
|
|
|
checkChange(e, element) { |
|
|
|
|
console.log(e, element) |
|
|
|
|
element.checked = e.checked |
|
|
|
|
if(element.checked){ |
|
|
|
|
if (element.checked) { |
|
|
|
|
this.selectedunitArr.push(element) |
|
|
|
|
} |
|
|
|
|
else{ |
|
|
|
|
for(var i=0;i<this.selectedunitArr.length;i++){ |
|
|
|
|
if(this.selectedunitArr[i].id==element.companyIntegrityScore.companyId){ |
|
|
|
|
this.selectedunitArr.splice(i,1) |
|
|
|
|
else { |
|
|
|
|
for (var i = 0; i < this.selectedunitArr.length; i++) { |
|
|
|
|
if (this.selectedunitArr[i].id == element.companyIntegrityScore.companyId) { |
|
|
|
|
this.selectedunitArr.splice(i, 1) |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
console.log(this.selectedunitArr) |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
} |
|
|
|
|
//删除某一个单位信息
|
|
|
|
|
deleteWork(e){ |
|
|
|
|
deleteWork(e) { |
|
|
|
|
console.log(e.target.id) |
|
|
|
|
console.log(this.tabledataSource.data) |
|
|
|
|
for(var i=0;i<this.selectedunitArr.length;i++){ |
|
|
|
|
if(this.selectedunitArr[i].id==e.target.id){ |
|
|
|
|
this.selectedunitArr.splice(i,1) |
|
|
|
|
for (var i = 0; i < this.selectedunitArr.length; i++) { |
|
|
|
|
if (this.selectedunitArr[i].id == e.target.id) { |
|
|
|
|
this.selectedunitArr.splice(i, 1) |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
for(var i=0;i<this.tabledataSource.data.length;i++){ |
|
|
|
|
if(this.tabledataSource.data[i].id==e.target.id){ |
|
|
|
|
this.tabledataSource.data[i].checked=false |
|
|
|
|
for (var i = 0; i < this.tabledataSource.data.length; i++) { |
|
|
|
|
if (this.tabledataSource.data[i].id == e.target.id) { |
|
|
|
|
this.tabledataSource.data[i].checked = false |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
//下一步事件
|
|
|
|
|
nextClick(){ |
|
|
|
|
nextClick() { |
|
|
|
|
console.log(this.pattern) |
|
|
|
|
/* var workDate=[] |
|
|
|
|
for(var i=0;i<this.selectedunitArr.length;i++){ |
|
|
|
|
workDate.push(this.selectedunitArr[i].buildingTypes) |
|
|
|
|
} |
|
|
|
|
console.log(workDate) */ |
|
|
|
|
const config = new MatSnackBarConfig(); |
|
|
|
|
config.verticalPosition = 'top'; |
|
|
|
|
config.duration = 3000 |
|
|
|
|
if(this.selectedunitArr.length==0){ |
|
|
|
|
this.snackBar.open('请选择单位','确定',config); |
|
|
|
|
if (this.selectedunitArr.length == 0) { |
|
|
|
|
this.snackBar.open('请选择单位', '确定', config); |
|
|
|
|
} |
|
|
|
|
else{ |
|
|
|
|
if(this.pattern=='edit'){ |
|
|
|
|
else { |
|
|
|
|
if (this.pattern == 'edit') { |
|
|
|
|
this.router.navigateByUrl("/examiner/create-test-score?pattern=edit") |
|
|
|
|
}else{ |
|
|
|
|
sessionStorage.setItem(this.indexid,JSON.stringify(this.selectedunitArr) ) |
|
|
|
|
this.router.navigateByUrl("/examiner/create-test-score") |
|
|
|
|
} else { |
|
|
|
|
sessionStorage.setItem(this.indexid, JSON.stringify(this.selectedunitArr)) |
|
|
|
|
this.router.navigateByUrl("/examiner/create-test-score") |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
} |
|
|
|
|
//编辑单位信息
|
|
|
|
|
editunit(){ |
|
|
|
|
sessionStorage.setItem("six","edit") |
|
|
|
|
editunit() { |
|
|
|
|
sessionStorage.setItem("six", "edit") |
|
|
|
|
let selectedunitArr = [] |
|
|
|
|
let selectedunitobj = [] |
|
|
|
|
this.allKeyUnitInfo.items.forEach(item => { |
|
|
|
|
if(item.checked){ |
|
|
|
|
if (item.checked) { |
|
|
|
|
selectedunitArr.push(item.id) |
|
|
|
|
selectedunitobj.push(item) |
|
|
|
|
} |
|
|
|
|
}); |
|
|
|
|
|
|
|
|
|
if(selectedunitArr.length == 0){ |
|
|
|
|
if (selectedunitArr.length == 0) { |
|
|
|
|
const config = new MatSnackBarConfig(); |
|
|
|
|
config.verticalPosition = 'top'; |
|
|
|
|
config.duration = 3000 |
|
|
|
|
this.snackBar.open('请先选择要修改的单位','确定',config); |
|
|
|
|
this.snackBar.open('请先选择要修改的单位', '确定', config); |
|
|
|
|
} |
|
|
|
|
if(selectedunitArr.length != 1 && selectedunitArr.length != 0){ |
|
|
|
|
if (selectedunitArr.length != 1 && selectedunitArr.length != 0) { |
|
|
|
|
const config = new MatSnackBarConfig(); |
|
|
|
|
config.verticalPosition = 'top'; |
|
|
|
|
config.duration = 3000 |
|
|
|
|
this.snackBar.open('只能选择一个单位修改','确定',config); |
|
|
|
|
this.snackBar.open('只能选择一个单位修改', '确定', config); |
|
|
|
|
} |
|
|
|
|
if(selectedunitArr.length == 1){ //带着id跳到修改页面
|
|
|
|
|
if (selectedunitArr.length == 1) { //带着id跳到修改页面
|
|
|
|
|
// console.log(778,selectedunitArr[0])
|
|
|
|
|
this.allKeyUnitInfo.items.forEach(item => { |
|
|
|
|
if(item.id == selectedunitArr[0]){ |
|
|
|
|
if (item.id == selectedunitArr[0]) { |
|
|
|
|
let companyName = item.name |
|
|
|
|
sessionStorage.setItem("companyName",companyName) |
|
|
|
|
sessionStorage.setItem("companyName", companyName) |
|
|
|
|
} |
|
|
|
|
}); |
|
|
|
|
sessionStorage.setItem("editable","1") |
|
|
|
|
sessionStorage.setItem(selectedunitobj[0].id,JSON.stringify(selectedunitobj[0].companyIntegrityScore)) |
|
|
|
|
sessionStorage.setItem("editable", "1") |
|
|
|
|
sessionStorage.setItem(selectedunitobj[0].id, JSON.stringify(selectedunitobj[0].companyIntegrityScore)) |
|
|
|
|
window.open(`/keyUnit/editplaninfo?id=${selectedunitArr[0]}`); |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
//重置
|
|
|
|
|
js:any //辖区中队输入框
|
|
|
|
|
jsId:any //辖区中队选择的id
|
|
|
|
|
companyName:any //单位名称
|
|
|
|
|
shehui:any //统一社会信用代码
|
|
|
|
|
unittype:any //单位类型
|
|
|
|
|
jscheck:any //辖区中队包含下级
|
|
|
|
|
js: any //辖区中队输入框
|
|
|
|
|
jsId: any //辖区中队选择的id
|
|
|
|
|
companyName: any //单位名称
|
|
|
|
|
shehui: any //统一社会信用代码
|
|
|
|
|
unittype: any //单位类型
|
|
|
|
|
jscheck: any //辖区中队包含下级
|
|
|
|
|
OrganizationId //
|
|
|
|
|
follow:any = '' //是否为关注单位
|
|
|
|
|
integritySort:any //完整度排序
|
|
|
|
|
reset(){ |
|
|
|
|
this.js='' //辖区中队输入框
|
|
|
|
|
this.jscheck='' //辖区中队包含下级
|
|
|
|
|
this.companyName='' //单位名称
|
|
|
|
|
this.shehui='' //统一社会信用代码
|
|
|
|
|
this.unittype='' //单位类型
|
|
|
|
|
follow: any = '' //是否为关注单位
|
|
|
|
|
integritySort: any //完整度排序
|
|
|
|
|
reset() { |
|
|
|
|
this.js = '' //辖区中队输入框
|
|
|
|
|
this.jscheck = '' //辖区中队包含下级
|
|
|
|
|
this.companyName = '' //单位名称
|
|
|
|
|
this.shehui = '' //统一社会信用代码
|
|
|
|
|
this.unittype = '' //单位类型
|
|
|
|
|
this.jsId = '' |
|
|
|
|
this.follow = '' |
|
|
|
|
this.PageNumber = 1 |
|
|
|
@ -431,19 +446,19 @@ export class ExaminerNewOneComponent implements OnInit {
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
//提交查询表单
|
|
|
|
|
onSubmit(value){ |
|
|
|
|
onSubmit(value) { |
|
|
|
|
this.PageNumber = 1 |
|
|
|
|
this.pageEvent.pageIndex = 0 |
|
|
|
|
this.getAllKeyUnit(); |
|
|
|
|
} |
|
|
|
|
bigclosediv(e){ |
|
|
|
|
bigclosediv(e) { |
|
|
|
|
this.isorganizationbox = false |
|
|
|
|
} |
|
|
|
|
stopclose(e){ |
|
|
|
|
stopclose(e) { |
|
|
|
|
e.stopPropagation(); |
|
|
|
|
} |
|
|
|
|
//辖区中队div是否显示
|
|
|
|
|
isorganizationbox:boolean = false |
|
|
|
|
isorganizationbox: boolean = false |
|
|
|
|
//点击辖区中队树,将选择的辖区中队添加到变量
|
|
|
|
|
add(node) { |
|
|
|
|
this.isorganizationbox = false |
|
|
|
@ -457,14 +472,14 @@ export class ExaminerNewOneComponent implements OnInit {
|
|
|
|
|
//打开辖区中队隐藏框
|
|
|
|
|
openorganizationbox() { |
|
|
|
|
this.isorganizationbox = true |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
//关闭出现的组织机构div
|
|
|
|
|
closediv(){ |
|
|
|
|
closediv() { |
|
|
|
|
this.isorganizationbox = false |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
} |
|
|
|
|