Browse Source

[完善]在线编制预案增加提交功能

tangshan
邵佳豪 3 years ago
parent
commit
ef42362bed
  1. 204
      src/app/plan-management/create-plan-online-five/create-plan-online-five.component.html
  2. 16
      src/app/plan-management/create-plan-online-five/create-plan-online-five.component.ts

204
src/app/plan-management/create-plan-online-five/create-plan-online-five.component.html

@ -10,7 +10,7 @@
<button mat-stroked-button (click)="preview()">
<mat-icon>visibility</mat-icon> 预览
</button>
<button mat-flat-button color="primary">
<button mat-flat-button color="primary" (click)="submit()">
<mat-icon>save</mat-icon> 提交
</button>
</div>
@ -174,7 +174,8 @@
</div>
<div class="buildingBody">
<div class="buildName" *ngFor="let item of planTemplateData[1].building;let i=index">
<mat-checkbox class="example-margin" color='primary' [(ngModel)]="item.completed" (change)='clickBuilding(item,i)'></mat-checkbox>
<mat-checkbox class="example-margin" color='primary' [(ngModel)]="item.completed"
(change)='clickBuilding(item,i)'></mat-checkbox>
<span>{{item.name}}</span>
</div>
</div>
@ -187,13 +188,13 @@
<div *ngFor="let item of planTemplateData;let key = index">
<div *ngIf="selectedItem == item.groupName || pattern == 'look'">
<!-- 封面 -->
<div class="cover" *ngIf="item.groupName == '封面'" id="cover">
<div class="cover" *ngIf="item.groupName == '封面' && pattern == 'edit'" id="cover">
<p class="planNum">
预案编号: <input [(ngModel)]="item.attribute.planNumber" type="text" name="" id="">
</p>
<h1>{{item.attribute.planName}}</h1>
<ul>
<li style="display: flex;">
<li>
<div>
对象名称:
</div>
@ -228,9 +229,9 @@
</div>
<div>
<select [(ngModel)]="item.attribute.disasterType">
<option value="0">火灾</option>
<option value="1">抢险救援</option>
<option value="2">其他</option>
<option value="火灾">火灾</option>
<option value="抢险救援">抢险救援</option>
<option value="其他">其他</option>
</select>
</div>
</li>
@ -283,11 +284,73 @@
审核时间:
</div>
<div>
<input style="border:none" type="text" [(ngModel)]="item.attribute.auditTime">
<input type="text" [(ngModel)]="item.attribute.auditTime">
</div>
</li>
</ul>
</div>
<div *ngIf="item.groupName == '封面' && pattern == 'look'" id="cover" style="margin-bottom: 100px;">
<p>
预案编号: {{item.attribute.planNumber}}
</p>
<h1 style="font-size: 46px;color: #2196f3;text-align: center;font-weight: 600;margin: 80px 0;">
{{item.attribute.planName}}</h1>
<div class="coverItem">
<div style="text-align: center;margin-bottom:12px;">
<span>对象名称:</span>
<span> {{item.attribute.objName}}</span>
</div>
<div style="text-align: center;margin-bottom:12px;">
<span>单位性质:</span>
<span> {{item.attribute.unitNature}}</span>
</div>
<div style="text-align: center;margin-bottom:12px;">
<span><span style="color: #ff0000;">*</span>预案级别:</span>
<span>
<ng-container *ngIf="planLevel == '5'; else elseTemplate">
Ⅴ级
</ng-container>
<ng-template #elseTemplate>
Ⅲ级
</ng-template>
</span>
</div>
<div style="text-align: center;margin-bottom:20px;">
<span><span style="color: #ff0000;">*</span>灾害类型:</span>
<span> {{item.attribute.disasterType}}</span>
</div>
<div style="text-align: center;margin-bottom:20px;">
<span>防火级别:</span>
<span> {{item.attribute.fireproofingLevel}}</span>
</div>
<div style="text-align: center;margin-bottom:20px;">
<span>防火管辖:</span>
<span> {{item.attribute.fireproofingAdminister}}</span>
</div>
<div style="text-align: center;margin-bottom:20px;">
<span>灭火责任队站:</span>
<span> {{item.attribute.putOutFireAdminister}}</span>
</div>
<div style="text-align: center;margin-bottom:20px;">
<span>制作人职务/姓名:</span>
<span>
<span style="margin-right:12px;">{{item.attribute.producer.duty}}</span>
<span>{{item.attribute.producer.name}}</span>
</span>
</div>
<div style="text-align: center;margin-bottom:20px;">
<span>审核人职务/姓名:</span>
<span>
<span style="margin-right:12px;">{{item.attribute.verifier.duty}}</span>
<span>{{item.attribute.verifier.name}}</span>
</span>
</div>
<div style="text-align: center;margin-bottom:20px;">
<span>审核时间:</span>
<span> {{item.attribute.auditTime}}</span>
</div>
</div>
</div>
<div class="centerBox"
*ngIf="item.groupName!='单位概况'&&item.groupName!='交通水源'&&item.groupName!='重点图示'&&item.groupName!='预案附件'&&item.groupName!='特别警示'&&item.groupName!='处置要点'&&item.groupName!='封面'">
<div class="titleItem">
@ -354,7 +417,8 @@
color: white;">
<span>{{item.groupName}}</span>
</div>
<div style="border: 1px solid #e8e9e9;width: 100%;" class="keyImgItem" *ngFor="let i of item.attribute;let key = index">
<div style="border: 1px solid #e8e9e9;width: 100%;" class="keyImgItem"
*ngFor="let i of item.attribute;let key = index">
<div class="keyImgTitle" style="height: 30px;
position: relative;">
<input *ngIf="pattern == 'edit'" type="text" placeholder="请输入分组名称" [(ngModel)]="i.name">
@ -366,14 +430,16 @@
border: 0;
box-sizing: border-box;
padding: 0 5px;"> {{ i.name }} </div>
<mat-icon class="deleteItem" *ngIf="key != 0 && pattern == 'edit'" (click)="deleteItem(item,key)">delete
<mat-icon class="deleteItem" *ngIf="key != 0 && pattern == 'edit'"
(click)="deleteItem(item,key)">delete
</mat-icon>
</div>
<div class="keyImgImg">
<div style="margin-top: 10px;
text-align: center;
position: relative;" class="imgbox" *ngFor="let imgUrl of i.imgArr;let imgkey = index">
<mat-icon *ngIf="pattern == 'edit'" class="deleteImg" (click)="deleteImgItem(i.imgArr,imgkey)">delete
<mat-icon *ngIf="pattern == 'edit'" class="deleteImg"
(click)="deleteImgItem(i.imgArr,imgkey)">delete
</mat-icon>
<img style="max-width: 100%;
width: auto;
@ -418,8 +484,8 @@
</mat-icon>
</div>
<div class="disposalPointTextarea">
<textarea *ngIf="pattern == 'edit'" [(ngModel)]="i.cantent" style="resize: none;" placeholder="请填写自定义内容" name=""
id="" cols="30" rows="10"></textarea>
<textarea *ngIf="pattern == 'edit'" [(ngModel)]="i.cantent" style="resize: none;"
placeholder="请填写自定义内容" name="" id="" cols="30" rows="10"></textarea>
<div style="width: 100%;height: auto;vertical-align: top;
box-sizing: border-box;
padding: 5px;" *ngIf="pattern == 'look'">
@ -457,8 +523,8 @@
padding: 0 5px;"> {{ i.name }} </div>
</div>
<div class="disposalPointTextarea">
<textarea *ngIf="pattern == 'edit'" [(ngModel)]="i.cantent" style="resize: none;" placeholder="请填写自定义内容" name=""
id="" cols="30" rows="10"></textarea>
<textarea *ngIf="pattern == 'edit'" [(ngModel)]="i.cantent" style="resize: none;"
placeholder="请填写自定义内容" name="" id="" cols="30" rows="10"></textarea>
<div style="width: 100%;height: auto;vertical-align: top;
box-sizing: border-box;
padding: 5px;" *ngIf="pattern == 'look'">
@ -468,7 +534,8 @@
</div>
</div>
<div class="unit" *ngIf="item.groupName == '单位概况'">
<div *ngFor="let itemunit of planTemplateData[1].building;let uniti=index" style="border-bottom: 3px solid #999;">
<div *ngFor="let itemunit of planTemplateData[1].building;let uniti=index"
style="border-bottom: 3px solid #999;">
<div *ngIf="itemunit.completed">
<div class="unithead">
<span>{{itemunit.name}}</span>
@ -478,7 +545,9 @@
<div class="unitbodyHead">
<span>{{element.surveyName}}</span>
<!-- <img src="../../../assets/images/deletered.png" > -->
<img src="../../../assets/images/addbai.png" (click)='unitadd(element.surveyName,uniti,1)' *ngIf="pattern == 'edit'&&(element.surveyName=='功能分区'||element.surveyName=='重点部位')">
<img src="../../../assets/images/addbai.png"
(click)='unitadd(element.surveyName,uniti,1)'
*ngIf="pattern == 'edit'&&(element.surveyName=='功能分区'||element.surveyName=='重点部位')">
</div>
<div class="body">
<!-- 进攻通道 -->
@ -486,9 +555,11 @@
<div *ngFor="let attack of element.attinf;let attacki=index">
<div class="attackhead">
<span>{{attack.head}}</span>
<img src="../../../assets/images/deleteblue.png" *ngIf="pattern == 'edit'"
<img src="../../../assets/images/deleteblue.png"
*ngIf="pattern == 'edit'"
(click)='unitDel(element.surveyName,uniti,attacki)'>
<img src="../../../assets/images/add.png" *ngIf="pattern == 'edit'"
<img src="../../../assets/images/add.png"
*ngIf="pattern == 'edit'"
(click)='unitadd(element.surveyName,uniti,attacki)'>
</div>
<div class="attackbody">
@ -520,16 +591,24 @@
<div class="building" *ngIf="element.surveyName=='单位基本信息'">
<div *ngFor="let info of element.attinf">
<div *ngIf="info.completed" class="onetext">
<input type="text" placeholder="请输入内容" style="width: 40%;background-color: #e8e9e9;text-align: center;" [(ngModel)]="info.propertyName" readonly>
<input type="text" placeholder="请输入内容" style="width: 60%;background-color: #FFFFFF;" [(ngModel)]="info.value">
<input type="text" placeholder="请输入内容"
style="width: 40%;background-color: #e8e9e9;text-align: center;"
[(ngModel)]="info.propertyName" readonly>
<input type="text" placeholder="请输入内容"
style="width: 60%;background-color: #FFFFFF;"
[(ngModel)]="info.value">
</div>
</div>
</div>
<div class="building" *ngIf="element.surveyName=='建筑信息'">
<div *ngFor="let info of element.attinf">
<div *ngIf="info.completed" class="onetext">
<input type="text" placeholder="请输入内容" style="width: 40%;background-color: #e8e9e9;text-align: center;" [(ngModel)]="info.propertyName" readonly>
<input type="text" placeholder="请输入内容" style="width: 60%;background-color: #FFFFFF;" [(ngModel)]="info.propertyValue">
<input type="text" placeholder="请输入内容"
style="width: 40%;background-color: #e8e9e9;text-align: center;"
[(ngModel)]="info.propertyName" readonly>
<input type="text" placeholder="请输入内容"
style="width: 60%;background-color: #FFFFFF;"
[(ngModel)]="info.propertyValue">
</div>
</div>
</div>
@ -543,8 +622,12 @@
<div class="fileBody">
<div *ngFor="let info of attack.facilityItems">
<div *ngIf="info.completed" class="onetext">
<input type="text" placeholder="请输入内容" style="width: 40%;background-color: #e8e9e9;text-align: center;" [(ngModel)]="info.name" readonly>
<input type="text" placeholder="请输入内容" style="width: 60%;background-color: #FFFFFF;" [(ngModel)]="info.value">
<input type="text" placeholder="请输入内容"
style="width: 40%;background-color: #e8e9e9;text-align: center;"
[(ngModel)]="info.name" readonly>
<input type="text" placeholder="请输入内容"
style="width: 60%;background-color: #FFFFFF;"
[(ngModel)]="info.value">
</div>
</div>
</div>
@ -556,50 +639,84 @@
<!-- 四周毗邻 -->
<div class="fouradj" *ngIf="element.surveyName=='四周毗邻'">
<div class="fourTexttwo" *ngFor="let info of element.attinf">
<input type="text" placeholder="请输入内容" style="width: 30%;background-color: #e8e9e9;text-align: center;" [(ngModel)]="info.name" readonly>
<input type="text" placeholder="请输入内容" style="width: 70%;background-color: #FFFFFF;" [(ngModel)]="info.value">
<input type="text" placeholder="请输入内容"
style="width: 30%;background-color: #e8e9e9;text-align: center;"
[(ngModel)]="info.name" readonly>
<input type="text" placeholder="请输入内容"
style="width: 70%;background-color: #FFFFFF;"
[(ngModel)]="info.value">
</div>
</div>
<!-- 功能分区 -->
<div class="fouradj" *ngIf="element.surveyName=='功能分区'">
<div class="onetext" *ngFor="let info of element.attinf;let infoi=index">
<input type="text" placeholder="请输入内容" style="width: 30%;background-color: #e8e9e9;text-align: center;" [(ngModel)]="info.name">
<input type="text" placeholder="请输入内容" style="width: 67%;background-color: #FFFFFF;" [(ngModel)]="info.value">
<img src="../../../assets/images/deletered.png" (click)='unitDel(element.surveyName,uniti,infoi)' *ngIf="pattern == 'edit'">
<div class="onetext"
*ngFor="let info of element.attinf;let infoi=index">
<input type="text" placeholder="请输入内容"
style="width: 30%;background-color: #e8e9e9;text-align: center;"
[(ngModel)]="info.name">
<input type="text" placeholder="请输入内容"
style="width: 67%;background-color: #FFFFFF;"
[(ngModel)]="info.value">
<img src="../../../assets/images/deletered.png"
(click)='unitDel(element.surveyName,uniti,infoi)'
*ngIf="pattern == 'edit'">
</div>
</div>
<!-- 重点部位 -->
<div class="parts" *ngIf="element.surveyName=='重点部位'">
<div *ngFor="let parts of element.attinf;let infoi=index">
<div class="partsHead">
<input type="text" placeholder="请输入内容" [(ngModel)]="parts.heafName">
<img src="../../../assets/images/deletered.png" (click)='unitDel(element.surveyName,uniti,infoi)' *ngIf="pattern == 'edit'">
<input type="text" placeholder="请输入内容"
[(ngModel)]="parts.heafName">
<img src="../../../assets/images/deletered.png"
(click)='unitDel(element.surveyName,uniti,infoi)'
*ngIf="pattern == 'edit'">
</div>
<div class="partsBody">
<div class="duohang">
<div class="duohangHalf">
<input type="text" placeholder="请输入内容" style="width: 40%;background-color: #e8e9e9;text-align: center;" [(ngModel)]="parts.body[0].name">
<input type="text" placeholder="请输入内容" style="width: 60%;background-color: #FFFFFF;" [(ngModel)]="parts.body[0].value">
<input type="text" placeholder="请输入内容"
style="width: 40%;background-color: #e8e9e9;text-align: center;"
[(ngModel)]="parts.body[0].name">
<input type="text" placeholder="请输入内容"
style="width: 60%;background-color: #FFFFFF;"
[(ngModel)]="parts.body[0].value">
</div>
<div class="duohangHalf">
<input type="text" placeholder="请输入内容" style="width: 40%;background-color: #e8e9e9;text-align: center;"[(ngModel)]="parts.body[1].name" >
<input type="text" placeholder="请输入内容" style="width: 60%;background-color: #FFFFFF;" [(ngModel)]="parts.body[1].value">
<input type="text" placeholder="请输入内容"
style="width: 40%;background-color: #e8e9e9;text-align: center;"
[(ngModel)]="parts.body[1].name">
<input type="text" placeholder="请输入内容"
style="width: 60%;background-color: #FFFFFF;"
[(ngModel)]="parts.body[1].value">
</div>
</div>
<div class="duohang">
<div class="duohangHalf">
<input type="text" placeholder="请输入内容" style="width: 40%;background-color: #e8e9e9;text-align: center;" [(ngModel)]="parts.body[2].name">
<input type="text" placeholder="请输入内容" style="width: 60%;background-color: #FFFFFF;" [(ngModel)]="parts.body[2].value">
<input type="text" placeholder="请输入内容"
style="width: 40%;background-color: #e8e9e9;text-align: center;"
[(ngModel)]="parts.body[2].name">
<input type="text" placeholder="请输入内容"
style="width: 60%;background-color: #FFFFFF;"
[(ngModel)]="parts.body[2].value">
</div>
<div class="duohangHalf">
<input type="text" placeholder="请输入内容" style="width: 40%;background-color: #e8e9e9;text-align: center;" [(ngModel)]="parts.body[3].name">
<input type="text" placeholder="请输入内容" style="width: 60%;background-color: #FFFFFF;" [(ngModel)]="parts.body[3].value">
<input type="text" placeholder="请输入内容"
style="width: 40%;background-color: #e8e9e9;text-align: center;"
[(ngModel)]="parts.body[3].name">
<input type="text" placeholder="请输入内容"
style="width: 60%;background-color: #FFFFFF;"
[(ngModel)]="parts.body[3].value">
</div>
</div>
<div class="danhang">
<input type="text" placeholder="请输入内容" style="width: 40%;background-color: #e8e9e9;text-align: center;" [(ngModel)]="parts.body[4].name">
<input type="text" placeholder="请输入内容" style="width: 60%;background-color: #FFFFFF;" [(ngModel)]="parts.body[4].value">
<input type="text" placeholder="请输入内容"
style="width: 40%;background-color: #e8e9e9;text-align: center;"
[(ngModel)]="parts.body[4].name">
<input type="text" placeholder="请输入内容"
style="width: 60%;background-color: #FFFFFF;"
[(ngModel)]="parts.body[4].value">
</div>
</div>
</div>
@ -633,7 +750,6 @@
</div>
</div>
</div>
<a id="msg_end" name="1" href="#cover"> </a>
<div id="viewerjs" style="display:none">

16
src/app/plan-management/create-plan-online-five/create-plan-online-five.component.ts

@ -168,7 +168,7 @@ export class CreatePlanOnlineFiveComponent implements OnInit {
objName: this.unitData.name,
unitNature: this.unitData.buildingTypes[0].name,
planLevel: '',
disasterType: '0',
disasterType: '火灾',
fireproofingLevel: '',
fireproofingAdminister: this.unitData.organizationName,
putOutFireAdminister: '',
@ -524,6 +524,20 @@ export class CreatePlanOnlineFiveComponent implements OnInit {
quitPreview() {
this.pattern = 'edit'
}
//提交
submit() {
console.log('提交信息', this.planTemplateData)
let body = {
webTextData: JSON.stringify(this.planTemplateData)
}
this.http.put(`/api/PlanComponents/${this.route.snapshot.queryParams.planId}`, body).subscribe(data => {
// console.log('提交成功',data)
const config = new MatSnackBarConfig();
config.verticalPosition = 'top';
config.duration = 3000
this.snackBar.open('提交成功', '确定', config);
})
}
//返回顶部
goBack() {
document.querySelector('#mainbox').scrollIntoView(true)

Loading…
Cancel
Save