| | |
| | | <el-form-item label="重复密码:" prop="confirmPassword" v-if="state.title == '新增' || state.title == '修改密码'"> |
| | | <el-input v-model.trim="state.form.confirmPassword" type="password" show-password placeholder="请输入确认密码"></el-input> |
| | | </el-form-item> |
| | | <el-form-item label="所属部门账号:" prop="createBy" v-if="state.title !== '修改密码' && (currentUserType === 1 || currentUserType === 4)"> |
| | | <!-- <el-form-item label="所属部门账号:" prop="createBy" v-if="state.title !== '修改密码' && (currentUserType === 1 || currentUserType === 4)">--> |
| | | <!-- <el-select--> |
| | | <!-- clearable--> |
| | | <!-- v-model="state.form.createBy"--> |
| | | <!-- filterable--> |
| | | <!-- remote--> |
| | | <!-- @change="selectValue"--> |
| | | <!-- reserve-keyword--> |
| | | <!-- placeholder="请输入部门账号名称"--> |
| | | <!-- remote-show-suffix--> |
| | | <!-- :remote-method="getDeptUserList"--> |
| | | <!-- :loading="loading"--> |
| | | <!-- style="width: 100%"--> |
| | | <!-- >--> |
| | | <!-- <el-option--> |
| | | <!-- v-for="item in state.deptUserList"--> |
| | | <!-- :key="item.id"--> |
| | | <!-- :label="item.name"--> |
| | | <!-- :value="item.name"--> |
| | | <!-- />--> |
| | | <!-- </el-select>--> |
| | | <!-- </el-form-item>--> |
| | | <el-form-item label="部门:" prop="deptId" v-if="state.title !== '修改密码'"> |
| | | <el-select |
| | | clearable |
| | | v-model="state.form.createBy" |
| | | filterable |
| | | remote |
| | | @change="selectValue" |
| | | reserve-keyword |
| | | placeholder="请输入部门账号名称" |
| | | remote-show-suffix |
| | | :remote-method="getDeptUserList" |
| | | :loading="loading" |
| | | v-model="state.form.deptId" |
| | | placeholder="请选择部门" |
| | | style="width: 100%" |
| | | > |
| | | <el-option |
| | | v-for="item in state.deptUserList" |
| | | :key="item.id" |
| | | :label="item.name" |
| | | :value="item.name" |
| | | v-for="item in state.deptList" |
| | | :key="item.deptId" |
| | | :label="item.deptName" |
| | | :value="item.deptId" |
| | | /> |
| | | </el-select> |
| | | </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:{ |
| | |
| | | confirmPassword: [{ required: true, validator: equalToPassword, trigger: 'blur' }], |
| | | phone: [{ required: true, validator: validateUserPhone, trigger: 'blur' }], |
| | | idNo: [{ required: true, validator: validateIdNo, trigger: 'blur' }], |
| | | createBy: [{ required: true, message: '请输入所属部门名称', trigger: 'blur' }], |
| | | // createBy: [{ required: true, message: '请输入所属部门名称', trigger: 'blur' }], |
| | | |
| | | }, |
| | | 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) |