| | |
| | | placeholder="选择部门" |
| | | /> |
| | | </el-form-item> |
| | | <el-form-item label="排班" prop="sysRostering.id"> |
| | | <el-select v-model="form.sysRostering.id" clearable style="width: 184px" placeholder="请选择"> |
| | | <el-option |
| | | v-for="item in rosterings" |
| | | :key="item.id" |
| | | :label="item.name" |
| | | :value="item.id" |
| | | /> |
| | | </el-select> |
| | | </el-form-item> |
| | | <el-form-item label="岗位" prop="jobs"> |
| | | <el-select |
| | | v-model="jobDatas" |
| | |
| | | /> |
| | | </el-select> |
| | | </el-form-item> |
| | | <el-form-item label="排班" prop="sysRostering.id"> |
| | | <el-select v-model="form.sysRostering.id" clearable style="width: 184px" placeholder="请选择"> |
| | | <el-form-item label="二级岗位" prop="jobSecondId"> |
| | | <el-select v-model="form.jobSecondId" clearable style="width: 184px" placeholder="请选择"> |
| | | <el-option |
| | | v-for="item in rosterings" |
| | | :key="item.id" |
| | | v-for="item in jobSeconds" |
| | | :key="item.name" |
| | | :label="item.name" |
| | | :value="item.id" |
| | | :disabled="!item.enabled" |
| | | /> |
| | | </el-select> |
| | | </el-form-item> |
| | |
| | | import { getDepts, getDeptSuperior } from '@/api/system/dept' |
| | | import { getAll, getLevel } from '@/api/system/role' |
| | | import crudJob from '@/api/system/job' |
| | | import crudJobSecond from '@/api/system/jobSecond' |
| | | import CRUD, { presenter, header, form, crud } from '@crud/crud' |
| | | import rrOperation from '@crud/RR.operation' |
| | | import crudOperation from '@crud/CRUD.operation' |
| | |
| | | let userRoles = [] |
| | | let userJobs = [] |
| | | let userCompanys = [] |
| | | const defaultForm = { id: null, username: null, company: { id: null }, internshipTime: null, nickName: null, gender: '男', email: null, enabled: 'false', loginEnabled: 'false', roles: [], jobs: [], dept: { id: null }, phone: null, birthday: null, address: null, dingding: null, weComId: null, sysRostering: { id: null }, levelId: null, companys: [] } |
| | | const defaultForm = { id: null, username: null, company: { id: null }, internshipTime: null, nickName: null, gender: '男', email: null, enabled: 'false', loginEnabled: 'false', roles: [], jobs: [], dept: { id: null }, phone: null, birthday: null, address: null, dingding: null, weComId: null, sysRostering: { id: null }, levelId: null, companys: [], jobSecondId: null } |
| | | export default { |
| | | name: 'User', |
| | | components: { Treeselect, crudOperation, rrOperation, udOperation, pagination, DateRangePicker }, |
| | |
| | | } |
| | | return { |
| | | height: document.documentElement.clientHeight - 180 + 'px;', |
| | | deptName: '', depts: [], deptDatas: [], jobs: [], level: 3, roles: [], |
| | | deptName: '', depts: [], deptDatas: [], jobs: [], jobSeconds: [], level: 3, roles: [], |
| | | jobDatas: [], roleDatas: [], companyDatas: [], // 多选时使用 |
| | | defaultProps: { children: 'children', label: 'name', isLeaf: 'leaf' }, |
| | | permission: { |
| | |
| | | // 用户表单 |
| | | this.form.levelId = null |
| | | } |
| | | if (value.length > 0) { |
| | | this.getJobSeconds() |
| | | } |
| | | }, |
| | | changeCompany(value) { |
| | | userCompanys = [] |
| | |
| | | const com = { id: company.id } |
| | | userCompanys.push(com) |
| | | }) |
| | | // 获取可选二级岗位 |
| | | this.getJobSeconds() |
| | | }, |
| | | // 提交前做的操作 |
| | | [CRUD.HOOK.afterValidateCU](crud) { |
| | |
| | | this.jobs = res |
| | | }).catch(() => { }) |
| | | }, |
| | | // 获取弹窗内二级岗位数据 |
| | | getJobSeconds() { |
| | | const that = this |
| | | crudJobSecond.getAll({ jobIds: that.jobDatas }).then(res => { |
| | | that.jobSeconds = res |
| | | }).catch(() => { }) |
| | | }, |
| | | // 获取权限级别 |
| | | getRoleLevel() { |
| | | getLevel().then(res => { |