Parcourir la source

Merge branch 'apiupdate' of git.sagacloud.cn:web/ibms into apiupdate

zhangyu il y a 5 ans
Parent
commit
752e6c63a3

+ 6 - 1
src/views/ledger/facility/addfacility.vue

@@ -291,7 +291,12 @@ export default {
       //     });
       //   }
       // }
-      createEquipAndProperty(newData, res => {
+      //待接口修改为关联创建即可修改
+      let param = {
+        Cascade: [],
+        Content: newData
+      }
+      createEquipAndProperty(param, res => {
         this.$message.success('创建成功')
         session.remove("deviceAddData")
         this.$router.push({

+ 11 - 7
src/views/ledger/facility/partsmanage/addparts/index.vue

@@ -203,15 +203,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('创建成功')