Browse Source

feat: [试验管理] tab菜单权限

lkf
memorylkf 2 months ago
parent
commit
b6cb60e2ed
3 changed files with 72 additions and 24 deletions
  1. +21
    -7
      src/views/business/form/drug/comp/enter.vue
  2. +24
    -8
      src/views/business/form/nonTrial/comp/enter.vue
  3. +27
    -9
      src/views/business/study/comp/enter.vue

+ 21
- 7
src/views/business/form/drug/comp/enter.vue View File

@ -19,6 +19,7 @@
</template> </template>
<script> <script>
import { checkPermi } from "@/utils/permission";
import { drug_info} from "@/api/business/form/drug"; import { drug_info} from "@/api/business/form/drug";
import ytbd from './ytbd.vue' import ytbd from './ytbd.vue'
import tbbd from './tbbd.vue' import tbbd from './tbbd.vue'
@ -33,21 +34,34 @@ export default {
data() { data() {
return { return {
showDetail: false, showDetail: false,
tabList: [
{ key: 'ytbd', name: 'page.business.study.studyEnter.ytbdlb' },
{ key: 'tbbd', name: 'page.business.study.studyEnter.tbbdlb' },
{ key: 'sqbd', name: 'page.business.study.studyEnter.sqbdlb' },
{ key: 'wzlb', name: 'page.business.study.studyEnter.wzlb' },
],
active: this.$route.params.tab || 'ytbd',
tabList: [],
active: '',
study: {}, study: {},
} }
}, },
created() { created() {
this.initTab()
this.getInfo() this.getInfo()
}, },
methods: { methods: {
checkPermi,
initTab(){
this.tabList = []
if(this.checkPermi(['business:drugFormPreTab'])){
this.tabList.push({ key: 'ytbd', name: 'page.business.study.studyEnter.ytbdlb' })
}
if(this.checkPermi(['business:drugFormFillTab'])){
this.tabList.push({ key: 'tbbd', name: 'page.business.study.studyEnter.tbbdlb' })
}
if(this.checkPermi(['business:drugFormApplyTab'])){
this.tabList.push({ key: 'sqbd', name: 'page.business.study.studyEnter.sqbdlb' })
}
if(this.checkPermi(['business:drugWzlbTab'])){
this.tabList.push({ key: 'wzlb', name: 'page.business.study.studyEnter.wzlb' })
}
this.active = this.$route.params.tab && _.findIndex(this.tabList,(o)=>{return o.key===this.$route.params.tab})>-1 ? this.$route.params.tab: this.tabList.length>0 ? this.tabList[0].key :''
},
getInfo(){ getInfo(){
this.$modal.loading() this.$modal.loading()
drug_info({id:this.$route.params.studyId}).then(({data}) => { drug_info({id:this.$route.params.studyId}).then(({data}) => {

+ 24
- 8
src/views/business/form/nonTrial/comp/enter.vue View File

@ -19,6 +19,7 @@
</template> </template>
<script> <script>
import { checkPermi } from "@/utils/permission";
import { nonTrial_info} from "@/api/business/form/nonTrial"; import { nonTrial_info} from "@/api/business/form/nonTrial";
import ytbd from './ytbd.vue' import ytbd from './ytbd.vue'
import tbbd from './tbbd.vue' import tbbd from './tbbd.vue'
@ -33,19 +34,34 @@ export default {
data() { data() {
return { return {
showDetail: false, showDetail: false,
tabList: [
{ key: 'ytbd', name: 'page.business.study.studyEnter.ytbdlb' },
{ key: 'tbbd', name: 'page.business.study.studyEnter.tbbdlb' },
{ key: 'wzlb', name: 'page.business.study.studyEnter.wzlb' },
{ key: 'syff', name: 'page.business.study.studyEnter.pzfflb' }
],
active: this.$route.params.tab || 'ytbd',
tabList: [],
active: '',
study: {}, study: {},
} }
}, },
created() {this.getInfo() },
created() {
this.initTab()
this.getInfo()
},
methods: { methods: {
checkPermi,
initTab(){
this.tabList = []
if(this.checkPermi(['business:nonTrialFormPreTab'])){
this.tabList.push({ key: 'ytbd', name: 'page.business.study.studyEnter.ytbdlb' })
}
if(this.checkPermi(['business:nonTrialFormFillTab'])){
this.tabList.push({ key: 'tbbd', name: 'page.business.study.studyEnter.tbbdlb' })
}
if(this.checkPermi(['business:nonTrialWzlbTab'])){
this.tabList.push({ key: 'wzlb', name: 'page.business.study.studyEnter.wzlb' })
}
if(this.checkPermi(['business:nonTrialMethodTab'])){
this.tabList.push({ key: 'syff', name: 'page.business.study.studyEnter.pzfflb' })
}
this.active = this.$route.params.tab && _.findIndex(this.tabList,(o)=>{return o.key===this.$route.params.tab})>-1 ? this.$route.params.tab: this.tabList.length>0 ? this.tabList[0].key :''
},
getInfo(){ getInfo(){
this.$modal.loading() this.$modal.loading()
nonTrial_info({id:this.$route.params.studyId}).then(({data}) => { nonTrial_info({id:this.$route.params.studyId}).then(({data}) => {

+ 27
- 9
src/views/business/study/comp/enter.vue View File

@ -21,6 +21,7 @@
</template> </template>
<script> <script>
import { checkPermi } from "@/utils/permission";
import { study_info} from "@/api/business/study/study"; import { study_info} from "@/api/business/study/study";
import ytbd from './ytbd.vue' import ytbd from './ytbd.vue'
import tbbd from './tbbd.vue' import tbbd from './tbbd.vue'
@ -37,15 +38,8 @@ export default {
data() { data() {
return { return {
showDetail: false, showDetail: false,
tabList: [
{ key: 'ytbd', name: 'page.business.study.studyEnter.ytbdlb' },
{ key: 'tbbd', name: 'page.business.study.studyEnter.tbbdlb' },
{ key: 'syxx', name: 'page.business.study.studyEnter.syxx' },
{ key: 'wzlb', name: 'page.business.study.studyEnter.wzlb' },
{ key: 'syff', name: 'page.business.study.studyEnter.syfflb' },
{ key: 'syj', name: 'page.business.study.studyEnter.syjsygl' }
],
active: this.$route.params.tab || 'ytbd',
tabList: [],
active: '',
study: {}, study: {},
} }
@ -54,10 +48,34 @@ export default {
// let x = this.$route.params // let x = this.$route.params
// let y = this.$route.query // let y = this.$route.query
// debugger // debugger
this.initTab()
this.getInfo() this.getInfo()
}, },
methods: { methods: {
checkPermi,
initTab(){
this.tabList = []
if(this.checkPermi(['business:studyFormPreTab'])){
this.tabList.push({ key: 'ytbd', name: 'page.business.study.studyEnter.ytbdlb' })
}
if(this.checkPermi(['business:studyFormFillTab'])){
this.tabList.push({ key: 'tbbd', name: 'page.business.study.studyEnter.tbbdlb' })
}
if(this.checkPermi(['business:studyFormPlanTab'])){
this.tabList.push({ key: 'syxx', name: 'page.business.study.studyEnter.syxx' })
}
if(this.checkPermi(['business:studyWzlbTab'])){
this.tabList.push({ key: 'wzlb', name: 'page.business.study.studyEnter.wzlb' })
}
if(this.checkPermi(['business:studyMethodTab'])){
this.tabList.push({ key: 'syff', name: 'page.business.study.studyEnter.syfflb' })
}
if(this.checkPermi(['business:studyRoomTab'])){
this.tabList.push({ key: 'syj', name: 'page.business.study.studyEnter.syjsygl' })
}
this.active = this.$route.params.tab && _.findIndex(this.tabList,(o)=>{return o.key===this.$route.params.tab})>-1 ? this.$route.params.tab: this.tabList.length>0 ? this.tabList[0].key :''
},
getInfo(){ getInfo(){
this.$modal.loading() this.$modal.loading()
study_info({id:this.$route.params.studyId}).then(({data}) => { study_info({id:this.$route.params.studyId}).then(({data}) => {

Loading…
Cancel
Save