diff --git a/src/views/newMap/displayNew/demon/addQuest.vue b/src/views/newMap/displayNew/demon/addQuest.vue index 03556d973..4f73289c9 100644 --- a/src/views/newMap/displayNew/demon/addQuest.vue +++ b/src/views/newMap/displayNew/demon/addQuest.vue @@ -213,22 +213,20 @@ export default { checkDisabled(role) { if (!this.$route.fullPath.includes('design/displayNew/demon')) { - if (this.$route.query.prdType == '01') { - return role !== 'Attendant' && role !== 'no'; - } else if (this.$route.query.prdType == '02') { - return role !== 'Dispatcher' && role !== 'no'; - } else if (this.$route.query.prdType == '04') { - return role !== 'Driver' && role !== 'no'; - } + const prdType = this.$route.query.prdType; + return this.judgeDisabled(prdType, role); } else { const prdType = this.$store.state.training.prdType; - if ( prdType == '01') { - return role !== '行值' && role !== 'no'; - } else if (prdType == '02') { - return role !== '行调' && role !== 'no'; - } else if (prdType == '04') { - return role !== '司机' && role !== 'no'; - } + return this.judgeDisabled(prdType, role); + } + }, + judgeDisabled(prdType, role) { + if ( prdType == '01') { + return role !== '行值' && role !== 'no'; + } else if (prdType == '02') { + return role !== '行调' && role !== 'no'; + } else if (prdType == '04') { + return role !== '司机' && role !== 'no'; } },