diff --git a/src/app/plan-management/create-plan-online-five/addattinf.html b/src/app/plan-management/create-plan-online-five/addattinf.html index e188e4f..f25d104 100644 --- a/src/app/plan-management/create-plan-online-five/addattinf.html +++ b/src/app/plan-management/create-plan-online-five/addattinf.html @@ -11,12 +11,12 @@ 新增分组 -
+
{{item.propertyName}}
-
+
{{item.name}}
diff --git a/src/app/plan-management/create-plan-online-five/create-plan-online-five.component.html b/src/app/plan-management/create-plan-online-five/create-plan-online-five.component.html index 965a0d2..1a3f107 100644 --- a/src/app/plan-management/create-plan-online-five/create-plan-online-five.component.html +++ b/src/app/plan-management/create-plan-online-five/create-plan-online-five.component.html @@ -716,7 +716,7 @@ opacity: 1; height: 40px; line-height: 40px;">{{itemunit.name}} - +
{{element.surveyName}} - +
@@ -838,11 +838,12 @@ text-align: center;"> {{attack.name}} - + *ngIf="pattern == 'edit'" + (click)='unitadd(element.surveyName,uniti,attacki,0)'> +
diff --git a/src/app/plan-management/create-plan-online-five/create-plan-online-five.component.ts b/src/app/plan-management/create-plan-online-five/create-plan-online-five.component.ts index 7a34fb3..c22d857 100644 --- a/src/app/plan-management/create-plan-online-five/create-plan-online-five.component.ts +++ b/src/app/plan-management/create-plan-online-five/create-plan-online-five.component.ts @@ -59,10 +59,12 @@ export class CreatePlanOnlineFiveComponent implements OnInit { blockyl = true zaixianDr=false haveNew=false + planMode//预案类型 //index ngOnInit(): void { //this.index = this.getArrayIndex(this.planTemplateData,'单位概况') this.haveNew=this.route.snapshot.queryParams.haveNew + this.planMode=this.route.snapshot.queryParams.planMode console.log(this.route.snapshot.queryParams.wordChange) this.planLevel = this.route.snapshot.queryParams.planCategory if (this.route.snapshot.queryParams.pattern == 'false') { @@ -1920,10 +1922,9 @@ export class CreatePlanOnlineFiveComponent implements OnInit { width: '290px', height:'460px', disableClose:true, - data:{element:element,buildingID:this.buildingsData[0].basicCategoryId} + data:{element:element,buildingID:this.buildingsData[0].basicCategoryId,fid:this.route.snapshot.queryParams.unitTypeId} }); dialogRef.afterClosed().subscribe(result => { - console.log(result) if(result!=undefined){ this.planTemplateData[index].building[this.clicki].body.forEach(item => { if(item.surveyName==element.surveyName){ @@ -1934,6 +1935,26 @@ export class CreatePlanOnlineFiveComponent implements OnInit { }) } + //消防设施具体属性编辑 + fileAdd(facilityItems,filei,filename){ + let index = this.getArrayIndex(this.planTemplateData,'单位概况') + if(facilityItems.length!=0){ + const dialogRef = this.dialog.open(adddwsurveys, {//调用open方法打开对话框并且携带参数过去 + width: '240px', + height:'400px', + disableClose:true, + data:{facilityItems:facilityItems,filename,fid:this.route.snapshot.queryParams.unitTypeId} + }); + dialogRef.afterClosed().subscribe(result => { + console.log(result) + this.planTemplateData[index].building[this.clicki].body.forEach(element => { + if(element.surveyName=='消防设施'){ + element.attinf[filei].facilityItems=result + } + }); + }) + } + } } @@ -2160,6 +2181,7 @@ export class adddwsurveys{ addAttinfFile filenewDate=[] facilityItems + facilityCategoryId//消防设施内容id ngOnInit(): void{ this.getinf() console.log(this.data) @@ -2167,7 +2189,8 @@ export class adddwsurveys{ } async getinf(){ - if(this.data.element.surveyName=='建筑信息'&&this.data.element.attinf==undefined){ + if(this.data.facilityItems==undefined){ + if(this.data.element.surveyName=='建筑信息'&&this.data.element.attinf==undefined){ this.addAttinfBuild=[] let paramsdata:any ={ categoryId:this.data.buildingID @@ -2235,38 +2258,55 @@ export class adddwsurveys{ console.log(this.buildnewDate) console.log(this.addAttinfBuild) - }else if(this.data.surveyName=='消防设施'&&this.data.attinf==undefined){ - let paramsdata:any ={ - categoryId:this.data.newleftTabledata[this.data.leftclicki].facilityCategoryId - } - this.http.get("/api/FacilityGroups",{params:paramsdata}).subscribe((data:any)=>{ - console.log(data) - this.addAttinfFile=data - this.addAttinfFile.forEach(element => { - element.completed=false - element.value='' + }else if(this.data.element.surveyName=='消防设施'&&this.data.element.attinf==undefined){ + this.http.get("/api/BuildingTypes").subscribe((buildData:any)=>{ + console.log(buildData) + buildData.forEach(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)=>{ + console.log(data) + this.addAttinfFile=data + this.addAttinfFile.forEach(element => { + element.completed=false + element.value='' + }); + console.log(this.addAttinfFile) + }) + } }); - console.log(this.addAttinfFile) }) + }else if(this.data.surveyName=='消防设施'&&this.data.attinf!=undefined){ this.filenewDate=[] this.addAttinfFile=this.data.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.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.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)=>{ @@ -2294,6 +2334,63 @@ export class adddwsurveys{ } }) } + }else{ + //消防设施最里层数据 + let apifile + this.facilityItems=JSON.parse(JSON.stringify(this.data.facilityItems)) + console.log(this.facilityItems) + //请求接口,看数据是否有变化 + 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 + } + let fileResult=await new Promise((resolve) => { + this.http.get("/api/FacilityGroups",{params:paramsdata}).subscribe((data:any)=>{ + resolve(data) + }) + }) + apifile=fileResult + let apifileData//消防设施最内层数据 + apifile.forEach(element => { + if(element.name==this.data.filename){ + apifileData=element.facilityItems + } + }); + console.log(apifileData) + let temp=0 + apifileData.forEach((buildval,buindi,buildarr)=>{ + temp=0 + this.facilityItems.forEach((addval,addi,addarr)=>{ + if(buildval.name==addval.name){ + temp++ + } + }) + if(temp==0){ + console.log(buildval) + this.facilityItems.push(buildval) + } + }) + this.facilityItems.forEach((addval,addi,addarr)=>{ + temp=0 + apifileData.forEach((buildval,buindi,buildarr)=>{ + if(buildarr[buindi].name==addarr[addi].name){ + temp++ + } + }) + if(temp==0){ + console.log(addarr[addi]) + this.facilityItems.splice(addi,1) + } + }) + } + }) + }) + + } + } //取消按钮 @@ -2302,7 +2399,8 @@ close(){ } //确定按钮 defineClick(){ - this.dialogRef.close(this.data.element.surveyName=='建筑信息'?this.addAttinfBuild:this.data.element.surveyName=='消防设施'?this.addAttinfFile:this.facilityItems) + this.dialogRef.close(this.data.element!=undefined&&this.data.element.surveyName=='建筑信息'? + this.addAttinfBuild:this.data.element!=undefined&&this.data.element.surveyName=='消防设施'?this.addAttinfFile:this.facilityItems) } } diff --git a/src/app/plan-management/entry-plan-look/AddPlanone.html b/src/app/plan-management/entry-plan-look/AddPlanone.html index 53c8564..f4ae373 100644 --- a/src/app/plan-management/entry-plan-look/AddPlanone.html +++ b/src/app/plan-management/entry-plan-look/AddPlanone.html @@ -61,11 +61,10 @@ (已上传)
-
+
- diff --git a/src/app/plan-management/entry-plan-look/entry-plan-look.component.ts b/src/app/plan-management/entry-plan-look/entry-plan-look.component.ts index 77c5fbb..37a9eba 100644 --- a/src/app/plan-management/entry-plan-look/entry-plan-look.component.ts +++ b/src/app/plan-management/entry-plan-look/entry-plan-look.component.ts @@ -191,9 +191,9 @@ export class EntryPlanLookComponent implements OnInit { else if (e.planType == 16) { if (e.attachmentUrls == null) { if(e.planMode==4){ - window.open(`/planManagement/createplanonlinefive?navIsOpen=false&companyId=${this.companyId}&planName=${e.name}&unitName=${this.unitdata.unitname}&planCategory=${e.planCategory}&planId=${e.id}&unitTypeId=${this.compantData.buildingTypes[0].id}&orName=${this.compantData.organizationName}&orId=${this.compantData.organizationId}&pattern=true&haveNew=true`) + window.open(`/planManagement/createplanonlinefive?navIsOpen=false&companyId=${this.companyId}&planName=${e.name}&unitName=${this.unitdata.unitname}&planCategory=${e.planCategory}&planId=${e.id}&unitTypeId=${this.compantData.buildingTypes[0].id}&orName=${this.compantData.organizationName}&orId=${this.compantData.organizationId}&pattern=true&haveNew=true&planMode=${e.planMode}`) }else{ - window.open(`/planManagement/createplanonlinefive?navIsOpen=false&companyId=${this.companyId}&planName=${e.name}&unitName=${this.unitdata.unitname}&planCategory=${e.planCategory}&planId=${e.id}&unitTypeId=${this.compantData.buildingTypes[0].id}&orName=${this.compantData.organizationName}&orId=${this.compantData.organizationId}&pattern=true`) + window.open(`/planManagement/createplanonlinefive?navIsOpen=false&companyId=${this.companyId}&planName=${e.name}&unitName=${this.unitdata.unitname}&planCategory=${e.planCategory}&planId=${e.id}&unitTypeId=${this.compantData.buildingTypes[0].id}&orName=${this.compantData.organizationName}&orId=${this.compantData.organizationId}&pattern=true&planMode=${e.planMode}`) } } @@ -231,16 +231,7 @@ export class EntryPlanLookComponent implements OnInit { } } ); - /* if (e.url.indexOf('app') == 0) { - window.location.href = e.url - } else { - sessionStorage.setItem("url", e.url) - if ((e.url as string).includes('gis/threeDimensionalHome')) { //三维预案 - window.open(`${e.url}?unitId=${this.companyId}&unitName=${this.unitdata.unitname}&editMode=true`) - } else { - window.open(`/planManagement/webLook`) - } - } */ + } else { this.snackBar.open('只有二维预案和文本预案可以编辑!', '确定', config); } @@ -259,7 +250,7 @@ export class EntryPlanLookComponent implements OnInit { else if (e.planType == 16) { if (e.attachmentUrls == null) { console.log(this.compantData) - window.open(`/planManagement/createplanonlinefive?navIsOpen=false&companyId=${this.companyId}&planName=${e.name}&unitName=${this.unitdata.unitname}&planCategory=${e.planCategory}&planId=${e.id}&unitTypeId=${this.compantData.buildingTypes[0].id}&orName=${this.compantData.organizationName}&orId=${this.compantData.organizationId}`) + window.open(`/planManagement/createplanonlinefive?navIsOpen=false&companyId=${this.companyId}&planName=${e.name}&unitName=${this.unitdata.unitname}&planCategory=${e.planCategory}&planId=${e.id}&unitTypeId=${this.compantData.buildingTypes[0].id}&orName=${this.compantData.organizationName}&orId=${this.compantData.organizationId}&planMode=${e.planMode}`) } else { let body = {}; @@ -280,16 +271,7 @@ export class EntryPlanLookComponent implements OnInit { } else if (e.planType == 2) { //三维预案 - /* if (e.url.indexOf('app') == 0) { - window.location.href = e.url - } else { - sessionStorage.setItem("url", e.url) - if ((e.url as string).includes('gis/threeDimensionalHome')) { //三维预案 - window.open(`${e.url}?unitId=${this.companyId}&unitName=${this.unitdata.unitname}&editMode=true`) - } else { - window.open(`/planManagement/webLook`) - } - } */ + const dialogRef = this.dialog.open(ChangeUrl, { data: { element: e } }); @@ -313,7 +295,6 @@ export class EntryPlanLookComponent implements OnInit { } } }else{ - if (e.auditStatus == 8) { if (e.planType == 1) { //如果是在线编辑 let id = e.id sessionStorage.setItem("planId", id) @@ -327,9 +308,9 @@ export class EntryPlanLookComponent implements OnInit { else if (e.planType == 16) { if (e.attachmentUrls == null) { if(e.planMode==4){ - window.open(`/planManagement/createplanonlinefive?navIsOpen=false&companyId=${this.companyId}&planName=${e.name}&unitName=${this.unitdata.unitname}&planCategory=${e.planCategory}&planId=${e.id}&unitTypeId=${this.compantData.buildingTypes[0].id}&orName=${this.compantData.organizationName}&orId=${this.compantData.organizationId}&pattern=true&haveNew=true`) + window.open(`/planManagement/createplanonlinefive?navIsOpen=false&companyId=${this.companyId}&planName=${e.name}&unitName=${this.unitdata.unitname}&planCategory=${e.planCategory}&planId=${e.id}&unitTypeId=${this.compantData.buildingTypes[0].id}&orName=${this.compantData.organizationName}&orId=${this.compantData.organizationId}&pattern=true&haveNew=true&planMode=${e.planMode}`) }else{ - window.open(`/planManagement/createplanonlinefive?navIsOpen=false&companyId=${this.companyId}&planName=${e.name}&unitName=${this.unitdata.unitname}&planCategory=${e.planCategory}&planId=${e.id}&unitTypeId=${this.compantData.buildingTypes[0].id}&orName=${this.compantData.organizationName}&orId=${this.compantData.organizationId}&pattern=true`) + window.open(`/planManagement/createplanonlinefive?navIsOpen=false&companyId=${this.companyId}&planName=${e.name}&unitName=${this.unitdata.unitname}&planCategory=${e.planCategory}&planId=${e.id}&unitTypeId=${this.compantData.buildingTypes[0].id}&orName=${this.compantData.organizationName}&orId=${this.compantData.organizationId}&pattern=true&planMode=${e.planMode}`) } } @@ -380,9 +361,7 @@ export class EntryPlanLookComponent implements OnInit { } else { this.snackBar.open('只有二维预案和文本预案可以编辑!', '确定', config); } - } else { - let isTrue = confirm('编辑后审核状态会成为未审核状态,您确定要编辑吗') - if (isTrue) { + /* else { if (e.planType == 1) { //如果是在线编辑 let id = e.id sessionStorage.setItem("planId", id) @@ -410,23 +389,11 @@ export class EntryPlanLookComponent implements OnInit { this.http.put(`/api/PlanComponents/${e.id}?resetAudit=${resetAudit}`, body, options).subscribe(data => { this.getAllPlanComponents() this.lookPlan(e) - }/* ,err => { - this.snackBar.open(err,'确定',config); - } */) + }) } } else if (e.planType == 2) { //三维预案 - /* if (e.url.indexOf('app') == 0) { - window.location.href = e.url - } else { - sessionStorage.setItem("url", e.url) - if ((e.url as string).includes('gis/threeDimensionalHome')) { //三维预案 - window.open(`${e.url}?unitId=${this.companyId}&unitName=${this.unitdata.unitname}&editMode=true`) - } else { - window.open(`/planManagement/webLook`) - } - } */ const dialogRef = this.dialog.open(ChangeUrl, { data: { element: e } }); @@ -446,8 +413,8 @@ export class EntryPlanLookComponent implements OnInit { this.snackBar.open('只有二维预案和文本预案可以编辑!', '确定', config); } - } - } + + } */ } @@ -1218,7 +1185,7 @@ export class AddPlanone { this.planData = plandata this.dialogRef.close(plandata); //console.log(plandata) - window.open(`/planManagement/createplanonlinefive?navIsOpen=false&companyId=${this.data.companyId}&planName=${this.planData.name}&unitName=${this.data.unitName}&planCategory=${this.selectedPLanLevel}&planId=${this.planData.id}&haveNew=${haveNew}`) + window.open(`/planManagement/createplanonlinefive?navIsOpen=false&companyId=${this.data.companyId}&planName=${this.planData.name}&unitName=${this.data.unitName}&planCategory=${this.selectedPLanLevel}&planId=${this.planData.id}&haveNew=${haveNew}&planMode=${this.defaultisshow}`) }) }else{ if (open.length > 0) {