chenjingyu 3 years ago
parent
commit
81012342e1
  1. 114
      src/app/plan-management/create-plan-online-five/create-plan-online-five.component.html
  2. 84
      src/app/plan-management/create-plan-online-five/create-plan-online-five.component.ts

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

@ -10,7 +10,7 @@
<button mat-stroked-button (click)="preview()"> <button mat-stroked-button (click)="preview()">
<mat-icon>visibility</mat-icon> 预览 <mat-icon>visibility</mat-icon> 预览
</button> </button>
<button mat-flat-button color="primary"> <button mat-flat-button color="primary" (click)="submit()">
<mat-icon>save</mat-icon> 提交 <mat-icon>save</mat-icon> 提交
</button> </button>
</div> </div>
@ -173,8 +173,9 @@
<span>建筑列表</span> <span>建筑列表</span>
</div> </div>
<div class="buildingBody"> <div class="buildingBody">
<div class="buildName" *ngFor="let item of planTemplateData[1].building;let i=index" > <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> <span>{{item.name}}</span>
</div> </div>
</div> </div>
@ -187,13 +188,13 @@
<div *ngFor="let item of planTemplateData;let key = index"> <div *ngFor="let item of planTemplateData;let key = index">
<div *ngIf="selectedItem == item.groupName || pattern == 'look'"> <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"> <p class="planNum">
预案编号: <input [(ngModel)]="item.attribute.planNumber" type="text" name="" id=""> 预案编号: <input [(ngModel)]="item.attribute.planNumber" type="text" name="" id="">
</p> </p>
<h1>{{item.attribute.planName}}</h1> <h1>{{item.attribute.planName}}</h1>
<ul> <ul>
<li style="display: flex;"> <li>
<div> <div>
对象名称: 对象名称:
</div> </div>
@ -228,9 +229,9 @@
</div> </div>
<div> <div>
<select [(ngModel)]="item.attribute.disasterType"> <select [(ngModel)]="item.attribute.disasterType">
<option value="0">火灾</option> <option value="火灾">火灾</option>
<option value="1">抢险救援</option> <option value="抢险救援">抢险救援</option>
<option value="2">其他</option> <option value="其他">其他</option>
</select> </select>
</div> </div>
</li> </li>
@ -283,16 +284,74 @@
审核时间: 审核时间:
</div> </div>
<div> <div>
<input style="border:none" type="text" [(ngModel)]="item.attribute.auditTime"> <input type="text" [(ngModel)]="item.attribute.auditTime">
</div> </div>
</li> </li>
</ul> </ul>
</div> </div>
<div class="centerBox" style="width: 100%; <div *ngIf="item.groupName == '封面' && pattern == 'look'" id="cover" style="margin-bottom: 100px;">
height: 100%; <p>
display: flex; 预案编号: {{item.attribute.planNumber}}
flex-direction: column; </p>
overflow-y: auto;" <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!='封面'"> *ngIf="item.groupName!='单位概况'&&item.groupName!='交通水源'&&item.groupName!='重点图示'&&item.groupName!='预案附件'&&item.groupName!='特别警示'&&item.groupName!='处置要点'&&item.groupName!='封面'">
<div class="titleItem" style="width: 100%; <div class="titleItem" style="width: 100%;
height: 36px; height: 36px;
@ -409,7 +468,8 @@
color: white;"> color: white;">
<span>{{item.groupName}}</span> <span>{{item.groupName}}</span>
</div> </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; <div class="keyImgTitle" style="height: 30px;
position: relative;"> position: relative;">
<input *ngIf="pattern == 'edit'" type="text" placeholder="请输入分组名称" [(ngModel)]="i.name"> <input *ngIf="pattern == 'edit'" type="text" placeholder="请输入分组名称" [(ngModel)]="i.name">
@ -421,14 +481,16 @@
border: 0; border: 0;
box-sizing: border-box; box-sizing: border-box;
padding: 0 5px;"> {{ i.name }} </div> 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> </mat-icon>
</div> </div>
<div class="keyImgImg"> <div class="keyImgImg">
<div style="margin-top: 10px; <div style="margin-top: 10px;
text-align: center; text-align: center;
position: relative;" class="imgbox" *ngFor="let imgUrl of i.imgArr;let imgkey = index"> 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> </mat-icon>
<img style="max-width: 100%; <img style="max-width: 100%;
width: auto; width: auto;
@ -473,8 +535,8 @@
</mat-icon> </mat-icon>
</div> </div>
<div class="disposalPointTextarea"> <div class="disposalPointTextarea">
<textarea *ngIf="pattern == 'edit'" [(ngModel)]="i.cantent" style="resize: none;" placeholder="请填写自定义内容" name="" <textarea *ngIf="pattern == 'edit'" [(ngModel)]="i.cantent" style="resize: none;"
id="" cols="30" rows="10"></textarea> placeholder="请填写自定义内容" name="" id="" cols="30" rows="10"></textarea>
<div style="width: 100%;height: auto;vertical-align: top; <div style="width: 100%;height: auto;vertical-align: top;
box-sizing: border-box; box-sizing: border-box;
padding: 5px;" *ngIf="pattern == 'look'"> padding: 5px;" *ngIf="pattern == 'look'">
@ -512,8 +574,8 @@
padding: 0 5px;"> {{ i.name }} </div> padding: 0 5px;"> {{ i.name }} </div>
</div> </div>
<div class="disposalPointTextarea"> <div class="disposalPointTextarea">
<textarea *ngIf="pattern == 'edit'" [(ngModel)]="i.cantent" style="resize: none;" placeholder="请填写自定义内容" name="" <textarea *ngIf="pattern == 'edit'" [(ngModel)]="i.cantent" style="resize: none;"
id="" cols="30" rows="10"></textarea> placeholder="请填写自定义内容" name="" id="" cols="30" rows="10"></textarea>
<div style="width: 100%;height: auto;vertical-align: top; <div style="width: 100%;height: auto;vertical-align: top;
box-sizing: border-box; box-sizing: border-box;
padding: 5px;" *ngIf="pattern == 'look'"> padding: 5px;" *ngIf="pattern == 'look'">
@ -554,9 +616,11 @@
line-height: 40px; line-height: 40px;
color: #ffffff;">{{element.surveyName}}</span> color: #ffffff;">{{element.surveyName}}</span>
<!-- <img src="../../../assets/images/deletered.png" > --> <!-- <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>
<div class="body" > <div class="body">
<!-- 进攻通道 --> <!-- 进攻通道 -->
<div class="attack" *ngIf="element.surveyName=='进攻通道'"> <div class="attack" *ngIf="element.surveyName=='进攻通道'">
<div *ngFor="let attack of element.attinf;let attacki=index"> <div *ngFor="let attack of element.attinf;let attacki=index">
@ -571,7 +635,8 @@
color: #b99a00;">{{attack.head}}</span> color: #b99a00;">{{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)'> (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)'> (click)='unitadd(element.surveyName,uniti,attacki)'>
</div> </div>
<div class="attackbody"> <div class="attackbody">
@ -888,7 +953,6 @@
</div> </div>
</div> </div>
</div> </div>
<a id="msg_end" name="1" href="#cover"> </a>
<div id="viewerjs" style="display:none"> <div id="viewerjs" style="display:none">

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

@ -12,7 +12,7 @@ import { ActivatedRoute } from '@angular/router';
import { MatDialog, MatDialogRef, MAT_DIALOG_DATA } from '@angular/material/dialog'; import { MatDialog, MatDialogRef, MAT_DIALOG_DATA } from '@angular/material/dialog';
import { MatSnackBar, MatSnackBarConfig } from '@angular/material/snack-bar'; import { MatSnackBar, MatSnackBarConfig } from '@angular/material/snack-bar';
import Viewer from 'viewerjs'; import Viewer from 'viewerjs';
declare var $:any declare var $: any
@Component({ @Component({
selector: 'app-create-plan-online-five', selector: 'app-create-plan-online-five',
templateUrl: './create-plan-online-five.component.html', templateUrl: './create-plan-online-five.component.html',
@ -79,12 +79,12 @@ export class CreatePlanOnlineFiveComponent implements OnInit {
} else if (this.selectedItem == '单位概况') { } else if (this.selectedItem == '单位概况') {
this.getAllBuildings() this.getAllBuildings()
console.log(this.planTemplateData) console.log(this.planTemplateData)
this.planTemplateData[1].attribute[0].attinf[0].value=this.unitData.usci this.planTemplateData[1].attribute[0].attinf[0].value = this.unitData.usci
this.planTemplateData[1].attribute[0].attinf[1].value=this.unitData.buildingTypes[0].name this.planTemplateData[1].attribute[0].attinf[1].value = this.unitData.buildingTypes[0].name
this.planTemplateData[1].attribute[0].attinf[2].value=this.unitData.contacts this.planTemplateData[1].attribute[0].attinf[2].value = this.unitData.contacts
this.planTemplateData[1].attribute[0].attinf[3].value=this.unitData.phone this.planTemplateData[1].attribute[0].attinf[3].value = this.unitData.phone
this.planTemplateData[1].attribute[0].attinf[4].value=this.unitData.organizationName this.planTemplateData[1].attribute[0].attinf[4].value = this.unitData.organizationName
this.planTemplateData[1].attribute[0].attinf[5].value=this.unitData.address this.planTemplateData[1].attribute[0].attinf[5].value = this.unitData.address
} /* else if (this.selectedItem == '单位概况') { } /* else if (this.selectedItem == '单位概况') {
//this.getAllBuildings() //this.getAllBuildings()
} */ else if (this.selectedItem == '') { } */ else if (this.selectedItem == '') {
@ -168,7 +168,7 @@ export class CreatePlanOnlineFiveComponent implements OnInit {
objName: this.unitData.name, objName: this.unitData.name,
unitNature: this.unitData.buildingTypes[0].name, unitNature: this.unitData.buildingTypes[0].name,
planLevel: '', planLevel: '',
disasterType: '0', disasterType: '火灾',
fireproofingLevel: '', fireproofingLevel: '',
fireproofingAdminister: this.unitData.organizationName, fireproofingAdminister: this.unitData.organizationName,
putOutFireAdminister: '', putOutFireAdminister: '',
@ -304,13 +304,13 @@ export class CreatePlanOnlineFiveComponent implements OnInit {
}) })
}) })
this.allBuildings = data this.allBuildings = data
if(this.planTemplateData[1].building==undefined){ if (this.planTemplateData[1].building == undefined) {
this.planTemplateData[1].building=[] this.planTemplateData[1].building = []
for(var i=0;i<this.allBuildings.length;i++){ for (var i = 0; i < this.allBuildings.length; i++) {
if(i==0){ if (i == 0) {
this.planTemplateData[1].building.push({name:this.allBuildings[i].name,body:this.planTemplateData[1].attribute,completed:true}) this.planTemplateData[1].building.push({ name: this.allBuildings[i].name, body: this.planTemplateData[1].attribute, completed: true })
}else{ } else {
this.planTemplateData[1].building.push({name:this.allBuildings[i].name,body:this.planTemplateData[1].attribute,completed:false}) this.planTemplateData[1].building.push({ name: this.allBuildings[i].name, body: this.planTemplateData[1].attribute, completed: false })
} }
} }
@ -318,7 +318,7 @@ export class CreatePlanOnlineFiveComponent implements OnInit {
console.log(this.planTemplateData) console.log(this.planTemplateData)
//this.buildingName=this.planTemplateData[1].building[0].name //this.buildingName=this.planTemplateData[1].building[0].name
this.group=this.planTemplateData[1].building this.group = this.planTemplateData[1].building
//delete this.planTemplateData[0].attribute //delete this.planTemplateData[0].attribute
}) })
@ -411,15 +411,15 @@ export class CreatePlanOnlineFiveComponent implements OnInit {
buildingName buildingName
clicki = 0 clicki = 0
group group
clickBuilding(item,i){ clickBuilding(item, i) {
this.buildingName=item.name this.buildingName = item.name
this.clicki=i this.clicki = i
console.log(item,this.clicki) console.log(item, this.clicki)
//this.group=this.planTemplateData[1].building[this.clicki].body //this.group=this.planTemplateData[1].building[this.clicki].body
} }
//单位概况增加一行 //单位概况增加一行
unitadd(surveyName, attacki,i) { unitadd(surveyName, attacki, i) {
this.addNumber++ this.addNumber++
if (surveyName == '进攻通道') { if (surveyName == '进攻通道') {
if (this.planTemplateData[1].building[attacki].body[4].attinf[i].tabletr == undefined) { if (this.planTemplateData[1].building[attacki].body[4].attinf[i].tabletr == undefined) {
@ -437,21 +437,21 @@ export class CreatePlanOnlineFiveComponent implements OnInit {
// console.log(this.planTemplateData) // console.log(this.planTemplateData)
} }
else if(surveyName=='功能分区'){ else if (surveyName == '功能分区') {
console.log(attacki) console.log(attacki)
this.planTemplateData[1].building[attacki].body[6].attinf.push({name:'',value:''}) this.planTemplateData[1].building[attacki].body[6].attinf.push({ name: '', value: '' })
}else if(surveyName=='重点部位'){ } else if (surveyName == '重点部位') {
this.planTemplateData[1].building[attacki].body[5].attinf.push({heafName:'',body:[{name:'重点部位名称',value:''},{name:'重点部位所在位置',value:''},{name:'建筑结构',value:''},{name:'使用性质',value:''},{name:'主要危险性',value:''}]}) this.planTemplateData[1].building[attacki].body[5].attinf.push({ heafName: '', body: [{ name: '重点部位名称', value: '' }, { name: '重点部位所在位置', value: '' }, { name: '建筑结构', value: '' }, { name: '使用性质', value: '' }, { name: '主要危险性', value: '' }] })
} }
} }
//单位概况删除一行 //单位概况删除一行
unitDel(surveyName, attacki,i) { unitDel(surveyName, attacki, i) {
const config = new MatSnackBarConfig(); const config = new MatSnackBarConfig();
config.verticalPosition = 'top'; config.verticalPosition = 'top';
config.duration = 3000 config.duration = 3000
let isTrue = confirm('您确定要删除该条信息吗') let isTrue = confirm('您确定要删除该条信息吗')
if(surveyName=='进攻通道'){ if (surveyName == '进攻通道') {
if(isTrue){ if (isTrue) {
if (this.planTemplateData[1].building[attacki].body[4].attinf[i].tabletr != undefined) { if (this.planTemplateData[1].building[attacki].body[4].attinf[i].tabletr != undefined) {
this.planTemplateData[1].building[attacki].body[4].attinf[i].tabletr.splice(this.planTemplateData[1].building[attacki].body[4].attinf[i].tabletr.length - 1, 1) this.planTemplateData[1].building[attacki].body[4].attinf[i].tabletr.splice(this.planTemplateData[1].building[attacki].body[4].attinf[i].tabletr.length - 1, 1)
this.addNumber-- this.addNumber--
@ -462,13 +462,13 @@ export class CreatePlanOnlineFiveComponent implements OnInit {
this.snackBar.open('请先增加一行!', '确定', config); this.snackBar.open('请先增加一行!', '确定', config);
} }
} }
}else if(surveyName=='功能分区'){ } else if (surveyName == '功能分区') {
if(isTrue){ if (isTrue) {
this.planTemplateData[1].building[attacki].body[6].attinf.splice(i,1) this.planTemplateData[1].building[attacki].body[6].attinf.splice(i, 1)
} }
}else if(surveyName=='重点部位'){ } else if (surveyName == '重点部位') {
if(isTrue){ if (isTrue) {
this.planTemplateData[1].building[attacki].body[5].attinf.splice(i,1) this.planTemplateData[1].building[attacki].body[5].attinf.splice(i, 1)
} }
} }
} }
@ -524,13 +524,27 @@ export class CreatePlanOnlineFiveComponent implements OnInit {
quitPreview() { quitPreview() {
this.pattern = 'edit' 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() { goBack() {
document.querySelector('#mainbox').scrollIntoView(true) document.querySelector('#mainbox').scrollIntoView(true)
} }
//生成word //生成word
generatingDoc() { generatingDoc() {
console.log(666,$(".mainbox")) console.log(666, $(".mainbox"))
$(".mainbox").wordExport('word文档'); $(".mainbox").wordExport('word文档');
} }
} }

Loading…
Cancel
Save