chenjingyu 4 years ago
parent
commit
6c2a44f332
  1. 427
      src/app/examiner/create-test-score/create-test-score.component.html
  2. 7
      src/app/examiner/create-test-score/create-test-score.component.scss
  3. 48
      src/app/examiner/create-test-score/create-test-score.component.ts
  4. 4
      src/app/examiner/examiner-new-one/examiner-new-one.component.html

427
src/app/examiner/create-test-score/create-test-score.component.html

@ -19,7 +19,7 @@
<td>单位名称</td>
<td>总分</td>
</tr>
<tr *ngFor="let item of unitId">
<tr *ngFor="let item of unitId;let key = index" (click)="clickUnitName(key)" [ngClass]="{'selectedLi': key == selectedUnitIndex}">
<td>{{item.name}}</td>
<td class="colorspan">{{item.score}}</td>
</tr>
@ -37,221 +37,224 @@
</div>
<div class="maincontantbox">
<div class="basicinfodiv" *ngIf="selectedTab == 1">
<div *ngFor="let unit of unitId;let key = index" style="margin-bottom: 30px;">
<!-- 选择的单位名称 -->
<p class="colorspan" style="margin: 0 0 12px 6px;">{{unit.name}}</p>
<!-- 基本信息 -->
<mat-accordion>
<mat-expansion-panel style="box-shadow: 0 0 black;" expanded>
<mat-expansion-panel-header collapsedHeight ='40px' expandedHeight='40px' style="position: relative;padding-left:20px;background: #F5FDFE;">
<mat-panel-title>
基本信息
<!-- <span class="colorspan" style="margin-left: 20px;">{{unit.basicInfoScore ? unit.basicInfoScore : 0}}分</span> -->
<span style="margin-left: 20px;">
总分值: <input class="scoreInput" type="number" (click)="stopPropagation($event)"
[(ngModel)]="unit.basicInfoScore" (input)="sumScore('基本信息',key)"> 分,
单项
<span style="color: #FF8678;">
{{unit.basicInfoItemScore ? unit.basicInfoItemScore : 0}}
</span>
</span>
</mat-panel-title>
</mat-expansion-panel-header>
<div style="box-sizing: border-box;padding: 10px;">
<nz-tree
[nzData]="unit.basicInfoNodes"
nzCheckable
nzMultiple
[nzCheckedKeys]="defaultCheckedKeys"
[nzExpandedKeys]="defaultExpandedKeys"
[nzSelectedKeys]="defaultSelectedKeys"
(nzClick)="nzEvent($event,key)"
(nzExpandChange)="nzEvent($event,key)"
(nzCheckBoxChange)="nzEvent($event,key)"
[nzTreeTemplate]="nzTreeTemplate"
>
</nz-tree>
<ng-template #nzTreeTemplate let-node let-origin="origin">
<div class="treeNodeTemplate">
<label class="overflowText textNode">{{node.origin.name}}</label>
<div class="scoreDiv" *ngIf="node.level == '0'">
<span class="colorspan lookitem" (click)="lookTreeNode(node)">查看</span>
<div *ngFor="let unit of unitId;let key = index">
<div [hidden]="!(key == selectedUnitIndex)">
<!-- 选择的单位名称 -->
<p class="colorspan" style="margin: 0 0 12px 6px;">{{unit.name}}</p>
<!-- 基本信息 -->
<mat-accordion>
<mat-expansion-panel style="box-shadow: 0 0 black;" expanded>
<mat-expansion-panel-header collapsedHeight ='40px' expandedHeight='40px' style="position: relative;padding-left:20px;background: #F5FDFE;">
<mat-panel-title>
基本信息
<!-- <span class="colorspan" style="margin-left: 20px;">{{unit.basicInfoScore ? unit.basicInfoScore : 0}}分</span> -->
<span style="margin-left: 20px;">
总分值: <input class="scoreInput" type="number" (click)="stopPropagation($event)"
[(ngModel)]="unit.basicInfoScore" (input)="sumScore('基本信息',key)"> 分,
单项
<span style="color: #FF8678;">
{{unit.basicInfoItemScore ? unit.basicInfoItemScore : 0}}
</span>
</span>
</mat-panel-title>
</mat-expansion-panel-header>
<div style="box-sizing: border-box;padding: 10px;">
<nz-tree
[nzData]="unit.basicInfoNodes"
nzCheckable
nzMultiple
[nzCheckedKeys]="defaultCheckedKeys"
[nzExpandedKeys]="defaultExpandedKeys"
[nzSelectedKeys]="defaultSelectedKeys"
(nzClick)="nzEvent($event,key)"
(nzExpandChange)="nzEvent($event,key)"
(nzCheckBoxChange)="nzEvent($event,key)"
[nzTreeTemplate]="nzTreeTemplate"
>
</nz-tree>
<ng-template #nzTreeTemplate let-node let-origin="origin">
<div class="treeNodeTemplate">
<label class="overflowText textNode">{{node.origin.name}}</label>
<div class="scoreDiv" *ngIf="node.level == '0'">
<span class="colorspan lookitem" (click)="lookTreeNode(node)">查看</span>
</div>
</div>
</div>
</ng-template>
</div>
</mat-expansion-panel>
</mat-accordion>
<!-- 四周毗邻 -->
<mat-accordion *ngIf="unit.aroundNodes.length != 0">
<mat-expansion-panel style="box-shadow: 0 0 black;" expanded>
<mat-expansion-panel-header collapsedHeight ='40px' expandedHeight='40px' style="position: relative;padding-left:20px;background: #F5FDFE;">
<mat-panel-title>
四周毗邻
<span style="margin-left: 20px;">
总分值: <input class="scoreInput" type="number" (click)="stopPropagation($event)"
[(ngModel)]="unit.aroundScore" (input)="sumScore('四周毗邻',key)"> 分,
单项 <span style="color: #FF8678;">
{{unit.aroundItemScore ? unit.aroundItemScore : 0}}
</span>
</span>
</mat-panel-title>
</mat-expansion-panel-header>
<div style="box-sizing: border-box;padding: 10px;">
<nz-tree
[nzData]="unit.aroundNodes"
nzCheckable
nzMultiple
[nzCheckedKeys]="defaultCheckedKeys"
[nzExpandedKeys]="defaultExpandedKeys"
[nzSelectedKeys]="defaultSelectedKeys"
(nzClick)="nzEvent($event,key)"
(nzExpandChange)="nzEvent($event,key)"
(nzCheckBoxChange)="nzEvent($event,key)"
[nzTreeTemplate]="nzTreeTemplate"
>
</nz-tree>
<ng-template #nzTreeTemplate let-node let-origin="origin">
<div class="treeNodeTemplate">
<label class="overflowText textNode">{{node.origin.title ? node.origin.title : node.origin.name}}</label>
<div class="scoreDiv" *ngIf="node.level == '0'">
<span class="colorspan lookitem" (click)="lookTreeNode(node)">查看</span>
</ng-template>
</div>
</mat-expansion-panel>
</mat-accordion>
<!-- 四周毗邻 -->
<mat-accordion *ngIf="unit.aroundNodes.length != 0">
<mat-expansion-panel style="box-shadow: 0 0 black;" expanded>
<mat-expansion-panel-header collapsedHeight ='40px' expandedHeight='40px' style="position: relative;padding-left:20px;background: #F5FDFE;">
<mat-panel-title>
四周毗邻
<span style="margin-left: 20px;">
总分值: <input class="scoreInput" type="number" (click)="stopPropagation($event)"
[(ngModel)]="unit.aroundScore" (input)="sumScore('四周毗邻',key)"> 分,
单项 <span style="color: #FF8678;">
{{unit.aroundItemScore ? unit.aroundItemScore : 0}}
</span>
</span>
</mat-panel-title>
</mat-expansion-panel-header>
<div style="box-sizing: border-box;padding: 10px;">
<nz-tree
[nzData]="unit.aroundNodes"
nzCheckable
nzMultiple
[nzCheckedKeys]="defaultCheckedKeys"
[nzExpandedKeys]="defaultExpandedKeys"
[nzSelectedKeys]="defaultSelectedKeys"
(nzClick)="nzEvent($event,key)"
(nzExpandChange)="nzEvent($event,key)"
(nzCheckBoxChange)="nzEvent($event,key)"
[nzTreeTemplate]="nzTreeTemplate"
>
</nz-tree>
<ng-template #nzTreeTemplate let-node let-origin="origin">
<div class="treeNodeTemplate">
<label class="overflowText textNode">{{node.origin.title ? node.origin.title : node.origin.name}}</label>
<div class="scoreDiv" *ngIf="node.level == '0'">
<span class="colorspan lookitem" (click)="lookTreeNode(node)">查看</span>
</div>
</div>
</div>
</ng-template>
</div>
</mat-expansion-panel>
</mat-accordion>
<!-- 重点部位 -->
<mat-accordion *ngIf="unit.keySiteNodes.length != 0">
<mat-expansion-panel style="box-shadow: 0 0 black;" expanded>
<mat-expansion-panel-header collapsedHeight ='40px' expandedHeight='40px' style="position: relative;padding-left:20px;background: #F5FDFE;">
<mat-panel-title>
重点部位
<span style="margin-left: 20px;">
总分值: <input class="scoreInput" type="number" (click)="stopPropagation($event)"
[(ngModel)]="unit.keySiteScore" (input)="sumScore('重点部位',key)"> 分,
单项 <span style="color: #FF8678;">
{{unit.keySiteItemScore ? unit.keySiteItemScore : 0}}
</span>
</span>
</mat-panel-title>
</mat-expansion-panel-header>
<div style="box-sizing: border-box;padding: 10px;">
<nz-tree
[nzData]="unit.keySiteNodes"
nzCheckable
nzMultiple
[nzCheckedKeys]="defaultCheckedKeys"
[nzExpandedKeys]="defaultExpandedKeys"
[nzSelectedKeys]="defaultSelectedKeys"
(nzClick)="nzEvent($event,key)"
(nzExpandChange)="nzEvent($event,key)"
(nzCheckBoxChange)="nzEvent($event,key)"
[nzTreeTemplate]="nzTreeTemplate"
>
</nz-tree>
<ng-template #nzTreeTemplate let-node let-origin="origin">
<div class="treeNodeTemplate">
<label class="overflowText textNode">{{node.origin.title ? node.origin.title : node.origin.name}}</label>
<div class="scoreDiv" *ngIf="node.level == '0'">
<span class="colorspan lookitem" (click)="lookTreeNode(node)">查看</span>
</ng-template>
</div>
</mat-expansion-panel>
</mat-accordion>
<!-- 重点部位 -->
<mat-accordion *ngIf="unit.keySiteNodes.length != 0">
<mat-expansion-panel style="box-shadow: 0 0 black;" expanded>
<mat-expansion-panel-header collapsedHeight ='40px' expandedHeight='40px' style="position: relative;padding-left:20px;background: #F5FDFE;">
<mat-panel-title>
重点部位
<span style="margin-left: 20px;">
总分值: <input class="scoreInput" type="number" (click)="stopPropagation($event)"
[(ngModel)]="unit.keySiteScore" (input)="sumScore('重点部位',key)"> 分,
单项 <span style="color: #FF8678;">
{{unit.keySiteItemScore ? unit.keySiteItemScore : 0}}
</span>
</span>
</mat-panel-title>
</mat-expansion-panel-header>
<div style="box-sizing: border-box;padding: 10px;">
<nz-tree
[nzData]="unit.keySiteNodes"
nzCheckable
nzMultiple
[nzCheckedKeys]="defaultCheckedKeys"
[nzExpandedKeys]="defaultExpandedKeys"
[nzSelectedKeys]="defaultSelectedKeys"
(nzClick)="nzEvent($event,key)"
(nzExpandChange)="nzEvent($event,key)"
(nzCheckBoxChange)="nzEvent($event,key)"
[nzTreeTemplate]="nzTreeTemplate"
>
</nz-tree>
<ng-template #nzTreeTemplate let-node let-origin="origin">
<div class="treeNodeTemplate">
<label class="overflowText textNode">{{node.origin.title ? node.origin.title : node.origin.name}}</label>
<div class="scoreDiv" *ngIf="node.level == '0'">
<span class="colorspan lookitem" (click)="lookTreeNode(node)">查看</span>
</div>
</div>
</div>
</ng-template>
</div>
</mat-expansion-panel>
</mat-accordion>
<!-- 功能分区 -->
<mat-accordion *ngIf="unit.funDivNodes.length != 0">
<mat-expansion-panel style="box-shadow: 0 0 black;" expanded>
<mat-expansion-panel-header collapsedHeight ='40px' expandedHeight='40px' style="position: relative;padding-left:20px;background: #F5FDFE;">
<mat-panel-title>
功能分区
<span style="margin-left: 20px;">
总分值: <input class="scoreInput" type="number" (click)="stopPropagation($event)"
[(ngModel)]="unit.funDivScore" (input)="sumScore('功能分区',key)"> 分,
单项 <span style="color: #FF8678;">
{{unit.funDivItemScore ? unit.funDivItemScore : 0}}
</span>
</span>
</mat-panel-title>
</mat-expansion-panel-header>
<div style="box-sizing: border-box;padding: 10px;">
<nz-tree
[nzData]="unit.funDivNodes"
nzCheckable
nzMultiple
[nzCheckedKeys]="defaultCheckedKeys"
[nzExpandedKeys]="defaultExpandedKeys"
[nzSelectedKeys]="defaultSelectedKeys"
(nzClick)="nzEvent($event,key)"
(nzExpandChange)="nzEvent($event,key)"
(nzCheckBoxChange)="nzEvent($event,key)"
[nzTreeTemplate]="nzTreeTemplate"
>
</nz-tree>
<ng-template #nzTreeTemplate let-node let-origin="origin">
<div class="treeNodeTemplate">
<label class="overflowText textNode">{{node.origin.region ? node.origin.region : node.origin.name}}</label>
<div class="scoreDiv" *ngIf="node.level == '0'">
<span class="colorspan lookitem" (click)="lookTreeNode(node)">查看</span>
</ng-template>
</div>
</mat-expansion-panel>
</mat-accordion>
<!-- 功能分区 -->
<mat-accordion *ngIf="unit.funDivNodes.length != 0">
<mat-expansion-panel style="box-shadow: 0 0 black;" expanded>
<mat-expansion-panel-header collapsedHeight ='40px' expandedHeight='40px' style="position: relative;padding-left:20px;background: #F5FDFE;">
<mat-panel-title>
功能分区
<span style="margin-left: 20px;">
总分值: <input class="scoreInput" type="number" (click)="stopPropagation($event)"
[(ngModel)]="unit.funDivScore" (input)="sumScore('功能分区',key)"> 分,
单项 <span style="color: #FF8678;">
{{unit.funDivItemScore ? unit.funDivItemScore : 0}}
</span>
</span>
</mat-panel-title>
</mat-expansion-panel-header>
<div style="box-sizing: border-box;padding: 10px;">
<nz-tree
[nzData]="unit.funDivNodes"
nzCheckable
nzMultiple
[nzCheckedKeys]="defaultCheckedKeys"
[nzExpandedKeys]="defaultExpandedKeys"
[nzSelectedKeys]="defaultSelectedKeys"
(nzClick)="nzEvent($event,key)"
(nzExpandChange)="nzEvent($event,key)"
(nzCheckBoxChange)="nzEvent($event,key)"
[nzTreeTemplate]="nzTreeTemplate"
>
</nz-tree>
<ng-template #nzTreeTemplate let-node let-origin="origin">
<div class="treeNodeTemplate">
<label class="overflowText textNode">{{node.origin.region ? node.origin.region : node.origin.name}}</label>
<div class="scoreDiv" *ngIf="node.level == '0'">
<span class="colorspan lookitem" (click)="lookTreeNode(node)">查看</span>
</div>
</div>
</div>
</ng-template>
</div>
</mat-expansion-panel>
</mat-accordion>
<!-- 数据核验(消防设施) -->
<mat-accordion *ngIf="unit.fireFacNodes .length != 0">
<mat-expansion-panel style="box-shadow: 0 0 black;" expanded>
<mat-expansion-panel-header collapsedHeight ='40px' expandedHeight='40px' style="position: relative;padding-left:20px;background: #F5FDFE;">
<mat-panel-title>
数据核验
<span style="margin-left: 20px;">
总分值: <input class="scoreInput" type="number" (click)="stopPropagation($event)"
[(ngModel)]="unit.fireFacScore " (input)="sumScore('数据核验',key)"> 分,
单项 <span style="color: #FF8678;">
{{unit.fireFacItemScore ? unit.fireFacItemScore : 0}}
</span>
</span>
</mat-panel-title>
</mat-expansion-panel-header>
<div style="box-sizing: border-box;padding: 10px;">
<nz-tree
[nzData]="unit.fireFacNodes"
nzCheckable
nzMultiple
[nzCheckedKeys]="defaultCheckedKeys"
[nzExpandedKeys]="defaultExpandedKeys"
[nzSelectedKeys]="defaultSelectedKeys"
(nzClick)="nzEvent($event,key)"
(nzExpandChange)="nzEvent($event,key)"
(nzCheckBoxChange)="nzEvent($event,key)"
[nzTreeTemplate]="nzTreeTemplate"
>
</nz-tree>
<ng-template #nzTreeTemplate let-node let-origin="origin">
<div class="treeNodeTemplate">
<label class="overflowText textNode">{{node.origin.name}}</label>
<div class="scoreDiv" *ngIf="node.level == '0'">
<span class="colorspan lookitem" (click)="lookTreeNode(node)">查看</span>
</ng-template>
</div>
</mat-expansion-panel>
</mat-accordion>
<!-- 数据核验(消防设施) -->
<mat-accordion *ngIf="unit.fireFacNodes .length != 0">
<mat-expansion-panel style="box-shadow: 0 0 black;" expanded>
<mat-expansion-panel-header collapsedHeight ='40px' expandedHeight='40px' style="position: relative;padding-left:20px;background: #F5FDFE;">
<mat-panel-title>
数据核验
<span style="margin-left: 20px;">
总分值: <input class="scoreInput" type="number" (click)="stopPropagation($event)"
[(ngModel)]="unit.fireFacScore " (input)="sumScore('数据核验',key)"> 分,
单项 <span style="color: #FF8678;">
{{unit.fireFacItemScore ? unit.fireFacItemScore : 0}}
</span>
</span>
</mat-panel-title>
</mat-expansion-panel-header>
<div style="box-sizing: border-box;padding: 10px;">
<nz-tree
[nzData]="unit.fireFacNodes"
nzCheckable
nzMultiple
[nzCheckedKeys]="defaultCheckedKeys"
[nzExpandedKeys]="defaultExpandedKeys"
[nzSelectedKeys]="defaultSelectedKeys"
(nzClick)="nzEvent($event,key)"
(nzExpandChange)="nzEvent($event,key)"
(nzCheckBoxChange)="nzEvent($event,key)"
[nzTreeTemplate]="nzTreeTemplate"
>
</nz-tree>
<ng-template #nzTreeTemplate let-node let-origin="origin">
<div class="treeNodeTemplate">
<label class="overflowText textNode">{{node.origin.name}}</label>
<div class="scoreDiv" *ngIf="node.level == '0'">
<span class="colorspan lookitem" (click)="lookTreeNode(node)">查看</span>
</div>
</div>
</div>
</ng-template>
</div>
</mat-expansion-panel>
</mat-accordion>
</ng-template>
</div>
</mat-expansion-panel>
</mat-accordion>
</div>
</div>
</div>
<div class="fightdeploydiv" *ngIf="selectedTab == 2">
@ -290,7 +293,7 @@
</div>
</div>
<div class="btnbox">
<div class="btn">
<div class="btn" (click)="goBack()">
上一步
</div>
<div class="btn" (click)="finishClick()">

7
src/app/examiner/create-test-score/create-test-score.component.scss

@ -59,6 +59,13 @@ table { text-align: center; border-collapse: collapse; padding:2px;}
tr:nth-child(1){
background: #F5FDFE;
}
.selectedLi{
background-color: #07CDCF;
color: #fff;
.colorspan{
color: #fff;
}
}
}
}
}

48
src/app/examiner/create-test-score/create-test-score.component.ts

@ -28,7 +28,11 @@ export class CreateTestScoreComponent implements OnInit {
this.getFunDiv()
this.getFireFac()
}
//当前选中的单位
selectedUnitIndex = 0
clickUnitName(key){
this.selectedUnitIndex = key
}
//模拟单位数据
unitDatas:any = [
{name:'富丽华大酒店1',score:0,basicInfoScore:0,basicInfoItemScore:0,basicInfoNodes : [
@ -81,11 +85,11 @@ export class CreateTestScoreComponent implements OnInit {
]
//上个页面传过来的单位数据
unitId:any = [{name:'最最最最最',id:'5fb76c42919f2b44e464016f'},
{name:'华南城集团有限公司',id:'5ee19fe06f91049f5e23e937'},
{name:'贵港油库',id:'5fa35d68f8eb762cb03c662e'}
]
// unitId:any = [{name:'最最最最最',id:'5fb76c42919f2b44e464016f'},
// {name:'华南城集团有限公司',id:'5ee19fe06f91049f5e23e937'},
// {name:'贵港油库',id:'5fa35d68f8eb762cb03c662e'}
// ]
unitId:any = JSON.parse(localStorage.getItem('checkedWork'))
//获取单位基本信息
getUnitData(){
this.unitId.forEach((element,index) => {
@ -737,7 +741,7 @@ export class CreateTestScoreComponent implements OnInit {
})
this.examScore = examScore + examScore2
}
@ViewChild('nzTreeComponent', { static: false }) nzTreeComponent!: NzTreeComponent;
//保存
save(){
let copyDatas = JSON.parse(JSON.stringify(this.unitId))
@ -1001,14 +1005,32 @@ export class CreateTestScoreComponent implements OnInit {
//循环每个建筑处理数据
console.log(copyDatas)
// copyDatas.forEach(item =>{
// //建筑的基本信息模块处理
// item.basicInfoNodes.forEach((i,key) => {
// })
let paperDataInfo = []
copyDatas.forEach((item,key) =>{
paperDataInfo[key] = {}
paperDataInfo[key].id = ''
paperDataInfo[key].paperId = ''
paperDataInfo[key].companyId = item.id
paperDataInfo[key].basicInfoData = item.basicInfoNodes
paperDataInfo[key].basicInfoScore = item.basicInfoScore
paperDataInfo[key].adjoinData = item.aroundNodes
paperDataInfo[key].adjoinScore = item.aroundScore
paperDataInfo[key].importLocationData = item.keySiteNodes
paperDataInfo[key].importLocationScore = item.keySiteScore
paperDataInfo[key].functionalDivisionData = item.funDivNodes
paperDataInfo[key].functionalDivisionScore = item.funDivScore
paperDataInfo[key].facilityData = item.fireFacNodes
paperDataInfo[key].facilityScore = item.fireFacScore
})
console.log(paperDataInfo)
// })
}
//上一步
goBack(){
window.history.back();
}
//完成按钮
finishClick(){

4
src/app/examiner/examiner-new-one/examiner-new-one.component.html

@ -23,7 +23,7 @@
<div><label style="margin-right: 10px;position: relative;top: 5px;" >辖区中队:</label></div>
<div>
<input (click)="stopclose($event)" readonly autocomplete="off" [(ngModel)]="js" name="js" (focus)="openorganizationbox()" placeholder="请填写">
<mat-checkbox style="margin-left: 6px;" [(ngModel)]="jscheck" name="jscheck">包含下级</mat-checkbox>
<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">
@ -59,7 +59,7 @@
<th mat-header-cell *matHeaderCellDef>
</th>
<td mat-cell *matCellDef="let element">
<mat-checkbox id={{element.id}} (change)="checkChange($event,element)" [(ngModel)]="element.checked"></mat-checkbox>
<mat-checkbox color="primary" id={{element.id}} (change)="checkChange($event,element)" [(ngModel)]="element.checked"></mat-checkbox>
</td>
</ng-container>
<ng-container matColumnDef="unitname">

Loading…
Cancel
Save