|
|
|
@ -47,11 +47,13 @@ export class FireFightingDeviceComponent implements OnInit {
|
|
|
|
|
this.companyEachDetails = data[0].eachDetails |
|
|
|
|
this.companyBuiltInGrouping.forEach(element => { //循环单位内置分组项
|
|
|
|
|
element.selectBuiltInGrouping = [] |
|
|
|
|
element.facilityItems.forEach(elements => { |
|
|
|
|
element.facilityItems.forEach((elements,index) => { |
|
|
|
|
elements.total = element.facilityCount[index] |
|
|
|
|
elements.expanded = false}); |
|
|
|
|
}); |
|
|
|
|
}) //http
|
|
|
|
|
} //if
|
|
|
|
|
|
|
|
|
|
}) |
|
|
|
|
} |
|
|
|
|
|
|
|
|
@ -66,27 +68,24 @@ export class FireFightingDeviceComponent implements OnInit {
|
|
|
|
|
//保存单位消防设施内置分组项
|
|
|
|
|
editCompanyGrouping(e) { |
|
|
|
|
let header = {groupId:e.id} |
|
|
|
|
if (e.facilityItems[e.facilityItems.length-1].isBuiltin) { |
|
|
|
|
const config = new MatSnackBarConfig(); |
|
|
|
|
config.verticalPosition = 'top'; |
|
|
|
|
config.duration = 3000 |
|
|
|
|
this.snackBar.open('数据更新成功','确定',config); |
|
|
|
|
} else { |
|
|
|
|
let data = [] |
|
|
|
|
e.facilityItems.forEach((element,index) => { |
|
|
|
|
if (!element.isBuiltin) { |
|
|
|
|
data.push(element) |
|
|
|
|
if (index==e.facilityItems.length-1) { |
|
|
|
|
this.http.post('/api/CompanyAccount/CompanyFacilityItems/Batch',data,{params:header}).subscribe(data=>{ |
|
|
|
|
const config = new MatSnackBarConfig(); |
|
|
|
|
config.verticalPosition = 'top'; |
|
|
|
|
config.duration = 3000 |
|
|
|
|
this.snackBar.open('数据更新成功','确定',config); }) |
|
|
|
|
} //if
|
|
|
|
|
|
|
|
|
|
} //if
|
|
|
|
|
}); //forEach
|
|
|
|
|
} |
|
|
|
|
let data = [] |
|
|
|
|
e.facilityItems.forEach((element,index) => { |
|
|
|
|
let msg = { |
|
|
|
|
isBuiltin: element.isBuiltin, |
|
|
|
|
details: element.details, |
|
|
|
|
name: element.name, |
|
|
|
|
isEachFloor: element.isEachFloor, |
|
|
|
|
order: element.order} |
|
|
|
|
data.push(msg) |
|
|
|
|
if (index==e.facilityItems.length-1) { |
|
|
|
|
this.http.post('/api/CompanyAccount/CompanyFacilityItems/Batch',data,{params:header}).subscribe(data=>{ |
|
|
|
|
const config = new MatSnackBarConfig(); |
|
|
|
|
config.verticalPosition = 'top'; |
|
|
|
|
config.duration = 3000 |
|
|
|
|
this.snackBar.open('数据更新成功','确定',config); |
|
|
|
|
}) } |
|
|
|
|
}); //forEach
|
|
|
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
//checked单位消防设施内置分组项时
|
|
|
|
@ -159,8 +158,12 @@ export class FireFightingDeviceComponent implements OnInit {
|
|
|
|
|
data[key].forEach(element => { //表格内容
|
|
|
|
|
let everyBody = {} |
|
|
|
|
element.propertyInfos.forEach((elements,index) => { |
|
|
|
|
if (elements.propertyType!=3 && elements.propertyType!=6) { everyBody[elements.propertyName] = elements.propertyValue+elements.physicalUnit } |
|
|
|
|
if (elements.propertyType!=3 && elements.propertyName!='图片' && elements.propertyType!=6) { everyBody[elements.propertyName] = elements.propertyValue+elements.physicalUnit } |
|
|
|
|
if (elements.propertyType==6) { everyBody[elements.propertyName] = elements.propertyValue=='1'?'是':'否' } |
|
|
|
|
if (elements.propertyType!=3 && elements.propertyName=='图片') {
|
|
|
|
|
let imgLength = [] |
|
|
|
|
element.propertyInfos.find(item=>{ if(item.propertyType==3){imgLength.push(item)} }) |
|
|
|
|
everyBody[elements.propertyName] = imgLength.length+elements.physicalUnit }
|
|
|
|
|
}); |
|
|
|
|
tableMsg.body.push(everyBody) |
|
|
|
|
}); |
|
|
|
@ -179,8 +182,12 @@ export class FireFightingDeviceComponent implements OnInit {
|
|
|
|
|
data.forEach(element => { //表格内容
|
|
|
|
|
let everyBody = {} |
|
|
|
|
element.propertyInfos.forEach((elements,index) => { |
|
|
|
|
if (elements.propertyType!=3 && elements.propertyType!=6) { everyBody[elements.propertyName] = elements.propertyValue+elements.physicalUnit } |
|
|
|
|
if (elements.propertyType!=3 && elements.propertyName!='图片' && elements.propertyType!=6) { everyBody[elements.propertyName] = elements.propertyValue+elements.physicalUnit } |
|
|
|
|
if (elements.propertyType==6) { everyBody[elements.propertyName] = elements.propertyValue=='1'?'是':'否' } |
|
|
|
|
if (elements.propertyType!=3 && elements.propertyName=='图片') {
|
|
|
|
|
let imgLength = [] |
|
|
|
|
element.propertyInfos.find(item=>{ if(item.propertyType==3){imgLength.push(item)} }) |
|
|
|
|
everyBody[elements.propertyName] = imgLength.length+elements.physicalUnit } |
|
|
|
|
}); |
|
|
|
|
e.body.push(everyBody) |
|
|
|
|
}); |
|
|
|
@ -213,13 +220,16 @@ export class FireFightingDeviceComponent implements OnInit {
|
|
|
|
|
element.buildingOptionalGroups = data[0].summary.buildingOptionalGroups |
|
|
|
|
element.buildingDetails = data[0].details |
|
|
|
|
element.buildingEachDetails = data[0].eachDetails |
|
|
|
|
element.buildingFacilityGroups.forEach(elements => { //循环每个建筑内置分组项
|
|
|
|
|
element.buildingFacilityGroups.forEach((elements) => { //循环每个建筑内置分组项
|
|
|
|
|
elements.selectBuiltInGrouping = [] |
|
|
|
|
elements.facilityItems.forEach(newElement => { newElement.expanded = false }); |
|
|
|
|
elements.facilityItems.forEach((newElement,index) => {
|
|
|
|
|
newElement.total = elements.facilityCount[index] |
|
|
|
|
newElement.expanded = false }); |
|
|
|
|
}); |
|
|
|
|
}) |
|
|
|
|
|
|
|
|
|
}); |
|
|
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
//创建建筑消防设施内置分组项
|
|
|
|
@ -234,27 +244,24 @@ export class FireFightingDeviceComponent implements OnInit {
|
|
|
|
|
//保存建筑消防设施内置分组项
|
|
|
|
|
editBuildingGrouping (e,item) { |
|
|
|
|
let header = {buildingId:e.id, groupId:item.id} |
|
|
|
|
if (item.facilityItems[item.facilityItems.length-1].isBuiltin) { |
|
|
|
|
const config = new MatSnackBarConfig(); |
|
|
|
|
config.verticalPosition = 'top'; |
|
|
|
|
config.duration = 3000 |
|
|
|
|
this.snackBar.open('数据更新成功','确定',config); |
|
|
|
|
} else { |
|
|
|
|
let data = [] |
|
|
|
|
item.facilityItems.forEach((element,index) => { |
|
|
|
|
if (!element.isBuiltin) { |
|
|
|
|
data.push(element) |
|
|
|
|
if (index==item.facilityItems.length-1) { |
|
|
|
|
this.http.post('/api/CompanyAccount/BuildingFacilityItems/Batch',data,{params:header}).subscribe(data=>{ |
|
|
|
|
const config = new MatSnackBarConfig(); |
|
|
|
|
config.verticalPosition = 'top'; |
|
|
|
|
config.duration = 3000 |
|
|
|
|
this.snackBar.open('数据更新成功','确定',config); }) |
|
|
|
|
} //if
|
|
|
|
|
let data = [] |
|
|
|
|
item.facilityItems.forEach((element,index) => { |
|
|
|
|
let msg = { |
|
|
|
|
isBuiltin: element.isBuiltin, |
|
|
|
|
details: element.details, |
|
|
|
|
name: element.name, |
|
|
|
|
isEachFloor: element.isEachFloor, |
|
|
|
|
order: element.order} |
|
|
|
|
data.push(msg) |
|
|
|
|
if (index==item.facilityItems.length-1) { |
|
|
|
|
this.http.post('/api/CompanyAccount/BuildingFacilityItems/Batch',data,{params:header}).subscribe(data=>{ |
|
|
|
|
const config = new MatSnackBarConfig(); |
|
|
|
|
config.verticalPosition = 'top'; |
|
|
|
|
config.duration = 3000 |
|
|
|
|
this.snackBar.open('数据更新成功','确定',config); |
|
|
|
|
}) } |
|
|
|
|
}); //forEach
|
|
|
|
|
|
|
|
|
|
} //if
|
|
|
|
|
}); //forEach
|
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
//删除建筑消防设施内置分组项
|
|
|
|
@ -318,8 +325,12 @@ export class FireFightingDeviceComponent implements OnInit {
|
|
|
|
|
data[key].forEach(element => { //表格内容
|
|
|
|
|
let everyBody = {} |
|
|
|
|
element.propertyInfos.forEach((elements,index) => { |
|
|
|
|
if (elements.propertyType!=3 && elements.propertyType!=6) { everyBody[elements.propertyName] = elements.propertyValue+elements.physicalUnit } |
|
|
|
|
if (elements.propertyType!=3 && elements.propertyName!='图片' && elements.propertyType!=6) { everyBody[elements.propertyName] = elements.propertyValue+elements.physicalUnit } |
|
|
|
|
if (elements.propertyType==6) { everyBody[elements.propertyName] = elements.propertyValue=='1'?'是':'否' } |
|
|
|
|
if (elements.propertyType!=3 && elements.propertyName=='图片') {
|
|
|
|
|
let imgLength = [] |
|
|
|
|
element.propertyInfos.find(item=>{ if(item.propertyType==3){imgLength.push(item)} }) |
|
|
|
|
everyBody[elements.propertyName] = imgLength.length+elements.physicalUnit } |
|
|
|
|
}); |
|
|
|
|
tableMsg.body.push(everyBody) |
|
|
|
|
}); |
|
|
|
@ -338,8 +349,12 @@ export class FireFightingDeviceComponent implements OnInit {
|
|
|
|
|
data.forEach(element => { //表格内容
|
|
|
|
|
let everyBody = {} |
|
|
|
|
element.propertyInfos.forEach((elements,index) => { |
|
|
|
|
if (elements.propertyType!=3 && elements.propertyType!=6) { everyBody[elements.propertyName] = elements.propertyValue+elements.physicalUnit } |
|
|
|
|
if (elements.propertyType!=3 && elements.propertyName!='图片' && elements.propertyType!=6) { everyBody[elements.propertyName] = elements.propertyValue+elements.physicalUnit } |
|
|
|
|
if (elements.propertyType==6) { everyBody[elements.propertyName] = elements.propertyValue=='1'?'是':'否' } |
|
|
|
|
if (elements.propertyType!=3 && elements.propertyName=='图片') {
|
|
|
|
|
let imgLength = [] |
|
|
|
|
element.propertyInfos.find(item=>{ if(item.propertyType==3){imgLength.push(item)} }) |
|
|
|
|
everyBody[elements.propertyName] = imgLength.length+elements.physicalUnit } |
|
|
|
|
}); |
|
|
|
|
e.body.push(everyBody) |
|
|
|
|
}); |
|
|
|
|