Browse Source

[完善]增加预案搜索条件

tangshan
邵佳豪 3 years ago
parent
commit
5a6da9f00d
  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. 4
      src/app/statistic-analysis/combined-query/combined-query.component.html
  11. 1
      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 style="height: 100%;overflow-y: auto;">
<div class="header" > <div class="header">
<form (ngSubmit)="onSubmit(form.value)" #form="ngForm"> <form (ngSubmit)="onSubmit(form.value)" #form="ngForm">
<div class="queryBox"> <div class="queryBox">
<div class="queryField"> <div class="queryField">
<label style="margin-right: 10px;">单位名称:</label> <label style="margin-right: 10px;">单位名称:</label>
<mat-form-field class="example-full-width"> <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> </mat-form-field>
</div> </div>
<div class="queryField" > <div class="queryField">
<label style="margin-right: 10px;">单位类型:</label> <label style="margin-right: 10px;">单位类型:</label>
<mat-form-field> <mat-form-field>
<mat-select placeholder='请选择单位类型' name="unittype" [(ngModel)]="unittype"> <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}} {{unit.name}}
</mat-option> </mat-option>
</mat-select> </mat-select>
</mat-form-field> </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="padMore" style="margin-left: 10px; color: #0080FF;" (click)='padInfo()'>更多筛选条件<img
<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> [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>
<div class="queryField" *ngIf="!pcfind"> <div class="queryField" *ngIf="!pcfind">
<button mat-raised-button color="primary">查询</button> <button mat-raised-button color="primary">查询</button>
@ -28,22 +30,24 @@
<div class="queryField ordiv" *ngIf="!padMore"> <div class="queryField ordiv" *ngIf="!padMore">
<label style="margin-right: 10px;">消防救援站:</label> <label style="margin-right: 10px;">消防救援站:</label>
<mat-form-field class="example-full-width"> <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-form-field>
<mat-checkbox style="margin-left: 6px;" [(ngModel)]="jscheck" name="jscheck">包含下级</mat-checkbox> <mat-checkbox style="margin-left: 6px;" [(ngModel)]="jscheck" name="jscheck">包含下级</mat-checkbox>
<div class="organizationbox" *ngIf="isorganizationbox"> <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 [dataSource]="dataSource" [treeControl]="treeControl">
<mat-tree-node *matTreeNodeDef="let node" matTreeNodePadding (click)='add(node)' class="organizationlist"> <mat-tree-node *matTreeNodeDef="let node" matTreeNodePadding (click)='add(node)'
<button type="button" mat-icon-button disabled ></button> class="organizationlist">
<button type="button" mat-icon-button disabled></button>
<li>{{node.name}}</li> <li>{{node.name}}</li>
</mat-tree-node> </mat-tree-node>
<mat-tree-node *matTreeNodeDef="let node;when: hasChild" matTreeNodePadding (click)='add(node)' class="organizationlist"> <mat-tree-node *matTreeNodeDef="let node;when: hasChild" matTreeNodePadding
<button (click)='add(node)' class="organizationlist">
type="button" <button type="button" mat-icon-button matTreeNodeToggle
mat-icon-button
matTreeNodeToggle
[attr.aria-label]="'toggle ' + node.name"> [attr.aria-label]="'toggle ' + node.name">
<mat-icon class="mat-icon-rtl-mirror"> <mat-icon class="mat-icon-rtl-mirror">
{{treeControl.isExpanded(node) ? 'expand_more' : 'chevron_right'}} {{treeControl.isExpanded(node) ? 'expand_more' : 'chevron_right'}}
@ -57,24 +61,30 @@
<div class="queryField" *ngIf="!padMore"> <div class="queryField" *ngIf="!padMore">
<label style="margin-right: 10px;">预案类型:</label> <label style="margin-right: 10px;">预案类型:</label>
<mat-form-field> <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=16>文本预案</mat-option>
<mat-option value=1>二维预案</mat-option> <mat-option value=1>二维预案</mat-option>
<mat-option value=2>三维预案</mat-option> <mat-option value=2>三维预案</mat-option>
<mat-option value=4>其他预案</mat-option> <mat-option value=4>其他预案</mat-option>
</mat-select> </mat-select>
</mat-form-field> </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="pcMore" style="margin-left: 15px; color: #0080FF; cursor: pointer;"
<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> (click)='pcInfo()'>更多筛选条件<img [src]='imgsrcopen'
</div> style="width: 10px;height: 6px;margin:0 0 3px 2px;"> </span>
<div class="queryField" *ngIf="pcfind" > <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 color="primary">查询</button>
<button mat-raised-button style="margin-left: 25px;" type="button" (click)="reset()">重置</button> <button mat-raised-button style="margin-left: 25px;" type="button" (click)="reset()">重置</button>
</div> </div>
<div class="queryField" *ngIf="!padMore&&!pcMore"> <div class="queryField" *ngIf="!padMore&&!pcMore">
<label style="margin-right: 10px;">预案级别:</label> <label style="margin-right: 10px;">预案级别:</label>
<mat-form-field> <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=3>Ⅲ级预案</mat-option>
<mat-option value=4>Ⅳ级预案</mat-option> <mat-option value=4>Ⅳ级预案</mat-option>
<mat-option value=5>Ⅴ级预案</mat-option> <mat-option value=5>Ⅴ级预案</mat-option>
@ -89,7 +99,8 @@
<mat-option value="2">支队</mat-option> <mat-option value="2">支队</mat-option>
<mat-option value="4">大队</mat-option> <mat-option value="4">大队</mat-option>
<mat-option value="8">中队</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-select>
</mat-form-field> </mat-form-field>
<mat-checkbox style="margin-left: 6px;" [(ngModel)]="plcheck" name="plcheck">包含下级</mat-checkbox> <mat-checkbox style="margin-left: 6px;" [(ngModel)]="plcheck" name="plcheck">包含下级</mat-checkbox>
@ -105,8 +116,6 @@
</mat-select> </mat-select>
</mat-form-field> </mat-form-field>
</div> </div>
<div class="queryField" *ngIf="!padMore&&!pcMore"> <div class="queryField" *ngIf="!padMore&&!pcMore">
<label style="margin-right: 10px;">信息完整度排序:</label> <label style="margin-right: 10px;">信息完整度排序:</label>
<mat-form-field> <mat-form-field>
@ -116,7 +125,7 @@
</mat-select> </mat-select>
</mat-form-field> </mat-form-field>
</div> </div>
<div class="queryField" *ngIf="!padMore&&!pcMore"> <div class="queryField" *ngIf="!padMore&&!pcMore">
<label style="margin-right: 10px;">制作情况:</label> <label style="margin-right: 10px;">制作情况:</label>
<mat-form-field> <mat-form-field>
<mat-select placeholder='请选择预案制作情况' [(ngModel)]="haveyuan" name="haveyuan"> <mat-select placeholder='请选择预案制作情况' [(ngModel)]="haveyuan" name="haveyuan">
@ -143,6 +152,12 @@
</mat-select> </mat-select>
</mat-form-field> </mat-form-field>
</div> </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> </div>
</form> </form>
</div> </div>
@ -169,7 +184,8 @@
<span class="integrityNum"> <span class="integrityNum">
{{(element.company.companyIntegrityScore.totalScore.toFixed(2) * 100).toFixed()}}% {{(element.company.companyIntegrityScore.totalScore.toFixed(2) * 100).toFixed()}}%
</span> </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>
<div class="integrityDetails" [ngClass]="{'bottomposition': i <= 5,'topposition': i > 5}"> <div class="integrityDetails" [ngClass]="{'bottomposition': i <= 5,'topposition': i > 5}">
<div class="integrityDetailsTop"> <div class="integrityDetailsTop">
@ -183,9 +199,12 @@
<div class="name">单位信息</div> <div class="name">单位信息</div>
<div class="colorDiv"> <div class="colorDiv">
<div class="colorDivBac"> <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> </div>
<span>{{(element.company.companyIntegrityScore.basicInfoScore * 5).toFixed(1)}}%</span> <span>{{(element.company.companyIntegrityScore.basicInfoScore *
5).toFixed(1)}}%</span>
</div> </div>
<div class="number">5%</div> <div class="number">5%</div>
</li> </li>
@ -193,9 +212,12 @@
<div class="name">建筑信息</div> <div class="name">建筑信息</div>
<div class="colorDiv"> <div class="colorDiv">
<div class="colorDivBac"> <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> </div>
<span>{{(element.company.companyIntegrityScore.buildingInfoScore * 10).toFixed(1)}}%</span> <span>{{(element.company.companyIntegrityScore.buildingInfoScore *
10).toFixed(1)}}%</span>
</div> </div>
<div class="number">10%</div> <div class="number">10%</div>
</li> </li>
@ -203,9 +225,12 @@
<div class="name">平面图</div> <div class="name">平面图</div>
<div class="colorDiv"> <div class="colorDiv">
<div class="colorDivBac"> <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> </div>
<span>{{(element.company.companyIntegrityScore.planImageScore * 10).toFixed(1)}}%</span> </div>
<span>{{(element.company.companyIntegrityScore.planImageScore *
10).toFixed(1)}}%</span>
</div> </div>
<div class="number">10%</div> <div class="number">10%</div>
</li> </li>
@ -213,9 +238,12 @@
<div class="name">四周毗邻</div> <div class="name">四周毗邻</div>
<div class="colorDiv"> <div class="colorDiv">
<div class="colorDivBac"> <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> </div>
<span>{{(element.company.companyIntegrityScore.adjoinScore * 10).toFixed(1)}}%</span> <span>{{(element.company.companyIntegrityScore.adjoinScore *
10).toFixed(1)}}%</span>
</div> </div>
<div class="number">10%</div> <div class="number">10%</div>
</li> </li>
@ -223,9 +251,12 @@
<div class="name">消防设施</div> <div class="name">消防设施</div>
<div class="colorDiv"> <div class="colorDiv">
<div class="colorDivBac"> <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> </div>
<span>{{(element.company.companyIntegrityScore.facilityScore * 25).toFixed(1)}}%</span> </div>
<span>{{(element.company.companyIntegrityScore.facilityScore *
25).toFixed(1)}}%</span>
</div> </div>
<div class="number">25%</div> <div class="number">25%</div>
</li> </li>
@ -233,9 +264,12 @@
<div class="name">重点部位</div> <div class="name">重点部位</div>
<div class="colorDiv"> <div class="colorDiv">
<div class="colorDivBac"> <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> </div>
<span>{{(element.company.companyIntegrityScore.importantLocationScore * 10).toFixed(1)}}%</span> <span>{{(element.company.companyIntegrityScore.importantLocationScore *
10).toFixed(1)}}%</span>
</div> </div>
<div class="number">10%</div> <div class="number">10%</div>
</li> </li>
@ -243,9 +277,12 @@
<div class="name">功能分区</div> <div class="name">功能分区</div>
<div class="colorDiv"> <div class="colorDiv">
<div class="colorDivBac"> <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> </div>
<span>{{(element.company.companyIntegrityScore.functionalDivisionScore * 10).toFixed(1)}}%</span> <span>{{(element.company.companyIntegrityScore.functionalDivisionScore *
10).toFixed(1)}}%</span>
</div> </div>
<div class="number">10%</div> <div class="number">10%</div>
</li> </li>
@ -253,9 +290,12 @@
<div class="name">实景图</div> <div class="name">实景图</div>
<div class="colorDiv"> <div class="colorDiv">
<div class="colorDivBac"> <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> </div>
<span>{{(element.company.companyIntegrityScore.realityImageScore * 10).toFixed(1)}}%</span> </div>
<span>{{(element.company.companyIntegrityScore.realityImageScore *
10).toFixed(1)}}%</span>
</div> </div>
<div class="number">10%</div> <div class="number">10%</div>
</li> </li>
@ -263,9 +303,12 @@
<div class="name">CAD上传</div> <div class="name">CAD上传</div>
<div class="colorDiv"> <div class="colorDiv">
<div class="colorDivBac"> <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> </div>
<span>{{(element.company.companyIntegrityScore.cadScore * 10).toFixed(1)}}%</span> <span>{{(element.company.companyIntegrityScore.cadScore *
10).toFixed(1)}}%</span>
</div> </div>
<div class="number">10%</div> <div class="number">10%</div>
</li> </li>
@ -289,7 +332,8 @@
<ng-container matColumnDef="unittype"> <ng-container matColumnDef="unittype">
<th mat-header-cell *matHeaderCellDef>单位类型</th> <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>
<ng-container matColumnDef="plantype"> <ng-container matColumnDef="plantype">
<th mat-header-cell *matHeaderCellDef>预案类型</th> <th mat-header-cell *matHeaderCellDef>预案类型</th>
@ -312,11 +356,8 @@
<tr mat-header-row *matHeaderRowDef="displayedColumns"></tr> <tr mat-header-row *matHeaderRowDef="displayedColumns"></tr>
<tr mat-row *matRowDef="let row; columns: displayedColumns;"></tr> <tr mat-row *matRowDef="let row; columns: displayedColumns;"></tr>
</table> </table>
<mat-paginator pageEvent [length]="length" <mat-paginator pageEvent [length]="length" [pageSize]="pageSize" [pageSizeOptions]="pageSizeOptions"
[pageSize]="pageSize" (page)="chagePage($event)">
[pageSizeOptions]="pageSizeOptions"
(page)="chagePage($event)"
>
</mat-paginator> </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 { MatPaginator } from '@angular/material/paginator';
import { FlatTreeControl } from '@angular/cdk/tree'; import { FlatTreeControl } from '@angular/cdk/tree';
import { FormControl } from '@angular/forms'; import { FormControl } from '@angular/forms';
import { Router,ActivatedRoute } from '@angular/router' import { Router, ActivatedRoute } from '@angular/router'
import { PageEvent } from '@angular/material/paginator'; import { PageEvent } from '@angular/material/paginator';
import { MatDialogRef, MatDialog, MAT_DIALOG_DATA } from '@angular/material/dialog'; import { MatDialogRef, MatDialog, MAT_DIALOG_DATA } from '@angular/material/dialog';
import { MatSnackBar, MatSnackBarConfig } from '@angular/material/snack-bar'; import { MatSnackBar, MatSnackBarConfig } from '@angular/material/snack-bar';
@ -17,7 +17,7 @@ import { ConstantPool } from '@angular/compiler';
}) })
export class EntryPlanComponent implements OnInit { 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 private _transformer = (node, level: number) => { //初始化tree
return { return {
@ -35,27 +35,27 @@ export class EntryPlanComponent implements OnInit {
myControl = new FormControl(); myControl = new FormControl();
hasChild = (_: number, node: any) => node.expandable; hasChild = (_: number, node: any) => node.expandable;
//分页 //分页
@ViewChild(MatPaginator, {static: true}) @ViewChild(MatPaginator, { static: true })
pageEvent: PageEvent; pageEvent: PageEvent;
paginator: MatPaginator; paginator: MatPaginator;
length:any; //共多少条数据 length: any; //共多少条数据
pageSize:any; //每页条数 pageSize: any; //每页条数
pageSizeOptions: number[] = [10] //设置每页条数 pageSizeOptions: number[] = [10] //设置每页条数
PageNumber:any; //第几页 PageNumber: any; //第几页
IsNewData='' //预案维护更新或者新增 IsNewData = '' //预案维护更新或者新增
IsNewCompanyData=''//单位维护更新或者新增 IsNewCompanyData = ''//单位维护更新或者新增
displayedColumns: string[] = ['state','unitname','integrity','level','jurisdictionsquadron', 'unittype','plantype', 'passstate','projectlevel','operation']; displayedColumns: string[] = ['state', 'unitname', 'integrity', 'level', 'jurisdictionsquadron', 'unittype', 'plantype', 'passstate', 'projectlevel', 'operation'];
allorganizations:any //所有组织机构 allorganizations: any //所有组织机构
allunittype:any //所有单位类型 allunittype: any //所有单位类型
tabledataSource:any //表格数据 tabledataSource: any //表格数据
organizationName:any //当前单位组织机构名称 organizationName: any //当前单位组织机构名称
preparelevels:any preparelevels: any
integritySort:any //完整度排序 integritySort: any //完整度排序
haveyuan//有无预案 haveyuan//有无预案
colorRgb(sColor){ colorRgb(sColor) {
var reg = /^#([0-9a-fA-f]{3}|[0-9a-fA-f]{6})$/; var reg = /^#([0-9a-fA-f]{3}|[0-9a-fA-f]{6})$/;
var sColor = sColor.toLowerCase(); var sColor = sColor.toLowerCase();
if (sColor && reg.test(sColor)) { if (sColor && reg.test(sColor)) {
@ -76,14 +76,14 @@ export class EntryPlanComponent implements OnInit {
return sColor; return sColor;
} }
} }
colorHex(rgb){ colorHex(rgb) {
var _this = rgb; var _this = rgb;
var reg = /^#([0-9a-fA-f]{3}|[0-9a-fA-f]{6})$/; var reg = /^#([0-9a-fA-f]{3}|[0-9a-fA-f]{6})$/;
if (/^(rgb|RGB)/.test(_this)) { if (/^(rgb|RGB)/.test(_this)) {
var aColor = _this.replace(/(?:(|)|rgb|RGB)*/g, "").split(","); var aColor = _this.replace(/(?:(|)|rgb|RGB)*/g, "").split(",");
var strHex = "#"; var strHex = "#";
for (var i = 0; i < aColor.length; i++) { 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位 hex = hex < 10 ? 0 + '' + hex : hex;// 保证每个rgb的值为2位
if (hex === "0") { if (hex === "0") {
hex += hex; hex += hex;
@ -128,143 +128,143 @@ export class EntryPlanComponent implements OnInit {
var colorArr = []; var colorArr = [];
for (var i = 0; i < step; i++) { for (var i = 0; i < step; i++) {
//计算每一步的hex值 //计算每一步的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); colorArr.push(hex);
} }
return colorArr; return colorArr;
} }
integrity(width){ integrity(width) {
let _this = this let _this = this
let style:any = {} let style: any = {}
style.width = width +'%'; style.width = width + '%';
if(width < 30){ if (width < 30) {
let colorArr = this.gradientColor('#D50000', '#E53935', 30); let colorArr = this.gradientColor('#D50000', '#E53935', 30);
for(let i = 0; i < 30; i++){ for (let i = 0; i < 30; i++) {
if( i == width){ if (i == width) {
style.background = colorArr[i] style.background = colorArr[i]
} }
} }
} }
if(width >= 30 && width < 60){ if (width >= 30 && width < 60) {
let colorArr = this.gradientColor('#FF9800', '#E65100', 30); let colorArr = this.gradientColor('#FF9800', '#E65100', 30);
for(let i = 30; i < 60; i++){ for (let i = 30; i < 60; i++) {
if( i == width){ if (i == width) {
style.background = colorArr[i-30] style.background = colorArr[i - 30]
} }
} }
} }
if(width >= 60){ if (width >= 60) {
let colorArr = this.gradientColor('#81C784', '#2E7D32', 41); let colorArr = this.gradientColor('#81C784', '#2E7D32', 41);
for(let i = 60; i <= 100; i++){ for (let i = 60; i <= 100; i++) {
if( i == width){ if (i == width) {
style.background = colorArr[i-60] style.background = colorArr[i - 60]
} }
} }
} }
return style return style
} }
integrityDetails(width,zong){ integrityDetails(width, zong) {
let style:any = {} let style: any = {}
style.width = (width/zong)*100 +'%'; style.width = (width / zong) * 100 + '%';
return style return style
} }
level level
ngOnInit(): void { ngOnInit(): void {
if(window.matchMedia("(max-width: 1400px)").matches){ if (window.matchMedia("(max-width: 1400px)").matches) {
this.pcMore=false this.pcMore = false
this.padMore=true this.padMore = true
this.pcfind=false this.pcfind = false
this.padjt=true this.padjt = true
}else{ } else {
this.pcfind=true this.pcfind = true
this.pcMore=true this.pcMore = true
this.padMore=false this.padMore = false
this.padjt=false this.padjt = false
} }
this.getunitdata(); this.getunitdata();
this.getOrganizations(); this.getOrganizations();
this.getUnittype(); this.getUnittype();
this.getAllPlanInfo(); this.getAllPlanInfo();
this.level = sessionStorage.getItem("level"); this.level = sessionStorage.getItem("level");
if(this.level == "0"){//如果是总队 if (this.level == "0") {//如果是总队
this.preparelevels = [ this.preparelevels = [
{name:"总队",value:"1"}, { name: "总队", value: "1" },
{name:"支队",value:"2"}, { name: "支队", value: "2" },
{name:"大队",value:"4"}, { name: "大队", value: "4" },
{name:"中队",value:"8"} { name: "中队", value: "8" }
] ]
} }
if(this.level == "1"){//如果是支队 if (this.level == "1") {//如果是支队
this.preparelevels = [ this.preparelevels = [
{name:"支队",value:"2"}, { name: "支队", value: "2" },
{name:"大队",value:"4"}, { name: "大队", value: "4" },
{name:"中队",value:"8"} { name: "中队", value: "8" }
] ]
} }
if(this.level == "2"){//如果是大队 if (this.level == "2") {//如果是大队
this.preparelevels = [ this.preparelevels = [
{name:"大队",value:"4"}, { name: "大队", value: "4" },
{name:"中队",value:"8"} { name: "中队", value: "8" }
] ]
} }
if(this.level == "3"){//如果是中队 if (this.level == "3") {//如果是中队
this.preparelevels = [ this.preparelevels = [
{name:"中队",value:"8"} { name: "中队", value: "8" }
] ]
} }
} }
pcMore//pc更多 pcMore//pc更多
pcput=false//pc收起 pcput = false//pc收起
pcfind//pc查询 pcfind//pc查询
padjt=false padjt = false
padMore=true//pad收缩控制 padMore = true//pad收缩控制
padput=false//pad收起按钮 padput = false//pad收起按钮
imgsrcopen="../../../assets/images/routdown2.png" imgsrcopen = "../../../assets/images/routdown2.png"
imgsrcdown="../../../assets/images/routup2.png" imgsrcdown = "../../../assets/images/routup2.png"
pcInfo(){ pcInfo() {
this.pcMore=!this.pcMore this.pcMore = !this.pcMore
this.pcput=!this.pcput this.pcput = !this.pcput
} }
padInfo(){ padInfo() {
this.padMore=!this.padMore this.padMore = !this.padMore
this.padput=!this.padput this.padput = !this.padput
} }
//得到当前单位信息 //得到当前单位信息
getunitdata(){ getunitdata() {
this.http.get("/api/Account/Profiles").subscribe( this.http.get("/api/Account/Profiles").subscribe(
(data:any)=>{ (data: any) => {
this.organizationName = data.organizationName this.organizationName = data.organizationName
} }
) )
} }
treedata:any //组织机构树型数据 treedata: any //组织机构树型数据
newArr:any = [] newArr: any = []
newallorganizations:any //用于存储在原始数据基础上的每个机构增加children字段 newallorganizations: any //用于存储在原始数据基础上的每个机构增加children字段
//得到当前单位所在组织机构的tree型数据 //得到当前单位所在组织机构的tree型数据
getpresentOrganization(){ getpresentOrganization() {
this.newallorganizations = this.allorganizations this.newallorganizations = this.allorganizations
this.newallorganizations.forEach(item => { this.newallorganizations.forEach(item => {
item.children = [] item.children = []
this.newallorganizations.forEach(element => { this.newallorganizations.forEach(element => {
if(element.parentId == item.id){ if (element.parentId == item.id) {
item.children.push(element) item.children.push(element)
} }
}); });
}); });
this.http.get("/api/Account/Profiles").subscribe( this.http.get("/api/Account/Profiles").subscribe(
(data:any)=>{ (data: any) => {
this.organizationName = data.organizationName this.organizationName = data.organizationName
if(this.organizationName){ if (this.organizationName) {
this.newallorganizations.forEach(item => { this.newallorganizations.forEach(item => {
if(item.name == this.organizationName){ if (item.name == this.organizationName) {
this.dataSource.data = [item] this.dataSource.data = [item]
} }
}); });
}else{ } else {
this.dataSource.data = this.tree.toTree(this.treedata); 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( this.http.get('/api/Organizations').subscribe(
(data:any)=>{ (data: any) => {
this.allorganizations = data this.allorganizations = data
this.treedata = this.tree.toTree(data); this.treedata = this.tree.toTree(data);
this.getpresentOrganization(); this.getpresentOrganization();
@ -283,21 +283,21 @@ export class EntryPlanComponent implements OnInit {
) )
} }
//获得所有单位类型 //获得所有单位类型
getUnittype(){ getUnittype() {
this.http.get('/api/BuildingTypes/Simple').subscribe( this.http.get('/api/BuildingTypes/Simple').subscribe(
data=>{ data => {
this.allunittype = data this.allunittype = data
} }
) )
} }
//分页事件 //分页事件
chagePage(e){ chagePage(e) {
this.PageNumber = e.pageIndex+1 this.PageNumber = e.pageIndex + 1
this.getAllPlanInfo(); this.getAllPlanInfo();
} }
//辖区中队div是否显示 //辖区中队div是否显示
isorganizationbox:boolean = false isorganizationbox: boolean = false
//点击辖区中队树,将选择的辖区中队添加到变量 //点击辖区中队树,将选择的辖区中队添加到变量
add(node) { add(node) {
this.isorganizationbox = false this.isorganizationbox = false
@ -309,21 +309,26 @@ export class EntryPlanComponent implements OnInit {
this.isorganizationbox = true this.isorganizationbox = true
} }
//关闭出现的组织机构div //关闭出现的组织机构div
closediv(){ closediv() {
this.isorganizationbox = false 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 let reservePlanType
this.reservePlanType ? reservePlanType = JSON.parse(JSON.stringify(this.reservePlanType)) : 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("|")) reservePlanType = eval(this.reservePlanType.join("|"))
} }
let paramsdata:any = { let paramsdata: any = {
CompanyName: this.companyName || '', CompanyName: this.companyName || '',
OrganizationId: this.jsId || '', OrganizationId: this.jsId || '',
HasChildrenOrganization:this.jscheck || '', HasChildrenOrganization: this.jscheck || '',
BuildingTypeId: this.unittype || '', BuildingTypeId: this.unittype || '',
PlanType: reservePlanType || '', PlanType: reservePlanType || '',
AuditStatus: this.toExamine || '', AuditStatus: this.toExamine || '',
@ -333,12 +338,13 @@ export class EntryPlanComponent implements OnInit {
PageSize: this.pageSizeOptions[0], PageSize: this.pageSizeOptions[0],
Sort: this.integritySort ? 'integrityscore' : '', Sort: this.integritySort ? 'integrityscore' : '',
SortType: this.integritySort || '', SortType: this.integritySort || '',
HasPlanComponents:this.haveyuan||'', HasPlanComponents: this.haveyuan || '',
PlanCategories:this.planCategory, PlanCategories: this.planCategory,
IsNewData:this.IsNewData, IsNewData: this.IsNewData,
IsNewCompanyData:this.IsNewCompanyData 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.length = data.totalCount
this.allPlanInfo = data this.allPlanInfo = data
@ -347,34 +353,34 @@ export class EntryPlanComponent implements OnInit {
}) })
} }
operation=true operation = true
//查看预案按钮跳转 //查看预案按钮跳转
routerTo(element){ routerTo(element) {
this.level=='0'?this.operation=false:true this.level == '0' ? this.operation = false : true
sessionStorage.setItem("companyName",element.company.name) 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}`); 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.PageNumber = 1
this.pageEvent.pageIndex = 0 this.pageEvent.pageIndex = 0
this.getAllPlanInfo() this.getAllPlanInfo()
} }
companyName:any //单位名称 companyName: any //单位名称
js:any //所选组织机构 js: any //所选组织机构
jsId:any //所选组织机构的id jsId: any //所选组织机构的id
jscheck:boolean //所选组织机构勾选框 jscheck: boolean //所选组织机构勾选框
unittype:any //单位类型 unittype: any //单位类型
reservePlanType:any //预案类型 reservePlanType: any //预案类型
toExamine:any //审核状态 toExamine: any //审核状态
preparelevel:any //编制级别 preparelevel: any //编制级别
plcheck:boolean //编制级别勾选框 plcheck: boolean //编制级别勾选框
planCategory=[] //预案级别 planCategory = [] //预案级别
//重置 //重置
reset(){ reset() {
this.IsNewCompanyData='' this.IsNewCompanyData = ''
this.IsNewData='' this.IsNewData = ''
this.companyName = '' this.companyName = ''
this.js = '' this.js = ''
this.jsId = '' this.jsId = ''
@ -385,12 +391,15 @@ export class EntryPlanComponent implements OnInit {
this.preparelevel = '' this.preparelevel = ''
this.integritySort = '' this.integritySort = ''
this.plcheck = false this.plcheck = false
this.haveyuan='' this.haveyuan = ''
this.planCategory=[] this.planCategory = []
//重新获取初始化列表 //重新获取初始化列表
// console.log(this.pageEvent) // console.log(this.pageEvent)
this.pageEvent.pageIndex = 0 this.pageEvent.pageIndex = 0
this.PageNumber = 1 this.PageNumber = 1
this.templatePlan = false
this.customPlan = false
this.getAllPlanInfo(); 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"> <input matInput placeholder="请输入单位名称" name="companyName" [(ngModel)]="companyName" autocomplete="off">
</mat-form-field> </mat-form-field>
</div> </div>
<div class="queryField" > <div class="queryField">
<label style="margin-right: 10px;">编制级别:</label> <label style="margin-right: 10px;">编制级别:</label>
<mat-form-field> <mat-form-field>
<mat-select [(ngModel)]="preparelevel" name="preparelevel" placeholder='请选择编制级别'> <mat-select [(ngModel)]="preparelevel" name="preparelevel" placeholder='请选择编制级别'>
@ -16,8 +16,10 @@
</mat-select> </mat-select>
</mat-form-field> </mat-form-field>
<mat-checkbox style="margin-left: 6px;" [(ngModel)]="plcheck" name="plcheck">包含下级</mat-checkbox> <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="padMore" style="margin-left: 20px; color: #0080FF;" (click)='padInfo()'>更多筛选条件<img
<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> [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>
<div class="queryField" *ngIf="!pcfind"> <div class="queryField" *ngIf="!pcfind">
@ -28,7 +30,7 @@
<label style="margin-right: 10px;">单位类型:</label> <label style="margin-right: 10px;">单位类型:</label>
<mat-form-field> <mat-form-field>
<mat-select placeholder='请选择单位类型' [(ngModel)]="unittype" name="unittype"> <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}} {{unit.name}}
</mat-option> </mat-option>
</mat-select> </mat-select>
@ -64,17 +66,22 @@
</mat-select> </mat-select>
</mat-form-field> </mat-form-field>
</div> </div>
<div class="queryField" *ngIf="!padMore">
<div class="queryField" *ngIf="pcfind" > <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 color="primary">查询</button>
<button mat-raised-button style="margin-left: 25px;" type="button" (click)="reset()">重置</button> <button mat-raised-button style="margin-left: 25px;" type="button" (click)="reset()">重置</button>
</div> </div>
</div> </div>
</form> </form>
</div> </div>
<!-- <mat-divider></mat-divider> --> <!-- <mat-divider></mat-divider> -->
<div class="body"> <div class="body">
<div class="tablebox"> <div class="tablebox">
<table mat-table [dataSource]="tabledataSource" class="mat-elevation-z8"> <table mat-table [dataSource]="tabledataSource" class="mat-elevation-z8">
<ng-container matColumnDef="state"> <ng-container matColumnDef="state">
@ -130,14 +137,10 @@
<tr mat-header-row *matHeaderRowDef="displayedColumns"></tr> <tr mat-header-row *matHeaderRowDef="displayedColumns"></tr>
<tr mat-row *matRowDef="let row; columns: displayedColumns;"></tr> <tr mat-row *matRowDef="let row; columns: displayedColumns;"></tr>
</table> </table>
<mat-paginator [length]="length" <mat-paginator [length]="length" [pageSize]="pageSize" [pageSizeOptions]="pageSizeOptions"
[pageSize]="pageSize"
[pageSizeOptions]="pageSizeOptions"
(page)="chagePage($event)"> (page)="chagePage($event)">
</mat-paginator> </mat-paginator>
</div> </div>
</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; //每页条数 pageSize: any; //每页条数
pageSizeOptions: number[] = [10] //设置每页条数 pageSizeOptions: number[] = [10] //设置每页条数
PageNumber: any; //第几页 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 //所有组织机构 allorganizations: any //所有组织机构
allunittype: any //所有单位类型 allunittype: any //所有单位类型
@ -115,8 +115,13 @@ export class OpenPlanComponent implements OnInit {
allPlanInfo: any //存储所有预案信息 allPlanInfo: any //存储所有预案信息
//获得所有预案信息 //获得所有预案信息
IsNewCompanyData='' IsNewCompanyData = ''
templatePlan: boolean = false//模板录入预案checkbox
customPlan: boolean = false//自定义预案
getAllPlanInfo() { getAllPlanInfo() {
let planmode = []
this.templatePlan ? planmode.push(2) : null
this.customPlan ? planmode.push(4) : null
let paramsdata: any = { let paramsdata: any = {
CompanyName: this.companyName || '', CompanyName: this.companyName || '',
OrganizationId: '', OrganizationId: '',
@ -129,8 +134,9 @@ export class OpenPlanComponent implements OnInit {
PageNumber: this.PageNumber || '1', PageNumber: this.PageNumber || '1',
PageSize: this.pageSizeOptions[0], PageSize: this.pageSizeOptions[0],
Sort: '', Sort: '',
IsNewData:this.IsNewData, IsNewData: this.IsNewData,
IsNewCompanyData:this.IsNewCompanyData IsNewCompanyData: this.IsNewCompanyData,
PlanModes: planmode
} }
this.http.get("/api/PublicPlans", { params: paramsdata }).subscribe((data: any) => { this.http.get("/api/PublicPlans", { params: paramsdata }).subscribe((data: any) => {
// console.log(111,data) // console.log(111,data)
@ -292,9 +298,11 @@ export class OpenPlanComponent implements OnInit {
//重新获取初始化列表 //重新获取初始化列表
this.pageEvent.pageIndex = 0 this.pageEvent.pageIndex = 0
this.PageNumber = 1 this.PageNumber = 1
this.templatePlan = false
this.customPlan = false
this.getAllPlanInfo(); this.getAllPlanInfo();
this.IsNewCompanyData='' this.IsNewCompanyData = ''
this.IsNewData='' this.IsNewData = ''
} }
} }

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

@ -13,24 +13,26 @@
<div class="queryField ordiv"> <div class="queryField ordiv">
<label style="margin-right: 10px;">消防救援站:</label> <label style="margin-right: 10px;">消防救援站:</label>
<mat-form-field class="example-full-width"> <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-form-field>
<mat-checkbox style="margin-left: 6px;" [(ngModel)]="jscheck" name="jscheck">包含下级</mat-checkbox> <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="padMore" style="margin-left: 10px; color: #0080FF;" (click)='padInfo()'>更多筛选条件<img
<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> [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 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 [dataSource]="dataSource" [treeControl]="treeControl">
<mat-tree-node *matTreeNodeDef="let node" matTreeNodePadding (click)='add(node)' class="organizationlist"> <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> <li>{{node.name}}</li>
</mat-tree-node> </mat-tree-node>
<mat-tree-node *matTreeNodeDef="let node;when: hasChild" matTreeNodePadding (click)='add(node)' class="organizationlist"> <mat-tree-node *matTreeNodeDef="let node;when: hasChild" matTreeNodePadding (click)='add(node)'
<button class="organizationlist">
type="button" <button type="button" mat-icon-button matTreeNodeToggle [attr.aria-label]="'toggle ' + node.name">
mat-icon-button
matTreeNodeToggle
[attr.aria-label]="'toggle ' + node.name">
<mat-icon class="mat-icon-rtl-mirror"> <mat-icon class="mat-icon-rtl-mirror">
{{treeControl.isExpanded(node) ? 'expand_more' : 'chevron_right'}} {{treeControl.isExpanded(node) ? 'expand_more' : 'chevron_right'}}
</mat-icon> </mat-icon>
@ -60,15 +62,17 @@
<label style="margin-right: 10px;">单位类型:</label> <label style="margin-right: 10px;">单位类型:</label>
<mat-form-field> <mat-form-field>
<mat-select placeholder='请选择单位类型' [(ngModel)]="unittype" name="unittype"> <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}} {{unit.name}}
</mat-option> </mat-option>
</mat-select> </mat-select>
</mat-form-field> </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="pcMore" style="margin-left: 20px; color: #0080FF; cursor: pointer;" (click)='pcInfo()'>更多筛选条件<img
<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> [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>
<div class="queryField" *ngIf="pcfind" > <div class="queryField" *ngIf="pcfind">
<button mat-raised-button color="primary">查询</button> <button mat-raised-button color="primary">查询</button>
<button mat-raised-button style="margin-left: 25px;" type="button" (click)="reset()">重置</button> <button mat-raised-button style="margin-left: 25px;" type="button" (click)="reset()">重置</button>
</div> </div>
@ -127,13 +131,18 @@
</mat-select> </mat-select>
</mat-form-field> </mat-form-field>
</div> </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> </div>
</form> </form>
</div> </div>
<!-- <mat-divider></mat-divider> --> <!-- <mat-divider></mat-divider> -->
<div class="body"> <div class="body">
<div class="tablebox"> <div class="tablebox">
<table mat-table [dataSource]="tabledataSource" class="mat-elevation-z8"> <table mat-table [dataSource]="tabledataSource" class="mat-elevation-z8">
@ -156,7 +165,8 @@
<ng-container matColumnDef="level"> <ng-container matColumnDef="level">
<th mat-header-cell *matHeaderCellDef>预案级别</th> <th mat-header-cell *matHeaderCellDef>预案级别</th>
<td mat-cell *matCellDef="let element">{{element.planCategory==1?'Ⅰ级预案':element.planCategory==2?'Ⅱ级预案': <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>
<ng-container matColumnDef="addtime"> <ng-container matColumnDef="addtime">
<th mat-header-cell *matHeaderCellDef>添加时间</th> <th mat-header-cell *matHeaderCellDef>添加时间</th>
@ -187,21 +197,21 @@
<th mat-header-cell *matHeaderCellDef>操作</th> <th mat-header-cell *matHeaderCellDef>操作</th>
<td mat-cell *matCellDef="let element"> <td mat-cell *matCellDef="let element">
<span (click)="lookUnitInfo(element)" style="color: blue;cursor: pointer;">查看单位信息</span> <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> <span (click)="routerTo(element)"
<label style="color: #0000FF;margin-left: 10px;cursor: pointer;" (click)='openReserve(element)' *ngIf="element.auditStatus==2">预案公开</label> style="color: blue;cursor: pointer;margin-left: 10px;">{{url=='1'?'审核预案':'查看预案'}} </span>
<label style="color: #0000FF;margin-left: 10px;cursor: pointer;" (click)='closeReserve(element)' *ngIf="element.auditStatus==2">预案取消公开</label> <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> </td>
</ng-container> </ng-container>
<tr mat-header-row *matHeaderRowDef="displayedColumns"></tr> <tr mat-header-row *matHeaderRowDef="displayedColumns"></tr>
<tr mat-row *matRowDef="let row; columns: displayedColumns;"></tr> <tr mat-row *matRowDef="let row; columns: displayedColumns;"></tr>
</table> </table>
<mat-paginator <mat-paginator [length]="length" [pageSize]="pageSize" [pageSizeOptions]="pageSizeOptions"
[length]="length"
[pageSize]="pageSize"
[pageSizeOptions]="pageSizeOptions"
(page)="chagePage($event)"> (page)="chagePage($event)">
</mat-paginator> </mat-paginator>
</div> </div>
</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] //设置每页条数 pageSizeOptions: number[] = [10] //设置每页条数
PageNumber: any; //第几页 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 //所有组织机构 allorganizations: any //所有组织机构
allunittype: any //所有单位类型 allunittype: any //所有单位类型
tabledataSource: any //表格数据 tabledataSource: any //表格数据
IsNewData='' //维护更新活新增 IsNewData = '' //维护更新活新增
url url
preparelevels: any preparelevels: any
@ -116,9 +116,14 @@ export class PassPlanComponent implements OnInit {
} }
allPlanInfo: any //存储所有预案信息 allPlanInfo: any //存储所有预案信息
IsNewCompanyData='' //单位是新增还是维护更新 IsNewCompanyData = '' //单位是新增还是维护更新
templatePlan: boolean = false//模板录入预案checkbox
customPlan: boolean = false//自定义预案
//获得所有预案信息 //获得所有预案信息
getAllPlanInfo() { getAllPlanInfo() {
let planmode = []
this.templatePlan ? planmode.push(2) : null
this.customPlan ? planmode.push(4) : null
let reservePlanType let reservePlanType
this.reservePlanType ? reservePlanType = JSON.parse(JSON.stringify(this.reservePlanType)) : 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) {
@ -139,8 +144,9 @@ export class PassPlanComponent implements OnInit {
PageSize: this.pageSizeOptions[0], PageSize: this.pageSizeOptions[0],
Sort: '', Sort: '',
PlanCategories: this.planCategory, PlanCategories: this.planCategory,
IsNewData:this.IsNewData, IsNewData: this.IsNewData,
IsNewCompanyData:this.IsNewCompanyData IsNewCompanyData: this.IsNewCompanyData,
PlanModes: planmode
} }
this.http.get("/api/ApprovedPlans", { params: paramsdata }).subscribe((data: any) => { this.http.get("/api/ApprovedPlans", { params: paramsdata }).subscribe((data: any) => {
this.length = data.totalCount this.length = data.totalCount
@ -453,8 +459,8 @@ export class PassPlanComponent implements OnInit {
planCategory = []//预案级别 planCategory = []//预案级别
//重置 //重置
reset() { reset() {
this.IsNewData='' this.IsNewData = ''
this.IsNewCompanyData='' this.IsNewCompanyData = ''
this.companyName = '' this.companyName = ''
this.js = '' this.js = ''
this.jsId = '' this.jsId = ''
@ -469,6 +475,10 @@ export class PassPlanComponent implements OnInit {
this.pageEvent.pageIndex = 0 this.pageEvent.pageIndex = 0
this.PageNumber = 1 this.PageNumber = 1
this.planCategory = [] this.planCategory = []
this.templatePlan = false
this.customPlan = false
this.getAllPlanInfo(); this.getAllPlanInfo();
} }
} }

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

@ -86,8 +86,8 @@
<mat-form-field> <mat-form-field>
<mat-select required [(ngModel)]="preparelevel" name="preparelevel" placeholder='请选择单位状态' <mat-select required [(ngModel)]="preparelevel" name="preparelevel" placeholder='请选择单位状态'
[multiple]="true"> [multiple]="true">
<mat-option [value]='preparelevel[0]'>新增</mat-option> <mat-option [value]='1'>新增</mat-option>
<mat-option [value]='preparelevel[1]||2'>维护更新</mat-option> <mat-option [value]='2'>维护更新</mat-option>
</mat-select> </mat-select>
</mat-form-field> </mat-form-field>
</div> </div>

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

@ -223,6 +223,7 @@ export class CombinedQueryComponent implements OnInit {
yuanintegritySort = 1 //预案排序字段 yuanintegritySort = 1 //预案排序字段
isMasklayer = false isMasklayer = false
async getAllPlanInfo() { async getAllPlanInfo() {
console.log(this.preparelevel)
let paramsdata: any = { let paramsdata: any = {
QueryMode: this.preparelevels, QueryMode: this.preparelevels,
OrganizationId: this.jsId || '', OrganizationId: this.jsId || '',

Loading…
Cancel
Save