From 25b1c09141f47cdbdd6eabd9c063a7a9448f2525 Mon Sep 17 00:00:00 2001 From: joylink_cuiweidong <364937672@qq.com> Date: Mon, 18 May 2020 13:32:25 +0800 Subject: [PATCH] =?UTF-8?q?=E5=89=A7=E6=9C=AC=E4=BB=A3=E7=A0=81=E8=B0=83?= =?UTF-8?q?=E6=95=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../newMap/displayNew/demon/addQuest.vue | 26 +++++++++---------- 1 file changed, 12 insertions(+), 14 deletions(-) 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'; } },