| | |
| | | </el-col> |
| | | <el-col :span="12"> |
| | | <el-form-item label="部门"> |
| | | <el-select v-model="addPersonForm.organizationId" filterable style="width: 100%" placeholder="部门"> |
| | | <el-option v-for="item in organizationList" :key="item.id" :label="item.name" :value="item.id"/> |
| | | </el-select> |
| | | <el-tree-select @change= "parentIdChange" v-model="addPersonForm.organizationId" clearable placeholder="上级部门" default-expand-all check-on-click-nod :data="departmentList" check-strictly :props="{ label: 'name' }" node-key="id" ref="parentTree" style="width: 100%" /> |
| | | </el-form-item> |
| | | </el-col> |
| | | <el-col :span="12"> |
| | |
| | | emits: ['success', 'closed'], |
| | | data() { |
| | | return { |
| | | departmentList: [], |
| | | parentData: {}, |
| | | selectedIds: [], |
| | | deptIdList: [], |
| | | userIdList: [], |
| | | organizationList: [], |
| | |
| | | status: "", |
| | | postId: "", |
| | | email: "", |
| | | organizationId: "", |
| | | organizationId: [], |
| | | pinCode: "", |
| | | hireDate: "", |
| | | jobNumber: "", |
| | |
| | | this.getdeptId(); //数据权限调整 |
| | | }, |
| | | methods: { |
| | | parentIdChange(val) { |
| | | // var $parentId = this.$refs.parentTree.getCurrentNode().title; |
| | | // this.depatmentForm.$parentId = $parentId; |
| | | }, |
| | | getdeptId() { //数据权限调整 |
| | | this.$HTTP.get(`/api/blade-system/data-scope-manager/tree`).then(res=> { |
| | | if(res.code == 200) { |
| | |
| | | } |
| | | }) |
| | | }, |
| | | getOrganizationList() { //部门 |
| | | getOrganizationList() { |
| | | this.$HTTP.get(`/api/blade-cps/organization/tree?groupType=group_organization&groupCategory=1`).then(res=> { |
| | | if(res.code == 200) { |
| | | this.organizationList = res.data; |
| | | this.departmentList = res.data; |
| | | this.addPersonForm.organizationId = res.data[0].id; |
| | | } |
| | | }) |
| | | }, |
| | |
| | | }else { |
| | | res.data.deptId = []; |
| | | } |
| | | res.data.status = String(res.data.status); |
| | | //可以和上面一样单个注入,也可以像下面一样直接合并进去 |
| | | Object.assign(this.addPersonForm, res.data); |
| | | } |