Explorar el Código

wbs节点更换修改1

duy hace 2 años
padre
commit
fcb39f27ec
Se han modificado 1 ficheros con 17 adiciones y 11 borrados
  1. 17 11
      src/views/manager/projectinfo/detail.vue

+ 17 - 11
src/views/manager/projectinfo/detail.vue

@@ -590,7 +590,9 @@ export default {
       logrightloading:false,
       selectData:{},
       isFirst:false,
-      rightTreeData:[]//存储右边的树数据
+      rightTreeData:[],//存储右边的试验树数据
+      rightTreeData1:[],//存储右边的质检树数据
+     
     }
   },
   computed: {
@@ -1139,7 +1141,13 @@ export default {
 
     treeChang () {
       console.log(this.$refs.treetotree.rightTreeData,'this.$refs.treetotree');
-      this.rightTreeData=this.$refs.treetotree.rightTreeData
+      console.log(this.templateType,'this.templateType');
+      if (this.templateType===2) {
+        this.rightTreeData=this.$refs.treetotree.rightTreeData
+      }else{
+          this.rightTreeData1=this.$refs.treetotree.rightTreeData
+      }
+    
       this.typeChang[2] = true;
     },
 
@@ -1354,28 +1362,26 @@ export default {
     },
 
     getRightTree() {
-      console.log("-------------------- getRightTree -------------------")
       this.rightloading = true;
-
       let WbsId = this.templateType === 1 ? this.selectData.referenceWbsTemplateId : this.selectData.referenceWbsTemplateIdTrial
-      console.log(WbsId, "getRightTree-WbsId")
-
       if (this.projectForm.referenceWbsTemplateType == 'private' && WbsId != null && WbsId.toString().length > 0) {
           let ids = WbsId.toString().split(",");
           WbsId = ids[0]
       }
-      console.log(this.rightTreeData,'this.rightTreeData');
-     
     findProjectTree(this.projectForm.id, WbsId).then((res) => {
-
-      if (this.rightTreeData.length>0) {
-        console.log(res.data.data,'res.data.data');
+      if (this.rightTreeData.length>0&&this.templateType===2) {
+         this.$refs.treetotree.setRightTree(this.rightTreeData);
+      }else if(this.rightTreeData1.length>0&&this.templateType===1){
+          this.$refs.treetotree.setRightTree(this.rightTreeData1);
       }
+      else{
         if (Array.isArray(res.data.data)) {
           this.$refs.treetotree.setRightTree(res.data.data);
         } else {
           this.$refs.treetotree.setRightTree([]);
         }
+      }
+        
        
       })