Browse Source

优化我的众测接口

郭超 4 years ago
parent
commit
47bd4f5ded

+ 32 - 27
src/components/Mine.vue

@@ -216,6 +216,8 @@
           }
         },
         isLogin: false,
+        agency: false,
+        part: false,
         showCreateData: false,
         showAcceptData: false,
         taskJson:[]
@@ -224,8 +226,8 @@
     mounted() {
       this.$nextTick(() => {
         this.init();
-        this.checkCreateProjectAuth();
-        this.checkAcceptTaskAuth()
+        // this.checkCreateProjectAuth();
+        // this.checkAcceptTaskAuth()
       })
     },
     methods: {
@@ -266,7 +268,9 @@
             this.acceptableProjects = res.acceptableProjects
           }
           this.canImportTask = res.canImportTask == null ? false : res.canImportTask;
-          console.log(this.canImportTask);
+          this.showCreateData = res.part;
+          this.showAcceptData = res.agency;
+          console.log(res);
           // if (res.userVO != null && res.userVO.length > 0) {
           //   this.user = res.userVO
           // }
@@ -403,30 +407,31 @@
         }
         console.log(event)
       },
-      //检查是否有发包权限
-      checkCreateProjectAuth() {
-        if (this.isLogin) {
-          Http.get(Apis.USER.IS_PART.replace('{userId}', this.user.userVO.id)).then((res) => {
-            if (res) {
-              this.showCreateData = true;
-            }
-          }).catch((error) => {
-            // notify('error', error)
-          })
-        }
-      },
-      //检查是否有接包权限
-      checkAcceptTaskAuth() {
-        if (this.isLogin) {
-          Http.get(Apis.USER.IS_AGENCY.replace('{userId}', this.user.userVO.id)).then((res) => {
-            if (res) {
-              this.showAcceptData = true;
-            }
-          }).catch((error) => {
-            // notify('error', error)
-          })
-        }
-      },
+
+      ////检查是否有发包权限
+      // checkCreateProjectAuth() {
+      //   if (this.isLogin) {
+      //     Http.get(Apis.USER.IS_PART.replace('{userId}', this.user.userVO.id)).then((res) => {
+      //       if (res) {
+      //         this.showCreateData = true;
+      //       }
+      //     }).catch((error) => {
+      //       // notify('error', error)
+      //     })
+      //   }
+      // },
+      // //检查是否有接包权限
+      // checkAcceptTaskAuth() {
+      //   if (this.isLogin) {
+      //     Http.get(Apis.USER.IS_AGENCY.replace('{userId}', this.user.userVO.id)).then((res) => {
+      //       if (res) {
+      //         this.showAcceptData = true;
+      //       }
+      //     }).catch((error) => {
+      //       // notify('error', error)
+      //     })
+      //   }
+      // },
     },
     created: function() {
 

+ 1 - 1
src/components/project/Project.vue

@@ -550,7 +550,7 @@
         this.setServiceType()
         this.setFields()
         this.setPlatformType()
-        this.setInstitutions()
+        // this.setInstitutions()
         this.setUserInfo()
         this.loadData()
         //this.reformDate(123)

+ 1 - 1
src/components/task/Task.vue

@@ -558,7 +558,7 @@ export default {
       //this.loadData(this.projectId, this.taskId)
       this.getTaskDetail()
       this.getWordCloud()
-      this.setInstitutions()
+      // this.setInstitutions()
     },
 
     //北斗测试报告填写跳转

+ 1 - 1
src/components/task/TaskCreate.vue

@@ -284,7 +284,7 @@
         this.projectId = this.$route.params.projectId
         this.$route.params.code && this.initTask()
         this.setServiceType()
-        this.setInstitutions()
+        // this.setInstitutions()
         this.setUserInfo()
       },
       initTask(){