Browse Source

[修改]在线编制预案预览页面修改

tangshan
陈敬瑜 3 years ago
parent
commit
18cf583fb0
  1. 268
      src/app/plan-management/create-plan-online-five/create-plan-online-five.component.html
  2. 61
      src/app/plan-management/create-plan-online-five/create-plan-online-five.component.ts

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

@ -455,8 +455,8 @@
line-height: 40px;
color: #b99a00;">{{element.headName}}</span>
<img src="../../../assets/images/delyello.png" *ngIf="pattern == 'edit'" (click)='delTd(key,i)'>
<img src="../../../assets/images/downyello.png" *ngIf="item.new!=undefined&&i<item.attribute.length-1" (click)='downPai(key,i)'>
<img src="../../../assets/images/uoyello.png" *ngIf="item.new!=undefined&&i>0" (click)='upPai(key,i)'>
<img src="../../../assets/images/downyello.png" *ngIf="item.new!=undefined&&i<item.attribute.length-1&&pattern == 'edit'" (click)='downPai(key,i)'>
<img src="../../../assets/images/uoyello.png" *ngIf="item.new!=undefined&&i>0 &&pattern == 'edit'" (click)='upPai(key,i)'>
<img src="../../../assets/images/updateyello.png" *ngIf="(element.level==1||element.level==2)&&pattern == 'edit'" (click)='updataHl(key,i)'>
<img src="../../../assets/images/addyello.png" *ngIf="element.level==1&&pattern == 'edit'" (click)='addTd(key,i)'>
</div>
@ -807,31 +807,32 @@
</div>
<!-- 单位和建筑信息 -->
<div class="building" *ngIf="element.surveyName=='单位基本信息'||element.surveyName=='建筑信息'">
<div *ngFor="let info of element.attinf;let infoi=index">
<div *ngIf="info.completed" class="onetext">
<div *ngFor="let info of element.attinf;let infoi=index" >
<div *ngIf="info.completed&&pattern != 'look'" class="onetext">
<input type="text" placeholder="请输入内容" style="width: 30%;background-color: #F9F9F9;text-align: center;" [(ngModel)]="info.propertyName" *ngIf="pattern == 'edit'" [readonly]='info.zdy==undefined'>
<input type="text" placeholder="请输入内容" style="width: 40%;background-color: #FFFFFF;" [(ngModel)]="info.propertyValue" *ngIf="pattern == 'edit'">
<!-- <input type="text" style="width: 30%;background-color: #FFFFFF;color: #999;" [(ngModel)]="info.olddata" *ngIf="pattern == 'edit'&&oldData" readonly> -->
<!-- <span style="width: 30%;background-color: #FFFFFF;color: #999;" *ngIf="pattern == 'edit'&&oldData">{{info.olddata||'无原数据'}}</span> -->
<input type="text" style="width: 27%;background-color: #FFFFFF;color: #999;" *ngIf="pattern == 'edit'&&oldData" [value]="info.olddata||'无原数据'" readonly>
<img style="float: right;" src="../../../assets/images/deletered.png" *ngIf="pattern == 'edit'&&info.zdy" (click)='unitDel(element.surveyName,uniti,infoi)'>
<table *ngIf="pattern == 'look'" style="width: 100%;border-collapse: collapse;">
<tr>
<th style="border: 1px solid #999;
height: 40px;
width: 40%;
font-size: 16px;
text-align: center;">{{info.propertyName}}</th>
<td style="border: 1px solid #999;
height: 40px;
width: 60%;
font-size: 16px;
text-align: center;">{{info.propertyValue}}</td>
</tr>
</table>
</div>
</div>
<table *ngIf="pattern == 'look'" style="width: 100%;border-collapse: collapse;">
<tr *ngFor="let info of element.attinf;let infoi=index">
<td style="border: 1px solid #999;
height: 40px;
width: 40%;
font-size: 16px;
text-align: center;" *ngIf="info.completed"><span>{{info.propertyName}}</span></td>
<td style="border: 1px solid #999;
height: 40px;
width: 60%;
font-size: 16px;
text-align: center;" *ngIf="info.completed"><span>{{info.propertyValue}}</span> </td>
</tr>
</table>
</div>
<!-- 消防设施 -->
<div class="file" *ngIf="element.surveyName=='消防设施'">
@ -852,26 +853,27 @@
</div>
<div class="fileBody">
<div *ngFor="let info of attack.facilityItems;let filenum=index">
<div *ngIf="info.completed" class="onetext">
<div *ngIf="info.completed&&pattern != 'look'" class="onetext">
<input type="text" placeholder="请输入内容" style="width: 40%;background-color: #F9F9F9;text-align: center;" [(ngModel)]="info.name" *ngIf="pattern == 'edit'" [readonly]='info.zdy==undefined'>
<input type="text" placeholder="请输入内容" style="width: 57%;background-color: #FFFFFF;" [(ngModel)]="info.value" *ngIf="pattern == 'edit'">
<img src="../../../assets/images/deletered.png" *ngIf="pattern == 'edit'&&info.zdy" (click)='unitDel(element.surveyName,uniti,attacki,filenum)'>
<table *ngIf="pattern == 'look'" style="width: 100%;border-collapse: collapse;">
<tr>
<th style="border: 1px solid #999;
height: 40px;
width: 40%;
font-size: 16px;
text-align: center;">{{info.name}}</th>
<td style="border: 1px solid #999;
height: 40px;
width: 60%;
font-size: 16px;
text-align: center;">{{info.value}}</td>
</tr>
</table>
</div>
</div>
<table *ngIf="pattern == 'look'" style="width: 100%;border-collapse: collapse;">
<tr *ngFor="let info of attack.facilityItems;let filenum=index">
<th style="border: 1px solid #999;
height: 40px;
width: 40%;
font-size: 16px;
text-align: center;">{{info.name}}</th>
<td style="border: 1px solid #999;
height: 40px;
width: 60%;
font-size: 16px;
text-align: center;">{{info.value}}</td>
</tr>
</table>
</div>
</div>
@ -879,48 +881,56 @@
</div>
<!-- 四周毗邻 -->
<div class="fouradj" *ngIf="element.surveyName=='四周毗邻'">
<div class="fourTexttwo" *ngFor="let info of element.attinf;let infoi=index">
<input type="text" placeholder="请输入内容" style="width: 30%;background-color: #F9F9F9;text-align: center;" [(ngModel)]="info.name" *ngIf="pattern == 'edit'" [readonly]='info.zdy==undefined'>
<input type="text" placeholder="请输入内容" style="width: 65%;background-color: #FFFFFF;" [(ngModel)]="info.value" *ngIf="pattern == 'edit'">
<img style="position: relative;bottom: 30px;left: 347px;" src="../../../assets/images/deletered.png" (click)='unitDel(element.surveyName,uniti,infoi)' *ngIf="pattern == 'edit'&&info.zdy">
<table *ngIf="pattern == 'look'" style="width: 100%;border-collapse: collapse;">
<tr>
<th style="border: 1px solid #999;
height: 40px;
width: 30%;
font-size: 16px;
text-align: center;">{{info.name}}</th>
<td style="border: 1px solid #999;
height: 40px;
width: 70%;
font-size: 16px;
text-align: center;">{{info.value}}</td>
</tr>
</table>
<div *ngIf="element.surveyName=='四周毗邻'">
<div class="fouradj" *ngIf="pattern != 'look'" >
<div class="fourTexttwo" *ngFor="let info of element.attinf;let infoi=index">
<input type="text" placeholder="请输入内容" style="width: 30%;background-color: #F9F9F9;text-align: center;" [(ngModel)]="info.name" *ngIf="pattern == 'edit'" [readonly]='info.zdy==undefined'>
<input type="text" placeholder="请输入内容" style="width: 65%;background-color: #FFFFFF;" [(ngModel)]="info.value" *ngIf="pattern == 'edit'">
<img style="position: relative;bottom: 30px;left: 347px;" src="../../../assets/images/deletered.png" (click)='unitDel(element.surveyName,uniti,infoi)' *ngIf="pattern == 'edit'&&info.zdy">
</div>
</div>
<table *ngIf="pattern == 'look'" style="width: 100%;border-collapse: collapse;">
<tr *ngFor="let info of element.attinf;let infoi=index">
<th style="border: 1px solid #999;
height: 40px;
width: 30%;
font-size: 16px;
text-align: center;">{{info.name}}</th>
<td style="border: 1px solid #999;
height: 40px;
width: 70%;
font-size: 16px;
text-align: center;">{{info.value}}</td>
</tr>
</table>
</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: #F9F9F9;text-align: center;" [(ngModel)]="info.name" *ngIf="pattern == 'edit'">
<input type="text" placeholder="请输入内容" style="width: 67%;background-color: #FFFFFF;" [(ngModel)]="info.value" *ngIf="pattern == 'edit'">
<img src="../../../assets/images/deletered.png" (click)='unitDel(element.surveyName,uniti,infoi)' *ngIf="pattern == 'edit'">
<table *ngIf="pattern == 'look'" style="width: 100%;border-collapse: collapse;">
<tr>
<th style="border: 1px solid #999;
height: 40px;
width: 30%;
font-size: 16px;
text-align: center;">{{info.name}}</th>
<td style="border: 1px solid #999;
height: 40px;
width: 70%;
font-size: 16px;
text-align: center;">{{info.value}}</td>
</tr>
</table>
<div *ngIf="element.surveyName=='功能分区'">
<div class="fouradj" *ngIf="pattern != 'look'">
<div class="onetext" *ngFor="let info of element.attinf;let infoi=index">
<input type="text" placeholder="请输入内容" style="width: 30%;background-color: #F9F9F9;text-align: center;" [(ngModel)]="info.name" *ngIf="pattern == 'edit'">
<input type="text" placeholder="请输入内容" style="width: 67%;background-color: #FFFFFF;" [(ngModel)]="info.value" *ngIf="pattern == 'edit'">
<img src="../../../assets/images/deletered.png" (click)='unitDel(element.surveyName,uniti,infoi)' *ngIf="pattern == 'edit'">
</div>
</div>
<table *ngIf="pattern == 'look'" style="width: 100%;border-collapse: collapse;">
<tr *ngFor="let info of element.attinf;let infoi=index">
<th style="border: 1px solid #999;
height: 40px;
width: 30%;
font-size: 16px;
text-align: center;">{{info.name}}</th>
<td style="border: 1px solid #999;
height: 40px;
width: 70%;
font-size: 16px;
text-align: center;">{{info.value}}</td>
</tr>
</table>
</div>
<!-- 重点部位 -->
<div class="parts" *ngIf="element.surveyName=='重点部位'">
@ -938,121 +948,57 @@
color: #b99a00;" *ngIf="pattern == 'look'">{{parts.heafName}}</span>
<img src="../../../assets/images/deletered.png" (click)='unitDel(element.surveyName,uniti,infoi)' *ngIf="pattern == 'edit'">
</div>
<div class="partsBody">
<div class="partsBody" *ngIf="pattern!='look'">
<div class="duohang">
<div class="duohangHalf">
<input type="text" placeholder="请输入内容" style="width: 40%;background-color: #F9F9F9;text-align: center;" [(ngModel)]="parts.body[0].name" *ngIf="pattern == 'edit'">
<input type="text" placeholder="请输入内容" style="width: 60%;background-color: #FFFFFF;" [(ngModel)]="parts.body[0].value" *ngIf="pattern == 'edit'">
<table *ngIf="pattern == 'look'" style="width: 100%;border-collapse: collapse;">
<tr>
<th style="border: 1px solid #999;
font-size: 16px;
text-align: center;height: 40px;width: 185px;">
{{parts.body[0].name}}
<!-- <textarea style="height: 100%;width: 100%;" [(ngModel)]="parts.body[0].name" disabled></textarea> -->
</th>
<td style="border: 1px solid #999;
font-size: 16px;
text-align: center;">
{{parts.body[0].value}}
<!-- <textarea style="height: 30px;width: 180px;" [(ngModel)]="parts.body[0].value" disabled></textarea> -->
</td>
</tr>
</table>
</div>
<div class="duohangHalf">
<input type="text" placeholder="请输入内容" style="width: 40%;background-color: #F9F9F9;text-align: center;"[(ngModel)]="parts.body[1].name" *ngIf="pattern == 'edit'">
<input type="text" placeholder="请输入内容" style="width: 60%;background-color: #FFFFFF;" [(ngModel)]="parts.body[1].value" *ngIf="pattern == 'edit'">
<table *ngIf="pattern == 'look'" style="width: 100%;border-collapse: collapse;">
<tr>
<th style="border: 1px solid #999;
height: 40px;width: 185px;
font-size: 16px;
text-align: center;">
{{parts.body[1].name}}
<!-- <textarea style="height: 100%;width: 100%;" [(ngModel)]="parts.body[1].name" disabled></textarea> -->
</th>
<td style="border: 1px solid #999;
height: 40px;
width: 60%;
font-size: 16px;
text-align: center;">
{{parts.body[1].value}}
<!-- <textarea style="height: 100%;width:100%;" [(ngModel)]="parts.body[1].value" disabled></textarea> -->
</td>
</tr>
</table>
</div>
</div>
<div class="duohang">
<div class="duohangHalf">
<input type="text" placeholder="请输入内容" style="width: 40%;background-color: #F9F9F9;text-align: center;" [(ngModel)]="parts.body[2].name" *ngIf="pattern == 'edit'">
<input type="text" placeholder="请输入内容" style="width: 60%;background-color: #FFFFFF;" [(ngModel)]="parts.body[2].value" *ngIf="pattern == 'edit'">
<table *ngIf="pattern == 'look'" style="width: 100%;border-collapse: collapse;">
<tr>
<th style="border: 1px solid #999;
height: 40px;width: 185px;
font-size: 16px;
text-align: center;">
{{parts.body[2].name}}
<!-- <textarea style="height: 100%;width: 100%;" [(ngModel)]="parts.body[2].name" disabled></textarea> -->
</th>
<td style="border: 1px solid #999;
height: 40px;width: 185px;
font-size: 16px;
text-align: center;">
{{parts.body[2].value}}
<!-- <textarea style="height: 100%;width: 100%;" [(ngModel)]="parts.body[2].value" disabled></textarea> -->
</td>
</tr>
</table>
</div>
<div class="duohangHalf">
<input type="text" placeholder="请输入内容" style="width: 40%;background-color: #F9F9F9;text-align: center;" [(ngModel)]="parts.body[3].name" *ngIf="pattern == 'edit'">
<input type="text" placeholder="请输入内容" style="width: 60%;background-color: #FFFFFF;" [(ngModel)]="parts.body[3].value" *ngIf="pattern == 'edit'">
<table *ngIf="pattern == 'look'" style="width: 100%;border-collapse: collapse;">
<tr>
<th style="border: 1px solid #999;
height: 40px;width: 185px;
font-size: 16px;
text-align: center;">
{{parts.body[3].name}}
<!-- <textarea style="height: 80%;width: 90%;" [(ngModel)]="parts.body[3].name" disabled></textarea> -->
</th>
<td style="border: 1px solid #999;
height: 40px;width: 185px;
font-size: 16px;
text-align: center;">
{{parts.body[3].value}}
<!-- <textarea style="height: 100%;width: 100%;" [(ngModel)]="parts.body[3].value" disabled></textarea> -->
</td>
</tr>
</table>
</div>
</div>
<div class="danhang">
<input type="text" placeholder="请输入内容" style="width: 40%;background-color: #F9F9F9;text-align: center;" [(ngModel)]="parts.body[4].name" *ngIf="pattern == 'edit'">
<input type="text" placeholder="请输入内容" style="width: 60%;background-color: #FFFFFF;" [(ngModel)]="parts.body[4].value" *ngIf="pattern == 'edit'">
<table *ngIf="pattern == 'look'" style="width: 100%;border-collapse: collapse;">
<tr>
<th style="
height: 40px;width: 185px;
font-size: 16px;
text-align: center;">
{{parts.body[4].name}}
<!-- <textarea style="height: 100%;width: 100%;" [(ngModel)]="parts.body[4].name" disabled></textarea> -->
</th>
<td style="
height: 40px;width: 185px;
font-size: 16px;
text-align: center;">
{{parts.body[4].value}}
<!-- <textarea style="height: 100%;width: 100%;" [(ngModel)]="parts.body[4].value" disabled></textarea> -->
</td>
</tr>
</table>
</div>
</div>
<table *ngIf="pattern == 'look'" style="width: 100%;border-collapse: collapse;">
<tr *ngFor="let partsbody of parts.body">
<th style="border: 1px solid #999;
height: 40px;
width: 30%;
font-size: 16px;
text-align: center;">
{{partsbody.name}}
<!-- <textarea style="height: 100%;width: 100%;" [(ngModel)]="parts.body[0].name" disabled></textarea> -->
</th>
<td style="border: 1px solid #999;
height: 40px;
width: 30%;
font-size: 16px;
text-align: center;">
{{partsbody.value}}
<!-- <textarea style="height: 30px;width: 180px;" [(ngModel)]="parts.body[0].value" disabled></textarea> -->
</td>
</tr>
</table>
</div>
</div>

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

@ -2237,6 +2237,7 @@ export class adddwsurveys{
return item.zdy!=undefined
})//模板传过来自定义数据
this.addAttinfBuild=JSON.parse(JSON.stringify(this.addAttinfBuild))
console.log(this.addAttinfBuild)
let paramsdata:any ={
categoryId:this.data.buildingID
}
@ -2265,7 +2266,7 @@ export class adddwsurveys{
})
if(temp==0){
//模板数据少于接口数据
console.log(buildval)
// console.log(buildval)
this.addAttinfBuild.push(buildval)
}
})
@ -2311,37 +2312,39 @@ export class adddwsurveys{
}else if(this.data.element.surveyName=='消防设施'&&this.data.element.attinf!=undefined){
this.filenewDate=[]
this.addAttinfFile=this.data.element.attinf.filter(element => {
return element.zdy==undefined
return element.zdy==false
});
this.zdyData=this.data.element.attinf.filter(element => {
return element.zdy!=undefined
});
this.addAttinfFile=JSON.parse(JSON.stringify(this.addAttinfFile))
console.log(this.addAttinfFile)
this.http.get("/api/BuildingTypes").subscribe((buildData:any)=>{
buildData.forEach(async element => {
if(element.id==this.data.fid){
this.facilityCategoryId=element.facilityCategoryId
let paramsdata:any ={
categoryId:this.facilityCategoryId
//this.addAttinfFile=JSON.parse(JSON.stringify(this.addAttinfFile))
console.log(this.addAttinfFile,this.zdyData)
let restlt=await new Promise((resolve) => {
this.http.get("/api/BuildingTypes").subscribe((buildData:any)=>{
buildData.forEach(async element => {
if(element.id==this.data.fid){
this.facilityCategoryId=element.facilityCategoryId
let paramsdata:any ={
categoryId:this.facilityCategoryId
}
this.http.get("/api/FacilityGroups",{params:paramsdata}).subscribe((data:any)=>{
data.forEach((buildDate,buildi,buildarr) => {
this.filenewDate.push(buildDate)
resolve(data)
});
this.filenewDate.forEach(element => {
element.completed=false
//element.olddata=element.propertyValue
});
})
}
let restlt=await new Promise((resolve) => {
this.http.get("/api/FacilityGroups",{params:paramsdata}).subscribe((data:any)=>{
data.forEach((buildDate,buildi,buildarr) => {
this.filenewDate.push(buildDate)
resolve(data)
});
this.filenewDate.forEach(element => {
element.completed=false
//element.olddata=element.propertyValue
});
})
})
}
})
})
})
this.filenewDate=JSON.parse(JSON.stringify(this.filenewDate))
console.log(this.filenewDate)
let temp=0
this.filenewDate.forEach((buildval,buindi,buildarr)=>{
temp=0
@ -2351,21 +2354,21 @@ export class adddwsurveys{
}
})
if(temp==0){
console.log(buildval)
//console.log(buildval)
this.addAttinfFile.push(buildval)
}
})
this.addAttinfFile.forEach((addval,addi,addarr)=>{
temp=0
this.filenewDate.forEach((buildval,buindi,buildarr)=>{
if(buildarr[buindi].id==addarr[addi].id){
if(buildval.name==addval.name){
temp++
}
if(temp==0){
this.addAttinfFile.splice(addi,1)
}
})
})
if(temp==0){
this.addAttinfFile.splice(addi,1)
}
})
this.addAttinfFile.push(...this.zdyData)
}

Loading…
Cancel
Save