Browse Source

[修改]消防设施跟自己的模板匹配

tangshan
陈敬瑜 3 years ago
parent
commit
c0e1e98220
  1. 13
      src/app/plan-management/create-plan-online-five/create-plan-online-five.component.ts
  2. 2
      src/app/ui/plan-template/Disaster.html
  3. 4
      src/app/ui/plan-template/plan-template.component.html
  4. 72
      src/app/ui/plan-template/plan-template.component.ts

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

@ -163,7 +163,7 @@ export class CreatePlanOnlineFiveComponent implements OnInit {
||this.unitData.buildingTypes[0].name=='商市场'||this.unitData.buildingTypes[0].name=='医院'||this.unitData.buildingTypes[0].name=='学校'
||this.unitData.buildingTypes[0].name=='宾馆'||this.unitData.buildingTypes[0].name=='娱乐场所'||this.unitData.buildingTypes[0].name=='餐饮业'
||this.unitData.buildingTypes[0].name=='影剧院'||this.unitData.buildingTypes[0].name=='展览建筑'||this.unitData.buildingTypes[0].name=='养老院'
||this.unitData.buildingTypes[0].name=='会议中心'||this.unitData.buildingTypes[0].name=='储罐类')&&this.planLevel=='5'){
||this.unitData.buildingTypes[0].name=='会议中心'||this.unitData.buildingTypes[0].name=='储罐类'||this.unitData.buildingTypes[0].name=='化工生产')&&this.planLevel=='5'){
this.zaixianDr=true
}
//console.log('单位列表信息', this.unitData)
@ -235,8 +235,8 @@ export class CreatePlanOnlineFiveComponent implements OnInit {
})
this.buData = JSON.parse(JSON.stringify(this.buData))
//console.log(this.buData)
this.buData.forEach((pvalue, pindex, parr) => {
console.log(this.buData)
this.buData[0].forEach((pvalue, pindex, parr) => {
if (parr[pindex].length > 0) {
parr[pindex].forEach((nval, nindex, narr) => {
this.planTemplateData[index].building[pindex].body[5].attinf[0].body[0].value = nval.name
@ -1440,6 +1440,7 @@ export class CreatePlanOnlineFiveComponent implements OnInit {
}
}
}
console.log(this.planTemplateData)
//this.planTemplateData[num[0]].building[num[1]].body[num[2]].attinf[num[3]].push()
}
//单位概况删除一行
@ -1709,11 +1710,11 @@ export class CreatePlanOnlineFiveComponent implements OnInit {
:(this.unitData.buildingTypes[0].name=='商市场'||this.unitData.buildingTypes[0].name=='医院'||this.unitData.buildingTypes[0].name=='学校'
||this.unitData.buildingTypes[0].name=='宾馆'||this.unitData.buildingTypes[0].name=='娱乐场所'||this.unitData.buildingTypes[0].name=='餐饮业'
||this.unitData.buildingTypes[0].name=='影剧院'||this.unitData.buildingTypes[0].name=='展览建筑'||this.unitData.buildingTypes[0].name=='养老院'
||this.unitData.buildingTypes[0].name=='会议中心')?4:this.unitData.buildingTypes[0].name=='储罐类'?'StorageTankFivePlan':''
let fileData={
||this.unitData.buildingTypes[0].name=='会议中心')?4:this.unitData.buildingTypes[0].name=='储罐类'?'StorageTankFivePlan':this.unitData.buildingTypes[0].name=='化工生产'?'hgFivePlan':''
/* let fileData={
type:this.unitData.buildingTypes[0].name=='高层建筑'?1:2,
file:formData
}
} */
this.http.post(`/api/OfficeExtract/ExtractWordPlan?type=${type}`,formData).subscribe((data:any)=>{
console.log(data)
if(data==null){

2
src/app/ui/plan-template/Disaster.html

@ -24,7 +24,7 @@
<div class="queryField" *ngIf="level!=2">
<label style="margin-right: 10px;">名称:</label>
<mat-form-field class="example-full-width">
<input matInput placeholder="请输入表头名称" [(ngModel)]="headName" autocomplete="off" required>
<input matInput placeholder="请输入表头名称" [(ngModel)]="headName" autocomplete="off">
</mat-form-field>
</div>
<div class="queryField" *ngIf="level==2">

4
src/app/ui/plan-template/plan-template.component.html

@ -246,7 +246,7 @@
<div class="attackLeft">
<div class="attackleftHead">
<div class="headName">
<input type="text" [placeholder]="zdy.level!=2?'请输入内容':''" [(ngModel)]="zdy.headName">
<input type="text" [placeholder]="zdy.level!=2&&zdy.level!=1?'请输入内容':''" [(ngModel)]="zdy.headName">
</div>
<div class="rightButton">
<img src="../../../assets/images/toppaixu.png" alt="" style="height: 15px;position: relative;top: 3px;" (click)='adyTop(suri,attributei)'>
@ -274,7 +274,7 @@
*ngFor="let itemth of zdy.tableth;let tablethi=index;TrackBy:trackByFn">
<div style="height: 100%;width: 100%;"
*ngFor="let itemthj of zdy.tableth[tablethi];let tablethj=index;TrackBy:trackByFn">
<input type="text" placeholder="请输入内容" style="background-color: #E8E9E9;width: 20%;"
<input type="text" placeholder="请输入内容" style="background-color: #E8E9E9;width: 20%;text-align: center;"
[(ngModel)]="itemthj.head">
<input type="text" placeholder="请输入内容" style="width: 80%;" [(ngModel)]="itemthj.body">
</div>

72
src/app/ui/plan-template/plan-template.component.ts

@ -1559,6 +1559,7 @@ export class addattinf{
addAttinfBuild=[]
buildnewDate=[]
addAttinfFile
filenewDate=[]
facilityItems
ngOnInit(): void{
console.log(this.data)
@ -1616,7 +1617,6 @@ async getattinf(){
let restlt=await new Promise((resolve) => {
this.http.get("/api/BasicGroups",{params:paramsdata}).subscribe((data:any)=>{
data.forEach((buildDate,buildi,buildarr) => {
//this.addAttinfBuild.push(...buildarr[buildi].propertyInfos)
this.buildnewDate.push(...buildarr[buildi].propertyInfos)
resolve(data)
});
@ -1626,22 +1626,11 @@ async getattinf(){
});
})
})
/* value.attinf.forEach((elattinf,fi,farr) => {
this.addAttinfBuild.forEach((element,ei,earr) => {
if(farr[fi].propertyName==earr[ei].propertyName){
if(farr[fi].completed==true&&earr[ei].completed==false){
farr[fi].completed=earr[ei].completed
}
}
});
element.olddata=element.propertyValue
}); */
let temp=0
this.buildnewDate=JSON.parse(JSON.stringify(this.buildnewDate))
let temp=0
this.buildnewDate.forEach((buildval,buindi,buildarr)=>{
temp=0
this.addAttinfBuild.forEach((addval,addi,addarr)=>{
if(buildval.propertyName==addval.propertyName){
temp++
}
@ -1651,6 +1640,18 @@ async getattinf(){
this.addAttinfBuild.push(buildval)
}
})
this.addAttinfBuild.forEach((addval,addi,addarr)=>{
temp=0
this.buildnewDate.forEach((buildval,buindi,buildarr)=>{
if(buildarr[buindi].propertyName==addarr[addi].propertyName){
temp++
}
})
if(temp==0){
console.log(addarr[addi])
this.addAttinfBuild.splice(addi,1)
}
})
console.log(this.buildnewDate)
console.log(this.addAttinfBuild)
@ -1668,7 +1669,50 @@ async getattinf(){
console.log(this.addAttinfFile)
})
}else if(value.surveyName=='消防设施'&&value.attinf!=undefined){
this.filenewDate=[]
this.addAttinfFile=value.attinf
this.addAttinfFile=JSON.parse(JSON.stringify(this.addAttinfFile))
let paramsdata:any ={
categoryId:this.data.newleftTabledata[this.data.leftclicki].facilityCategoryId
}
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))
let temp=0
this.filenewDate.forEach((buildval,buindi,buildarr)=>{
temp=0
this.filenewDate.forEach((addval,addi,addarr)=>{
if(buildval.propertyName==addval.propertyName){
temp++
}
})
if(temp==0){
console.log(buildval)
this.filenewDate.push(buildval)
}
})
this.filenewDate.forEach((addval,addi,addarr)=>{
temp=0
this.filenewDate.forEach((buildval,buindi,buildarr)=>{
if(buildarr[buindi].propertyName==addarr[addi].propertyName){
temp++
}
})
if(temp==0){
console.log(addarr[addi])
this.filenewDate.splice(addi,1)
}
})
}
});
}
@ -1718,7 +1762,7 @@ export class zdydisaster{
config.duration = 3000
if(this.level==undefined||this.level==''){
this.snackBar.open('请选择类型!','确定',config);
}else if(this.level!=2&&(this.headName==undefined||this.headName=='')){
}else if((this.level!=2&&this.level!=1)&&(this.headName==undefined||this.headName=='')){
this.snackBar.open('请输入表头名称!','确定',config);
}else if(this.level==2&&(this.lieNumber==0||this.lieNumber==undefined) ){
this.snackBar.open('请输入列数!','确定',config);

Loading…
Cancel
Save