Browse Source

[新增]完成维护更新页面

zhuzhou
邵佳豪 4 years ago
parent
commit
1efe169171
  1. 3
      src/app/interface.ts
  2. 1
      src/app/key-unit/edit-plan-info/edit-plan-info.component.html
  3. 2
      src/app/key-unit/edit-plan-info/edit-plan-info.component.scss
  4. 1
      src/app/key-unit/key-unit-management/key-unit-management.component.ts
  5. 15
      src/app/pipes/boolean.pipe.ts
  6. 416
      src/app/plan-management/maintain-up/maintain-up.component.html
  7. 398
      src/app/plan-management/maintain-up/maintain-up.component.scss
  8. 628
      src/app/plan-management/maintain-up/maintain-up.component.ts
  9. 4
      src/app/plan-management/plan-management.module.ts
  10. 13
      src/app/tabbar/tabbar.component.html
  11. 9
      src/app/tabbar/tabbar.component.scss
  12. 46
      src/app/tabbar/tabbar.component.ts

3
src/app/interface.ts

@ -80,4 +80,5 @@ export enum PlanLevelEnum {
"编制级别6",
"编制级别7",
"中队"
}
}

1
src/app/key-unit/edit-plan-info/edit-plan-info.component.html

@ -8,6 +8,7 @@
<label class="scorePrompt" *ngIf="selected.value == 9">*外观,室内,安全出口各上传2张图片可得满分</label>
<label class="scorePrompt" *ngIf="selected.value == 10">*上传2张CAD图片可得满分</label>
</div>
<mat-tab-group style="height: 100%;" [selectedIndex]="selected.value" (selectedIndexChange)="selected.setValue($event)">
<mat-tab label="1.基本信息">
<ng-template matTabContent>

2
src/app/key-unit/edit-plan-info/edit-plan-info.component.scss

@ -14,4 +14,4 @@
z-index: 111;
color: red;
}
}
}

1
src/app/key-unit/key-unit-management/key-unit-management.component.ts

@ -349,6 +349,7 @@ export class KeyUnitManagementComponent implements OnInit {
PageSize: this.pageSizeOptions[0],
Sort: this.integritySort ? 'integrityscore' : '',
SortType: this.integritySort || '',
IsNewData:true,
IntegrityScoreMin:this.integrityScoreMin/100||0,
IntegrityScoreMax:this.integrityScoreMax/100||1
}

15
src/app/pipes/boolean.pipe.ts

@ -29,4 +29,19 @@ export class PlanLevel implements PipeTransform {
transform(value: number): string {
return PlanLevelEnum[value]
}
}
@Pipe({name: 'state'})
export class state implements PipeTransform {
transform(value: number): string {
if(value == 3){
return '维护中'
}else if(value == 4){
return '维护通过审核'
}else if(value == 5){
return '维护驳回审核'
}else{
return '未维护'
}
}
}

416
src/app/plan-management/maintain-up/maintain-up.component.html

@ -1,88 +1,68 @@
<div style="height: 100%;overflow-y: auto;">
<div class="header" >
<form #form="ngForm">
<div style="height: 100%;overflow-y: auto">
<div id="header" class="header" (click)="bigclosediv($event)">
<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">
</mat-form-field>
</div>
<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()">
</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>
<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>
<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-icon class="mat-icon-rtl-mirror">
{{treeControl.isExpanded(node) ? 'expand_more' : 'chevron_right'}}
</mat-icon>
</button>
<li>{{node.name}}</li>
</mat-tree-node>
</mat-tree>
<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">
</mat-form-field>
</div>
<div class="queryField ordiv">
<label style="margin-right: 10px;">消防救援站:</label>
<mat-form-field class="example-full-width">
<input (click)="stopclose($event)" readonly matInput placeholder="请选择消防救援站" autocomplete="off" [(ngModel)]="js" name="js" (focus)="openorganizationbox()">
</mat-form-field>
<mat-checkbox color="primary" 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>
<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>
<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-icon class="mat-icon-rtl-mirror">
{{treeControl.isExpanded(node) ? 'expand_more' : 'chevron_right'}}
</mat-icon>
</button>
<li>{{node.name}}</li>
</mat-tree-node>
</mat-tree>
</div>
</div>
<div class="queryField">
<label style="margin-right: 10px;">统一社会信用代码:</label>
<mat-form-field class="example-full-width">
<input matInput placeholder="请输入统一社会信用代码" name="shehui" [(ngModel)]="shehui" autocomplete="off">
</mat-form-field>
</div>
<div class="queryField">
<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" >
{{unit.name}}
</mat-option>
</mat-select>
</mat-form-field>
</div>
<div class="queryField">
<label style="margin-right: 10px;">关注单位:</label>
<mat-form-field>
<mat-select placeholder='请选择单位是否关注' [(ngModel)]="follow" name="follow">
<mat-option value="0">未关注</mat-option>
<mat-option value="1">已关注</mat-option>
</mat-select>
</mat-form-field>
</div>
</div>
<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" >
{{unit.name}}
</mat-option>
</mat-select>
</mat-form-field>
</div>
<div class="queryField">
<label style="margin-right: 10px;">统一社会信用代码:</label>
<mat-form-field>
<input matInput placeholder="请输入统一社会信用代码" name="reservePlanType" [(ngModel)]="reservePlanType" autocomplete="off">
<!-- <mat-select name="reservePlanType" [(ngModel)]="reservePlanType" placeholder='请选择预案类型' [multiple]="true">
<mat-option value=8>卡片预案</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>
</div>
<div class="queryField">
<label style="margin-right: 10px;">维护状态:</label>
<mat-form-field>
<mat-select name="toExamine" [(ngModel)]="toExamine" placeholder='请选择审核状态'>
<mat-option value="8">未提交审核</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>
</div>
<div class="queryField">
<label style="margin-right: 10px;">添加时间:</label>
<mat-form-field class="example-full-width">
<input type="date" matInput name="addtime" autocomplete="off" [(ngModel)]="addtime">
</mat-form-field>
🠊
<mat-form-field class="example-full-width">
<input type="date" matInput name="endtime" autocomplete="off" [(ngModel)]="endtime">
</mat-form-field>
</div>
<div class="queryField">
<label style="margin-right: 10px;">信息完整度排序:</label>
<mat-form-field>
@ -92,62 +72,226 @@
</mat-select>
</mat-form-field>
</div>
<div class="queryField" style="margin-left: 100px;">
<label style="margin-right: 10px;">完整度查询:</label>
<mat-form-field class="example-full-width">
<input type="number" oninput="if(value>100)value=100;if(value<0)value=0" matInput placeholder="请输入完整度最小值" name="integrityScoreMin" [(ngModel)]="integrityScoreMin" autocomplete="off">
</mat-form-field>
🠊
<mat-form-field class="example-full-width" style="margin-left: 5px;">
<input type="number" oninput="if(value>100)value=100;if(value<0)value=0" matInput placeholder="请输入完整度最大值" name="integrityScoreMax" [(ngModel)]="integrityScoreMax" autocomplete="off">
</mat-form-field>
</div>
</div>
<div class="butclass" style="width: 100%;text-align: center;">
<button mat-raised-button color="primary" type="submit">查询</button>
<button mat-raised-button style="margin-left: 25px;" type="button" >重置</button>
<div style="width: 100%;text-align: center;">
<button mat-raised-button color="primary">查询</button>
<button mat-raised-button style="margin-left: 25px;" type="button" (click)="reset()">重置</button>
</div>
</form>
</div>
<mat-divider></mat-divider>
<div class="newadd">
<div>
<button mat-raised-button color="primary" color="warn">删除</button>
</div>
</form>
</div>
<mat-divider></mat-divider>
<div class="body">
<div class="buttonbox">
<!-- <button type="button" mat-raised-button color="primary" (click)="editunit()">修改</button> -->
<button type="button" mat-raised-button color="warn" (click)="deleteunit()">删除</button>
</div>
<div class="body">
<div class="tablebox">
<table mat-table class="mat-elevation-z8">
<ng-container matColumnDef="unitname">
<th mat-header-cell *matHeaderCellDef>单位名称</th>
<td mat-cell *matCellDef="let element">{{element.company.name}}</td>
</ng-container>
<ng-container matColumnDef="integrity">
<th mat-header-cell *matHeaderCellDef style="text-align: center;">信息完整度</th>
</ng-container>
<ng-container matColumnDef="jurisdictionsquadron">
<th mat-header-cell *matHeaderCellDef>消防救援站</th>
</ng-container>
<ng-container matColumnDef="unittype">
<th mat-header-cell *matHeaderCellDef>单位类型</th>
</ng-container>
<ng-container matColumnDef="plantype">
<div class="tablebox">
<table mat-table [dataSource]="tabledataSource" class="mat-elevation-z8">
<ng-container matColumnDef="checked">
<th mat-header-cell *matHeaderCellDef>
</th>
<td mat-cell *matCellDef="let element">
<mat-checkbox color="primary" (change)="checkChange($event,element)" [disabled]="element.contentVerify!=null&&(element.contentVerify.verifyState==0||element.contentVerify.verifyState==3)" (click)='checkClick(element)'></mat-checkbox>
</td>
</ng-container>
<ng-container matColumnDef="Follow">
<th mat-header-cell *matHeaderCellDef>
</th>
<td mat-cell *matCellDef="let element">
<span title="已关注" *ngIf="element.isFollowed"><mat-icon style="margin-top: 6px;color: red;">star</mat-icon></span>
</td>
</ng-container>
<ng-container matColumnDef="unitname">
<th mat-header-cell *matHeaderCellDef>单位名称</th>
<td mat-cell *matCellDef="let element">
{{element.name}}
<!-- <mat-icon class="editUnitName" (click)="editUnitName(element)">create</mat-icon> -->
</td>
</ng-container>
<ng-container matColumnDef="integrity" >
<th mat-header-cell *matHeaderCellDef style="text-align: center;">信息完整度得分</th>
<td mat-cell *matCellDef="let element;let i = index">
<div class="integrityDiv">
<span class="integrityNum">
{{(element.companyIntegrityScore.totalScore.toFixed(2) * 100).toFixed()}}分
</span>
<div class="integrityColorDiv" [style]="integrity((element.companyIntegrityScore.totalScore.toFixed(2) * 100).toFixed())">
</div>
<div class="integrityDetails" [ngClass]="{'bottomposition': i <= 5,'topposition': i > 5}">
<div class="integrityDetailsTop">
<span class="span1">分类名称</span>
<span class="span2">已得分</span>
<span class="span3">总分</span>
</div>
<div class="integrityDetailsBody">
<ul>
<li>
<div class="name">单位信息</div>
<div class="colorDiv">
<div class="colorDivBac">
<div class="colorDivCon" [style]="integrityDetails((element.companyIntegrityScore.basicInfoScore * 5).toFixed(1),5)"></div>
</div>
<span>{{(element.companyIntegrityScore.basicInfoScore * 5).toFixed(1)}}分</span>
</div>
<div class="number">5分</div>
</li>
<li>
<div class="name">建筑信息</div>
<div class="colorDiv">
<div class="colorDivBac">
<div class="colorDivCon" [style]="integrityDetails((element.companyIntegrityScore.buildingInfoScore * 10).toFixed(1),10)"></div>
</div>
<span>{{(element.companyIntegrityScore.buildingInfoScore * 10).toFixed(1)}}分</span>
</div>
<div class="number">10分</div>
</li>
<li>
<div class="name">平面图</div>
<div class="colorDiv">
<div class="colorDivBac">
<div class="colorDivCon" [style]="integrityDetails((element.companyIntegrityScore.planImageScore * 10).toFixed(1),10)"></div>
</div>
<span>{{(element.companyIntegrityScore.planImageScore * 10).toFixed(1)}}分</span>
</div>
<div class="number">10分</div>
</li>
<li>
<div class="name">四周毗邻</div>
<div class="colorDiv">
<div class="colorDivBac">
<div class="colorDivCon" [style]="integrityDetails((element.companyIntegrityScore.adjoinScore * 10).toFixed(1),10)"></div>
</div>
<span>{{(element.companyIntegrityScore.adjoinScore * 10).toFixed(1)}}分</span>
</div>
<div class="number">10分</div>
</li>
<li>
<div class="name">消防设施</div>
<div class="colorDiv">
<div class="colorDivBac">
<div class="colorDivCon" [style]="integrityDetails((element.companyIntegrityScore.facilityScore * 25).toFixed(1),25)"></div>
</div>
<span>{{(element.companyIntegrityScore.facilityScore * 25).toFixed(1)}}分</span>
</div>
<div class="number">25分</div>
</li>
<li>
<div class="name">重点部位</div>
<div class="colorDiv">
<div class="colorDivBac">
<div class="colorDivCon" [style]="integrityDetails((element.companyIntegrityScore.importantLocationScore * 10).toFixed(1),10)"></div>
</div>
<span>{{(element.companyIntegrityScore.importantLocationScore * 10).toFixed(1)}}分</span>
</div>
<div class="number">10分</div>
</li>
<li>
<div class="name">功能分区</div>
<div class="colorDiv">
<div class="colorDivBac">
<div class="colorDivCon" [style]="integrityDetails((element.companyIntegrityScore.functionalDivisionScore * 10).toFixed(1),10)"></div>
</div>
<span>{{(element.companyIntegrityScore.functionalDivisionScore * 10).toFixed(1)}}分</span>
</div>
<div class="number">10分</div>
</li>
<li>
<div class="name">实景图</div>
<div class="colorDiv">
<div class="colorDivBac">
<div class="colorDivCon" [style]="integrityDetails((element.companyIntegrityScore.realityImageScore * 10).toFixed(1),10)"></div>
</div>
<span>{{(element.companyIntegrityScore.realityImageScore * 10).toFixed(1)}}分</span>
</div>
<div class="number">10分</div>
</li>
<li>
<div class="name">CAD上传</div>
<div class="colorDiv">
<div class="colorDivBac">
<div class="colorDivCon" [style]="integrityDetails((element.companyIntegrityScore.cadScore * 10).toFixed(1),10)"></div>
</div>
<span>{{(element.companyIntegrityScore.cadScore * 10).toFixed(1)}}分</span>
</div>
<div class="number">10分</div>
</li>
</ul>
</div>
<div style="width: 100%;text-align: center;font-size: 13px;">
仅供参考
</div>
</div>
</div>
</td>
</ng-container>
<ng-container matColumnDef="jurisdictionsquadron">
<th mat-header-cell *matHeaderCellDef>消防救援站</th>
<td mat-cell *matCellDef="let element">{{element.organizationName}}</td>
</ng-container>
<ng-container matColumnDef="unittype">
<th mat-header-cell *matHeaderCellDef>单位类型</th>
<td mat-cell *matCellDef="let element">{{element.buildingTypes.length != 0 ? element.buildingTypes[0].name : ''}}</td>
</ng-container>
<ng-container matColumnDef="scc">
<th mat-header-cell *matHeaderCellDef>统一社会信用代码</th>
</ng-container>
<ng-container matColumnDef="time">
<th mat-header-cell *matHeaderCellDef>录入时间</th>
</ng-container>
<ng-container matColumnDef="passstate">
<th mat-header-cell *matHeaderCellDef>审核状态</th>
</ng-container>
<ng-container matColumnDef="operation">
<th mat-header-cell *matHeaderCellDef>操作</th>
</ng-container>
<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"
>
</mat-paginator>
</div>
</div>
<td mat-cell *matCellDef="let element">{{element.usci}}</td>
</ng-container>
<ng-container matColumnDef="time">
<th mat-header-cell *matHeaderCellDef>录入时间</th>
<td mat-cell *matCellDef="let element">
{{element.createTime|date:'yyyy-MM-dd'}}
</td>
</ng-container>
<ng-container matColumnDef="state">
<th mat-header-cell *matHeaderCellDef>状态</th>
<td mat-cell *matCellDef="let element">
<span *ngIf="element.contentVerify">
{{element.contentVerify.verifyState | state}}
</span>
<span *ngIf="!element.contentVerify">
未维护
</span>
</td>
</ng-container>
<ng-container matColumnDef="operation">
<th mat-header-cell *matHeaderCellDef>操作</th>
<td mat-cell *matCellDef="let element" class="operation">
<!-- <span (click)="unitdetails(element)" >查看详情</span> -->
<!-- <span style="color: blue;margin-left: 4px;" *ngIf="element.contentVerify==null||element.contentVerify.verifyState==-1||element.contentVerify.verifyState==1||element.contentVerify.verifyState==2||element.contentVerify.verifyState==4||element.contentVerify.verifyState==5" (click)='submitAudit(element)'>提交审核</span>
<span style="color: blue;margin-left: 4px;" *ngIf="element.contentVerify!=null&&(element.contentVerify.verifyState==0||element.contentVerify.verifyState==3) " (click)="cancelAudit(element)">撤销审核</span>
<span style="color: blue;margin-left: 4px;" (click)="auditResult(element)">审批结果</span>
<span (click)="Follow(element)" *ngIf="!element.isFollowed">关注单位</span>
<span (click)="unFollow(element)" *ngIf="element.isFollowed">取消关注</span> -->
<span (click)="openBasicWeb(element)">基本信息维护</span>
<span (click)="openPlanWeb(element)">预案维护</span>
</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"
(page)="chagePage($event)">
</mat-paginator>
</div>
</div>
</div>

398
src/app/plan-management/maintain-up/maintain-up.component.scss

@ -1,3 +1,6 @@
.header {
width: 100%;
padding: 12px 10px;
@ -6,14 +9,14 @@
// border-bottom: 1px solid black;
.queryBox {
box-sizing: border-box;
padding: 5px 25px 0 25px;
padding: 5px 25px;
display: flex;
flex-direction: row;
flex-wrap: wrap;
align-items:center;
// justify-content:center;
.queryField {
margin: 0 40px;
margin: 3px 40px;
input {
width: 180px;
height: 22px;
@ -22,12 +25,6 @@
}
} //queryBox
.butclass{
button{
width: 80px;height: 36px;
font-size: 16px;
}
}
.ordiv{
position: relative;
@ -41,23 +38,17 @@
z-index: 999;
border: 1px solid grey;
overflow-y: auto;
background-color: #fafafa;
li{
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;
background-color: #fafafa;
}
mat-tree-node{
cursor: pointer;
white-space:pre;
background-color: #fafafa;
}
mat-tree-node:hover{
background: rgba(225, 225, 225, 0.8);
li{
background: rgba(225, 225, 225, 0.8);
}
}
.closediv{
z-index: 100;
@ -74,183 +65,210 @@
background:rgba(225, 225, 225, 0.8);
}
}
}
}
.body{
.buttonbox{
margin-top: 15px;
padding-left: 15px;
button{
margin:0 10px
}
}
}
.newadd{
margin-top: 12px;
margin-left: 70px;
display: flex;
button{
font-size: 16px;
width: 100px;
height: 36px;
.tablebox{
table{
width: 100%;
margin-top: 15px;
}
mat-paginator{
width: 100%;
// margin-top: 30px;
}
.editUnitName{
width: 13px;
height: 13px;
font-size: 18px;
vertical-align: sub;
cursor: pointer;
}
.editUnitName:hover{
color: red;
}
}
}
.body{
.buttonbox{
padding-left: 50px;
button{
margin:0 10px
}
}
.tablebox{
table{
width: 100%;
margin-left: 0%;
margin-top:15px;
}
mat-paginator{
width: 100%;
margin-left: 0%;
}
.mat-column-unitname{
width: 15%;
}
.mat-column-integrity{
width: 13%;
}
.mat-column-operation{
width: 5%;
}
.mat-column-jurisdictionsquadron{
width: 10%;
}
}
}
.mat-header-cell{
text-align: center;
}
.mat-cell{
text-align: center;
span{
// color:red;
// margin: 0 3px;
cursor: pointer;
}
span:hover{
text-decoration:underline
}
.grey{
color: grey;
pointer-events: none;
}
}
//完整度
.integrityDiv{
width: 70%;
height: 30px;
background-color: #e2e7ee;
// background-image: linear-gradient(to right, #e2e7ee ,#FF4500, #FF8C00,#32cd32);
margin: 0 auto;
position: relative;
.integrityNum{
position: absolute;
left: 50%;
top: 50%;
transform: translate(-50%, -50%);
color: black;
font-weight: 800;
font-size: 15px;
cursor: default;
}
.integrityColorDiv{
height: 100%;
}
.integrityDetails{
position: absolute;
display: none;
width: 350px;
height:280px;
border: 1px solid rgba(0, 0, 0, 0.22);
background-color: white;
.integrityDetailsTop{
width: 100%;
height: 23px;
line-height:23px;
border-bottom: 1px solid rgba(0, 0, 0, 0.22);
margin-bottom: 1px;
font-size: 14px;
span{
display: inline-block;
text-align: center;
font-weight: 800;
}
.span1{
width: 25%;
}
.span2{
width: 60%;
}
.span3{
width: 15%;
}
}
.integrityDetailsBody{
ul{
li{
width: 100%;
height: 23px;
line-height: 23px;
margin: 3px 0;
div{
float: left;
font-size: 13px;
}
.name{
width: 25%;
height: 100%;
}
.colorDiv{
width: 60%;
height: 100%;
position: relative;
.colorDivBac{
width: 90%;
height: 100%;
position: absolute;
left: 50%;
top: 50%;
transform: translate(-50%,-50%);
background-color: #dfe5ec;
border-radius: 5px;
.colorDivCon{
border-radius: 5px;
height: 100%;
background-color: #2398f1;
}
}
span{
position: absolute;
left: 50%;
top: 50%;
transform: translate(-50%,-50%);
// color: white;
font-weight: 600;
}
}
.number{
width: 15%;
height: 100%;
}
}
}
}
}
.bottomposition{
top: 2px;
left: 188px;
}
.topposition{
top: -252px;
left: 188px;
}
}
.integrityDiv:hover{
.integrityDetails{
display: block;
.leftbox{
width: 250px;
float: left;
.btn{
button{
margin: 0 6px;
}
}
}
.treebox{
float: left;
width: 325px;
height: 350px;
overflow: auto;
.organizationlist{
list-style: none
}
}
.organizationlist:hover{
background: rgba(225, 225, 225, 0.8);
cursor: pointer;
}
}
.mat-header-cell{
text-align: center;
}
.mat-cell{
text-align: center;
}
.operation{
span{
color: blue;
cursor: pointer;
margin: 0 3px;
}
}
//完整度
.integrityDiv{
width: 180px;
height: 30px;
background-color: #e2e7ee;
// background-image: linear-gradient(to right, #e2e7ee ,#FF4500, #FF8C00,#32cd32);
margin: 0 auto;
position: relative;
.integrityNum{
position: absolute;
left: 50%;
top: 50%;
transform: translate(-50%, -50%);
color: black;
font-weight: 800;
font-size: 15px;
cursor: default;
}
.integrityColorDiv{
height: 100%;
}
.integrityDetails{
position: absolute;
display: none;
width: 350px;
height:280px;
border: 1px solid rgba(0, 0, 0, 0.22);
background-color: white;
.integrityDetailsTop{
width: 100%;
height: 23px;
line-height:23px;
border-bottom: 1px solid rgba(0, 0, 0, 0.22);
margin-bottom: 1px;
font-size: 14px;
span{
display: inline-block;
text-align: center;
font-weight: 800;
}
.span1{
width: 25%;
}
.span2{
width: 60%;
}
.span3{
width: 15%;
}
}
.integrityDetailsBody{
ul{
li{
width: 100%;
height: 23px;
line-height: 23px;
margin: 3px 0;
div{
float: left;
font-size: 13px;
}
.name{
width: 25%;
height: 100%;
}
.colorDiv{
width: 60%;
height: 100%;
position: relative;
.colorDivBac{
width: 90%;
height: 100%;
position: absolute;
left: 50%;
top: 50%;
transform: translate(-50%,-50%);
background-color: #dfe5ec;
border-radius: 5px;
.colorDivCon{
border-radius: 5px;
height: 100%;
background-color: #2398f1;
}
}
span{
position: absolute;
left: 50%;
top: 50%;
transform: translate(-50%,-50%);
// color: white;
font-weight: 600;
}
}
.number{
width: 15%;
height: 100%;
}
}
}
}
}
.bottomposition{
top: 2px;
left: 188px;
}
.topposition{
top: -252px;
left: 188px;
}
}
.integrityDiv:hover{
.integrityDetails{
display: block;
}
}
.fail{
// background : #FF4500;
// background-image: linear-gradient(to right, #e2e7ee , #FF4500);
}
.pass{
// background : #FF8C00;
// background-image: linear-gradient(to right, #e2e7ee , #FF8C00);
}
.excellent{
// background : #32cd32;
// background-image: linear-gradient(to right, #e2e7ee ,#FF4500, #FF8C00,#32cd32);
}
//审核结果
.auditDiv{
p{
margin: 8px 0;
margin-left: 16px;
}
}

628
src/app/plan-management/maintain-up/maintain-up.component.ts

@ -1,12 +1,4 @@
/*
* @Descripttion:
* @version:
* @Author: sueRimn
* @Date: 2021-01-28 14:13:20
* @LastEditors: sueRimn
* @LastEditTime: 2021-01-28 14:53:18
*/
import { Component, OnInit, ViewChild, Inject } from '@angular/core';
import { Component, OnInit, ViewChild, Inject } from '@angular/core';
import { HttpClient } from '@angular/common/http'
import { MatTreeFlatDataSource, MatTreeFlattener } from '@angular/material/tree';
import { MatPaginator } from '@angular/material/paginator';
@ -17,7 +9,8 @@ import { PageEvent } from '@angular/material/paginator';
import { MatDialogRef, MatDialog, MAT_DIALOG_DATA } from '@angular/material/dialog';
import { MatSnackBar, MatSnackBarConfig } from '@angular/material/snack-bar';
import { TreeService } from '../../http-interceptors/tree.service'
import { ConstantPool } from '@angular/compiler';
import { MatSort } from '@angular/material/sort';
import { MatTableDataSource } from '@angular/material/table';
@Component({
selector: 'app-maintain-up',
@ -27,40 +20,7 @@ import { ConstantPool } from '@angular/compiler';
export class MaintainUpComponent implements OnInit {
constructor(private http:HttpClient,private router:Router,private route:ActivatedRoute,private tree: TreeService,public dialog: MatDialog,public snackBar: MatSnackBar) { }
ngOnInit(): void {
this.getunitdata();
this.getOrganizations();
this.getUnittype();
let level = sessionStorage.getItem("level");
if(level == "0"){//如果是总队
this.preparelevels = [
{name:"总队",value:"1"},
{name:"支队",value:"2"},
{name:"大队",value:"4"},
{name:"中队",value:"8"}
]
}
if(level == "1"){//如果是支队
this.preparelevels = [
{name:"支队",value:"2"},
{name:"大队",value:"4"},
{name:"中队",value:"8"}
]
}
if(level == "2"){//如果是大队
this.preparelevels = [
{name:"大队",value:"4"},
{name:"中队",value:"8"}
]
}
if(level == "3"){//如果是中队
this.preparelevels = [
{name:"中队",value:"8"}
]
}
}
private _transformer = (node, level: number) => { //初始化tree
return {
expandable: !!node.children && node.children.length > 0,
@ -76,6 +36,11 @@ export class MaintainUpComponent implements OnInit {
dataSource = new MatTreeFlatDataSource(this.treeControl, this.treeFlattener);
myControl = new FormControl();
hasChild = (_: number, node: any) => node.expandable;
@ViewChild(MatSort) sort: MatSort;
allunittype:any //获取所有的单位类型
//分页
@ViewChild(MatPaginator, {static: true})
pageEvent: PageEvent;
@ -83,21 +48,324 @@ export class MaintainUpComponent implements OnInit {
length:any; //共多少条数据
pageSize:any; //每页条数
pageSizeOptions: number[] = [10] //设置每页条数
PageNumber:any; //第几页
PageNumber:any //第几页
displayedColumns: string[] = ['checked','Follow','unitname','integrity','jurisdictionsquadron', 'unittype','scc', 'time','state','operation'];
tabledataSource:any
allorganizations:any
oldDataSource:any; //原始表格数据
integrityScoreMin//下界
integrityScoreMax//上界
//表头排序
sortData (e) {
let data = this.tabledataSource.filteredData;
console.log(data.filteredData)
// data.filteredData.forEach(element => {
// if(element.key.indexOf(".") != -1){
// let typeArr = element.key.split('.')
// element.type = typeArr[typeArr.length - 1]
// element.newTime = new Date(element.lastModified).getTime()
// }
// });
organizationName:any //当前单位组织机构名称
preparelevels:any
integritySort:any //完整度排序
haveyuan//有无预案
companyName:any //单位名称
js:any //所选组织机构
jsId:any //所选组织机构的id
jscheck:boolean //所选组织机构勾选框
unittype:any //单位类型
reservePlanType:any //预案类型
toExamine:any //审核状态
preparelevel:any //编制级别
plcheck:boolean //编制级别勾选框
if( e.direction=='asc' ) { //从小到大排序
data.sort( function(a,b) {
return a.newTime - b.newTime
} )
this.tabledataSource = new MatTableDataSource(data);
} else if ( e.direction=='desc' ) {//从大到小排序
data.sort( function(a,b) {
return b.newTime - a.newTime
} )
this.tabledataSource = new MatTableDataSource(data);
} else { //原始数据
this.tabledataSource = new MatTableDataSource(this.oldDataSource);
}
}
colorRgb(sColor){
var reg = /^#([0-9a-fA-f]{3}|[0-9a-fA-f]{6})$/;
var sColor = sColor.toLowerCase();
if (sColor && reg.test(sColor)) {
if (sColor.length === 4) {
var sColorNew = "#";
for (var i = 1; i < 4; i += 1) {
sColorNew += sColor.slice(i, i + 1).concat(sColor.slice(i, i + 1));
}
sColor = sColorNew;
}
//处理六位的颜色值
var sColorChange = [];
for (var i = 1; i < 7; i += 2) {
sColorChange.push(parseInt("0x" + sColor.slice(i, i + 2)));
}
return sColorChange;
} else {
return sColor;
}
}
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);
hex = hex < 10 ? 0 + '' + hex : hex;// 保证每个rgb的值为2位
if (hex === "0") {
hex += hex;
}
strHex += hex;
}
if (strHex.length !== 7) {
strHex = _this;
}
return strHex;
} else if (reg.test(_this)) {
var aNum = _this.replace(/#/, "").split("");
if (aNum.length === 6) {
return _this;
} else if (aNum.length === 3) {
var numHex = "#";
for (var i = 0; i < aNum.length; i += 1) {
numHex += (aNum[i] + aNum[i]);
}
return numHex;
}
} else {
return _this;
}
}
gradientColor(startColor, endColor, step) {
let _this = this
let startRGB = _this.colorRgb(startColor);//转换为rgb数组模式
let startR = startRGB[0];
let startG = startRGB[1];
let startB = startRGB[2];
let endRGB = _this.colorRgb(endColor);
let endR = endRGB[0];
let endG = endRGB[1];
let endB = endRGB[2];
let sR = (endR - startR) / step;//总差值
let sG = (endG - startG) / step;
let sB = (endB - startB) / step;
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)) + ')');
colorArr.push(hex);
}
return colorArr;
}
integrity(width){
let _this = this
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){
style.background = colorArr[i]
}
}
}
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]
}
}
}
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]
}
}
}
return style
}
integrityDetails(width,zong){
let style:any = {}
style.width = (width/zong)*100 +'%';
return style
}
//分页事件
chagePage(e){
this.PageNumber = e.pageIndex+1
this.getAllKeyUnit();
}
ngOnInit(): void {
this.getunitdata();
this.getOrganizations();
this.getUnittype();
this.getAllKeyUnit();
}
//获得所有重点单位
wanzhengduArr = [
{id:0,zong:94,details:[
{name:'单位信息',score:5,totalpoints:5},
{name:'建筑信息',score:8,totalpoints:10},
{name:'平面图',score:8,totalpoints:10},
{name:'四周毗邻',score:25,totalpoints:25},
{name:'消防设施',score:10,totalpoints:10},
{name:'重点部位',score:10,totalpoints:10},
{name:'功能分区',score:8,totalpoints:10},
{name:'实景图',score:10,totalpoints:10},
{name:'CAD上传',score:10,totalpoints:10},
]},
{id:1,zong:82,details:[
{name:'单位信息',score:5,totalpoints:5},
{name:'建筑信息',score:8,totalpoints:10},
{name:'平面图',score:8,totalpoints:10},
{name:'四周毗邻',score:25,totalpoints:25},
{name:'消防设施',score:8,totalpoints:10},
{name:'重点部位',score:8,totalpoints:10},
{name:'功能分区',score:6,totalpoints:10},
{name:'实景图',score:8,totalpoints:10},
{name:'CAD上传',score:6,totalpoints:10},
]},
{id:2,zong:72,details:[
{name:'单位信息',score:3,totalpoints:5},
{name:'建筑信息',score:5,totalpoints:10},
{name:'平面图',score:8,totalpoints:10},
{name:'四周毗邻',score:22,totalpoints:25},
{name:'消防设施',score:7,totalpoints:10},
{name:'重点部位',score:7,totalpoints:10},
{name:'功能分区',score:6,totalpoints:10},
{name:'实景图',score:8,totalpoints:10},
{name:'CAD上传',score:6,totalpoints:10},
]},
{id:3,zong:61,details:[
{name:'单位信息',score:3,totalpoints:5},
{name:'建筑信息',score:5,totalpoints:10},
{name:'平面图',score:7,totalpoints:10},
{name:'四周毗邻',score:18,totalpoints:25},
{name:'消防设施',score:5,totalpoints:10},
{name:'重点部位',score:3,totalpoints:10},
{name:'功能分区',score:5,totalpoints:10},
{name:'实景图',score:8,totalpoints:10},
{name:'CAD上传',score:6,totalpoints:10},
]},
{id:4,zong:60,details:[
{name:'单位信息',score:3,totalpoints:5},
{name:'建筑信息',score:5,totalpoints:10},
{name:'平面图',score:6,totalpoints:10},
{name:'四周毗邻',score:18,totalpoints:25},
{name:'消防设施',score:5,totalpoints:10},
{name:'重点部位',score:3,totalpoints:10},
{name:'功能分区',score:5,totalpoints:10},
{name:'实景图',score:8,totalpoints:10},
{name:'CAD上传',score:6,totalpoints:10},
]},
{id:5,zong:53,details:[
{name:'单位信息',score:5,totalpoints:5},
{name:'建筑信息',score:5,totalpoints:10},
{name:'平面图',score:5,totalpoints:10},
{name:'四周毗邻',score:10,totalpoints:25},
{name:'消防设施',score:5,totalpoints:10},
{name:'重点部位',score:5,totalpoints:10},
{name:'功能分区',score:5,totalpoints:10},
{name:'实景图',score:7,totalpoints:10},
{name:'CAD上传',score:6,totalpoints:10},
]},
{id:6,zong:45,details:[
{name:'单位信息',score:3,totalpoints:5},
{name:'建筑信息',score:5,totalpoints:10},
{name:'平面图',score:5,totalpoints:10},
{name:'四周毗邻',score:15,totalpoints:25},
{name:'消防设施',score:5,totalpoints:10},
{name:'重点部位',score:5,totalpoints:10},
{name:'功能分区',score:3,totalpoints:10},
{name:'实景图',score:5,totalpoints:10},
{name:'CAD上传',score:4,totalpoints:10},
]},
{id:7,zong:30,details:[
{name:'单位信息',score:3,totalpoints:5},
{name:'建筑信息',score:0,totalpoints:10},
{name:'平面图',score:4,totalpoints:10},
{name:'四周毗邻',score:2,totalpoints:25},
{name:'消防设施',score:5,totalpoints:10},
{name:'重点部位',score:5,totalpoints:10},
{name:'功能分区',score:2,totalpoints:10},
{name:'实景图',score:6,totalpoints:10},
{name:'CAD上传',score:3,totalpoints:10},
]},
{id:8,zong:20,details:[
{name:'单位信息',score:3,totalpoints:5},
{name:'建筑信息',score:2,totalpoints:10},
{name:'平面图',score:0,totalpoints:10},
{name:'四周毗邻',score:3,totalpoints:25},
{name:'消防设施',score:3,totalpoints:10},
{name:'重点部位',score:3,totalpoints:10},
{name:'功能分区',score:3,totalpoints:10},
{name:'实景图',score:2,totalpoints:10},
{name:'CAD上传',score:1,totalpoints:10},
]},
{id:9,zong:13,details:[
{name:'单位信息',score:5,totalpoints:5},
{name:'建筑信息',score:3,totalpoints:10},
{name:'平面图',score:0,totalpoints:10},
{name:'四周毗邻',score:2,totalpoints:25},
{name:'消防设施',score:0,totalpoints:10},
{name:'重点部位',score:3,totalpoints:10},
{name:'功能分区',score:0,totalpoints:10},
{name:'实景图',score:0,totalpoints:10},
{name:'CAD上传',score:0,totalpoints:10},
]}
]
allKeyUnitInfo:any //所有的重点单位
getAllKeyUnit(){
// console.log(Boolean(Number(this.follow)))
let follow
if(this.follow == ''){
follow = ''
}
if(this.follow == '0'){
follow = false
}
if(this.follow == '1'){
follow = true
}
let paramsdata:any = {
Name: this.companyName || '',
OrganizationId: this.jsId || '',
HasChildren:this.jscheck || '',
USCI:this.shehui || '',
IsFollowed: follow,
BuildingTypeId: this.unittype || '',
PageNumber: this.PageNumber || '1',
PageSize: this.pageSizeOptions[0],
Sort: this.integritySort ? 'integrityscore' : '',
SortType: this.integritySort || '',
IsNewData : false,
IntegrityScoreMin:this.integrityScoreMin/100||0,
IntegrityScoreMax:this.integrityScoreMax/100||1
}
this.http.get("/api/Companies",{params:paramsdata}).subscribe((data:any)=>{
this.length = data.totalCount
this.allKeyUnitInfo = data
// data.items.sort( (a,b) => {
// return a.usci - b.usci
// })
data.items.forEach( (item,index) => {
item.integrity = this.wanzhengduArr[index]
})
//console.log(789,data.items)
this.tabledataSource = new MatTableDataSource(data.items);
})
}
//得到当前单位信息
getunitdata(){
this.http.get("/api/Account/Profiles").subscribe(
@ -106,13 +374,14 @@ export class MaintainUpComponent implements OnInit {
}
)
}
organizationName:any //当前单位组织机构名称
treedata:any //组织机构树型数据
newArr:any = []
newallorganizations:any //用于存储在原始数据基础上的每个机构增加children字段
newallorganizations2:any
//得到当前单位所在组织机构的tree型数据
getpresentOrganization(){
this.newallorganizations = this.allorganizations
this.newallorganizations.forEach(item => {
item.children = []
this.newallorganizations.forEach(element => {
@ -128,15 +397,16 @@ export class MaintainUpComponent implements OnInit {
this.newallorganizations.forEach(item => {
if(item.name == this.organizationName){
this.dataSource.data = [item]
this.newallorganizations2 = [item]
}
});
}else{
this.dataSource.data = this.tree.toTree(this.treedata);
this.newallorganizations2 = this.treedata
this.dataSource.data = this.treedata
}
}
)
}
//获得所有组织机构
getOrganizations(){
@ -148,6 +418,7 @@ export class MaintainUpComponent implements OnInit {
}
)
}
//获得所有单位类型
getUnittype(){
this.http.get('/api/BuildingTypes/Simple').subscribe(
@ -156,6 +427,230 @@ export class MaintainUpComponent implements OnInit {
}
)
}
selectedunitArr:any =[] //选中单位的数组
//勾选框事件
verifyState //判断是否可以修改
checkChange(e,element){
console.log(element)
if(element.contentVerify!=null){
this.verifyState=element.contentVerify.verifyState
}else{
this.verifyState=null
}
element.checked = e.checked
}
checkClick(element){
if(element.contentVerify!=null){
if(element.contentVerify.verifyState==0||element.contentVerify.verifyState==3){
const config = new MatSnackBarConfig();
config.verticalPosition = 'top';
config.duration = 3000
this.snackBar.open('该单位正在审核不能选中','确定',config);
}
}
}
//编辑单位信息
editunit(){
const config = new MatSnackBarConfig();
config.verticalPosition = 'top';
config.duration = 3000
let selectedunitArr = []
let selectedunitobj = []
this.allKeyUnitInfo.items.forEach(item => {
if(item.checked){
selectedunitArr.push(item.id)
selectedunitobj.push(item)
}
});
if(selectedunitArr.length == 0){
this.snackBar.open('请先选择要修改的单位','确定',config);
}
if(selectedunitArr.length != 1 && selectedunitArr.length != 0){
const config = new MatSnackBarConfig();
config.verticalPosition = 'top';
config.duration = 3000
this.snackBar.open('只能选择一个单位修改','确定',config);
}
if(selectedunitArr.length == 1){ //带着id跳到修改页面
this.allKeyUnitInfo.items.forEach(item => {
if(item.id == selectedunitArr[0]){
let companyName = item.name
sessionStorage.setItem("companyName",companyName)
sessionStorage.setItem("companyId",item.id)
}
});
sessionStorage.setItem("editable","1")
sessionStorage.setItem(selectedunitobj[0].id,JSON.stringify(selectedunitobj[0].companyIntegrityScore))
window.open(`/keyUnit/editplaninfo?id=${selectedunitArr[0]}&usci=${selectedunitobj[0].usci}`);
}
}
//关注重点单位
Follow(element){
// console.log(element)
this.http.put(`/api/Companies/${element.id}/Follow`,'').subscribe(data=>{
const config = new MatSnackBarConfig();
config.verticalPosition = 'top';
config.duration = 3000
this.snackBar.open('关注成功','确定',config);
this.getAllKeyUnit();
})
}
//取消关注
unFollow(element){
// console.log(element)
this.http.put(`/api/Companies/${element.id}/Unfollow`,'').subscribe(data=>{
const config = new MatSnackBarConfig();
config.verticalPosition = 'top';
config.duration = 3000
this.snackBar.open('取消成功','确定',config);
this.getAllKeyUnit();
})
}
//删除单位信息
deleteunit(){
if(this.verifyState==0||this.verifyState==3){
const config = new MatSnackBarConfig();
config.verticalPosition = 'top';
config.duration = 3000
this.snackBar.open('审核中,不能删除','确定',config);
}else{
let selectedunitArr = []
this.allKeyUnitInfo.items.forEach(item => {
if(item.checked){
selectedunitArr.push(item.id)
}
});
if(selectedunitArr.length == 0){
const config = new MatSnackBarConfig();
config.verticalPosition = 'top';
config.duration = 3000
this.snackBar.open('请先选择要删除的单位','确定',config);
}
if(selectedunitArr.length != 1 && selectedunitArr.length != 0){
const config = new MatSnackBarConfig();
config.verticalPosition = 'top';
config.duration = 3000
this.snackBar.open('只能选择一个单位删除','确定',config);
}
if(selectedunitArr.length == 1){ //带着id跳到删除页面
let isTrue = confirm('您确定要删除吗')
if(isTrue){
console.log(selectedunitArr)
let body = {
// title: item.name,
operation: 2,//删除操作方式
contentType: 11,//重点单位
itemId: selectedunitArr[0],
verifyState: 3,
}
this.http.post('/api/ContentVerifies',body).subscribe((data) => {
let config = new MatSnackBarConfig();
config.verticalPosition = 'top';
config.duration = 3000
this.snackBar.open('删除审核提交成功','确定',config);
// this.addWaterListData.items.forEach(element => {
// if(element.id == selectedunitArr[0]){
// element.contentVerify = data
// }
// });
this.getAllKeyUnit()
})
}
}
}
}
//基本信息维护
openBasicWeb(element){
sessionStorage.setItem("companyName",element.name)
sessionStorage.setItem("companyId",element.id)
sessionStorage.setItem("editable","1")
sessionStorage.setItem(element.id,JSON.stringify(element.companyIntegrityScore))
sessionStorage.setItem('contentVerify',JSON.stringify(element.contentVerify))
window.open(`/keyUnit/editplaninfo?id=${element.id}&usci=${element.usci}&isUpdates=1`);
}
//预案维护
level
operation
openPlanWeb(element){
this.level = sessionStorage.getItem("level");
this.level=='0'?this.operation=false:this.operation=true
sessionStorage.setItem("companyName",element.name)
window.open(`/planManagement/entryPlandetail?unitId=${element.id}&unitTypeId=${element.buildingTypes.length == 0 ? null :element.buildingTypes[0].id}&operation=${this.operation}&pagetype=entryplan&unitName=${element.name}&orName=${element.organizationName}&orId=${element.organizationId}&unitType=${element.buildingTypes.length == 0 ? null :element.buildingTypes[0].name}&unitAdd=${element.address}&usci=${element.usci}`);
}
//重置
js:any //辖区中队输入框
jsId:any //辖区中队选择的id
companyName:any //单位名称
shehui:any //统一社会信用代码
unittype:any //单位类型
jscheck:any //辖区中队包含下级
OrganizationId //
follow:any = '' //是否为关注单位
integritySort:any //完整度排序
reset(){
this.js='' //辖区中队输入框
this.jscheck='' //辖区中队包含下级
this.companyName='' //单位名称
this.shehui='' //统一社会信用代码
this.unittype='' //单位类型
this.jsId = ''
this.follow = ''
this.PageNumber = 1
this.pageEvent.pageIndex = 0
this.integritySort = ''
this.integrityScoreMax=undefined
this.integrityScoreMin=undefined
this.getAllKeyUnit();
}
//编辑单位名称
editUnitName(element){
// const dialogRef = this.dialog.open(upname, {
// width: '340px',
// height:'280px',
// data: element
// });
// dialogRef.afterClosed().subscribe(result => {
// //console.log(result);
// element.name=result
// });
}
//跳转查看基本信息页面
unitdetails(element){
// console.log(element)
sessionStorage.setItem("editable","0")
sessionStorage.setItem("companyName",element.name)
sessionStorage.setItem("companyId",element.id)
sessionStorage.setItem(element.id,JSON.stringify(element.companyIntegrityScore))
window.open(`/keyUnit/viewunitinfo?id=${element.id}&usci=${element.usci}`,'_blank');
}
//提交查询表单
onSubmit(value){
this.PageNumber = 1
this.pageEvent.pageIndex = 0
const config = new MatSnackBarConfig();
config.verticalPosition = 'top';
config.duration = 3000
if(this.integrityScoreMax<this.integrityScoreMin){
this.snackBar.open('最大值不能小于最小值!','确定',config);
}else{
this.getAllKeyUnit();
}
}
bigclosediv(e){
this.isorganizationbox = false
}
stopclose(e){
e.stopPropagation();
}
//辖区中队div是否显示
isorganizationbox:boolean = false
//点击辖区中队树,将选择的辖区中队添加到变量
@ -164,10 +659,16 @@ export class MaintainUpComponent implements OnInit {
this.js = node.name
this.jsId = node.id
}
//关闭辖区中队隐藏框
closeorganizationbox() {
this.isorganizationbox = false
}
//打开辖区中队隐藏框
openorganizationbox() {
this.isorganizationbox = true
}
//关闭出现的组织机构div
closediv(){
this.isorganizationbox = false
@ -175,10 +676,5 @@ export class MaintainUpComponent implements OnInit {
displayedColumns: string[] = ['unitname','integrity','jurisdictionsquadron', 'unittype','plantype', 'time','passstate','operation'];
allunittype:any //所有单位类型
allorganizations:any //所有组织机构
addtime
endtime
}

4
src/app/plan-management/plan-management.module.ts

@ -48,7 +48,7 @@ import { EntryPlanComponent } from './entry-plan/entry-plan.component';
import { PassPlanComponent, UnitInfo } from './pass-plan/pass-plan.component';
import { OpenPlanComponent } from './open-plan/open-plan.component';
import { EntryPlanLookComponent, AddPlanone, DownloadFile, AuditResult, ChangeName } from './entry-plan-look/entry-plan-look.component';
import { PlanType, AuditSatus, PlanLevel } from '../pipes/boolean.pipe';
import { PlanType, AuditSatus, PlanLevel, state } from '../pipes/boolean.pipe';
import { WebLookComponent } from './web-look/web-look.component';
import { OnetwoEntryPlanComponent } from './onetwo-entry-plan/onetwo-entry-plan.component';
import { newunitComponent} from './onetwo-entry-plan/onetwo-entry-plan.component';
@ -70,7 +70,7 @@ import { ReinforcePlanComponent } from './reinforce-plan/reinforce-plan.componen
@NgModule({
declarations: [EntryPlanComponent, PassPlanComponent, OpenPlanComponent, EntryPlanLookComponent,AddPlanone,PlanType,AuditSatus,PlanLevel,DownloadFile,AuditResult,ChangeName,
WebLookComponent, OnetwoEntryPlanComponent,newunitComponent, MeetPlanComponent,newunitMeet, TypePlanComponent,newunitType,PsViewer,onetwoAuditResult,meetAuditResult,
typeAuditResult, MaintainUpComponent,GkPsViewer,GkhtmlPsViewer,UnitInfo, ReinforcePlanComponent],
typeAuditResult, MaintainUpComponent,GkPsViewer,GkhtmlPsViewer,UnitInfo, ReinforcePlanComponent, state],
imports: [
CommonModule,
PlanManagementRoutingModule,

13
src/app/tabbar/tabbar.component.html

@ -186,7 +186,20 @@
</div>
</div>
</div>
<div class="isUpdates" *ngIf="isUpdates">
<span class="name" (click)="submitAudit()" *ngIf="!contentVerify || contentVerify.verifyState == 5 || contentVerify.verifyState == 4">提交审核</span>
<span class="name" (click)="cancelAudit()" *ngIf="contentVerify && contentVerify.verifyState == 3">撤销审核</span>
<span class="span" *ngIf="contentVerify && contentVerify.verifyState == 3">(
<span *ngIf="contentVerify.operation == 2" style="color: red;">删除</span>
<span *ngIf="contentVerify.operation == 0" >新增</span>
<span *ngIf="contentVerify.operation == 1" >更新</span>
待审核)</span>
<span [matTooltip]="contentVerify.remark" class="span" *ngIf="contentVerify && contentVerify.verifyState == 4">(审核通过)</span>
<span [matTooltip]="contentVerify.remark" class="span" *ngIf="contentVerify && contentVerify.verifyState == 5">(审核驳回)</span>
</div>
<div class="spinner" *ngIf="isSpinner">
<mat-spinner [diameter]='26' color="warn"></mat-spinner>
<span style="font-size: 13px;margin-left: 6px;">帮助文档下载中,请等待...</span>

9
src/app/tabbar/tabbar.component.scss

@ -176,7 +176,7 @@ mat-icon{
}
}
//计分规则按钮
.scoringRule{
.scoringRule,.isUpdates{
user-select: none;
position: absolute;
left: 480px;
@ -194,6 +194,10 @@ mat-icon{
margin: 0;
padding: 0;
}
.span{
font-size: 18px;
margin-left: 12px;
}
.scoringRuleImg{
z-index: 999;
position: absolute;
@ -251,6 +255,9 @@ mat-icon{
}
}
.isUpdates{
left: 596px;
}
.uploadFile{
height: 64px;
line-height: 64px;

46
src/app/tabbar/tabbar.component.ts

@ -37,7 +37,9 @@ export class TabbarComponent implements OnInit {
integrityData:any
companyIntegrityScore:any
companyIntegrityScore:any//是否显示单位分数
isUpdates:any //是否显示单位提交审核 撤销审核等按钮
contentVerify:any//当前单位的审核状态信息
ngOnInit() {
this.routerEventsListener = this.router.events.pipe(
@ -46,6 +48,7 @@ export class TabbarComponent implements OnInit {
this.title = "数字化预案编制管理平台"
this.planName = null
this.grade = null
this.isUpdates = null
if(this.router.url.indexOf("editunitinfo") == -1 || this.router.url.indexOf("viewunitinfoplan") == -1){//如果url地址是从录入预案跳转
this.companyIntegrityScore = ''
}
@ -57,9 +60,13 @@ export class TabbarComponent implements OnInit {
}
if(this.router.url.indexOf("editplaninfo") != -1 || (this.router.url.indexOf("viewunitinfo") != -1 && this.router.url.indexOf("viewunitinfoplan") == -1)){//如果url地址是从重点单位跳转
this.title = sessionStorage.getItem("companyName")
// let obj = JSON.parse(sessionStorage.getItem(this.route.snapshot.queryParams.id))
// this.companyIntegrityScore = obj
this.getIntegrityScore()
//从维护更新页面进入需要显示提交审核按钮
if(this.route.snapshot.queryParams["isUpdates"] == '1'){
this.contentVerify = JSON.parse(sessionStorage.getItem('contentVerify'))
console.log(6666,JSON.parse(sessionStorage.getItem('contentVerify')))
this.isUpdates = true
}
this.tabbarService.getMessage().subscribe((message: any)=>{
this.getIntegrityScore()
});
@ -97,7 +104,38 @@ export class TabbarComponent implements OnInit {
this.snackBar.open('下载失败','确定',config);
})
}
//提交单位审核
submitAudit(){
let body:any = {
title : sessionStorage.getItem('companyName'),
Operation : sessionStorage.getItem('contentVerify') ? 1 : 0,
itemId : sessionStorage.getItem('companyId'),
verifyState : 3,
contentType : 11
}
this.http.post(`/api/ContentVerifies`,body).subscribe(data=>{
this.contentVerify = data
sessionStorage.setItem('contentVerify',JSON.stringify(data))
},err=>{
const config = new MatSnackBarConfig();
config.verticalPosition = 'top';
config.duration = 3000
this.snackBar.open(err,'确定',config);
})
}
//撤销单位审核
cancelAudit(){
this.http.delete(`/api/ContentVerifies/${this.contentVerify.id}`).subscribe(data=>{
this.contentVerify = data
sessionStorage.setItem('contentVerify',JSON.stringify(data))
},
err=>{
const config = new MatSnackBarConfig();
config.verticalPosition = 'top';
config.duration = 3000
this.snackBar.open(err,'确定',config);
})
}
//初始化下载
downloadFile () {
let file = this.download

Loading…
Cancel
Save