duy 2 éve
szülő
commit
06c8b034d4
1 módosított fájl, 51 hozzáadás és 6 törlés
  1. 51 6
      src/views/manager/projectinfo/detail.vue

+ 51 - 6
src/views/manager/projectinfo/detail.vue

@@ -822,15 +822,23 @@ export default {
         this.saveBtnBackLoad = true;
         this.saveBtnNextDisabled = true
         this.saveBtnDisabled = true
+      
+
       }
       try {
         if (this.activeType == '1') {
           let res = await this.saveProject();
           this.projectForm.id = res.data.data.id;
         } else if (this.activeType == '2') {
+  
           await this.saveWbsTree();
         } else if (this.activeType == '3'){
           await this.saveLogWbsTree();
+          if(type == 'p'){
+            console.log(this.wbsId,'wbsis');
+          }
+                
+
         }
       } catch (error) {
         this.btnLoad = false;
@@ -846,6 +854,7 @@ export default {
         if(this.activeType == '2'){
           console.log("saveNext getRightTree")
           this.getRightTree();
+          // this.templateType=1
         }
         return;
       }
@@ -1349,7 +1358,7 @@ export default {
         //有引用id,回显
         //this.selected = true;
 
-        this.templateType = this.projectForm.wbsType;
+        // this.templateType = this.projectForm.wbsType;
         await this.getTreeList();
         let priv = {};
 
@@ -1492,7 +1501,9 @@ export default {
     },
     //初始化试验
     async treeInitTrial () {
+      console.log(this.wbsId,'wbsidshiyan');
       let refId = this.selectData.referenceWbsTemplateIdTrial;
+      console.log(refId,'wbsidshiyan');
       //引用被删会出现 wbsType -1
       if (refId && refId > 0 && Number(this.projectForm.wbsType) > 0) {
         //有引用id,回显
@@ -1567,8 +1578,7 @@ export default {
           this.iswbsselected=false
       }else{
               let WbsId=''
-              if (this.projectForm.referenceWbsTemplateType === 'private'  && refId != null && refId.toString().length > 0
-              ||this.projectForm.referenceWbsTemplateTypeLar === 'private' && refId != null && refId.toString().length > 0) {
+              if (this.projectForm.referenceWbsTemplateType === 'private'  && refId != null && refId.toString().length > 0&&this.templateType===1) {
                 // 私有库右边树形数据是通过 pkeyId 查询的
                 let ids = refId.toString().split(",");
                 console.log(ids,'ids111111');
@@ -1581,10 +1591,39 @@ export default {
                 
                 }
               }
+              if (this.projectForm.referenceWbsTemplateTypeTrial === 'private'  && refId != null && refId.toString().length > 0&&this.templateType===2) {
+                // 私有库右边树形数据是通过 pkeyId 查询的
+                let ids = refId.toString().split(",");
+                console.log(ids,'试验');
+                this.finalIds=ids
+                if (ids.length > 1) {
+                  refId = ids[0]
+                  let list = this.treeList[1].options;
+                  refId = list.filter(e => e.projectId == ids[1])[0].pkeyId;
+                  console.log(refId,'refId');
+                
+                }
+              }
+              if (
+              this.projectForm.referenceWbsTemplateTypeLar === 'private' && refId != null && refId.toString().length > 0 &&this.templateType===5) {
+                // 私有库右边树形数据是通过 pkeyId 查询的
+                let ids = refId.toString().split(",");
+                console.log(ids,'征拆');
+                this.finalIds=ids
+                if (ids.length > 1) {
+                  refId = ids[0]
+                  let list = this.treeList[1].options;
+                  refId = list.filter(e => e.projectId == ids[1])[0].pkeyId;
+                  console.log(refId,'refId');
+                
+                }
+              }
               //引用被删会出现 wbsType -1
               if (refId && refId > 0) {
                 let priv = {};
-                if (this.projectForm.referenceWbsTemplateType == 'private'||this.projectForm.referenceWbsTemplateTypeLar === 'private' ) {
+                if (this.projectForm.referenceWbsTemplateType == 'private'&&this.templateType===1
+                ||this.projectForm.referenceWbsTemplateTypeLar === 'private' &&this.templateType===5
+                ||this.projectForm.referenceWbsTemplateTypeTrial === 'private'&&this.templateType===2) {
                   //私有
                   let list = this.treeList[1].options;
                   for (let i = 0; i < list.length; i++) {
@@ -1608,8 +1647,14 @@ export default {
                 console.log(11111111111);
                 WbsId=this.nowref.id
               }else{
-                if (this.projectForm.referenceWbsTemplateType == 'private'&& refId != null && refId.toString().length > 0 ||this.projectForm.referenceWbsTemplateTypeLar === 'private'&& refId != null && refId.toString().length > 0) {
-                    WbsId = priv.pkeyId||this.selectData.referenceWbsTemplateIdTrial 
+                if (this.projectForm.referenceWbsTemplateType == 'private'&& refId != null && refId.toString().length > 0 &&this.templateType==1) {
+                    WbsId = priv.pkeyId
+                }
+               else if (this.projectForm.referenceWbsTemplateTypeTrial == 'private'&& refId != null && refId.toString().length > 0 &&this.templateType==2) {
+                    WbsId =priv.pkeyId
+                }
+               else if (this.projectForm.referenceWbsTemplateTypeLar === 'private'&& refId != null && refId.toString().length > 0&&this.templateType==5) {
+                    WbsId = priv.pkeyId
                 }
                 else {//公有
                   WbsId=this.templateType === 1 ?this.selectData.referenceWbsTemplateId: this.selectData.referenceWbsTemplateIdTrial