From fb9a865f25f94f688abacf4aff117a936f00827e Mon Sep 17 00:00:00 2001 From: qq787203167 <787203167@qq.com> Date: Tue, 14 Jun 2022 18:38:17 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E5=B7=B2=E7=9F=A5=E9=97=AE?= =?UTF-8?q?=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../components/listOfRegulations.vue | 73 ++++++++++++++----- 1 file changed, 55 insertions(+), 18 deletions(-) diff --git a/jero-web/src/views/projectManagement/components/listOfRegulations.vue b/jero-web/src/views/projectManagement/components/listOfRegulations.vue index 8deb81ac6..b17ecaa11 100644 --- a/jero-web/src/views/projectManagement/components/listOfRegulations.vue +++ b/jero-web/src/views/projectManagement/components/listOfRegulations.vue @@ -119,15 +119,15 @@
-
+
{{ $t('submit') }}
-
+
{{ $t('overrule') }}
-
+
{{ $t('batSetting') }}
@@ -235,6 +235,7 @@ :placeholder="$t('PleaseSelect')+$t('TaskCutOffTime')" @change="dateChange({db_field_name:'inventoryAffirmDueDate'})" format="YYYY-MM-DD" + :disabledDate="disabledDate" :getCalendarContainer="(trigger) => trigger.parentNode" v-model="formInline.inventoryAffirmDueDate" style="width: 100%"/> @@ -244,6 +245,7 @@ :placeholder="$t('PleaseSelect')+$t('TaskCutOffTime')" @change="dateChange({db_field_name:'taskAffirmDueDate'})" format="YYYY-MM-DD" + :disabledDate="disabledDate" :getCalendarContainer="(trigger) => trigger.parentNode" v-model="formInline.taskAffirmDueDate" style="width: 100%"/> @@ -336,14 +338,9 @@ - - - {{$t('StudioEngineer')}} - - - - - {{$t('regulatoryEngineerOrcertifiedEngineer')}} + + + {{item.roleName}} @@ -386,7 +383,8 @@ }, data() { return { - columns: [ + roleSwitchingList: [], + columnsAll: [ { title: this.$t('standard'), align: 'center', @@ -683,6 +681,7 @@ ], visibleFile: false, JLoading: false, + isRoleSwitching: true, formInlineComment: {}, rulesComment: { commentContent: [ @@ -801,19 +800,19 @@ { type: 'Personnel', value: 'regulationOwnerId', - valueName:'regulationOwnerIdName', + valueName: 'regulationOwnerIdName', text: this.$t('regulatoryEngineer') }, { type: 'Personnel', value: 'homologationEngineerId', - valueName:'homologationEngineerIdName', + valueName: 'homologationEngineerIdName', text: this.$t('certifiedEngineer') }, { type: 'Personnel', value: 'engineeringInterfacePerson', - valueName:'engineeringInterfacePersonName', + valueName: 'engineeringInterfacePersonName', text: this.$t('engineeringInterfacePerson') } ], @@ -837,6 +836,7 @@ if (this.$route.query.studioEngineer == this.userInfo().id) { this.JLoading = true this.getAndUserId() + this.getRoleByUserId() } else { this.isDisplay = false } @@ -861,6 +861,18 @@ } } return columnResult + }, + columns() { + let columnResult = JSON.parse(JSON.stringify(this.columnsAll)) + if (!this.isRoleSwitching) { + for (var i = 0; i < columnResult.length; i++) { + if (columnResult[i].title === this.$t('operation')) { + columnResult.splice(i, 1) + i-- + } + } + } + return columnResult } }, methods: { @@ -868,6 +880,18 @@ handleModule() { downloadFile(this.url.exportTemplate, this.$t('listOfRegulations') + this.$t('importTemplate') + '.xls', {}) }, + disabledDate(current) { + return current && current < moment().subtract(1, 'day') + }, + getRoleByUserId() { + getAction('/sys/role/getRoleByUserId', {}).then((res) => { + if (res.success) { + this.roleSwitchingList = res.result || [] + } else { + this.roleSwitchingList = [] + } + }) + }, getAndUserId() { let query = { projectLibraryId: this.$route.query.id, @@ -878,10 +902,14 @@ this.isDisplay = true this.formInlineRoleSwitching.roleSwitchingCode = res.result.roleCode this.AndUserId = res.result.id + this.isRoleSwitching = true if (this.formInlineRoleSwitching.roleSwitchingCode == '0') { this.isDisplay = true } else { this.isDisplay = false + if (this.formInlineRoleSwitching.roleSwitchingCode == '11' || this.formInlineRoleSwitching.roleSwitchingCode == '12') { + this.isRoleSwitching = false + } } this.JLoading = false } else { @@ -1020,10 +1048,14 @@ this.confirmLoadingRoleSwitching = true postAction(this.url.AndUserIdEdit, query).then((res) => { if (res.success) { + this.isRoleSwitching = true if (this.formInlineRoleSwitching.roleSwitchingCode == '0') { this.isDisplay = true } else { this.isDisplay = false + if (this.formInlineRoleSwitching.roleSwitchingCode == '11' || this.formInlineRoleSwitching.roleSwitchingCode == '12') { + this.isRoleSwitching = false + } } this.$message.success(this.$t('OperationSuccessful')) this.visibleRoleSwitching = false @@ -1044,10 +1076,11 @@ this.visibleRoleSwitching = true this.$nextTick(() => { this.$refs.ruleFormRoleSwitching.clearValidate() - if (this.isDisplay) { + if (!this.formInlineRoleSwitching.roleSwitchingCode) { this.formInlineRoleSwitching.roleSwitchingCode = '0' - } else { - this.formInlineRoleSwitching.roleSwitchingCode = '4' + } + if (!(this.roleSwitchingList.some(val => val.roleCode == this.formInlineRoleSwitching.roleSwitchingCode))) { + this.formInlineRoleSwitching.roleSwitchingCode = this.roleSwitchingList[0].roleCode } this.formInlineRoleSwitching = { ...this.formInlineRoleSwitching } }) @@ -1148,6 +1181,9 @@ } else { roleCode = 4 } + if (this.formInlineRoleSwitching.roleSwitchingCode == '11' || this.formInlineRoleSwitching.roleSwitchingCode == '12') { + roleCode = 0 + } let query = { ...this.queryParamQuery, ...this.queryParam, @@ -1155,6 +1191,7 @@ roleCode: roleCode } this.loading = true + this.getRoleByUserId() getAction(this.url.list, query).then((res) => { if (res.success) { this.dataSource = res.result