Browse Source

feat: [试验管理] 增加TFM角色权限

master
memorylkf 1 week ago
parent
commit
a44ec3e1e0
5 changed files with 23 additions and 11 deletions
  1. +1
    -1
      src/views/business/study/comp/edit.vue
  2. +6
    -2
      src/views/business/study/comp/suject.vue
  3. +2
    -1
      src/views/business/study/comp/syff.vue
  4. +4
    -1
      src/views/business/study/comp/syxx.vue
  5. +10
    -6
      src/views/business/study/list.vue

+ 1
- 1
src/views/business/study/comp/edit.vue View File

@ -94,7 +94,7 @@ export default {
},
edit(row) {
this.$refs['infoDialogForm'] && this.$refs['infoDialogForm'].resetFields()
this.infoDialog.formData = _.merge({}, EmptyDialogData)
this.infoDialog.formData = _.merge({}, EmptyDialogData,{leader:this.$store.getters.id,leaderName:this.$store.getters.nickName})
if(row && row.id){
this.$modal.loading()
study_info({id:row.id}).then(({data}) => {

+ 6
- 2
src/views/business/study/comp/suject.vue View File

@ -10,7 +10,7 @@
<div class="operate-img"></div>
<div class="operate-left">{{$t('page.business.study.studyEnter.syxkxx')}}</div>
<div class="operate-right">
<i class="el-icon-edit operate-icon" @click="editSubject" v-if="operate && study.createBy==userId"></i>
<i class="el-icon-edit operate-icon" @click="editSubject" v-if="operate && (study.leader==userId || checkRole(['TFM']))"></i>
</div>
</div>
<div class="subject-content">
@ -57,6 +57,7 @@
</template>
<script>
import { checkPermi, checkRole } from "@/utils/permission";
import {
studySubject_listByStudyId,
studySubject_getAllListByStudyId,
@ -76,7 +77,8 @@ export default {
type:Object,
default:()=>{
return {}
}
},
deep: true,
},
operate:{
type:Boolean,
@ -120,6 +122,8 @@ export default {
},
created() {},
methods: {
checkPermi,
checkRole,
getList(){
studySubject_listByStudyId({studyId:this.study.id}).then(response => {
this.subjectList = response.data;

+ 2
- 1
src/views/business/study/comp/syff.vue View File

@ -31,7 +31,8 @@ export default {
studyLeader:v.leader,
studySubjectId:''
}
}
},
deep: true,
},
},
components: {sbject},

+ 4
- 1
src/views/business/study/comp/syxx.vue View File

@ -35,7 +35,7 @@
</el-form-item>
</el-col>
<el-col>
<el-button type="primary" @click="sdsy" v-hasPermi="['business:study:sd']" v-if="studyInfo.createBy==userId && studyInfo.status!=5">{{ $t('page.business.study.studyFormPlan.sdsy') }}</el-button>
<el-button type="primary" @click="sdsy" v-hasPermi="['business:study:sd']" v-if="(studyInfo.leader==userId || checkRole(['TFM'])) && studyInfo.status!=5">{{ $t('page.business.study.studyFormPlan.sdsy') }}</el-button>
</el-col>
</el-row>
</el-form>
@ -58,6 +58,7 @@
</template>
<script>
import { checkPermi, checkRole } from "@/utils/permission";
import Sign from './sign.vue'
import jhbdList from './jhbdList.vue'
import { study_info,study_checkSd,study_sd } from "@/api/business/study/study"
@ -94,6 +95,8 @@ export default {
created() {
},
methods: {
checkPermi,
checkRole,
getstudySubject() {
studySubject_listByStudyId({ studyId: this.id }).then(response => {
this.subjectList = response.data;

+ 10
- 6
src/views/business/study/list.vue View File

@ -80,21 +80,21 @@
<el-table-column :label="$t('form.operate')" fixed="right" align="center" width="200">
<template slot-scope="scope">
<!-- 编辑 -->
<el-button type="text" @click="edit(scope.row)" v-hasPermi="['business:study:edit']" v-if="scope.row.status===1 || scope.row.status===3">{{$t('page.business.study.study.edit')}}</el-button>
<el-button type="text" @click="edit(scope.row)" v-hasPermi="['business:study:edit']" v-if="(scope.row.leader==userId || checkRole(['TFM'])) && (scope.row.status===1 || scope.row.status===3)">{{$t('page.business.study.study.edit')}}</el-button>
<!-- 删除 -->
<el-button type="text" @click="del(scope.row)" v-hasPermi="['business:study:remove']" v-if="scope.row.status===1">{{$t('page.business.study.study.delete')}}</el-button>
<el-button type="text" @click="del(scope.row)" v-hasPermi="['business:study:remove']" v-if="(scope.row.leader==userId || checkRole(['TFM'])) && scope.row.status===1">{{$t('page.business.study.study.delete')}}</el-button>
<!-- 详情 -->
<el-button type="text" @click="detail(scope.row)" v-hasPermi="['business:study:detail']" v-if="scope.row.status===1 || scope.row.status===3 || scope.row.status===5 || (scope.row.status===9 && scope.row.borrowStatus===10)">{{$t('page.business.study.study.detail')}}</el-button>
<!-- 进入试验 -->
<el-button type="text" @click="enter(scope.row)" v-hasPermi="['business:study:enter']" v-if="scope.row.status===3 || scope.row.status===5 || (scope.row.status===9 && scope.row.borrowStatus===10)">{{$t('page.business.study.study.enter')}}</el-button>
<!-- 归档 -->
<el-button type="text" @click="gd(scope.row)" v-hasPermi="['business:study:gd']" v-if="scope.row.status===5">{{$t('page.business.study.study.gd')}}</el-button>
<el-button type="text" @click="gd(scope.row)" v-hasPermi="['business:study:gd']" v-if="(scope.row.leader==userId || checkRole(['TFM'])) && scope.row.status===5">{{$t('page.business.study.study.gd')}}</el-button>
<!-- 解锁 -->
<el-button type="text" @click="js(scope.row)" v-hasPermi="['business:study:js']" v-if="scope.row.status===5">{{$t('page.business.study.study.js')}}</el-button>
<el-button type="text" @click="js(scope.row)" v-hasPermi="['business:study:js']" v-if="(scope.row.leader==userId || checkRole(['TFM'])) && scope.row.status===5">{{$t('page.business.study.study.js')}}</el-button>
<!-- 解档 -->
<el-button type="text" @click="jd(scope.row)" v-hasPermi="['business:study:jd']" v-if="scope.row.status===9 && scope.row.borrowStatus===1">{{$t('page.business.study.study.jd')}}</el-button>
<el-button type="text" @click="jd(scope.row)" v-hasPermi="['business:study:jd']" v-if="(scope.row.leader==userId || checkRole(['TFM'])) && scope.row.status===9 && scope.row.borrowStatus===1">{{$t('page.business.study.study.jd')}}</el-button>
<!-- 借阅 -->
<el-button type="text" @click="jy(scope.row)" v-hasPermi="['business:study:jy']" v-if="scope.row.status===9 && scope.row.borrowStatus===1">{{$t('page.business.study.study.jy')}}</el-button>
<el-button type="text" @click="jy(scope.row)" v-hasPermi="['business:study:jy']" v-if="(scope.row.leader==userId || checkRole(['TFM'])) && scope.row.status===9 && scope.row.borrowStatus===1">{{$t('page.business.study.study.jy')}}</el-button>
</template>
</el-table-column>
</el-table>
@ -147,6 +147,7 @@
</template>
<script>
import { checkPermi, checkRole } from "@/utils/permission";
import { study_list,study_delete,study_gd,study_js,study_jd,study_jy} from "@/api/business/study/study";
import Edit from './comp/edit.vue'
import Enter from './comp/enter.vue'
@ -168,6 +169,7 @@ export default {
},
data() {
return {
userId:this.$store.getters.id,
daterange:[],
searchForm: {
pageNum: 1,
@ -194,6 +196,8 @@ export default {
this.getList();
},
methods: {
checkPermi,
checkRole,
getList() {
this.loading = true;
this.searchForm.startDate = this.daterange && this.daterange.length > 0 ? this.daterange[0] : ''

Loading…
Cancel
Save