@@ -82,7 +82,7 @@
[ngClass]="{'grey': !(element.auditStatus!='16' && element.auditStatus != '1')}">编辑
查看
下载
+ [ngClass]="{'grey': element.planMode == '2' || element.planMode == '3'}">下载
删除
审批结果
{
+ this.newleftTabledata[this.newleftTabledata.length-1].id=''
+ this.newleftTabledata[this.newleftTabledata.length-1].id=data.id
+ //console.log(data,this.newleftTabledata)
this.snackBar.open('创建成功!','确定',config);
})
}
@@ -166,18 +169,18 @@ export class PlanTemplateComponent implements OnInit {
unitName
leftclicki=-1//点了第几个模板
planClick(item){
- console.log(item)
+
this.Id=item.id
this.planCategory=item.planCategory
this.unitName=item.unitname
this.buildingTypeId=item.buildingTypeId
this.newleftTabledata.forEach((value,index,array)=>{
- if(array[index].buildingTypeId==this.buildingTypeId){
- this.group=array[index].data
+ if(array[index].buildingTypeId==this.buildingTypeId&&array[index].planCategory==this.planCategory){
this.leftclicki=index
+ this.group=array[this.leftclicki].data
}
})
-
+ //console.log(item,this.leftclicki)
}
//右侧新增分组点击事件
addGroupClick(){
@@ -196,16 +199,20 @@ export class PlanTemplateComponent implements OnInit {
width: '240px',
height:'620px',
disableClose:true,
- data:this.group==null?null:this.group.length==0?null:this.group
+ data:this.newleftTabledata[this.leftclicki].data==null?null:this.newleftTabledata[this.leftclicki].data==0?null:this.newleftTabledata[this.leftclicki].data
});
dialogRef.afterClosed().subscribe(result => {
- console.log(result,this.newleftTabledata)
+ //console.log(result,this.newleftTabledata)
this.newleftTabledata.forEach((value,index,array)=>{
- if(array[index].buildingTypeId==this.buildingTypeId){
+ if(array[index].buildingTypeId==this.buildingTypeId&&array[index].planCategory==this.planCategory){
if(result!=undefined){
result.forEach((valuer,i,rarr) => {
//添加分组名称
- array[index].data=rarr
+ if(array[index].data==null){
+ array[index].data=result
+ }else{
+ array[index].data[i].completed=rarr[i].completed
+ }
});
}
@@ -244,11 +251,20 @@ export class PlanTemplateComponent implements OnInit {
data:this.group
});
dialogRef.afterClosed().subscribe(result => {
- //console.log(result)
+ console.log(result)
if(result!=undefined){
this.group.forEach((value,index,array)=>{
if(array[index].groupName=='单位概况'){
- array[index].attribute=result
+ result.forEach((valuer,i,rarr) => {
+ //添加分组名称
+ if(array[index].attribute==null){
+ array[index].attribute=result
+ }else{
+ array[index].attribute[i].completed=rarr[i].completed
+ }
+
+ });
+ //array[index].attribute=result
}
})
}
@@ -476,11 +492,13 @@ export class PlanTemplateComponent implements OnInit {
planCategory:Number(this.newleftTabledata[this.leftclicki].planCategory),
data:JSON.stringify(this.newleftTabledata[this.leftclicki].data)
}
+ console.log(`ary`, this.newleftTabledata, `key:`, this.leftclicki)
if(this.newleftTabledata[this.leftclicki].id==undefined){
- this.http.post("/api/PlanTemplate",this.newleftTabledata[this.leftclicki]).subscribe((data:any)=>{
+ /* this.http.post("/api/PlanTemplate",this.newleftTabledata[this.leftclicki]).subscribe((data:any)=>{
this.snackBar.open('创建成功!','确定',config);
console.log(data)
- })
+ }) */
+ this.snackBar.open('请先创建模板!','确定',config);
}
else{
this.http.put(`/api/PlanTemplate/${this.Id}`,body).subscribe((data:any)=>{
@@ -641,14 +659,23 @@ export class addGroup{
{groupName:'单位概况',completed:false},{groupName:'灾情设定',completed:false},{groupName:'力量调集',completed:false},
{groupName:'组织指挥',completed:false},{groupName:'作战行动',completed:false},{groupName:'社会联动',completed:false},
{groupName:'勤务保障',completed:false},{groupName:'特别警示',completed:false},{groupName:'辅助决策',completed:false},
- {groupName:'交通水源',completed:false},{groupName:'重点图示',completed:false},{groupName:'特别警示',completed:false},
+ {groupName:'交通水源',completed:false},{groupName:'重点图示',completed:false},{groupName:'处置要点',completed:false},
{groupName:'预案附件',completed:false}
]
groupName=[]
ngOnInit(): void{
console.log(this.data)
if(this.data!=null){
- this.addgtoup=this.data
+ //this.addgtoup=this.data
+ this.data.forEach((datavalue,index,dataarr) => {
+ this.addgtoup.forEach((value,i,arr)=>{
+ if(dataarr[index].groupName==arr[i].groupName){
+ if(dataarr[index].completed==true&&arr[i].completed==false){
+ arr[i].completed= true
+ }
+ }
+ })
+ });
}
}
@@ -702,15 +729,27 @@ export class addGroup{
export class adddwsurvey{
constructor(private http: HttpClient,public dialogRef: MatDialogRef,@Inject(MAT_DIALOG_DATA) public data,public snackBar: MatSnackBar) {}
addwsurvey=[
- {surveyName:'单位基本信息',completed:false},{surveyName:'建筑信息',completed:false},{surveyName:'四周毗邻',completed:false},
- {surveyName:'消防设施',completed:false},{surveyName:'进攻通道',completed:false},{surveyName:'重点部位',completed:false},
- {surveyName:'功能分区',completed:false},{surveyName:'行车路线',completed:false},{surveyName:'千米水源',completed:false},{surveyName:'实景图',completed:false}
+ {surveyName:'单位基本信息',completed:false},{surveyName:'建筑信息',completed:false},
+ {surveyName:'四周毗邻',completed:false,attinf:[{name:'东',value:''},{name:'西',value:''},{name:'南',value:''},{name:'北',value:''}]},
+ {surveyName:'消防设施',completed:false},{surveyName:'进攻通道',completed:false},
+ {surveyName:'重点部位',completed:false,attinf:[{heafName:'',body:[{name:'重点部位名称',value:''},{name:'重点部位所在位置',value:''},{name:'建筑结构',value:''},{name:'使用性质',value:''},{name:'主要危险性',value:''}]}]},
+ {surveyName:'功能分区',completed:false,attinf:[{name:'',value:''}]},{surveyName:'行车路线',completed:false},{surveyName:'千米水源',completed:false},
+ {surveyName:'实景图',completed:false}
]
ngOnInit(): void{
console.log(this.data)
this.data.forEach(element => {
if(element.groupName=='单位概况'&&element.attribute!=undefined){
- this.addwsurvey=element.attribute
+ //this.addwsurvey=element.attribute
+ element.attribute.forEach((datavalue,index,dataarr) => {
+ this.addwsurvey.forEach((value,i,arr)=>{
+ if(dataarr[index].surveyName==arr[i].surveyName){
+ if(dataarr[index].completed==true&&arr[i].completed==false){
+ arr[i].completed= dataarr[index].completed
+ }
+ }
+ })
+ });
}
});
}
@@ -732,13 +771,13 @@ defineClick(){
export class addattinf{
constructor(private http: HttpClient,public dialogRef: MatDialogRef,@Inject(MAT_DIALOG_DATA) public data,public snackBar: MatSnackBar) {}
addAttinf=[
- {propertyName:'统一社会信用代码',completed:false,propertyType:0},
- {propertyName:'单位类型',completed:false,propertyType:0},
- {propertyName:'联系人',completed:false,propertyType:0},
- {propertyName:'联系电话',completed:false,propertyType:0},
- {propertyName:'辖区中队',completed:false,propertyType:0},
- {propertyName:'单位地址',completed:false,propertyType:0},
- {propertyName:'单位照片',completed:false,propertyType:0}//,default:'-',must:'是',danwei:'-'
+ {propertyName:'统一社会信用代码',completed:false,propertyType:0,value:''},
+ {propertyName:'单位类型',completed:false,propertyType:0,value:''},
+ {propertyName:'联系人',completed:false,propertyType:0,value:''},
+ {propertyName:'联系电话',completed:false,propertyType:0,value:''},
+ {propertyName:'辖区中队',completed:false,propertyType:0,value:''},
+ {propertyName:'单位地址',completed:false,propertyType:0,value:''},
+ /* {propertyName:'单位照片',completed:false,propertyType:0,value:''} *///,default:'-',must:'是',danwei:'-'
]
addAttinfBuild
addAttinfFile
@@ -754,7 +793,16 @@ getattinf(){
if(element.groupName=='单位概况'&&element.attribute!=undefined){
element.attribute.forEach(value => {
if(value.surveyName=='单位基本信息'&&value.attinf!=undefined){
- this.addAttinf=value.attinf
+ //this.addAttinf=value.attinf
+ value.attinf.forEach((datavalue,index,dataarr) => {
+ this.addAttinf.forEach((value,i,arr)=>{
+ if(dataarr[index].propertyName==arr[i].propertyName){
+ if(dataarr[index].completed==true&&arr[i].completed==false){
+ arr[i].completed= dataarr[index].completed
+ }
+ }
+ })
+ });
}else if(value.surveyName=='建筑信息'&&value.attinf==undefined){
let paramsdata:any ={
categoryId:this.data.newleftTabledata[this.data.leftclicki].basicCategoryId
@@ -768,6 +816,16 @@ getattinf(){
})
}else if(value.surveyName=='建筑信息'&&value.attinf!=undefined){
this.addAttinfBuild=value.attinf
+ /* console.log(this.addAttinfBuild)
+ value.attinf.forEach((datavalue,index,dataarr) => {
+ this.addAttinfBuild.forEach((value,i,arr)=>{
+ if(dataarr[index].propertyName==arr[i].propertyName){
+ if(dataarr[index].completed==true&&arr[i].completed==false){
+ arr[i].completed= dataarr[index].completed
+ }
+ }
+ })
+ }); */
}else if(value.surveyName=='消防设施'&&value.attinf==undefined){
let paramsdata:any ={
categoryId:this.data.newleftTabledata[this.data.leftclicki].facilityCategoryId
@@ -776,6 +834,7 @@ getattinf(){
this.addAttinfFile=data
this.addAttinfFile.forEach(element => {
element.completed=false
+ element.value=''
});
})
}else if(value.surveyName=='消防设施'&&value.attinf!=undefined){