Browse Source

修改创建资产同时创建部件bug

zhangyu 5 years ago
parent
commit
49d619fd2b
2 changed files with 15 additions and 16 deletions
  1. 2 2
      src/api/scan/request.js
  2. 13 14
      src/views/ledger/facility/partsmanage/addparts/index.vue

+ 2 - 2
src/api/scan/request.js

@@ -872,9 +872,9 @@ export function getEquipPartsType(param, success) {
 
 //设备清单-查询当前设备类下的部件分类
 export function getPartsAllType(param, success) {
-    let url = `${baseUrl}/equip-component/equip-query/equip-compon?category=${data.category}&id=${data.id}`;
+    let url = `${baseUrl}/equip-component/equip-query/equip-compon`;
     let data = param;
-    http.postJson(url, data, success)
+    http.getJson(url, data, success)
 }
 
 //all - 查询数据字典 --列表表头

+ 13 - 14
src/views/ledger/facility/partsmanage/addparts/index.vue

@@ -258,23 +258,22 @@ export default {
         if(newData[i].Checked){//同时创建资产
           await createPropertyData(params, res => {
             let response = res;
-            if(response.Result=='success'){
-              params.data.PropertyId = response.Id;
-              createPart(params, res=>{});
-              if(i==newData.length-1){
-                this.$router.push({
-                  path: "/ledger/partsmanage",
-                  query: {
-                    deviceId: this.category.deviceId,
-                    typeId: this.category.ParentId
-                  }
-                });
-                session.remove("partsAddData")
-              }
+            params.data.PropertyId = response.Id;
+          })
+          await createPart(params, res=>{
+            if(i==newData.length-1){
+              this.$router.push({
+                path: "/ledger/partsmanage",
+                query: {
+                  deviceId: this.category.deviceId,
+                  typeId: this.category.ParentId
+                }
+              });
+              session.remove("partsAddData")
             }
           })
         }else{
-          createPart(params, res=>{
+          await createPart(params, res=>{
             if(i==newData.length-1){
               this.$router.push({
                 path: "/ledger/partsmanage",