|
@@ -970,14 +970,24 @@
|
|
|
getHazardInfoByJoinIds(id,joinHazardIds){
|
|
|
getHazardInfoByJoinIds({joinHazardIds:joinHazardIds}).then(response => {
|
|
|
if(response.data[0]){
|
|
|
- response.data.forEach(function(item) {
|
|
|
- item.lookType=true;
|
|
|
- item.checkHazardDtoList.forEach(function(item2) {
|
|
|
- item2.hazardCheckCode=item2.code
|
|
|
- })
|
|
|
- })
|
|
|
+ let dataList=JSON.parse(JSON.stringify(response.data))
|
|
|
+ for(let i=0;i<dataList.length;i++){
|
|
|
+ dataList[i].lookType=true;
|
|
|
+ for(let b=0;b<dataList[i].checkHazardDtoList.length;b++){
|
|
|
+ //把最外层的code填充到内层
|
|
|
+ dataList[i].checkHazardDtoList[b].hazardCheckCode=dataList[i].code
|
|
|
+ }
|
|
|
+ //判断新旧数据是否相等,如果相等旧数据填充新数据
|
|
|
+ for(let k=0;k<this.addForm.checkHazardInfoVoList.length;k++){
|
|
|
+ if(dataList[i].joinHazardId==this.addForm.checkHazardInfoVoList[k].joinHazardId){
|
|
|
+ dataList[i]=this.addForm.checkHazardInfoVoList[k]
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ }
|
|
|
+ this.addForm.checkHazardInfoVoList=dataList
|
|
|
}
|
|
|
- this.addForm.checkHazardInfoVoList=response.data
|
|
|
+
|
|
|
});
|
|
|
},
|
|
|
//专项检查选中
|