| | |
| | | </el-form-item> |
| | | </el-col> |
| | | <el-col :xs="24" :sm="12" :md="12" :lg="12" :xl="12" class="mb20"> |
| | | <el-form-item label="职务" prop="positionId"> |
| | | <el-select v-model="userForm.positionId" placeholder="请选择" clearable class="w100"> |
| | | <el-option v-for="item in dutyData" :key="item.positionId" :label="item.positionName" :value="item.positionId"> </el-option> |
| | | </el-select> |
| | | </el-form-item> |
| | | </el-col> |
| | | <el-col :xs="24" :sm="12" :md="12" :lg="12" :xl="12" class="mb20"> |
| | | <el-form-item label="手机号" prop="phone"> |
| | | <el-input v-model.trim="userForm.phone" placeholder="请输入手机号" clearable></el-input> |
| | | </el-form-item> |
| | |
| | | // 定义接口来定义对象的类型 |
| | | interface DeptData {} |
| | | interface roleData {} |
| | | interface dutyData {} |
| | | interface sexData {} |
| | | interface UserState { |
| | | title: string; |
| | |
| | | realName: string; |
| | | roleId: number | null; |
| | | depId: number | null; |
| | | positionId: number | null; |
| | | phone: string; |
| | | email: string; |
| | | gender: number | null; |
| | | positionId: number | null; |
| | | password: string; |
| | | expireTime: string; |
| | | status: number; |
| | |
| | | }, |
| | | departmentData: Array<DeptData>; |
| | | roleData: Array<roleData>; |
| | | dutyData: Array<dutyData>; |
| | | sexList: Array<sexData>; |
| | | } |
| | | |
| | |
| | | identify: '', |
| | | gender: null, // 性别 |
| | | password: '', // 账户密码 |
| | | positionId: 1, // 岗位 |
| | | positionId: null, // 岗位 |
| | | expireTime: '', // 账户过期 |
| | | status: 1 // 用户状态 |
| | | }, |
| | |
| | | realName: [{ required: true, message: '请填写真实姓名', trigger: 'blur' }], |
| | | roleId: [{ required: true, message: '请选择用户角色', trigger: 'change' }], |
| | | depId: [{ required: true, message: '请选择部门', trigger: 'change' }], |
| | | positionId: [{ required: true, message: '请选择职务', trigger: 'change' }], |
| | | phone: [{ required: true, message: '请填写手机号', trigger: 'blur' }], |
| | | gender: [{ required: true, message: '请选择性别', trigger: 'change' }], |
| | | expireTime: [{ required: true, message: '请输入账户过期时间', trigger: 'blur' }], |
| | |
| | | }, |
| | | departmentData: [], // 部门数据 |
| | | roleData: [], //角色数据 |
| | | dutyData:[], //职务数据 |
| | | sexList: [ |
| | | { id: 1, name: '男' }, |
| | | { id: 0, name: '女' } |
| | | ] |
| | | }); |
| | | // 打开弹窗 |
| | | const openDialog = (type: string, value: any, departmentList: [], roleList: []) => { |
| | | const openDialog = (type: string, value: any, departmentList: [], roleList: [], dutyList:[]) => { |
| | | state.isShowUserDialog = true; |
| | | state.departmentData = departmentList; |
| | | state.roleData = roleList; |
| | | state.dutyData = dutyList |
| | | if (type === '新增') { |
| | | state.disabled = false |
| | | state.title = '新增用户'; |
| | |
| | | phone: '', |
| | | email: '', |
| | | identify: '', |
| | | positionId: 1, |
| | | positionId: null, |
| | | gender: null, |
| | | password: '', |
| | | expireTime: '', |