Browse Source

需求改动

go语言测试平台
企业认证bug
JunboXu 2 years ago
parent
commit
4e75ccfefb
2 changed files with 43 additions and 4 deletions
  1. 40 1
      src/components/task/Task.vue
  2. 3 3
      src/pages/UserCenter/EnterpriseAuth.vue

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

@@ -157,6 +157,8 @@
               <el-button v-if="taskOperationControl.update||taskOperationControl.taskRecommend" @click="manageVirtualMachine()" type="primary" size="mini">管理虚拟机</el-button>
               <el-button v-if="taskOperationControl.writeReport||taskOperationControl.uploadReport" @click="connectVirtualMachine()" type="primary" size="mini">连接虚拟机</el-button>
               <el-button size="mini" @click="toProject()">项目详情</el-button>
+              <el-button size="mini" @click="toGo()">go语言测试在线测试平台</el-button>
+
               <el-popover
                 placement="top-start"
                 title="确认结束?"
@@ -420,6 +422,8 @@ export default {
       acceptedUserList: [],
       shortLink:'',
       editShortLink:false,
+      creatorId:'',
+      receiverId:''
     }
   },
   watch: {
@@ -433,8 +437,10 @@ export default {
   },
   mounted() {
     this.$nextTick(() => {
-      this.init()
+      this.init();
+
     })
+
   },
   methods: {
     //跳转到任务对应的数据面板
@@ -479,6 +485,7 @@ export default {
       this.getTaskDetail()
       this.getWordCloud()
       this.setInstitutions()
+      this.getProjectInfo()
     },
 
     //北斗测试报告填写跳转
@@ -493,6 +500,21 @@ export default {
         params: {projectId: this.projectId}
       })
     },
+    toGo() {
+      let roleid=1;
+      // console.log(this.user.roleList.length,"this.user.roleList.length");
+      // console.log(this.user.roleList.includes("generalUser"),'this.user.roleList.includes("generalUser")');
+      // console.log(this.receiverId,"this.receiverId   ",this.user.userVO.id,"this.user.userVO.id");
+      // console.log(this.creatorId,'this.creatorId')
+      if(this.user.roleList.length==1 && this.user.roleList.includes("generalUser")){roleid = 1;}
+      if(this.creatorId==this.user.userVO.id){roleid=3;}
+      if(this.taskOperationControl.uploadReport){roleid=4;}
+      if(this.receiverId==this.user.userVO.id){roleid=2;}
+
+      // console.log(roleid,'roleid')
+      let goUrl='http://101.132.74.9:1106/hjc2?project_code='+this.projectId+'&user_id'+this.user.userVO.id+'&role_id='+roleid;
+      window.open(goUrl, '_blank');
+    },
     //切换至可编辑页面
     modifyForm() {
       // this.task.serviceType = ''
@@ -528,13 +550,27 @@ export default {
     //加载用户信息
     setUserInfo() {
       this.user = storageGet('user')
+      console.log(this.user,'this.user')
+
       this.rolesPermissions = storageGet('rolesPermissions')
+      console.log(this.rolesPermissions,'this.rolesPermissions')
       if (storageGet('rolesPermissions').isRegionManager || storageGet('rolesPermissions').isSystemAdministrator) {
         this.showBD = true;
       } else {
         this.showBD = false;
       }
     },
+    getProjectInfo(){
+       Http.get(Apis.PROJECT.GET_PROJECT.replace('{projectId}', this.projectId)).then((res) => {
+          // console.log(res,"获取project res");
+          this.creatorId = res.projectDetails.userId;
+          this.receiverId =res.projectDetails.regionManagerId;
+          // console.log(typeof res.projectDetails.field)
+        }).catch((error) => {
+          // this.hideLoading()
+          // notify('error', error.data)
+        })
+    },
     //加载任务的测试类型
     setServiceType() {
       getAllServiceTypes().then((res) => {
@@ -620,6 +656,7 @@ export default {
         serverCode: '',
       }
       this.taskOperationControl = res.taskOperationControl;
+      // console.log(this.taskOperationControl,'this.taskOperationControl')
       this.acceptedUserList = res.acceptedUserList;
       this.crowdReportUrl = res.crowdTaskVO.writeReportUrl;
       this.handleFormatReport(this.acceptedUserList);
@@ -645,7 +682,9 @@ export default {
 
     //处理显示报告
     handleFormatReport(acceptedUserList) {
+      console.log(acceptedUserList,"this.acceptedUserList")
       acceptedUserList.map((user) => {
+        
         user.crowdReportVOS && user.crowdReportVOS.map((report) => {
           report.userName = user.userVO.userName;
           this.reportList.push(report);

+ 3 - 3
src/pages/UserCenter/EnterpriseAuth.vue

@@ -36,7 +36,7 @@
         </el-form-item>
         <el-form-item label="企业名称:" prop="evaluationAgencyName">
           <el-input :disabled="!canEdit" v-model="enterpriseForm1.evaluationAgencyName"
-                    placeholder="身份证前后不能有空格"></el-input>
+                    placeholder="企业名称不能为空"></el-input>
         </el-form-item>
         <el-form-item label="营业执照:" prop="businessLicensePhoto" style="width: 850px">
           <el-row class="agency-form-item">
@@ -337,8 +337,8 @@
       },
       setFormInfo(detail) {
         //回显认证信息
-        console.log("回显认证信息", detail.roleList);
-        this.enterpriseForm.roleList = detail.roleList.length>1?[0]:[1],
+        console.log("回显认证信息rolelist", detail.roleList);
+        this.enterpriseForm.roleList = detail.roleList.length>1? [0] :[1] ;
         console.log(this.enterpriseForm.roleList,"this.enterpriseForm.roleList");
           this.enterpriseForm.legalPersonName = detail.legalPersonName,
           this.enterpriseForm.gender = detail.gender,