修改角色切换

This commit is contained in:
qq787203167
2022-06-06 15:38:39 +08:00
parent 80b9cae192
commit 6d47ca665f
@@ -353,6 +353,7 @@
</a-row>
</a-form-model>
</a-modal>
<JLoading :loading="JLoading">{{$t('dataLoading')}}</JLoading>
<resultReportedUpload @resultReportedUploadForm="addModelList" ref="resultReportedUploadRef"/>
</a-card>
</template>
@@ -681,6 +682,7 @@
}
],
visibleFile: false,
JLoading:false,
formInlineComment: {},
rulesComment: {
commentContent: [
@@ -736,7 +738,9 @@
setBatch: '/project/projectLawsInventoryEO/setBatch',//批量设置
copyUrl: '/project/projectLawsInventoryEO/copyInfoByIds',//复制
transferUrl: '/project/projectLawsInventoryEO/getPageInfoDummy',//调取
ExportReportUrl: '/project/projectLawsInventoryEO/downloadDocxReport'
ExportReportUrl: '/project/projectLawsInventoryEO/downloadDocxReport',
AndUserId: '/project/projectLibraryRoleRelEO/queryByProjectLibraryIdAndUserId',
AndUserIdEdit: '/project/projectLibraryRoleRelEO/edit'
},
downLoadFileUrl: window._CONFIG['domianPreviewURL'] + '/sys/common/download',
loading: false,
@@ -798,6 +802,7 @@
visibleRoleSwitching: false,
confirmLoadingRoleSwitching: false,
formInlineRoleSwitching: {},
AndUserId: '',
rulesRoleSwitching: {
roleSwitchingCode: [
{
@@ -812,8 +817,8 @@
mounted() {
if (this.$route.query.studioEngineer == this.userInfo().id) {
this.isDisplay = true
this.formInlineRoleSwitching.roleSwitchingCode = '0'
this.JLoading = true
this.getAndUserId()
} else {
this.isDisplay = false
}
@@ -845,6 +850,27 @@
handleModule() {
downloadFile(this.url.exportTemplate, this.$t('listOfRegulations') + this.$t('importTemplate') + '.xls', {})
},
getAndUserId() {
let query = {
projectLibraryId: this.$route.query.id,
userId: this.userInfo().id
}
getAction(this.url.AndUserId, query).then((res) => {
if (res.success) {
this.isDisplay = true
this.formInlineRoleSwitching.roleSwitchingCode = res.result.roleCode
this.AndUserId = res.result.id
if (this.formInlineRoleSwitching.roleSwitchingCode == '0') {
this.isDisplay = true
} else {
this.isDisplay = false
}
this.JLoading = false
}else{
this.JLoading = false
}
})
},
ExportReportClick() {
let selectedRowKeys = JSON.parse(JSON.stringify(this.selectedRowKeys))
if (selectedRowKeys && selectedRowKeys.length == 0) {
@@ -969,13 +995,27 @@
handleOkRoleSwitching() {
this.$refs.ruleFormRoleSwitching.validate(valid => {
if (valid) {
if (this.formInlineRoleSwitching.roleSwitchingCode == '0') {
this.isDisplay = true
} else {
this.isDisplay = false
let query = {
roleCode: this.formInlineRoleSwitching.roleSwitchingCode,
id: this.AndUserId
}
this.visibleRoleSwitching = false
this.getList()
this.confirmLoadingRoleSwitching = true
postAction(this.url.AndUserIdEdit, query).then((res) => {
if (res.success) {
if (this.formInlineRoleSwitching.roleSwitchingCode == '0') {
this.isDisplay = true
} else {
this.isDisplay = false
}
this.$message.success(this.$t('OperationSuccessful'))
this.visibleRoleSwitching = false
this.confirmLoadingRoleSwitching = false
this.getList()
} else {
this.confirmLoadingRoleSwitching = false
this.$message.warning(this.$t('operationFailed'))
}
})
}
})
},