|
@@ -202,15 +202,19 @@ export default {
|
|
|
}
|
|
|
|
|
|
for (let i = 0; i < newData.length; i++) {
|
|
|
- let params = newData[i]
|
|
|
- params.ParentId = this.category.deviceId //当前设备id
|
|
|
- params.Category = this.category.Code //当前部件分类
|
|
|
- params.Family = this.firmId;
|
|
|
+ newData[i].ParentId = this.category.deviceId //当前设备id
|
|
|
+ newData[i].Category = this.category.Code //当前部件分类
|
|
|
+ newData[i].Family = this.firmId;
|
|
|
+ //待接口修改为关联创建
|
|
|
+ let param = {
|
|
|
+ Cascade:[],
|
|
|
+ Content:[newData[i]]
|
|
|
+ }
|
|
|
|
|
|
- await createPart([params], async res => {
|
|
|
+ await createPart(param, async res => {
|
|
|
if (newData[i].Checked) {//同时创建资产
|
|
|
- params.EquipmentId = res.EntityList[0].EquipID
|
|
|
- await createPropertyData([params], res => { })
|
|
|
+ param.Content[0].EquipmentId = res.EntityList[0].EquipID
|
|
|
+ await createPropertyData(param, res => { })
|
|
|
}
|
|
|
if (i == newData.length - 1) {
|
|
|
this.$message.success('创建成功')
|