Bläddra i källkod

评估-项目登记权限

lizhenhao 2 år sedan
förälder
incheckning
bc94d5f22e

+ 6 - 0
src/api/program/ProgramProjectListInfoService.js

@@ -182,4 +182,10 @@ export default class ProgramProjectListInfoService {
       responseType: 'blob'
     })
   }
+  getHaveProjectIds () {
+    return request({
+      url: '/program/projectList/getHaveProjectIds',
+      method: 'get'
+    })
+  }
 }

+ 28 - 17
src/views/modules/program/registered/ProjectList.vue

@@ -141,38 +141,38 @@
           </vxe-column>
           <vxe-column title="操作" min-width="200px" fixed="right" align="center">
             <template  slot-scope="scope">
-              <el-button v-if="hasPermission('program:registered:edit')&&(scope.row.status === '1' || scope.row.status === '3')&&scope.row.createBy === createName" type="text" size="small" @click="registeredPush(scope.row)">修改</el-button>
+              <el-button v-if="hasPermission('program:registered:edit')&&(scope.row.status === '1' || scope.row.status === '3')&&(scope.row.createBy === createName||haveProjectIds.includes(scope.row.id))" type="text" size="small" @click="registeredPush(scope.row)">修改</el-button>
               <!--管理员角色登记完成后可修改-->
               <el-button v-if="hasPermission('program:registered:edit')&&scope.row.status === '5' && isAdmin" type="text" size="small" @click="edit(scope.row.id)">修改</el-button>
               <!--项目负责人修改-->
-              <el-button v-if="hasPermission('program:registered:edit')&&scope.row.status === '5' && scope.row.createBy === createName && (scope.row.archiveStatus === null ||scope.row.archiveStatus === undefined ||scope.row.archiveStatus === '' ||scope.row.archiveStatus === '0')" type="text" size="small" @click="edit(scope.row.id)">修改</el-button>
-              <el-button v-if="hasPermission('program:registered:edit')&&scope.row.status === '2'&&scope.row.createBy === createName" type="text" size="small" @click="registeredReback(scope.row)">撤回</el-button>
-              <el-button v-if="hasPermission('program:registered:del')&&(scope.row.status === '1' || scope.row.status === '3')&&scope.row.createBy === createName" type="text" size="small" @click="del(scope.row.id)">删除</el-button>
+              <el-button v-if="hasPermission('program:registered:edit')&&scope.row.status === '5' &&(scope.row.createBy === createName||haveProjectIds.includes(scope.row.id)) && (scope.row.archiveStatus === null ||scope.row.archiveStatus === undefined ||scope.row.archiveStatus === '' ||scope.row.archiveStatus === '0')" type="text" size="small" @click="edit(scope.row.id)">修改</el-button>
+              <el-button v-if="hasPermission('program:registered:edit')&&scope.row.status === '2'&&(scope.row.createBy === createName||haveProjectIds.includes(scope.row.id))" type="text" size="small" @click="registeredReback(scope.row)">撤回</el-button>
+              <el-button v-if="hasPermission('program:registered:del')&&(scope.row.status === '1' || scope.row.status === '3')&&(scope.row.createBy === createName||haveProjectIds.includes(scope.row.id))" type="text" size="small" @click="del(scope.row.id)">删除</el-button>
               <!--管理员角色登记完成后可删除-->
               <el-button v-if="hasPermission('program:registered:del')&&scope.row.status === '5' && isAdmin" type="text" size="small" @click="del(scope.row.id)">删除</el-button>
 
 <!--              <el-button v-if="hasPermission('program:registered:edit')&&scope.row.status === '5' && commonJS.isEmpty(scope.row.reportNo) && scope.row.createBy === createName" type="text" size="small" @click="saveReportNo(scope.row.id)">生成报告号</el-button>-->
 
-              <el-button v-if="hasPermission('program:registered:edit')&&scope.row.status === '5' &&scope.row.createBy === createName&&(scope.row.status1 === '0'||scope.row.status1 === '1'||scope.row.status1 === '3')" type="text" size="small" @click="firstAuditPush(scope.row)">一级校审</el-button>
-              <el-button v-if="hasPermission('program:registered:edit')&&scope.row.status1 === '2' &&scope.row.createBy === createName" type="text" size="small" @click="firstAuditReback(scope.row)">校审撤回</el-button>
+              <el-button v-if="hasPermission('program:registered:edit')&&scope.row.status === '5' &&(scope.row.createBy === createName||haveProjectIds.includes(scope.row.id))&&(scope.row.status1 === '0'||scope.row.status1 === '1'||scope.row.status1 === '3')" type="text" size="small" @click="firstAuditPush(scope.row)">一级校审</el-button>
+              <el-button v-if="hasPermission('program:registered:edit')&&scope.row.status1 === '2' &&(scope.row.createBy === createName||haveProjectIds.includes(scope.row.id))" type="text" size="small" @click="firstAuditReback(scope.row)">校审撤回</el-button>
 
-              <el-button v-if="hasPermission('program:registered:edit')&&scope.row.createBy === createName&&scope.row.status1 === '5'&&(scope.row.status2 === '0'||scope.row.status2 === '1'||scope.row.status2 === '3')" type="text" size="small" @click="secondAuditPush(scope.row)">二级校审</el-button>
-              <el-button v-if="hasPermission('program:registered:edit')&&scope.row.status2 === '2'&&scope.row.createBy === createName" type="text" size="small" @click="secondAuditReback(scope.row)">校审撤回</el-button>
+              <el-button v-if="hasPermission('program:registered:edit')&&(scope.row.createBy === createName||haveProjectIds.includes(scope.row.id))&&scope.row.status1 === '5'&&(scope.row.status2 === '0'||scope.row.status2 === '1'||scope.row.status2 === '3')" type="text" size="small" @click="secondAuditPush(scope.row)">二级校审</el-button>
+              <el-button v-if="hasPermission('program:registered:edit')&&scope.row.status2 === '2'&&(scope.row.createBy === createName||haveProjectIds.includes(scope.row.id))" type="text" size="small" @click="secondAuditReback(scope.row)">校审撤回</el-button>
 
-              <el-button v-if="hasPermission('program:registered:edit')&&scope.row.createBy === createName&&scope.row.status2 === '5' &&(scope.row.status3 === '0'||scope.row.status3 === '1'||scope.row.status3 === '3')" type="text" size="small" @click="thirdAuditPush(scope.row)">三级校审</el-button>
-              <el-button v-if="hasPermission('program:registered:edit')&&scope.row.createBy === createName&&scope.row.status3 === '2'" type="text" size="small" @click="thirdAuditReback(scope.row)">校审撤回</el-button>
+              <el-button v-if="hasPermission('program:registered:edit')&&(scope.row.createBy === createName||haveProjectIds.includes(scope.row.id))&&scope.row.status2 === '5' &&(scope.row.status3 === '0'||scope.row.status3 === '1'||scope.row.status3 === '3')" type="text" size="small" @click="thirdAuditPush(scope.row)">三级校审</el-button>
+              <el-button v-if="hasPermission('program:registered:edit')&&(scope.row.createBy === createName||haveProjectIds.includes(scope.row.id))&&scope.row.status3 === '2'" type="text" size="small" @click="thirdAuditReback(scope.row)">校审撤回</el-button>
 
               <!--三神结束后,评估报告签发前进行资产评估项目(校对)-->
-              <el-button v-if="hasPermission('program:registered:proo')&&scope.row.createBy === createName&&scope.row.status3 === '5'&&commonJS.isEmpty(scope.row.issuedStatus)" type="text" size="small" @click="proofread(scope.row.id)">校对</el-button>
+              <el-button v-if="hasPermission('program:registered:proo')&&(scope.row.createBy === createName||haveProjectIds.includes(scope.row.id))&&scope.row.status3 === '5'&&commonJS.isEmpty(scope.row.issuedStatus)" type="text" size="small" @click="proofread(scope.row.id)">校对</el-button>
               <!--报告签发-->
-              <el-button v-if="hasPermission('program:registered:browse')&&scope.row.createBy === createName &&scope.row.status3 === '5' && (scope.row.issuedStatus === null ||scope.row.issuedStatus === undefined ||scope.row.issuedStatus === '' ||scope.row.issuedStatus === '0' || scope.row.issuedStatus === '1' || scope.row.issuedStatus === '3')" type="text" size="small" @click="issued(scope.row)">签发</el-button>
+              <el-button v-if="hasPermission('program:registered:browse')&&(scope.row.createBy === createName||haveProjectIds.includes(scope.row.id)) &&scope.row.status3 === '5' && (scope.row.issuedStatus === null ||scope.row.issuedStatus === undefined ||scope.row.issuedStatus === '' ||scope.row.issuedStatus === '0' || scope.row.issuedStatus === '1' || scope.row.issuedStatus === '3')" type="text" size="small" @click="issued(scope.row)">签发</el-button>
               <!--报告签发撤回-->
-              <el-button v-if="hasPermission('program:registered:browse')&&scope.row.createBy === createName && scope.row.issuedStatus === '2'" type="text" size="small" @click="issuedReback(scope.row)">签发撤回</el-button>
+              <el-button v-if="hasPermission('program:registered:browse')&&(scope.row.createBy === createName||haveProjectIds.includes(scope.row.id)) && scope.row.issuedStatus === '2'" type="text" size="small" @click="issuedReback(scope.row)">签发撤回</el-button>
               <!--评估报告装订后的审核-->
-              <el-button v-if="hasPermission('program:registered:browse')&&scope.row.createBy === createName&&scope.row.issuedStatus === '5'&&scope.row.archiveStatus === '0'" type="text" size="small" @click="browse(scope.row.id)">装订自校</el-button>
+              <el-button v-if="hasPermission('program:registered:browse')&&(scope.row.createBy === createName||haveProjectIds.includes(scope.row.id))&&scope.row.issuedStatus === '5'&&scope.row.archiveStatus === '0'" type="text" size="small" @click="browse(scope.row.id)">装订自校</el-button>
 
-              <el-button v-if="hasPermission('program:registered:edit')&&scope.row.createBy === createName&&scope.row.issuedStatus === '5' &&(scope.row.archiveStatus === '0'||scope.row.archiveStatus === '1'||scope.row.archiveStatus === '3')" type="text" size="small" @click="archivePush(scope.row)">项目归档</el-button>
-              <el-button v-if="hasPermission('program:registered:edit')&&scope.row.createBy === createName&&scope.row.archiveStatus === '2'" type="text" size="small" @click="archiveReback(scope.row)">项目归档撤回</el-button>
+              <el-button v-if="hasPermission('program:registered:edit')&&(scope.row.createBy === createName||haveProjectIds.includes(scope.row.id))&&scope.row.issuedStatus === '5' &&(scope.row.archiveStatus === '0'||scope.row.archiveStatus === '1'||scope.row.archiveStatus === '3')" type="text" size="small" @click="archivePush(scope.row)">项目归档</el-button>
+              <el-button v-if="hasPermission('program:registered:edit')&&(scope.row.createBy === createName||haveProjectIds.includes(scope.row.id))&&scope.row.archiveStatus === '2'" type="text" size="small" @click="archiveReback(scope.row)">项目归档撤回</el-button>
 
               <!--一级校审ftl文件下载-->
 <!--              <el-button v-if="hasPermission('program:registered:edit')" type="text"  icon="el-icon-circle-check" size="small" @click="downloadFirstAuditTpl(scope.row)">一级校审下载</el-button>-->
@@ -256,7 +256,8 @@
         processDefinitionIdArchive: '',
         procDefKeyArchive: '',
         processDefinitionId4: '',
-        procDefKey4: ''
+        procDefKey4: '',
+        haveProjectIds: ''
       }
     },
     programProjectListInfoService: null,
@@ -325,6 +326,16 @@
           this.tablePage.total = data.total
           this.loading = false
         })
+        // 获取当前登录人的所属项目id集合
+        this.programProjectListInfoService.getHaveProjectIds().then(({data}) => {
+          if (this.commonJS.isNotEmpty(data)) {
+            this.haveProjectIds = data.map(i => {
+              if (this.commonJS.isNotEmpty(i)) {
+                return i
+              }
+            }).join(',')
+          }
+        })
         this.processService.getByName('评估-项目登记').then(({data}) => {
           if (!this.commonJS.isEmpty(data.id)) {
             this.processDefinitionAuditId = data.id