| | |
| | | title="确定要删除该成员吗?" |
| | | @confirm="remove(scope.row.id)" |
| | | > |
| | | <el-button slot="reference" type="danger" size="small">删除</el-button> |
| | | <el-button slot="reference" type="danger" size="small" v-show="false">删除</el-button> |
| | | </el-popconfirm> |
| | | </template> |
| | | </el-table-column> |
| | |
| | | :before-close="handleAddClose" |
| | | :close-on-click-modal="false"> |
| | | <el-form :model="studentForm" :rules="studentRules" ref="studentForm" label-width="100px" class="demo-ruleForm"> |
| | | <el-form-item label="姓名" prop="realName"> |
| | | <el-input v-model="studentForm.realName"></el-input> |
| | | </el-form-item> |
| | | <el-form-item label="性别" prop="sex"> |
| | | <el-select v-model="studentForm.sex"> |
| | | <el-option label="男" :value="1"></el-option> |
| | | <el-option label="女" :value="2"></el-option> |
| | | </el-select> |
| | | </el-form-item> |
| | | <el-form-item label="电话" prop="phone"> |
| | | <el-input v-model="studentForm.phone"></el-input> |
| | | </el-form-item> |
| | | <el-form-item label="登录账号" prop="account"> |
| | | <el-input v-model="studentForm.account"></el-input> |
| | | </el-form-item> |
| | | <el-form-item label="登录密码" prop="password"> |
| | | <el-input v-model="studentForm.password" show-password placeholder="不填写会使用默认202406"></el-input> |
| | | </el-form-item> |
| | | <el-form-item label="真实姓名:" prop="realName" required> |
| | | <el-input v-model="studentForm.realName"></el-input> |
| | | </el-form-item> |
| | | <el-form-item label="手机号码:" prop="phone" required> |
| | | <el-input v-model="studentForm.phone"></el-input> |
| | | </el-form-item> |
| | | <el-form-item label="登录账号:" prop="userName" required> |
| | | <el-input v-model="studentForm.userName" autocomplete="off"></el-input> |
| | | </el-form-item> |
| | | <el-form-item v-if="!studentForm.id" label="登录密码:" prop="password" required> |
| | | <el-input v-model="studentForm.password" show-password autocomplete="off"></el-input> |
| | | </el-form-item> |
| | | <el-form-item label="年龄:"> |
| | | <el-input v-model="studentForm.age"></el-input> |
| | | </el-form-item> |
| | | <el-form-item label="性别:"> |
| | | <el-select v-model="studentForm.sex" placeholder="性别" clearable> |
| | | <el-option v-for="item in sexEnum" :key="item.key" :value="item.key" :label="item.value"></el-option> |
| | | </el-select> |
| | | </el-form-item> |
| | | <el-form-item label="出生日期:"> |
| | | <el-date-picker v-model="studentForm.birthDay" type="date" value-format="yyyy-MM-dd" placeholder="选择日期"/> |
| | | </el-form-item> |
| | | |
| | | <el-form-item label="状态:" required> |
| | | <el-select v-model="studentForm.status" placeholder="状态"> |
| | | <el-option v-for="item in statusEnum" :key="item.key" :value="item.key" :label="item.value"></el-option> |
| | | </el-select> |
| | | </el-form-item> |
| | | </el-form> |
| | | <span slot="footer" class="dialog-footer"> |
| | | <el-button @click="handleAddClose">取 消</el-button> |
| | |
| | | <script> |
| | | // 引入彈出窗口組件 |
| | | import UserApi from '@/api/user' |
| | | import { mapGetters, mapState } from 'vuex' |
| | | import { |
| | | updateClassesUser, |
| | | getClassesUsers, |
| | |
| | | editClassesUser |
| | | } from '@/api/classesUser' |
| | | import Pagination from '@/components/Pagination' |
| | | import {deleteExamById} from "@/api/exam"; |
| | | |
| | | export default { |
| | | components: { Pagination }, |
| | |
| | | realName: '', |
| | | sex: 1, |
| | | phone: '', |
| | | birthDay: '', |
| | | age: null, |
| | | account: '', |
| | | userName: '', |
| | | password: '' |
| | | }, |
| | | studentRules: { |
| | | realName: [ |
| | | { required: true, message: '请填写学员姓名', trigger: 'blur' }, |
| | | { required: true, message: '请填写学员姓名', trigger: 'blur' } |
| | | ], |
| | | sex: [ |
| | | { required: true, message: '请选择学员性别', trigger: 'change' }, |
| | | { required: true, message: '请选择学员性别', trigger: 'change' } |
| | | ], |
| | | phone: [ |
| | | { required: true, message: '请填写学员电话', trigger: 'blur' }, |
| | | { required: true, message: '请填写学员电话', trigger: 'blur' } |
| | | ], |
| | | account: [ |
| | | { required: true, message: '请填写学员登录账号', trigger: 'blur' }, |
| | | userName: [ |
| | | { required: true, message: '请填写学员登录账号', trigger: 'blur' } |
| | | ] |
| | | }, |
| | | studentTitle: '新增学员', |
| | |
| | | formLabelAlign: { |
| | | type: '', |
| | | user: '', |
| | | region: '', |
| | | region: '' |
| | | }, |
| | | tableData: [], |
| | | tableData: [] |
| | | } |
| | | }, |
| | | mounted () { |
| | |
| | | editClassesUser(this.studentForm).then(res => { |
| | | this.addOpen = false |
| | | this.$message.success(res.data.message) |
| | | this.submitForm() |
| | | this.page() |
| | | this.resetStudentForm() |
| | | }) |
| | | }else { |
| | | window.location.reload() |
| | | } else { |
| | | addClassesUser(this.studentForm).then(res => { |
| | | this.addOpen = false |
| | | this.$message.success(res.data.message) |
| | | this.page() |
| | | this.resetStudentForm() |
| | | }) |
| | | window.location.reload() |
| | | } |
| | | } |
| | | }) |
| | | }, |
| | | resetStudentForm () { |
| | | this.studentForm = { |
| | | id: null, |
| | | realName: '', |
| | | sex: '', |
| | | sex: 1, |
| | | phone: '', |
| | | age: null |
| | | birthDay: '', |
| | | age: null, |
| | | userName: '', |
| | | password: '' |
| | | } |
| | | }, |
| | | handleAddClose () { |
| | |
| | | // 生成试卷 |
| | | getCreate () { |
| | | // 跳转到生成页面 |
| | | //跳转到对应的管理页面 |
| | | // 跳转到对应的管理页面 |
| | | this.$router.push({ |
| | | path: '/manage/test-paper-generation', |
| | | path: '/manage/test-paper-generation' |
| | | }) |
| | | }, |
| | | // 弹窗 |
| | | // 接收弹窗组件返回的表单值 |
| | | parentGoods (obj) { |
| | | console.log(obj, '弹窗组件的表单值') |
| | | }, |
| | | } |
| | | }, |
| | | computed: { |
| | | ...mapGetters('enumItem', [ |
| | | 'enumFormat' |
| | | ]), |
| | | ...mapState('enumItem', { |
| | | sexEnum: state => state.user.sexEnum, |
| | | roleEnum: state => state.user.roleEnum, |
| | | statusEnum: state => state.user.statusEnum, |
| | | levelEnum: state => state.user.levelEnum |
| | | }) |
| | | } |
| | | } |
| | | </script> |
| | | <style scoped lang="scss"> |
| | |
| | | margin-right: 5px; |
| | | } |
| | | </style> |
| | | |