| | |
| | | </a-form-model> |
| | | |
| | | <a-tabs v-model="activeTabKey"> |
| | | <a-tab-pane :key="1" tab="分配部门"> |
| | | <a-tab-pane :key="1" tab="分配车间"> |
| | | <DepartPermissionTransfer ref="departPermissionTransferRef" :currentTreeNodeInfo="currentTreeNodeInfo" |
| | | :treeDataProps="allDepartmentsList" :allTreeKeys="allTreeKeys" |
| | | :isAssignSonNode="isAssignSonNode"/> |
| | |
| | | |
| | | <a-tab-pane :key="2" tab="分配用户"> |
| | | <UserPermissionTransfer ref="userPermissionTransferRef" :currentTreeNodeInfo="currentTreeNodeInfo" |
| | | :dataSource="allUsersList" :isAssignSonNode="isAssignSonNode"/> |
| | | :dataSource="allUsersList" :isAssignSonNode="isAssignSonNode" |
| | | @setAdminDisabled="setAdminDisabled"/> |
| | | </a-tab-pane> |
| | | </a-tabs> |
| | | </a-modal> |
| | |
| | | this.visible = true |
| | | }, |
| | | |
| | | // 调用接口获取所有部门列表 |
| | | // 调用接口获取所有车间列表 |
| | | getAllDepartmentsListByApi() { |
| | | this.allTreeKeys = [] |
| | | queryProductionTreeList() |
| | | .then(res => { |
| | | console.log('res-------------------', res) |
| | | if (res.success) { |
| | | this.allDepartmentsList = res.result |
| | | this.generateList(this.allDepartmentsList) |
| | |
| | | this.$refs.departPermissionTransferRef.expandedKeys = this.allTreeKeys |
| | | this.$refs.departPermissionTransferRef.flatten(JSON.parse(JSON.stringify(this.allDepartmentsList))) |
| | | }) |
| | | // 只有上次退出时在部门分配tab界面才会进入此判断 |
| | | // 只有上次退出时在车间分配tab界面才会进入此判断 |
| | | // 若上次退出时在用户分配tab界面则再次进入时key由2变为1时会触发watch监测activeTabKey变化则会将key:1加入hasLoadedDataTabKeyArray,因此无需再次加入key:1 |
| | | if (!this.hasLoadedDataTabKeyArray.includes(this.activeTabKey)) this.hasLoadedDataTabKeyArray.push(this.activeTabKey) |
| | | } |
| | |
| | | dncApi.getAllUsersListApi() |
| | | .then(res => { |
| | | if (res.success) { |
| | | this.allUsersList = res.result.records.map(item => { |
| | | return { |
| | | ...item, |
| | | disabled: item.username === 'admin' |
| | | } |
| | | }) |
| | | this.allUsersList = res.result.records |
| | | this.$nextTick(() => this.$refs.userPermissionTransferRef.getHasPermissionUserByApi()) |
| | | } |
| | | }) |
| | | }, |
| | | |
| | | setAdminDisabled() { |
| | | this.allUsersList = this.allUsersList.map(item => { |
| | | return { |
| | | ...item, |
| | | disabled: item.username === 'admin' |
| | | } |
| | | }) |
| | | }, |
| | | |
| | | handleModalClose() { |
| | | this.visible = false |
| | | this.hasLoadedDataTabKeyArray = [] |