From 525a36341d4f3bb98202b4a8cb20a23822b84dd5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E8=B5=B5=E9=9C=84?= Date: Fri, 22 Dec 2023 11:23:08 +0800 Subject: [PATCH] =?UTF-8?q?update=20=E5=9B=BD=E5=86=85\=E6=B5=B7=E5=A4=96?= =?UTF-8?q?=E6=A0=87=E5=87=86=E9=9D=9E=E7=AE=A1=E7=90=86=E5=91=98=E7=94=A8?= =?UTF-8?q?=E6=88=B7=E6=96=B0=E5=A2=9E\=E7=BC=96=E8=BE=91=E8=B7=B3?= =?UTF-8?q?=E8=BD=AC=E5=85=A5=E5=BA=93=E5=8F=98=E6=9B=B4=E6=B5=81=E7=A8=8B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../domesticStandard/DomesticStandardList.vue | 43 +++++++++++- .../overseasStandard/OverseasStandardList.vue | 44 ++++++++++++- .../StandardEntryOrChangeProcess.vue | 66 ++++++++++++++----- 3 files changed, 135 insertions(+), 18 deletions(-) diff --git a/src/views/standardRegulationLibrary/domesticStandard/DomesticStandardList.vue b/src/views/standardRegulationLibrary/domesticStandard/DomesticStandardList.vue index 9341495a..7970527c 100644 --- a/src/views/standardRegulationLibrary/domesticStandard/DomesticStandardList.vue +++ b/src/views/standardRegulationLibrary/domesticStandard/DomesticStandardList.vue @@ -217,7 +217,7 @@ import { collectionDomesticStandard, cancelCollectionDomesticStandard } from '../../../api/standardRegulationLibraryApi' -import { StandardSource, StandardSystemTreeNodeType, YesOrNoEnum } from '../../../enums/commonEnums' +import { OperationType, StandardSource, StandardSystemTreeNodeType, YesOrNoEnum } from '../../../enums/commonEnums' import UserSelectModal from '../../../components/selection/UserSelectModal.vue' import DomesticSystemTreeModal from './modules/DomesticSystemTreeModal.vue' import SelectionDomesticStandardDrawer from './modules/SelectionDomesticStandardDrawer.vue' @@ -291,8 +291,15 @@ export default { } }, computed: { + ...mapGetters(['userInfo']), importExcelUrl () { return `${window._CONFIG.domianURL}/${this.url.importExcelUrl}` + }, + // 当前用户是否管理员 + isAdmin () { + const adminRoleList = window._CONFIG.adminRoleCode.split(',') + const userRoleList = this.userInfo.roleCode.split(',') + return userRoleList.some(tt => adminRoleList.includes(tt)) } }, created () { @@ -643,6 +650,40 @@ export default { // 销毁这个提示 modalLoading.destroy() }) + }, + /** + * 新增-非管理员用户跳转流程发起页面,不能修改操作类型 + */ + handleAdd () { + if (!this.isAdmin) { + this.$router.push({ + path: '/workCenter/StandardEntryOrChangeProcess', + query: { + source: StandardSource.DOMESTIC.value, // 国内标准 + operateType: OperationType.ENTRY.value // 入库 + } + }) + return + } + this.$refs.modalForm.add() + this.$refs.modalForm.title = this.$t('newlyAdded') + this.$refs.modalForm.disableSubmit = false + }, + handleEdit (record) { + if (!this.isAdmin) { + this.$router.push({ + path: '/workCenter/StandardEntryOrChangeProcess', + query: { + source: StandardSource.DOMESTIC.value, // 国内标准 + operateType: OperationType.CHANGE.value, // 变更 + standardId: record.id // 标准id + } + }) + return + } + this.$refs.modalForm.edit(record) + this.$refs.modalForm.title = this.$t('edit') + this.$refs.modalForm.disableSubmit = false } } } diff --git a/src/views/standardRegulationLibrary/overseasStandard/OverseasStandardList.vue b/src/views/standardRegulationLibrary/overseasStandard/OverseasStandardList.vue index 37666783..897374f3 100644 --- a/src/views/standardRegulationLibrary/overseasStandard/OverseasStandardList.vue +++ b/src/views/standardRegulationLibrary/overseasStandard/OverseasStandardList.vue @@ -217,12 +217,13 @@ import { configOverseasStandard, removeOverseasStandard } from '../../../api/standardRegulationLibraryApi' -import { StandardSource, StandardSystemTreeNodeType, YesOrNoEnum } from '../../../enums/commonEnums' +import { OperationType, StandardSource, StandardSystemTreeNodeType, YesOrNoEnum } from '../../../enums/commonEnums' import UserSelectModal from '../../../components/selection/UserSelectModal.vue' import OverseasStandardModal from './modules/OverseasStandardModal.vue' import OverseasSystemTreeModal from './modules/OverseasSystemTreeModal.vue' import SelectionOverseasStandardDrawer from './modules/SelectionOverseasStandardDrawer.vue' import { postDownFile } from '../../../api/manage.js' +import { mapGetters } from 'vuex' export default { name: 'OverseasStandardList', @@ -291,8 +292,15 @@ export default { } }, computed: { + ...mapGetters(['userInfo']), importExcelUrl () { return `${window._CONFIG.domianURL}/${this.url.importExcelUrl}` + }, + // 当前用户是否管理员 + isAdmin () { + const adminRoleList = window._CONFIG.adminRoleCode.split(',') + const userRoleList = this.userInfo.roleCode.split(',') + return userRoleList.some(tt => adminRoleList.includes(tt)) } }, created () { @@ -644,6 +652,40 @@ export default { // 销毁这个提示 modalLoading.destroy() }) + }, + /** + * 新增-非管理员用户跳转流程发起页面,不能修改操作类型 + */ + handleAdd () { + if (!this.isAdmin) { + this.$router.push({ + path: '/workCenter/StandardEntryOrChangeProcess', + query: { + source: StandardSource.OVERSEAS.value, // 海外标准 + operateType: OperationType.ENTRY.value // 入库 + } + }) + return + } + this.$refs.modalForm.add() + this.$refs.modalForm.title = this.$t('newlyAdded') + this.$refs.modalForm.disableSubmit = false + }, + handleEdit (record) { + if (!this.isAdmin) { + this.$router.push({ + path: '/workCenter/StandardEntryOrChangeProcess', + query: { + source: StandardSource.OVERSEAS.value, // 海外标准 + operateType: OperationType.CHANGE.value, // 变更 + standardId: record.id // 标准id + } + }) + return + } + this.$refs.modalForm.edit(record) + this.$refs.modalForm.title = this.$t('edit') + this.$refs.modalForm.disableSubmit = false } } } diff --git a/src/views/workCenter/standardEntryOrChangeProcess/StandardEntryOrChangeProcess.vue b/src/views/workCenter/standardEntryOrChangeProcess/StandardEntryOrChangeProcess.vue index b4c71e2e..196564b2 100644 --- a/src/views/workCenter/standardEntryOrChangeProcess/StandardEntryOrChangeProcess.vue +++ b/src/views/workCenter/standardEntryOrChangeProcess/StandardEntryOrChangeProcess.vue @@ -79,7 +79,7 @@ +