From 2637821cb7466330f5c612be809531cb65790219 Mon Sep 17 00:00:00 2001 From: lyh <925863403@qq.com> Date: 星期五, 04 七月 2025 20:01:54 +0800 Subject: [PATCH] Merge remote-tracking branch 'origin/master' --- src/views/system/modules/UserModal.vue | 82 ++++++++++++++++++++++++++++++++++++++--- 1 files changed, 76 insertions(+), 6 deletions(-) diff --git a/src/views/system/modules/UserModal.vue b/src/views/system/modules/UserModal.vue index 0bb2e81..375d389 100644 --- a/src/views/system/modules/UserModal.vue +++ b/src/views/system/modules/UserModal.vue @@ -212,6 +212,20 @@ /> </a-form-model-item> + <a-form-model-item + label="缁翠慨閮ㄩ棬/鐝粍鍒嗛厤" + :labelCol="labelCol" + :wrapperCol="wrapperCol" + v-show="!repairDepartDisabled" + > + <j-select-repair-depart + v-model="model.selectedRepairDeparts" + :multi="true" + @back="backRepairDepartInfo" + :backRepairDepart="true" + :treeRepairDepartOpera="true" + ></j-select-repair-depart> + </a-form-model-item> <a-form-model-item label="璐熻矗閮ㄩ棬" @@ -267,6 +281,7 @@ import { disabledAuthFilter } from '@/utils/authFilter' import { duplicateCheck } from '@/api/api' import JSelectProduction from '../../../components/jeecgbiz/JSelectProduction' + import JSelectRepairDepart from '../../../components/jeecgbiz/JSelectRepairDepart' import { mapActions } from 'vuex' import { ajaxGetDictItems, getDictItemsFromCache } from '@/api/api' import SelectDeviceModal from './SelectDeviceModal' @@ -275,13 +290,15 @@ name: 'UserModal', components: { SelectDeviceModal, - JSelectProduction + JSelectProduction, + JSelectRepairDepart }, data() { return { departDisabled: false, //鏄惁鏄垜鐨勯儴闂ㄨ皟鐢ㄨ椤甸潰 productionDisabled: false, //鏄惁鏄垜鐨勮溅闂磋皟鐢ㄨ椤甸潰 roleDisabled: false, //鏄惁鏄鑹茬淮鎶よ皟鐢ㄨ椤甸潰 + repairDepartDisabled: false, //鏄惁鏄垜鐨勭淮淇儴闂ㄧ彮缁勮皟鐢ㄨ椤甸潰 modalWidth: 800, drawerWidth: 700, modaltoggleFlag: true, @@ -331,15 +348,19 @@ userProductionList: '/sys/user/userProductionList', userId: '/sys/user/generateUserId', // 寮曞叆鐢熸垚娣诲姞鐢ㄦ埛鎯呭喌涓嬬殑url syncUserByUserName: '/act/process/extActProcess/doSyncUserByUserName',//鍚屾鐢ㄦ埛鍒板伐浣滄祦 - queryTenantList: '/sys/tenant/queryList' + queryTenantList: '/sys/tenant/queryList', + userRepairDepartList: '/sys/user/userRepairDepartList', + repairDepartTreeList: '/eam/eamBaseRepairDepart/queryTreeList' }, tenantsOptions: [], rolesOptions: [], nextDepartOptions: [], nextProductionOptions: [], + nextRepairDepartOptions: [], isDepartType: '', model: { - selectedProduction: '' + selectedProduction: '', + selectedRepairDeparts: '' } } }, @@ -367,6 +388,7 @@ this.initRoleList() this.initTenantList() this.queryTreeData() + this.getRepairDepartTreeDataByApi() }, computed: { uploadAction: function() { @@ -389,6 +411,20 @@ }).finally(() => { }) }, + // 鑾峰彇缁翠慨鐝粍鏍� + getRepairDepartTreeDataByApi() { + getAction(this.url.repairDepartTreeList) + .then(res => { + if (res.success) { + this.repairDepartTreeData = res.result + } else { + this.$notification.warning({ + message: '娑堟伅', + description: res.message + }) + } + }) + }, add() { this.refresh() this.edit({ @@ -397,7 +433,8 @@ userIdentity: 1, selectedroles: '', selecteddeparts: '', - selectedProduction: '' + selectedProduction: '', + selectedRepairDeparts: '' }) }, edit(record) { @@ -418,6 +455,8 @@ if (record.hasOwnProperty('id')) { that.getUserRoles(record.id) that.getUserDeparts(record.id) + that.getUserProductions(record.id) + that.getUserRepairDeparts(record.id) } }, isDisabledAuth(code) { @@ -490,7 +529,9 @@ that.nextDepartOptions = departOptions } }) - + }, + getUserProductions(userid) { + let that = this // 鑾峰彇杞﹂棿鍒嗛厤 getAction(that.url.userProductionList, { userId: userid }).then((res) => { if (res.success) { @@ -509,7 +550,27 @@ that.nextProductionOptions = ProductionOptions } }) - //杞﹂棿鐨剈rl + }, + getUserRepairDeparts(userid) { + let that = this + // 鑾峰彇缁翠慨閮ㄩ棬/鐝粍鍒嗛厤 + getAction(that.url.userRepairDepartList, { userId: userid }).then((res) => { + if (res.success) { + let repairDepartOptions = [] + let selectedRepairDepartKeys = [] + for (let i = 0; i < res.result.length; i++) { + selectedRepairDepartKeys.push(res.result[i].key) + //鏂板璐熻矗缁翠慨閮ㄩ棬/鐝粍閫夋嫨涓嬫媺妗� + repairDepartOptions.push({ + value: res.result[i].key, + label: res.result[i].title + }) + } + + this.$set(this.model, 'selectedRepairDeparts', selectedRepairDepartKeys.join(',')) + that.nextRepairDepartOptions = repairDepartOptions + } + }) }, backDepartInfo(info) { this.model.departIds = this.model.selecteddeparts @@ -525,11 +586,19 @@ return c }) }, + backRepairDepartInfo(info) { + this.model.repairDepartIds = this.model.selectedRepairDeparts + this.nextRepairDepartOptions = info.map((item, index, arr) => { + let c = { label: item.text, value: item.value + '' } + return c + }) + }, refresh() { this.userId = '' this.nextDepartOptions = [] this.nextProductionOptions = [] + this.nextRepairDepartOptions = [] this.departIdShow = false }, close() { @@ -538,6 +607,7 @@ this.disableSubmit = false this.nextDepartOptions = [] this.nextProductionOptions = [] + this.nextRepairDepartOptions = [] this.departIdShow = false this.$refs.form.resetFields() }, -- Gitblit v1.9.3