| | |
| | | /> |
| | | </el-select> |
| | | </el-form-item> |
| | | <el-form-item label="部门:" prop="deptId" v-if="state.title !== '修改密码'"> |
| | | <el-select |
| | | v-model="state.form.deptId" |
| | | placeholder="请选择部门" |
| | | style="width: 100%" |
| | | > |
| | | <el-option |
| | | v-for="item in state.deptList" |
| | | :key="item.deptId" |
| | | :label="item.deptName" |
| | | :value="item.deptId" |
| | | /> |
| | | </el-select> |
| | | </el-form-item> |
| | | <el-form-item label="工号:" prop="empno" v-if="state.title !== '修改密码'"> |
| | | <el-input v-model.trim="state.form.empno" :disabled="disabled" placeholder="请输入工号" ></el-input> |
| | | </el-form-item> |
| | |
| | | import {addStudent, checkStuIdNo, checkStuPhone, editStudent} from "@/api/onlineEducation/student"; |
| | | import {getCompany} from "@/api/onlineEducation/company"; |
| | | import {getUser} from "@/api/onlineEducation/user"; |
| | | import {getDept} from "@/api/qualityObjectives/object"; |
| | | const emit = defineEmits(["getList"]); |
| | | const dialogVisible = ref(false) |
| | | const superRef = ref(null) |
| | |
| | | idNo: '', |
| | | createId: null, |
| | | createBy: '', |
| | | userType: null |
| | | userType: null, |
| | | deptId: null |
| | | |
| | | }, |
| | | formRules:{ |
| | |
| | | |
| | | }, |
| | | isAdmin: false, |
| | | deptUserList: [] |
| | | deptUserList: [], |
| | | deptList: [] |
| | | |
| | | }) |
| | | const startPhone = ref(''); |
| | | const startIdNo = ref(''); |
| | | const UisMounted = ref(false); |
| | | onMounted(() => { |
| | | onMounted(async () => { |
| | | UisMounted.value = true; |
| | | await getDeptList() |
| | | |
| | | }); |
| | | |
| | | const getDeptList = async () => { |
| | | const param = { |
| | | pageNum: 1, |
| | | pageSize: 999, |
| | | companyId: state.form.companyId |
| | | } |
| | | const res = await getDept(param) |
| | | if(res.code === 200){ |
| | | state.deptList = res.data |
| | | } |
| | | } |
| | | const currentUserType = ref(null) |
| | | const disabled = ref(false); |
| | | const openDialog = async (type, value) => { |
| | |
| | | if(valid){ |
| | | if(state.title == '新增'){ |
| | | const {confirmPassword,id,...data} = state.form |
| | | |
| | | data.password = Base64.encode(data.password) |
| | | const res = await addStudent(data) |
| | | if(res.code == 200){ |
| | |
| | | ElMessage.warning(res.message) |
| | | } |
| | | }else if(state.title == '编辑'){ |
| | | const {id, name, phone, sex, companyId, empno, post, duty, idNo,createId,createBy} = state.form |
| | | const data = {id, name, phone, sex, companyId, empno, post, duty, idNo,createId,createBy} |
| | | const {id, name, phone, sex, companyId, empno, post, duty,deptId, idNo,createId,createBy} = state.form |
| | | const data = {id, name, phone, sex, companyId, empno, post, deptId, duty, idNo,createId,createBy} |
| | | const res = await editStudent(data) |
| | | if(res.code == 200){ |
| | | ElMessage.success(res.message) |