|
|
|
@ -112,9 +112,12 @@ export class BasicinfoComponent implements OnInit {
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
//石油化工装置信息勾选框
|
|
|
|
|
checkboxchange(e){ |
|
|
|
|
// console.log(e)
|
|
|
|
|
// console.log(this.houses[0])
|
|
|
|
|
checkboxchange(item,e){ |
|
|
|
|
item.buildingBasicGroups.forEach(item=>{ |
|
|
|
|
if(item.name != "基本信息" && item.name != "装置信息"){ |
|
|
|
|
item.submitted = e.checked |
|
|
|
|
} |
|
|
|
|
}) |
|
|
|
|
} |
|
|
|
|
//获得所有单位类型
|
|
|
|
|
getallunittype() { |
|
|
|
@ -317,14 +320,15 @@ export class BasicinfoComponent implements OnInit {
|
|
|
|
|
} |
|
|
|
|
//删除自定义信息行数
|
|
|
|
|
deleteCustomData(item){ |
|
|
|
|
if(item.buildingCustomData.customProperties.length>1){ |
|
|
|
|
item.buildingCustomData.customProperties.pop() |
|
|
|
|
}else{ |
|
|
|
|
const config = new MatSnackBarConfig(); |
|
|
|
|
config.verticalPosition = 'top'; |
|
|
|
|
config.duration = 3000 |
|
|
|
|
this.snackBar.open('已达最小值,无法删除','确定',config); |
|
|
|
|
} |
|
|
|
|
// if(item.buildingCustomData.customProperties.length>1){
|
|
|
|
|
// item.buildingCustomData.customProperties.pop()
|
|
|
|
|
// }else{
|
|
|
|
|
// const config = new MatSnackBarConfig();
|
|
|
|
|
// config.verticalPosition = 'top';
|
|
|
|
|
// config.duration = 3000
|
|
|
|
|
// this.snackBar.open('已达最小值,无法删除','确定',config);
|
|
|
|
|
// }
|
|
|
|
|
item.buildingCustomData.customProperties.pop() |
|
|
|
|
} |
|
|
|
|
//得到建筑信息数据并进行处理
|
|
|
|
|
getunitallbuilding(){ |
|
|
|
@ -349,9 +353,9 @@ export class BasicinfoComponent implements OnInit {
|
|
|
|
|
let _data = data |
|
|
|
|
this.http.get("/api/CompanyAccount/BuildingCustomData",{params:{ |
|
|
|
|
buildingId:n.id |
|
|
|
|
}}).subscribe(data=>{ |
|
|
|
|
}}).subscribe((data:any)=>{ |
|
|
|
|
_data[0].buildingCustomData = data |
|
|
|
|
if(data){ |
|
|
|
|
if(data && data.customProperties.length != 0){ |
|
|
|
|
_data[0].isCustomData = true |
|
|
|
|
}else{ |
|
|
|
|
_data[0].isCustomData = false |
|
|
|
@ -1050,11 +1054,11 @@ export class BasicinfoComponent implements OnInit {
|
|
|
|
|
err=>{ |
|
|
|
|
alert("名称和类型保存失败") |
|
|
|
|
}) |
|
|
|
|
|
|
|
|
|
if(value.checkbuilding){//如果勾选了自定义信息的checkbox
|
|
|
|
|
let CustomDataval = [] |
|
|
|
|
var CustomDataval = [] |
|
|
|
|
for (const key in value) { |
|
|
|
|
if (key.indexOf("CustomData") != -1) { |
|
|
|
|
// CustomData[key] = value[key]
|
|
|
|
|
CustomDataval.push(value[key]) |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
@ -1075,6 +1079,20 @@ export class BasicinfoComponent implements OnInit {
|
|
|
|
|
buildingId:item.buildingId |
|
|
|
|
}}).subscribe(data=>{ |
|
|
|
|
|
|
|
|
|
}, |
|
|
|
|
err=>{ |
|
|
|
|
alert("自定义信息保存失败") |
|
|
|
|
}) |
|
|
|
|
}else{ |
|
|
|
|
let CustomDatabody = { |
|
|
|
|
id: "", |
|
|
|
|
customProperties: [], |
|
|
|
|
buildingId: item.buildingId |
|
|
|
|
} |
|
|
|
|
this.http.post("/api/CompanyAccount/BuildingCustomData",CustomDatabody,{params:{ |
|
|
|
|
buildingId:item.buildingId |
|
|
|
|
}}).subscribe(data=>{ |
|
|
|
|
|
|
|
|
|
}, |
|
|
|
|
err=>{ |
|
|
|
|
alert("自定义信息保存失败") |
|
|
|
@ -1270,7 +1288,7 @@ export class BasicinfoComponent implements OnInit {
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if(bodyObj.buildingBasicGroups[2].submitted){//如果没有勾选储罐信息 则直接提交当前bodyObj
|
|
|
|
|
if(bodyObj.buildingBasicGroups[2].submitted){ //如果没有勾选储罐信息 则直接提交当前bodyObj
|
|
|
|
|
var map = {}; //用于存储石油化工要提交的储罐信息表单
|
|
|
|
|
for (let key in value) { |
|
|
|
|
if (key.indexOf('tanker') != -1) { |
|
|
|
@ -1638,7 +1656,7 @@ export class BasicinfoComponent implements OnInit {
|
|
|
|
|
bodyObj.buildingBasicGroups.push(basictankchildinfobody) |
|
|
|
|
}); |
|
|
|
|
}else{ |
|
|
|
|
// console.log(666,bodyObj)
|
|
|
|
|
console.log(66666,bodyObj) |
|
|
|
|
bodyObj.buildingBasicGroups[2].buildingId = item.buildingId |
|
|
|
|
bodyObj.buildingBasicGroups[2].companyId = this.unitinfo.id |
|
|
|
|
bodyObj.buildingBasicGroups[2].propertyInfos.forEach(item=>{ |
|
|
|
@ -1646,8 +1664,217 @@ export class BasicinfoComponent implements OnInit {
|
|
|
|
|
}) |
|
|
|
|
bodyObj.buildingBasicGroups[3].buildingId = item.buildingId |
|
|
|
|
bodyObj.buildingBasicGroups[3].companyId = this.unitinfo.id |
|
|
|
|
|
|
|
|
|
} |
|
|
|
|
bodyObj.buildingBasicGroups[3].propertyInfos = [ |
|
|
|
|
{ |
|
|
|
|
propertyName: "罐区", |
|
|
|
|
propertyValue: "", |
|
|
|
|
propertyType: 0, |
|
|
|
|
required: false, |
|
|
|
|
ruleName: "", |
|
|
|
|
ruleValue: "", |
|
|
|
|
physicalUnit: "", |
|
|
|
|
order: 0, |
|
|
|
|
enabled: true, |
|
|
|
|
visible: true, |
|
|
|
|
tag:"1"
|
|
|
|
|
}, |
|
|
|
|
{ |
|
|
|
|
propertyName: "储罐编号", |
|
|
|
|
propertyValue: "", |
|
|
|
|
propertyType: 0, |
|
|
|
|
required: true, |
|
|
|
|
ruleName: "", |
|
|
|
|
ruleValue: "", |
|
|
|
|
physicalUnit: "", |
|
|
|
|
order: 0, |
|
|
|
|
enabled: true, |
|
|
|
|
visible: true, |
|
|
|
|
tag:"1"
|
|
|
|
|
}, |
|
|
|
|
{ |
|
|
|
|
propertyName: "储存介质", |
|
|
|
|
propertyValue: "", |
|
|
|
|
propertyType: 0, |
|
|
|
|
required: true, |
|
|
|
|
ruleName: "", |
|
|
|
|
ruleValue: "", |
|
|
|
|
physicalUnit: "", |
|
|
|
|
order: 0, |
|
|
|
|
enabled: true, |
|
|
|
|
visible: true, |
|
|
|
|
tag:"1"
|
|
|
|
|
}, |
|
|
|
|
{ |
|
|
|
|
propertyName: "储罐类型", |
|
|
|
|
propertyValue:"", |
|
|
|
|
propertyType: 0, |
|
|
|
|
required: true, |
|
|
|
|
ruleName: "", |
|
|
|
|
ruleValue: "", |
|
|
|
|
physicalUnit: "", |
|
|
|
|
order: 0, |
|
|
|
|
enabled: true, |
|
|
|
|
visible: true, |
|
|
|
|
tag:"1"
|
|
|
|
|
}, |
|
|
|
|
{ |
|
|
|
|
propertyName: "容量", |
|
|
|
|
propertyValue: "", |
|
|
|
|
propertyType: 2, |
|
|
|
|
required: true, |
|
|
|
|
ruleName: "", |
|
|
|
|
ruleValue: "", |
|
|
|
|
physicalUnit: "㎡", |
|
|
|
|
order: 0, |
|
|
|
|
enabled: true, |
|
|
|
|
visible: true, |
|
|
|
|
tag:"1"
|
|
|
|
|
}, |
|
|
|
|
{ |
|
|
|
|
propertyName: "直径", |
|
|
|
|
propertyValue:"", |
|
|
|
|
propertyType: 2, |
|
|
|
|
required: true, |
|
|
|
|
ruleName: "", |
|
|
|
|
ruleValue: "", |
|
|
|
|
physicalUnit: "m", |
|
|
|
|
order: 0, |
|
|
|
|
enabled: true, |
|
|
|
|
visible: true, |
|
|
|
|
tag:"1"
|
|
|
|
|
}, |
|
|
|
|
{ |
|
|
|
|
propertyName: "高度", |
|
|
|
|
propertyValue: "", |
|
|
|
|
propertyType: 2, |
|
|
|
|
required: true, |
|
|
|
|
ruleName: "", |
|
|
|
|
ruleValue: "", |
|
|
|
|
physicalUnit: "m", |
|
|
|
|
order: 0, |
|
|
|
|
enabled: true, |
|
|
|
|
visible: true, |
|
|
|
|
tag:"1"
|
|
|
|
|
}, |
|
|
|
|
{ |
|
|
|
|
propertyName: "顶盖形式", |
|
|
|
|
propertyValue: "", |
|
|
|
|
propertyType: 0, |
|
|
|
|
required: false, |
|
|
|
|
ruleName: "", |
|
|
|
|
ruleValue: "", |
|
|
|
|
physicalUnit: "", |
|
|
|
|
order: 0, |
|
|
|
|
enabled: true, |
|
|
|
|
visible: true, |
|
|
|
|
tag:"1"
|
|
|
|
|
}, |
|
|
|
|
{ |
|
|
|
|
propertyName: "浮盘材质", |
|
|
|
|
propertyValue:"", |
|
|
|
|
propertyType: 0, |
|
|
|
|
required: false, |
|
|
|
|
ruleName: "", |
|
|
|
|
ruleValue: "", |
|
|
|
|
physicalUnit: "", |
|
|
|
|
order: 0, |
|
|
|
|
enabled: true, |
|
|
|
|
visible: true, |
|
|
|
|
tag:"1"
|
|
|
|
|
}, |
|
|
|
|
{ |
|
|
|
|
propertyName: "浮盘类型", |
|
|
|
|
propertyValue: "", |
|
|
|
|
propertyType: 0, |
|
|
|
|
required: false, |
|
|
|
|
ruleName: "", |
|
|
|
|
ruleValue: "", |
|
|
|
|
physicalUnit: "", |
|
|
|
|
order: 0, |
|
|
|
|
enabled: true, |
|
|
|
|
visible: true, |
|
|
|
|
tag:"1"
|
|
|
|
|
}, |
|
|
|
|
{ |
|
|
|
|
propertyName: "泡沫产生器型号", |
|
|
|
|
propertyValue:"", |
|
|
|
|
propertyType: 0, |
|
|
|
|
required: false, |
|
|
|
|
ruleName: "", |
|
|
|
|
ruleValue: "", |
|
|
|
|
physicalUnit: "", |
|
|
|
|
order: 0, |
|
|
|
|
enabled: true, |
|
|
|
|
visible: true, |
|
|
|
|
tag:"1"
|
|
|
|
|
}, |
|
|
|
|
{ |
|
|
|
|
propertyName: "泡沫产生器形式", |
|
|
|
|
propertyValue: "", |
|
|
|
|
propertyType: 0, |
|
|
|
|
required: false, |
|
|
|
|
ruleName: "", |
|
|
|
|
ruleValue: "", |
|
|
|
|
physicalUnit: "", |
|
|
|
|
order: 0, |
|
|
|
|
enabled: true, |
|
|
|
|
visible: true, |
|
|
|
|
tag:"1"
|
|
|
|
|
}, |
|
|
|
|
{ |
|
|
|
|
propertyName: "是否设置氮封惰化保护装置", |
|
|
|
|
propertyValue:"", |
|
|
|
|
propertyType: 0, |
|
|
|
|
required: false, |
|
|
|
|
ruleName: "", |
|
|
|
|
ruleValue: "", |
|
|
|
|
physicalUnit: "", |
|
|
|
|
order: 0, |
|
|
|
|
enabled: true, |
|
|
|
|
visible: true, |
|
|
|
|
tag:"1"
|
|
|
|
|
}, |
|
|
|
|
{ |
|
|
|
|
propertyName: "防护堤高度", |
|
|
|
|
propertyValue:"", |
|
|
|
|
propertyType: 2, |
|
|
|
|
required: true, |
|
|
|
|
ruleName: "", |
|
|
|
|
ruleValue: "", |
|
|
|
|
physicalUnit: "m", |
|
|
|
|
order: 0, |
|
|
|
|
enabled: true, |
|
|
|
|
visible: true, |
|
|
|
|
tag:"1"
|
|
|
|
|
}, |
|
|
|
|
{ |
|
|
|
|
propertyName: "半固定泡沫灭火接口数量", |
|
|
|
|
propertyValue: "", |
|
|
|
|
propertyType: 2, |
|
|
|
|
required: false, |
|
|
|
|
ruleName: "", |
|
|
|
|
ruleValue: "", |
|
|
|
|
physicalUnit: "个", |
|
|
|
|
order: 0, |
|
|
|
|
enabled: true, |
|
|
|
|
visible: true, |
|
|
|
|
tag:"1"
|
|
|
|
|
}, |
|
|
|
|
{ |
|
|
|
|
propertyName: "其他设施", |
|
|
|
|
propertyValue: "", |
|
|
|
|
propertyType: 0, |
|
|
|
|
required: false, |
|
|
|
|
ruleName: "", |
|
|
|
|
ruleValue: "", |
|
|
|
|
physicalUnit: "", |
|
|
|
|
order: 0, |
|
|
|
|
enabled: true, |
|
|
|
|
visible: true, |
|
|
|
|
tag:"1"
|
|
|
|
|
} |
|
|
|
|
] |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|