陈鹏飞 3 years ago
parent
commit
208739bea8
  1. 143
      src/app/plan-management/entry-plan/entry-plan.component.html
  2. 25
      src/app/plan-management/entry-plan/entry-plan.component.spec.ts
  3. 257
      src/app/plan-management/entry-plan/entry-plan.component.ts
  4. 33
      src/app/plan-management/open-plan/open-plan.component.html
  5. 25
      src/app/plan-management/open-plan/open-plan.component.spec.ts
  6. 22
      src/app/plan-management/open-plan/open-plan.component.ts
  7. 66
      src/app/plan-management/pass-plan/pass-plan.component.html
  8. 25
      src/app/plan-management/pass-plan/pass-plan.component.spec.ts
  9. 24
      src/app/plan-management/pass-plan/pass-plan.component.ts
  10. 22
      src/app/statistic-analysis/combined-query/combined-query.component.html
  11. 3
      src/app/statistic-analysis/combined-query/combined-query.component.scss
  12. 79
      src/app/statistic-analysis/combined-query/combined-query.component.ts

143
src/app/plan-management/entry-plan/entry-plan.component.html

@ -1,25 +1,27 @@
<div style="height: 100%;overflow-y: auto;">
<div class="header" >
<div class="header">
<form (ngSubmit)="onSubmit(form.value)" #form="ngForm">
<div class="queryBox">
<div class="queryField">
<label style="margin-right: 10px;">单位名称:</label>
<mat-form-field class="example-full-width">
<input matInput placeholder="请输入单位名称" name="companyName" [(ngModel)]="companyName" autocomplete="off">
<input matInput placeholder="请输入单位名称" name="companyName" [(ngModel)]="companyName"
autocomplete="off">
</mat-form-field>
</div>
<div class="queryField" >
<div class="queryField">
<label style="margin-right: 10px;">单位类型:</label>
<mat-form-field>
<mat-select placeholder='请选择单位类型' name="unittype" [(ngModel)]="unittype">
<mat-option *ngFor="let unit of allunittype" [value]="unit.id" >
<mat-option *ngFor="let unit of allunittype" [value]="unit.id">
{{unit.name}}
</mat-option>
</mat-select>
</mat-form-field>
<span *ngIf="padMore" style="margin-left: 10px; color: #0080FF;" (click)='padInfo()'>更多筛选条件<img [src]='imgsrcopen'style="width: 10px;height: 6px;margin:0 0 3px 2px;"> </span>
<span *ngIf="padput" style="margin-left: 10px; color: #0080FF;" (click)='padInfo()'>收起<img [src]='imgsrcdown'style="width: 10px;height: 6px;margin:0 0 3px 2px;"> </span>
<span *ngIf="padMore" style="margin-left: 10px; color: #0080FF;" (click)='padInfo()'>更多筛选条件<img
[src]='imgsrcopen' style="width: 10px;height: 6px;margin:0 0 3px 2px;"> </span>
<span *ngIf="padput" style="margin-left: 10px; color: #0080FF;" (click)='padInfo()'>收起<img
[src]='imgsrcdown' style="width: 10px;height: 6px;margin:0 0 3px 2px;"> </span>
</div>
<div class="queryField" *ngIf="!pcfind">
<button mat-raised-button color="primary">查询</button>
@ -28,22 +30,24 @@
<div class="queryField ordiv" *ngIf="!padMore">
<label style="margin-right: 10px;">消防救援站:</label>
<mat-form-field class="example-full-width">
<input readonly matInput placeholder="请选择消防救援站" autocomplete="off" [(ngModel)]="js" name="js" (focus)="openorganizationbox()">
<input readonly matInput placeholder="请选择消防救援站" autocomplete="off" [(ngModel)]="js" name="js"
(focus)="openorganizationbox()">
</mat-form-field>
<mat-checkbox style="margin-left: 6px;" [(ngModel)]="jscheck" name="jscheck">包含下级</mat-checkbox>
<div class="organizationbox" *ngIf="isorganizationbox">
<div (click)="closediv()" class="closediv"><mat-icon>clear</mat-icon></div>
<div (click)="closediv()" class="closediv">
<mat-icon>clear</mat-icon>
</div>
<mat-tree [dataSource]="dataSource" [treeControl]="treeControl">
<mat-tree-node *matTreeNodeDef="let node" matTreeNodePadding (click)='add(node)' class="organizationlist">
<button type="button" mat-icon-button disabled ></button>
<mat-tree-node *matTreeNodeDef="let node" matTreeNodePadding (click)='add(node)'
class="organizationlist">
<button type="button" mat-icon-button disabled></button>
<li>{{node.name}}</li>
</mat-tree-node>
<mat-tree-node *matTreeNodeDef="let node;when: hasChild" matTreeNodePadding (click)='add(node)' class="organizationlist">
<button
type="button"
mat-icon-button
matTreeNodeToggle
<mat-tree-node *matTreeNodeDef="let node;when: hasChild" matTreeNodePadding
(click)='add(node)' class="organizationlist">
<button type="button" mat-icon-button matTreeNodeToggle
[attr.aria-label]="'toggle ' + node.name">
<mat-icon class="mat-icon-rtl-mirror">
{{treeControl.isExpanded(node) ? 'expand_more' : 'chevron_right'}}
@ -57,24 +61,30 @@
<div class="queryField" *ngIf="!padMore">
<label style="margin-right: 10px;">预案类型:</label>
<mat-form-field>
<mat-select name="reservePlanType" [(ngModel)]="reservePlanType" placeholder='请选择预案类型' [multiple]="true">
<mat-select name="reservePlanType" [(ngModel)]="reservePlanType" placeholder='请选择预案类型'
[multiple]="true">
<mat-option value=16>文本预案</mat-option>
<mat-option value=1>二维预案</mat-option>
<mat-option value=2>三维预案</mat-option>
<mat-option value=4>其他预案</mat-option>
</mat-select>
</mat-form-field>
<span *ngIf="pcMore" style="margin-left: 15px; color: #0080FF; cursor: pointer;" (click)='pcInfo()'>更多筛选条件<img [src]='imgsrcopen'style="width: 10px;height: 6px;margin:0 0 3px 2px;"> </span>
<span *ngIf="pcput" style="margin-left: 10px; color: #0080FF; cursor: pointer;" (click)='pcInfo()'>收起<img [src]='imgsrcdown'style="width: 10px;height: 6px;margin:0 0 3px 2px;"> </span>
</div>
<div class="queryField" *ngIf="pcfind" >
<span *ngIf="pcMore" style="margin-left: 15px; color: #0080FF; cursor: pointer;"
(click)='pcInfo()'>更多筛选条件<img [src]='imgsrcopen'
style="width: 10px;height: 6px;margin:0 0 3px 2px;"> </span>
<span *ngIf="pcput" style="margin-left: 10px; color: #0080FF; cursor: pointer;"
(click)='pcInfo()'>收起<img [src]='imgsrcdown'
style="width: 10px;height: 6px;margin:0 0 3px 2px;"> </span>
</div>
<div class="queryField" *ngIf="pcfind">
<button mat-raised-button color="primary">查询</button>
<button mat-raised-button style="margin-left: 25px;" type="button" (click)="reset()">重置</button>
</div>
<div class="queryField" *ngIf="!padMore&&!pcMore">
<label style="margin-right: 10px;">预案级别:</label>
<mat-form-field>
<mat-select placeholder='请选择预案级别' [(ngModel)]="planCategory" name="planCategory" [multiple]="true">
<mat-select placeholder='请选择预案级别' [(ngModel)]="planCategory" name="planCategory"
[multiple]="true">
<mat-option value=3>Ⅲ级预案</mat-option>
<mat-option value=4>Ⅳ级预案</mat-option>
<mat-option value=5>Ⅴ级预案</mat-option>
@ -89,7 +99,8 @@
<mat-option value="2">支队</mat-option>
<mat-option value="4">大队</mat-option>
<mat-option value="8">中队</mat-option> -->
<mat-option *ngFor="let item of preparelevels" [value]="item.value">{{item.name}}</mat-option>
<mat-option *ngFor="let item of preparelevels" [value]="item.value">{{item.name}}
</mat-option>
</mat-select>
</mat-form-field>
<mat-checkbox style="margin-left: 6px;" [(ngModel)]="plcheck" name="plcheck">包含下级</mat-checkbox>
@ -105,8 +116,6 @@
</mat-select>
</mat-form-field>
</div>
<div class="queryField" *ngIf="!padMore&&!pcMore">
<label style="margin-right: 10px;">信息完整度排序:</label>
<mat-form-field>
@ -116,7 +125,7 @@
</mat-select>
</mat-form-field>
</div>
<div class="queryField" *ngIf="!padMore&&!pcMore">
<div class="queryField" *ngIf="!padMore&&!pcMore">
<label style="margin-right: 10px;">制作情况:</label>
<mat-form-field>
<mat-select placeholder='请选择预案制作情况' [(ngModel)]="haveyuan" name="haveyuan">
@ -143,6 +152,12 @@
</mat-select>
</mat-form-field>
</div>
<div class="queryField" *ngIf="!padMore&&!pcMore">
<mat-checkbox [(ngModel)]="templatePlan" name="templatePlan">模板录入预案</mat-checkbox>
</div>
<div class="queryField" *ngIf="!padMore&&!pcMore">
<mat-checkbox [(ngModel)]="customPlan" name="customPlan">自定义预案</mat-checkbox>
</div>
</div>
</form>
</div>
@ -169,7 +184,8 @@
<span class="integrityNum">
{{(element.company.companyIntegrityScore.totalScore.toFixed(2) * 100).toFixed()}}%
</span>
<div class="integrityColorDiv" [style]="integrity((element.company.companyIntegrityScore.totalScore.toFixed(2) * 100).toFixed())">
<div class="integrityColorDiv"
[style]="integrity((element.company.companyIntegrityScore.totalScore.toFixed(2) * 100).toFixed())">
</div>
<div class="integrityDetails" [ngClass]="{'bottomposition': i <= 5,'topposition': i > 5}">
<div class="integrityDetailsTop">
@ -183,9 +199,12 @@
<div class="name">单位信息</div>
<div class="colorDiv">
<div class="colorDivBac">
<div class="colorDivCon" [style]="integrityDetails((element.company.companyIntegrityScore.basicInfoScore * 5).toFixed(1),5)"></div>
<div class="colorDivCon"
[style]="integrityDetails((element.company.companyIntegrityScore.basicInfoScore * 5).toFixed(1),5)">
</div>
</div>
<span>{{(element.company.companyIntegrityScore.basicInfoScore * 5).toFixed(1)}}%</span>
<span>{{(element.company.companyIntegrityScore.basicInfoScore *
5).toFixed(1)}}%</span>
</div>
<div class="number">5%</div>
</li>
@ -193,9 +212,12 @@
<div class="name">建筑信息</div>
<div class="colorDiv">
<div class="colorDivBac">
<div class="colorDivCon" [style]="integrityDetails((element.company.companyIntegrityScore.buildingInfoScore * 10).toFixed(1),10)"></div>
<div class="colorDivCon"
[style]="integrityDetails((element.company.companyIntegrityScore.buildingInfoScore * 10).toFixed(1),10)">
</div>
</div>
<span>{{(element.company.companyIntegrityScore.buildingInfoScore * 10).toFixed(1)}}%</span>
<span>{{(element.company.companyIntegrityScore.buildingInfoScore *
10).toFixed(1)}}%</span>
</div>
<div class="number">10%</div>
</li>
@ -203,9 +225,12 @@
<div class="name">平面图</div>
<div class="colorDiv">
<div class="colorDivBac">
<div class="colorDivCon" [style]="integrityDetails((element.company.companyIntegrityScore.planImageScore * 10).toFixed(1),10)"></div>
<div class="colorDivCon"
[style]="integrityDetails((element.company.companyIntegrityScore.planImageScore * 10).toFixed(1),10)">
</div>
<span>{{(element.company.companyIntegrityScore.planImageScore * 10).toFixed(1)}}%</span>
</div>
<span>{{(element.company.companyIntegrityScore.planImageScore *
10).toFixed(1)}}%</span>
</div>
<div class="number">10%</div>
</li>
@ -213,9 +238,12 @@
<div class="name">四周毗邻</div>
<div class="colorDiv">
<div class="colorDivBac">
<div class="colorDivCon" [style]="integrityDetails((element.company.companyIntegrityScore.adjoinScore * 10).toFixed(1),10)"></div>
<div class="colorDivCon"
[style]="integrityDetails((element.company.companyIntegrityScore.adjoinScore * 10).toFixed(1),10)">
</div>
</div>
<span>{{(element.company.companyIntegrityScore.adjoinScore * 10).toFixed(1)}}%</span>
<span>{{(element.company.companyIntegrityScore.adjoinScore *
10).toFixed(1)}}%</span>
</div>
<div class="number">10%</div>
</li>
@ -223,9 +251,12 @@
<div class="name">消防设施</div>
<div class="colorDiv">
<div class="colorDivBac">
<div class="colorDivCon" [style]="integrityDetails((element.company.companyIntegrityScore.facilityScore * 25).toFixed(1),25)"></div>
<div class="colorDivCon"
[style]="integrityDetails((element.company.companyIntegrityScore.facilityScore * 25).toFixed(1),25)">
</div>
<span>{{(element.company.companyIntegrityScore.facilityScore * 25).toFixed(1)}}%</span>
</div>
<span>{{(element.company.companyIntegrityScore.facilityScore *
25).toFixed(1)}}%</span>
</div>
<div class="number">25%</div>
</li>
@ -233,9 +264,12 @@
<div class="name">重点部位</div>
<div class="colorDiv">
<div class="colorDivBac">
<div class="colorDivCon" [style]="integrityDetails((element.company.companyIntegrityScore.importantLocationScore * 10).toFixed(1),10)"></div>
<div class="colorDivCon"
[style]="integrityDetails((element.company.companyIntegrityScore.importantLocationScore * 10).toFixed(1),10)">
</div>
</div>
<span>{{(element.company.companyIntegrityScore.importantLocationScore * 10).toFixed(1)}}%</span>
<span>{{(element.company.companyIntegrityScore.importantLocationScore *
10).toFixed(1)}}%</span>
</div>
<div class="number">10%</div>
</li>
@ -243,9 +277,12 @@
<div class="name">功能分区</div>
<div class="colorDiv">
<div class="colorDivBac">
<div class="colorDivCon" [style]="integrityDetails((element.company.companyIntegrityScore.functionalDivisionScore * 10).toFixed(1),10)"></div>
<div class="colorDivCon"
[style]="integrityDetails((element.company.companyIntegrityScore.functionalDivisionScore * 10).toFixed(1),10)">
</div>
</div>
<span>{{(element.company.companyIntegrityScore.functionalDivisionScore * 10).toFixed(1)}}%</span>
<span>{{(element.company.companyIntegrityScore.functionalDivisionScore *
10).toFixed(1)}}%</span>
</div>
<div class="number">10%</div>
</li>
@ -253,9 +290,12 @@
<div class="name">实景图</div>
<div class="colorDiv">
<div class="colorDivBac">
<div class="colorDivCon" [style]="integrityDetails((element.company.companyIntegrityScore.realityImageScore * 10).toFixed(1),10)"></div>
<div class="colorDivCon"
[style]="integrityDetails((element.company.companyIntegrityScore.realityImageScore * 10).toFixed(1),10)">
</div>
<span>{{(element.company.companyIntegrityScore.realityImageScore * 10).toFixed(1)}}%</span>
</div>
<span>{{(element.company.companyIntegrityScore.realityImageScore *
10).toFixed(1)}}%</span>
</div>
<div class="number">10%</div>
</li>
@ -263,9 +303,12 @@
<div class="name">CAD上传</div>
<div class="colorDiv">
<div class="colorDivBac">
<div class="colorDivCon" [style]="integrityDetails((element.company.companyIntegrityScore.cadScore * 10).toFixed(1),10)"></div>
<div class="colorDivCon"
[style]="integrityDetails((element.company.companyIntegrityScore.cadScore * 10).toFixed(1),10)">
</div>
</div>
<span>{{(element.company.companyIntegrityScore.cadScore * 10).toFixed(1)}}%</span>
<span>{{(element.company.companyIntegrityScore.cadScore *
10).toFixed(1)}}%</span>
</div>
<div class="number">10%</div>
</li>
@ -289,7 +332,8 @@
<ng-container matColumnDef="unittype">
<th mat-header-cell *matHeaderCellDef>单位类型</th>
<td mat-cell *matCellDef="let element">{{element.company.buildingTypes[0] ? element.company.buildingTypes[0].name : ''}}</td>
<td mat-cell *matCellDef="let element">{{element.company.buildingTypes[0] ?
element.company.buildingTypes[0].name : ''}}</td>
</ng-container>
<ng-container matColumnDef="plantype">
<th mat-header-cell *matHeaderCellDef>预案类型</th>
@ -312,11 +356,8 @@
<tr mat-header-row *matHeaderRowDef="displayedColumns"></tr>
<tr mat-row *matRowDef="let row; columns: displayedColumns;"></tr>
</table>
<mat-paginator pageEvent [length]="length"
[pageSize]="pageSize"
[pageSizeOptions]="pageSizeOptions"
(page)="chagePage($event)"
>
<mat-paginator pageEvent [length]="length" [pageSize]="pageSize" [pageSizeOptions]="pageSizeOptions"
(page)="chagePage($event)">
</mat-paginator>

25
src/app/plan-management/entry-plan/entry-plan.component.spec.ts

@ -1,25 +0,0 @@
import { async, ComponentFixture, TestBed } from '@angular/core/testing';
import { EntryPlanComponent } from './entry-plan.component';
describe('EntryPlanComponent', () => {
let component: EntryPlanComponent;
let fixture: ComponentFixture<EntryPlanComponent>;
beforeEach(async(() => {
TestBed.configureTestingModule({
declarations: [ EntryPlanComponent ]
})
.compileComponents();
}));
beforeEach(() => {
fixture = TestBed.createComponent(EntryPlanComponent);
component = fixture.componentInstance;
fixture.detectChanges();
});
it('should create', () => {
expect(component).toBeTruthy();
});
});

257
src/app/plan-management/entry-plan/entry-plan.component.ts

@ -4,7 +4,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';
@ -17,7 +17,7 @@ import { ConstantPool } from '@angular/compiler';
})
export class EntryPlanComponent 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) { }
private _transformer = (node, level: number) => { //初始化tree
return {
@ -35,27 +35,27 @@ export class EntryPlanComponent implements OnInit {
myControl = new FormControl();
hasChild = (_: number, node: any) => node.expandable;
//分页
@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; //第几页
IsNewData='' //预案维护更新或者新增
IsNewCompanyData=''//单位维护更新或者新增
PageNumber: any; //第几页
IsNewData = '' //预案维护更新或者新增
IsNewCompanyData = ''//单位维护更新或者新增
displayedColumns: string[] = ['state','unitname','integrity','level','jurisdictionsquadron', 'unittype','plantype', 'passstate','projectlevel','operation'];
allorganizations:any //所有组织机构
allunittype:any //所有单位类型
tabledataSource:any //表格数据
displayedColumns: string[] = ['state', 'unitname', 'integrity', 'level', 'jurisdictionsquadron', 'unittype', 'plantype', 'passstate', 'projectlevel', 'operation'];
allorganizations: any //所有组织机构
allunittype: any //所有单位类型
tabledataSource: any //表格数据
organizationName:any //当前单位组织机构名称
preparelevels:any
integritySort:any //完整度排序
organizationName: any //当前单位组织机构名称
preparelevels: any
integritySort: any //完整度排序
haveyuan//有无预案
colorRgb(sColor){
colorRgb(sColor) {
var reg = /^#([0-9a-fA-f]{3}|[0-9a-fA-f]{6})$/;
var sColor = sColor.toLowerCase();
if (sColor && reg.test(sColor)) {
@ -76,14 +76,14 @@ export class EntryPlanComponent implements OnInit {
return sColor;
}
}
colorHex(rgb){
colorHex(rgb) {
var _this = rgb;
var reg = /^#([0-9a-fA-f]{3}|[0-9a-fA-f]{6})$/;
if (/^(rgb|RGB)/.test(_this)) {
var aColor = _this.replace(/(?:(|)|rgb|RGB)*/g, "").split(",");
var strHex = "#";
for (var i = 0; i < aColor.length; i++) {
var hex:any = Number(aColor[i]).toString(16);
var hex: any = Number(aColor[i]).toString(16);
hex = hex < 10 ? 0 + '' + hex : hex;// 保证每个rgb的值为2位
if (hex === "0") {
hex += hex;
@ -128,143 +128,143 @@ export class EntryPlanComponent implements OnInit {
var colorArr = [];
for (var i = 0; i < step; i++) {
//计算每一步的hex值
var hex = _this.colorHex('rgb('+ parseInt((sR * i + startR))+ ',' + parseInt((sG * i + startG))+ ',' + parseInt((sB * i + startB)) + ')');
var hex = _this.colorHex('rgb(' + parseInt((sR * i + startR)) + ',' + parseInt((sG * i + startG)) + ',' + parseInt((sB * i + startB)) + ')');
colorArr.push(hex);
}
return colorArr;
}
integrity(width){
}
integrity(width) {
let _this = this
let style:any = {}
style.width = width +'%';
if(width < 30){
let style: any = {}
style.width = width + '%';
if (width < 30) {
let colorArr = this.gradientColor('#D50000', '#E53935', 30);
for(let i = 0; i < 30; i++){
if( i == width){
for (let i = 0; i < 30; i++) {
if (i == width) {
style.background = colorArr[i]
}
}
}
if(width >= 30 && width < 60){
if (width >= 30 && width < 60) {
let colorArr = this.gradientColor('#FF9800', '#E65100', 30);
for(let i = 30; i < 60; i++){
if( i == width){
style.background = colorArr[i-30]
for (let i = 30; i < 60; i++) {
if (i == width) {
style.background = colorArr[i - 30]
}
}
}
if(width >= 60){
if (width >= 60) {
let colorArr = this.gradientColor('#81C784', '#2E7D32', 41);
for(let i = 60; i <= 100; i++){
if( i == width){
style.background = colorArr[i-60]
for (let i = 60; i <= 100; i++) {
if (i == width) {
style.background = colorArr[i - 60]
}
}
}
return style
}
integrityDetails(width,zong){
let style:any = {}
style.width = (width/zong)*100 +'%';
integrityDetails(width, zong) {
let style: any = {}
style.width = (width / zong) * 100 + '%';
return style
}
level
ngOnInit(): void {
if(window.matchMedia("(max-width: 1400px)").matches){
this.pcMore=false
this.padMore=true
this.pcfind=false
this.padjt=true
}else{
this.pcfind=true
this.pcMore=true
this.padMore=false
this.padjt=false
if (window.matchMedia("(max-width: 1400px)").matches) {
this.pcMore = false
this.padMore = true
this.pcfind = false
this.padjt = true
} else {
this.pcfind = true
this.pcMore = true
this.padMore = false
this.padjt = false
}
this.getunitdata();
this.getOrganizations();
this.getUnittype();
this.getAllPlanInfo();
this.level = sessionStorage.getItem("level");
if(this.level == "0"){//如果是总队
if (this.level == "0") {//如果是总队
this.preparelevels = [
{name:"总队",value:"1"},
{name:"支队",value:"2"},
{name:"大队",value:"4"},
{name:"中队",value:"8"}
{ name: "总队", value: "1" },
{ name: "支队", value: "2" },
{ name: "大队", value: "4" },
{ name: "中队", value: "8" }
]
}
if(this.level == "1"){//如果是支队
if (this.level == "1") {//如果是支队
this.preparelevels = [
{name:"支队",value:"2"},
{name:"大队",value:"4"},
{name:"中队",value:"8"}
{ name: "支队", value: "2" },
{ name: "大队", value: "4" },
{ name: "中队", value: "8" }
]
}
if(this.level == "2"){//如果是大队
if (this.level == "2") {//如果是大队
this.preparelevels = [
{name:"大队",value:"4"},
{name:"中队",value:"8"}
{ name: "大队", value: "4" },
{ name: "中队", value: "8" }
]
}
if(this.level == "3"){//如果是中队
if (this.level == "3") {//如果是中队
this.preparelevels = [
{name:"中队",value:"8"}
{ name: "中队", value: "8" }
]
}
}
pcMore//pc更多
pcput=false//pc收起
pcput = false//pc收起
pcfind//pc查询
padjt=false
padMore=true//pad收缩控制
padput=false//pad收起按钮
imgsrcopen="../../../assets/images/routdown2.png"
imgsrcdown="../../../assets/images/routup2.png"
pcInfo(){
this.pcMore=!this.pcMore
this.pcput=!this.pcput
}
padInfo(){
this.padMore=!this.padMore
this.padput=!this.padput
padjt = false
padMore = true//pad收缩控制
padput = false//pad收起按钮
imgsrcopen = "../../../assets/images/routdown2.png"
imgsrcdown = "../../../assets/images/routup2.png"
pcInfo() {
this.pcMore = !this.pcMore
this.pcput = !this.pcput
}
padInfo() {
this.padMore = !this.padMore
this.padput = !this.padput
}
//得到当前单位信息
getunitdata(){
getunitdata() {
this.http.get("/api/Account/Profiles").subscribe(
(data:any)=>{
(data: any) => {
this.organizationName = data.organizationName
}
)
}
treedata:any //组织机构树型数据
newArr:any = []
newallorganizations:any //用于存储在原始数据基础上的每个机构增加children字段
treedata: any //组织机构树型数据
newArr: any = []
newallorganizations: any //用于存储在原始数据基础上的每个机构增加children字段
//得到当前单位所在组织机构的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/Account/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]
}
});
}else{
} else {
this.dataSource.data = this.tree.toTree(this.treedata);
}
}
@ -273,9 +273,9 @@ export class EntryPlanComponent implements OnInit {
}
//获得所有组织机构
getOrganizations(){
getOrganizations() {
this.http.get('/api/Organizations').subscribe(
(data:any)=>{
(data: any) => {
this.allorganizations = data
this.treedata = this.tree.toTree(data);
this.getpresentOrganization();
@ -283,21 +283,21 @@ export class EntryPlanComponent implements OnInit {
)
}
//获得所有单位类型
getUnittype(){
getUnittype() {
this.http.get('/api/BuildingTypes/Simple').subscribe(
data=>{
data => {
this.allunittype = data
}
)
}
//分页事件
chagePage(e){
this.PageNumber = e.pageIndex+1
chagePage(e) {
this.PageNumber = e.pageIndex + 1
this.getAllPlanInfo();
}
//辖区中队div是否显示
isorganizationbox:boolean = false
isorganizationbox: boolean = false
//点击辖区中队树,将选择的辖区中队添加到变量
add(node) {
this.isorganizationbox = false
@ -309,21 +309,26 @@ export class EntryPlanComponent implements OnInit {
this.isorganizationbox = true
}
//关闭出现的组织机构div
closediv(){
closediv() {
this.isorganizationbox = false
}
allPlanInfo:any //存储所有预案信息
allPlanInfo: any //存储所有预案信息
//获得所有预案信息
getAllPlanInfo(){
templatePlan: boolean = false//模板录入预案checkbox
customPlan: boolean = false//自定义预案
getAllPlanInfo() {
let planmode = []
this.templatePlan ? planmode.push(2) : null
this.customPlan ? planmode.push(4) : null
let reservePlanType
this.reservePlanType ? reservePlanType = JSON.parse(JSON.stringify(this.reservePlanType)) : reservePlanType = ''
if(this.reservePlanType && this.reservePlanType.length != 0){
if (this.reservePlanType && this.reservePlanType.length != 0) {
reservePlanType = eval(this.reservePlanType.join("|"))
}
let paramsdata:any = {
let paramsdata: any = {
CompanyName: this.companyName || '',
OrganizationId: this.jsId || '',
HasChildrenOrganization:this.jscheck || '',
HasChildrenOrganization: this.jscheck || '',
BuildingTypeId: this.unittype || '',
PlanType: reservePlanType || '',
AuditStatus: this.toExamine || '',
@ -333,12 +338,13 @@ export class EntryPlanComponent implements OnInit {
PageSize: this.pageSizeOptions[0],
Sort: this.integritySort ? 'integrityscore' : '',
SortType: this.integritySort || '',
HasPlanComponents:this.haveyuan||'',
PlanCategories:this.planCategory,
IsNewData:this.IsNewData,
IsNewCompanyData:this.IsNewCompanyData
HasPlanComponents: this.haveyuan || '',
PlanCategories: this.planCategory,
IsNewData: this.IsNewData,
IsNewCompanyData: this.IsNewCompanyData,
PlanModes: planmode
}
this.http.get("/api/Plans",{params:paramsdata}).subscribe((data:any)=>{
this.http.get("/api/Plans", { params: paramsdata }).subscribe((data: any) => {
this.length = data.totalCount
this.allPlanInfo = data
@ -347,34 +353,34 @@ export class EntryPlanComponent implements OnInit {
})
}
operation=true
operation = true
//查看预案按钮跳转
routerTo(element){
this.level=='0'?this.operation=false:true
sessionStorage.setItem("companyName",element.company.name)
window.open(`/planManagement/entryPlandetail?unitId=${element.company.id}&unitTypeId=${element.company.buildingTypes.length == 0 ? null :element.company.buildingTypes[0].id}&operation=${this.operation}&pagetype=entryplan&unitName=${element.company.name}&orName=${element.company.organizationName}&orId=${element.company.organizationId}&unitType=${element.company.buildingTypes.length == 0 ? null :element.company.buildingTypes[0].name}&unitAdd=${element.company.address}&usci=${element.company.usci}`);
routerTo(element) {
this.level == '0' ? this.operation = false : true
sessionStorage.setItem("companyName", element.company.name)
window.open(`/planManagement/entryPlandetail?unitId=${element.company.id}&unitTypeId=${element.company.buildingTypes.length == 0 ? null : element.company.buildingTypes[0].id}&operation=${this.operation}&pagetype=entryplan&unitName=${element.company.name}&orName=${element.company.organizationName}&orId=${element.company.organizationId}&unitType=${element.company.buildingTypes.length == 0 ? null : element.company.buildingTypes[0].name}&unitAdd=${element.company.address}&usci=${element.company.usci}`);
}
//查询
onSubmit (value) {
onSubmit(value) {
this.PageNumber = 1
this.pageEvent.pageIndex = 0
this.getAllPlanInfo()
}
companyName:any //单位名称
js:any //所选组织机构
jsId:any //所选组织机构的id
jscheck:boolean //所选组织机构勾选框
unittype:any //单位类型
reservePlanType:any //预案类型
toExamine:any //审核状态
preparelevel:any //编制级别
plcheck:boolean //编制级别勾选框
planCategory=[] //预案级别
companyName: any //单位名称
js: any //所选组织机构
jsId: any //所选组织机构的id
jscheck: boolean //所选组织机构勾选框
unittype: any //单位类型
reservePlanType: any //预案类型
toExamine: any //审核状态
preparelevel: any //编制级别
plcheck: boolean //编制级别勾选框
planCategory = [] //预案级别
//重置
reset(){
this.IsNewCompanyData=''
this.IsNewData=''
reset() {
this.IsNewCompanyData = ''
this.IsNewData = ''
this.companyName = ''
this.js = ''
this.jsId = ''
@ -385,12 +391,15 @@ export class EntryPlanComponent implements OnInit {
this.preparelevel = ''
this.integritySort = ''
this.plcheck = false
this.haveyuan=''
this.planCategory=[]
this.haveyuan = ''
this.planCategory = []
//重新获取初始化列表
// console.log(this.pageEvent)
this.pageEvent.pageIndex = 0
this.PageNumber = 1
this.templatePlan = false
this.customPlan = false
this.getAllPlanInfo();
}
}

33
src/app/plan-management/open-plan/open-plan.component.html

@ -8,7 +8,7 @@
<input matInput placeholder="请输入单位名称" name="companyName" [(ngModel)]="companyName" autocomplete="off">
</mat-form-field>
</div>
<div class="queryField" >
<div class="queryField">
<label style="margin-right: 10px;">编制级别:</label>
<mat-form-field>
<mat-select [(ngModel)]="preparelevel" name="preparelevel" placeholder='请选择编制级别'>
@ -16,8 +16,10 @@
</mat-select>
</mat-form-field>
<mat-checkbox style="margin-left: 6px;" [(ngModel)]="plcheck" name="plcheck">包含下级</mat-checkbox>
<span *ngIf="padMore" style="margin-left: 20px; color: #0080FF;" (click)='padInfo()'>更多筛选条件<img [src]='imgsrcopen'style="width: 10px;height: 6px;margin:0 0 3px 2px;"> </span>
<span *ngIf="padput" style="margin-left: 10px; color: #0080FF;" (click)='padInfo()'>收起<img [src]='imgsrcdown'style="width: 10px;height: 6px;margin:0 0 3px 2px;"> </span>
<span *ngIf="padMore" style="margin-left: 20px; color: #0080FF;" (click)='padInfo()'>更多筛选条件<img
[src]='imgsrcopen' style="width: 10px;height: 6px;margin:0 0 3px 2px;"> </span>
<span *ngIf="padput" style="margin-left: 10px; color: #0080FF;" (click)='padInfo()'>收起<img [src]='imgsrcdown'
style="width: 10px;height: 6px;margin:0 0 3px 2px;"> </span>
</div>
<div class="queryField" *ngIf="!pcfind">
@ -28,7 +30,7 @@
<label style="margin-right: 10px;">单位类型:</label>
<mat-form-field>
<mat-select placeholder='请选择单位类型' [(ngModel)]="unittype" name="unittype">
<mat-option *ngFor="let unit of allunittype" [value]="unit.id" >
<mat-option *ngFor="let unit of allunittype" [value]="unit.id">
{{unit.name}}
</mat-option>
</mat-select>
@ -64,17 +66,22 @@
</mat-select>
</mat-form-field>
</div>
<div class="queryField" *ngIf="pcfind" >
<div class="queryField" *ngIf="!padMore">
<mat-checkbox [(ngModel)]="templatePlan" name="templatePlan">模板录入预案</mat-checkbox>
</div>
<div class="queryField" *ngIf="!padMore">
<mat-checkbox [(ngModel)]="customPlan" name="customPlan">自定义预案</mat-checkbox>
</div>
<div class="queryField" *ngIf="pcfind">
<button mat-raised-button color="primary">查询</button>
<button mat-raised-button style="margin-left: 25px;" type="button" (click)="reset()">重置</button>
</div>
</div>
</form>
</div>
<!-- <mat-divider></mat-divider> -->
<div class="body">
</div>
<!-- <mat-divider></mat-divider> -->
<div class="body">
<div class="tablebox">
<table mat-table [dataSource]="tabledataSource" class="mat-elevation-z8">
<ng-container matColumnDef="state">
@ -130,14 +137,10 @@
<tr mat-header-row *matHeaderRowDef="displayedColumns"></tr>
<tr mat-row *matRowDef="let row; columns: displayedColumns;"></tr>
</table>
<mat-paginator [length]="length"
[pageSize]="pageSize"
[pageSizeOptions]="pageSizeOptions"
<mat-paginator [length]="length" [pageSize]="pageSize" [pageSizeOptions]="pageSizeOptions"
(page)="chagePage($event)">
</mat-paginator>
</div>
</div>
</div>
</div>

25
src/app/plan-management/open-plan/open-plan.component.spec.ts

@ -1,25 +0,0 @@
import { async, ComponentFixture, TestBed } from '@angular/core/testing';
import { OpenPlanComponent } from './open-plan.component';
describe('OpenPlanComponent', () => {
let component: OpenPlanComponent;
let fixture: ComponentFixture<OpenPlanComponent>;
beforeEach(async(() => {
TestBed.configureTestingModule({
declarations: [ OpenPlanComponent ]
})
.compileComponents();
}));
beforeEach(() => {
fixture = TestBed.createComponent(OpenPlanComponent);
component = fixture.componentInstance;
fixture.detectChanges();
});
it('should create', () => {
expect(component).toBeTruthy();
});
});

22
src/app/plan-management/open-plan/open-plan.component.ts

@ -43,9 +43,9 @@ export class OpenPlanComponent implements OnInit {
pageSize: any; //每页条数
pageSizeOptions: number[] = [10] //设置每页条数
PageNumber: any; //第几页
IsNewData='' //维护更新活新增
IsNewData = '' //维护更新活新增
displayedColumns: string[] = ['state','unitname', 'planname', 'addpeople', 'addtime', 'plantype', 'auditStatus', 'weihuStatus','openRange', 'projectlevel', 'operation'];
displayedColumns: string[] = ['state', 'unitname', 'planname', 'addpeople', 'addtime', 'plantype', 'auditStatus', 'weihuStatus', 'openRange', 'projectlevel', 'operation'];
allorganizations: any //所有组织机构
allunittype: any //所有单位类型
@ -115,8 +115,13 @@ export class OpenPlanComponent implements OnInit {
allPlanInfo: any //存储所有预案信息
//获得所有预案信息
IsNewCompanyData=''
IsNewCompanyData = ''
templatePlan: boolean = false//模板录入预案checkbox
customPlan: boolean = false//自定义预案
getAllPlanInfo() {
let planmode = []
this.templatePlan ? planmode.push(2) : null
this.customPlan ? planmode.push(4) : null
let paramsdata: any = {
CompanyName: this.companyName || '',
OrganizationId: '',
@ -129,8 +134,9 @@ export class OpenPlanComponent implements OnInit {
PageNumber: this.PageNumber || '1',
PageSize: this.pageSizeOptions[0],
Sort: '',
IsNewData:this.IsNewData,
IsNewCompanyData:this.IsNewCompanyData
IsNewData: this.IsNewData,
IsNewCompanyData: this.IsNewCompanyData,
PlanModes: planmode
}
this.http.get("/api/PublicPlans", { params: paramsdata }).subscribe((data: any) => {
// console.log(111,data)
@ -292,9 +298,11 @@ export class OpenPlanComponent implements OnInit {
//重新获取初始化列表
this.pageEvent.pageIndex = 0
this.PageNumber = 1
this.templatePlan = false
this.customPlan = false
this.getAllPlanInfo();
this.IsNewCompanyData=''
this.IsNewData=''
this.IsNewCompanyData = ''
this.IsNewData = ''
}
}

66
src/app/plan-management/pass-plan/pass-plan.component.html

@ -13,24 +13,26 @@
<div class="queryField ordiv">
<label style="margin-right: 10px;">消防救援站:</label>
<mat-form-field class="example-full-width">
<input readonly matInput placeholder="请选择消防救援站" autocomplete="off" [(ngModel)]="js" name="js" (focus)="openorganizationbox()">
<input readonly matInput placeholder="请选择消防救援站" autocomplete="off" [(ngModel)]="js" name="js"
(focus)="openorganizationbox()">
</mat-form-field>
<mat-checkbox style="margin-left: 6px;" [(ngModel)]="jscheck" name="jscheck">包含下级</mat-checkbox>
<span *ngIf="padMore" style="margin-left: 10px; color: #0080FF;" (click)='padInfo()'>更多筛选条件<img [src]='imgsrcopen'style="width: 10px;height: 6px;margin:0 0 3px 2px;"> </span>
<span *ngIf="padput" style="margin-left: 10px; color: #0080FF;" (click)='padInfo()'>收起<img [src]='imgsrcdown'style="width: 10px;height: 6px;margin:0 0 3px 2px;"> </span>
<span *ngIf="padMore" style="margin-left: 10px; color: #0080FF;" (click)='padInfo()'>更多筛选条件<img
[src]='imgsrcopen' style="width: 10px;height: 6px;margin:0 0 3px 2px;"> </span>
<span *ngIf="padput" style="margin-left: 10px; color: #0080FF;" (click)='padInfo()'>收起<img [src]='imgsrcdown'
style="width: 10px;height: 6px;margin:0 0 3px 2px;"> </span>
<div class="organizationbox" *ngIf="isorganizationbox">
<div (click)="closediv()" class="closediv"><mat-icon>clear</mat-icon></div>
<div (click)="closediv()" class="closediv">
<mat-icon>clear</mat-icon>
</div>
<mat-tree [dataSource]="dataSource" [treeControl]="treeControl">
<mat-tree-node *matTreeNodeDef="let node" matTreeNodePadding (click)='add(node)' class="organizationlist">
<button type="button" mat-icon-button disabled ></button>
<button type="button" mat-icon-button disabled></button>
<li>{{node.name}}</li>
</mat-tree-node>
<mat-tree-node *matTreeNodeDef="let node;when: hasChild" matTreeNodePadding (click)='add(node)' class="organizationlist">
<button
type="button"
mat-icon-button
matTreeNodeToggle
[attr.aria-label]="'toggle ' + node.name">
<mat-tree-node *matTreeNodeDef="let node;when: hasChild" matTreeNodePadding (click)='add(node)'
class="organizationlist">
<button type="button" mat-icon-button matTreeNodeToggle [attr.aria-label]="'toggle ' + node.name">
<mat-icon class="mat-icon-rtl-mirror">
{{treeControl.isExpanded(node) ? 'expand_more' : 'chevron_right'}}
</mat-icon>
@ -60,15 +62,17 @@
<label style="margin-right: 10px;">单位类型:</label>
<mat-form-field>
<mat-select placeholder='请选择单位类型' [(ngModel)]="unittype" name="unittype">
<mat-option *ngFor="let unit of allunittype" [value]="unit.id" >
<mat-option *ngFor="let unit of allunittype" [value]="unit.id">
{{unit.name}}
</mat-option>
</mat-select>
</mat-form-field>
<span *ngIf="pcMore" style="margin-left: 20px; color: #0080FF; cursor: pointer;" (click)='pcInfo()'>更多筛选条件<img [src]='imgsrcopen'style="width: 10px;height: 6px;margin:0 0 3px 2px;"> </span>
<span *ngIf="pcput" style="margin-left: 10px; color: #0080FF; cursor: pointer;" (click)='pcInfo()'>收起<img [src]='imgsrcdown'style="width: 10px;height: 6px;margin:0 0 3px 2px;"> </span>
<span *ngIf="pcMore" style="margin-left: 20px; color: #0080FF; cursor: pointer;" (click)='pcInfo()'>更多筛选条件<img
[src]='imgsrcopen' style="width: 10px;height: 6px;margin:0 0 3px 2px;"> </span>
<span *ngIf="pcput" style="margin-left: 10px; color: #0080FF; cursor: pointer;" (click)='pcInfo()'>收起<img
[src]='imgsrcdown' style="width: 10px;height: 6px;margin:0 0 3px 2px;"> </span>
</div>
<div class="queryField" *ngIf="pcfind" >
<div class="queryField" *ngIf="pcfind">
<button mat-raised-button color="primary">查询</button>
<button mat-raised-button style="margin-left: 25px;" type="button" (click)="reset()">重置</button>
</div>
@ -127,13 +131,18 @@
</mat-select>
</mat-form-field>
</div>
<div class="queryField" *ngIf="!padMore&&!pcMore">
<mat-checkbox [(ngModel)]="templatePlan" name="templatePlan">模板录入预案</mat-checkbox>
</div>
<div class="queryField" *ngIf="!padMore&&!pcMore">
<mat-checkbox [(ngModel)]="customPlan" name="customPlan">自定义预案</mat-checkbox>
</div>
</div>
</form>
</div>
<!-- <mat-divider></mat-divider> -->
<div class="body">
</div>
<!-- <mat-divider></mat-divider> -->
<div class="body">
<div class="tablebox">
<table mat-table [dataSource]="tabledataSource" class="mat-elevation-z8">
@ -156,7 +165,8 @@
<ng-container matColumnDef="level">
<th mat-header-cell *matHeaderCellDef>预案级别</th>
<td mat-cell *matCellDef="let element">{{element.planCategory==1?'Ⅰ级预案':element.planCategory==2?'Ⅱ级预案':
element.planCategory==3?'Ⅲ级预案':element.planCategory==4?'Ⅳ级预案':element.planCategory==5?'Ⅴ级预案':element.planCategory==8?'类型预案':'应急预案'}}</td>
element.planCategory==3?'Ⅲ级预案':element.planCategory==4?'Ⅳ级预案':element.planCategory==5?'Ⅴ级预案':element.planCategory==8?'类型预案':'应急预案'}}
</td>
</ng-container>
<ng-container matColumnDef="addtime">
<th mat-header-cell *matHeaderCellDef>添加时间</th>
@ -187,21 +197,21 @@
<th mat-header-cell *matHeaderCellDef>操作</th>
<td mat-cell *matCellDef="let element">
<span (click)="lookUnitInfo(element)" style="color: blue;cursor: pointer;">查看单位信息</span>
<span (click)="routerTo(element)" style="color: blue;cursor: pointer;margin-left: 10px;">{{url=='1'?'审核预案':'查看预案'}} </span>
<label style="color: #0000FF;margin-left: 10px;cursor: pointer;" (click)='openReserve(element)' *ngIf="element.auditStatus==2">预案公开</label>
<label style="color: #0000FF;margin-left: 10px;cursor: pointer;" (click)='closeReserve(element)' *ngIf="element.auditStatus==2">预案取消公开</label>
<span (click)="routerTo(element)"
style="color: blue;cursor: pointer;margin-left: 10px;">{{url=='1'?'审核预案':'查看预案'}} </span>
<label style="color: #0000FF;margin-left: 10px;cursor: pointer;" (click)='openReserve(element)'
*ngIf="element.auditStatus==2">预案公开</label>
<label style="color: #0000FF;margin-left: 10px;cursor: pointer;" (click)='closeReserve(element)'
*ngIf="element.auditStatus==2">预案取消公开</label>
</td>
</ng-container>
<tr mat-header-row *matHeaderRowDef="displayedColumns"></tr>
<tr mat-row *matRowDef="let row; columns: displayedColumns;"></tr>
</table>
<mat-paginator
[length]="length"
[pageSize]="pageSize"
[pageSizeOptions]="pageSizeOptions"
<mat-paginator [length]="length" [pageSize]="pageSize" [pageSizeOptions]="pageSizeOptions"
(page)="chagePage($event)">
</mat-paginator>
</div>
</div>
</div>
</div>

25
src/app/plan-management/pass-plan/pass-plan.component.spec.ts

@ -1,25 +0,0 @@
import { async, ComponentFixture, TestBed } from '@angular/core/testing';
import { PassPlanComponent } from './pass-plan.component';
describe('PassPlanComponent', () => {
let component: PassPlanComponent;
let fixture: ComponentFixture<PassPlanComponent>;
beforeEach(async(() => {
TestBed.configureTestingModule({
declarations: [ PassPlanComponent ]
})
.compileComponents();
}));
beforeEach(() => {
fixture = TestBed.createComponent(PassPlanComponent);
component = fixture.componentInstance;
fixture.detectChanges();
});
it('should create', () => {
expect(component).toBeTruthy();
});
});

24
src/app/plan-management/pass-plan/pass-plan.component.ts

@ -44,11 +44,11 @@ export class PassPlanComponent implements OnInit {
pageSizeOptions: number[] = [10] //设置每页条数
PageNumber: any; //第几页
displayedColumns: string[] = ['state','planname', 'addpeople', 'level', 'addtime', 'plantype', 'auditStatus','weihuState', 'openRange', 'projectlevel', 'operation'];
displayedColumns: string[] = ['state', 'planname', 'addpeople', 'level', 'addtime', 'plantype', 'auditStatus', 'weihuState', 'openRange', 'projectlevel', 'operation'];
allorganizations: any //所有组织机构
allunittype: any //所有单位类型
tabledataSource: any //表格数据
IsNewData='' //维护更新活新增
IsNewData = '' //维护更新活新增
url
preparelevels: any
@ -116,9 +116,14 @@ export class PassPlanComponent implements OnInit {
}
allPlanInfo: any //存储所有预案信息
IsNewCompanyData='' //单位是新增还是维护更新
IsNewCompanyData = '' //单位是新增还是维护更新
templatePlan: boolean = false//模板录入预案checkbox
customPlan: boolean = false//自定义预案
//获得所有预案信息
getAllPlanInfo() {
let planmode = []
this.templatePlan ? planmode.push(2) : null
this.customPlan ? planmode.push(4) : null
let reservePlanType
this.reservePlanType ? reservePlanType = JSON.parse(JSON.stringify(this.reservePlanType)) : reservePlanType = ''
if (this.reservePlanType && this.reservePlanType.length != 0) {
@ -139,8 +144,9 @@ export class PassPlanComponent implements OnInit {
PageSize: this.pageSizeOptions[0],
Sort: '',
PlanCategories: this.planCategory,
IsNewData:this.IsNewData,
IsNewCompanyData:this.IsNewCompanyData
IsNewData: this.IsNewData,
IsNewCompanyData: this.IsNewCompanyData,
PlanModes: planmode
}
this.http.get("/api/ApprovedPlans", { params: paramsdata }).subscribe((data: any) => {
this.length = data.totalCount
@ -453,8 +459,8 @@ export class PassPlanComponent implements OnInit {
planCategory = []//预案级别
//重置
reset() {
this.IsNewData=''
this.IsNewCompanyData=''
this.IsNewData = ''
this.IsNewCompanyData = ''
this.companyName = ''
this.js = ''
this.jsId = ''
@ -469,6 +475,10 @@ export class PassPlanComponent implements OnInit {
this.pageEvent.pageIndex = 0
this.PageNumber = 1
this.planCategory = []
this.templatePlan = false
this.customPlan = false
this.getAllPlanInfo();
}
}

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

@ -86,8 +86,8 @@
<mat-form-field>
<mat-select required [(ngModel)]="preparelevel" name="preparelevel" placeholder='请选择单位状态'
[multiple]="true">
<mat-option [value]='preparelevel[0]'>新增</mat-option>
<mat-option [value]='preparelevel[1]||2'>维护更新</mat-option>
<mat-option [value]='1'>新增</mat-option>
<mat-option [value]='2'>维护更新</mat-option>
</mat-select>
</mat-form-field>
</div>
@ -134,22 +134,32 @@
<div class="tablebox" id="table">
<table cellpadding="0" cellspacing="0" *ngIf="preparelevels==0&&!tableDataNull">
<thead>
<th *ngFor="let item of displayedColumns;let i=index">{{item}}</th>
<th *ngFor="let item of displayedColumns;let i=index">{{item}}<mat-icon
*ngIf="i == 0 && orRecord.length != 0" style="cursor: pointer;vertical-align: text-top;"
(click)="goBack()">undo
</mat-icon>
</th>
</thead>
<tbody>
<tr *ngFor="let element of tabledataSource">
<td *ngFor="let eletd of element.name;let key = index" (click)="clicktd(key,eletd)">{{eletd}}</td>
<td *ngFor="let eletd of element.name;let key = index" [ngClass]="{'pointer': key == 0}"
(click)="clicktd(key,eletd)">{{eletd}}</td>
</tr>
</tbody>
</table>
<table cellpadding="0" cellspacing="0" *ngIf="preparelevels==1&&!tableDataNull">
<thead>
<th *ngFor="let item of yuanColumns;let i=index">{{item}}</th>
<th *ngFor="let item of yuanColumns;let i=index">{{item}}<mat-icon
*ngIf="i == 0 && orRecord.length != 0" style="cursor: pointer;vertical-align: text-top;"
(click)="goBack()">undo
</mat-icon>
</th>
</thead>
<tbody>
<tr *ngFor="let element of yuanTable">
<td *ngFor="let eletd of element.name;let key = index" (click)="clicktd(key,eletd)">{{eletd}}</td>
<td *ngFor="let eletd of element.name;let key = index" [ngClass]="{'pointer': key == 0}"
(click)="clicktd(key,eletd)">{{eletd}}</td>
</tr>
</tbody>
</table>

3
src/app/statistic-analysis/combined-query/combined-query.component.scss

@ -176,6 +176,9 @@
mat-paginator {
width: 100%;
}
.pointer{
cursor: pointer;
}
}
}

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

@ -59,10 +59,30 @@ export class CombinedQueryComponent implements OnInit {
selected = new FormControl(0); //选项卡实例
//判断选了哪一个
selectedIndexChange(e) {
this.orRecord = []
this.selected.setValue(e)
this.preparelevels = Number(e)
if (this.preparelevels == 0) {
this.js = this.organizationName
this.jsId = this.organizationId
this.jscheck = true
this.unittype = []
this.allunittype.forEach(element => {
this.unittype.push(element.id)
});
this.preparelevel = [1]
this.dwaddtime = '2020-01-01'//单位查询开始时间
this.dwendtime = this.getNowFormatDate()//单位结束时间
} else if (this.preparelevels == 1) {
this.yuanjs = this.organizationName
this.yuanjsId = this.organizationId
this.yuanaddtime = '2020-01-01'//预案查询开始时间
this.yuanendtime = this.getNowFormatDate()//预案查询结束时间
this.yuanjscheck = true
this.reservePlanType = ['1', '2', '4', '16']
this.planCategory = ['1', '2', '3', '4', '5']
}
this.getAllPlanInfo()
}
@ -203,6 +223,7 @@ export class CombinedQueryComponent implements OnInit {
yuanintegritySort = 1 //预案排序字段
isMasklayer = false
async getAllPlanInfo() {
console.log(this.preparelevel)
let paramsdata: any = {
QueryMode: this.preparelevels,
OrganizationId: this.jsId || '',
@ -413,6 +434,7 @@ export class CombinedQueryComponent implements OnInit {
//重置
reset() {
this.orRecord = []
if (this.preparelevels == 0) {
this.js = this.organizationName
this.jsId = this.organizationId
@ -437,27 +459,66 @@ export class CombinedQueryComponent implements OnInit {
this.getAllPlanInfo();
}
orRecord = []
//进入下一层
clicktd(key, element) {
// console.log(key)
// console.log(element)
// console.log(this.allorganizations)
let config = new MatSnackBarConfig();
config.verticalPosition = 'top';
config.duration = 3000
if (key == 0) {
let clickOr
this.allorganizations.forEach(item => {
if (element === item.name) {
clickOr = item
}
});
// console.log(clickOr)
if (this.preparelevels == 0) {
if (element == this.js) {
this.snackBar.open('已在当前查询的消防救援站下,无法下钻', '确定', config);
return
}
} else if (this.preparelevels == 1) {
if (element == this.yuanjs) {
this.snackBar.open('已在当前查询的消防救援站下,无法下钻', '确定', config);
return
}
}
if (clickOr.children.length == 0 && this.excelData.length == 1) {
this.snackBar.open('无下级消防救援站,无法下钻', '确定', config);
return
}
//记录点击过的消防救援站
this.orRecord.push({ name: this.js, id: this.jsId })
if (this.preparelevels == 0) {
this.js = element
this.jsId = item.id
this.jsId = clickOr.id
} else if (this.preparelevels == 1) {
this.yuanjs = element
this.yuanjsId = item.id
this.yuanjsId = clickOr.id
}
console.log(this.orRecord)
this.getAllPlanInfo();
}
});
}
goBack() {
if (this.preparelevels == 0) {
this.js = this.orRecord[this.orRecord.length - 1].name
this.jsId = this.orRecord[this.orRecord.length - 1].id
} else if (this.preparelevels == 1) {
this.yuanjs = this.orRecord[this.orRecord.length - 1].name
this.yuanjsId = this.orRecord[this.orRecord.length - 1].id
}
this.orRecord.pop();
console.log(this.orRecord)
this.getAllPlanInfo();
}
exal() {

Loading…
Cancel
Save