班级管理修改

master
4 years ago
parent 7ae8cc955f
commit 9df7d84e37
  1. 2
      src/components/page/AddAssessment.vue
  2. 70
      src/components/page/ClassStudent.vue
  3. 17
      src/components/page/Dashboard.vue
  4. 14
      src/utils/api.js

@ -220,7 +220,7 @@ export default {
data.pageNo = this.pageNo
data.pageSize = this.pageSize
data.projectName = ''
data.projectPermissions = 2
data.projectPermissions = 1
this.$get(this.api.queryAllManagements,data).then(res => {
this.projectData = res.pageInfo.list
this.totals = res.pageInfo.total

@ -30,8 +30,8 @@
</el-table-column>
<el-table-column label="操作" align="center" width="300">
<template slot-scope="scope">
<el-button type="text" @click="editStudent(scope.row,true)">查看</el-button>
<el-button type="text" @click="editStudent(scope.row,false)">编辑</el-button>
<el-button type="text" @click="editStudent(scope.row,true,true)">查看</el-button>
<el-button type="text" @click="editStudent(scope.row,false,false)">编辑</el-button>
<el-button type="text" @click="resetPassword(scope.row)">重置密码</el-button>
<el-button type="text" @click="handleDelete(scope.row)">删除</el-button>
<el-switch
@ -50,9 +50,17 @@
</div>
</el-card>
<el-dialog :title="isDetail ? '查看学生' : (isAdd ? '新增学生' : '编辑学生')" :visible.sync="studentVisible"
<el-dialog :title="isRepeat ? '查看学生' : (isAdd ? '新增学生' : '编辑学生')" :visible.sync="studentVisible"
width="30%" center @close="closeStudent" class="dialog" :close-on-click-modal="false">
<el-form ref="form" :model="form" :rules="rules" :disabled="isDetail" label-width="100px">
<el-form-item prop="schoolAppellationId" label="所在院校">
<el-select v-model="form.schoolAppellationId" placeholder="默认为当前院校(可修改)" filterable @change="worknumberChange">
<el-option v-for="(item,index) in schoolList" :key="index" :label="item.schoolName" :value="item.schoolId"></el-option>
</el-select>
</el-form-item>
<el-form-item prop="workNumber" label="学生学号">
<el-input v-model="form.workNumber" placeholder="请输入学生学号" @change="worknumberChange"></el-input>
</el-form-item>
<el-form-item prop="account" label="账号">
<el-input v-model="form.account" placeholder="请输入学生账号" @change="accountChange"></el-input>
</el-form-item>
@ -62,25 +70,17 @@
<el-form-item prop="roleId" label="账号角色">
学生
</el-form-item>
<el-form-item prop="workNumber" label="学生学号">
<el-input v-model="form.workNumber" placeholder="" @change="worknumberChange"></el-input>
</el-form-item>
<el-form-item prop="phone" label="手机号">
<el-input v-model="form.phone" placeholder="可用于登录平台,以及找回密码" maxlength="11"></el-input>
</el-form-item>
<el-form-item prop="email" label="邮箱">
<el-input v-model="form.email" placeholder="可用于登录平台,以及找回密码"></el-input>
</el-form-item>
<el-form-item prop="schoolAppellationId" label="所在院校">
<el-select v-model="form.schoolAppellationId" placeholder="默认为当前院校(可修改)" filterable @change="worknumberChange">
<el-option v-for="(item,index) in schoolList" :key="index" :label="item.schoolName" :value="item.schoolId"></el-option>
</el-select>
</el-form-item>
<el-form-item prop="uniqueIdentificationAccount" label="唯一标识">
<el-input disabled v-model="form.uniqueIdentificationAccount"></el-input>
</el-form-item>
</el-form>
<span slot="footer" class="dialog-footer" v-if="!isDetail">
<span slot="footer" class="dialog-footer" v-if="!isRepeat">
<el-button @click="studentVisible = false">取消</el-button>
<el-button type="primary" @click="saveData"> </el-button>
</span>
@ -146,6 +146,7 @@ export default {
data() {
return {
isDetail: false,
isRepeat: false,
keyword: '',
schoolId: 2105,
classId: this.$route.query.classId,
@ -213,7 +214,6 @@ export default {
phoneRepeat: false,
workNumberRepeat: false,
originalWorkNumber: '',
isDetail: false,
resetVisible: false,
passwordVisible: false,
passwordForm: {
@ -236,7 +236,7 @@ export default {
this.getSchoolData()
},
watch: {
keyword: function(val) {
keyword (val) {
this.getData()
}
},
@ -245,8 +245,8 @@ export default {
let data = {
classId: this.classId,
searchContent: this.encodeString(this.keyword),
page: this.pageNo,
size: this.pageSize
current: this.pageNo,
pageSize: this.pageSize
}
this.$post(this.api.queryStudentList,data).then(res => {
this.studentData = res.data.list
@ -257,9 +257,9 @@ export default {
this.$refs.form.validate((valid) => {
if (valid) {
if(this.accountReapeat) return this.$message.warning(this.accountMsg)
if(this.workNumberRepeat) return this.$message.warning('该学生学号已存在')
if(this.phoneRepeat) return this.$message.warning('该手机号已存在')
if(this.form.studentId) {
// if(this.workNumberRepeat) return this.$message.warning('')
// if(this.phoneRepeat) return this.$message.warning('')
if(!this.isAdd) {
this.form.classId = this.classId
this.$put(this.api.updateStudent,this.form).then(res => {
if(res.errmessage == 'success') {
@ -272,15 +272,17 @@ export default {
}).catch(res => {});
}else{
this.form.classId = this.classId
this.form.uniqueIdentificationAccount = new Date().getTime()
if(this.form.uniqueIdentificationAccount == ''){
this.form.uniqueIdentificationAccount = new Date().getTime()
}
this.$post(this.api.addStudentToClass,this.form).then(res => {
if(res.errmessage == 'success') {
// if(res.errmessage == 'success') {
this.$message.success('提交成功!');
this.studentVisible = false
this.getData()
}else{
this.$message.error(res.message);
}
// }else{
// this.$message.error(res.message);
// }
}).catch(res => {});
}
}else{
@ -308,16 +310,21 @@ export default {
},
async worknumberChange(){
// if(this.form.workNumber !== this.originalWorkNumber){
let res = await this.$get(this.api.queryWorkNumberIsExist, {
let res = await this.$get(this.api.queryStudentMessage, {
workNumber: this.encodeString(this.form.workNumber),
schoolAppellationId: this.form.schoolAppellationId
});
if(res.status != 200){
this.$message.warning('该学生学号已存在');
this.workNumberRepeat = true
if(res.data){
this.form = res.data
this.isDetail = true
}else{
this.workNumberRepeat = false
this.isDetail = false
}
// if(res.status != 200){
// this.workNumberRepeat = true
// }else{
// this.workNumberRepeat = false
// }
// }else{
// this.workNumberRepeat = false
// }
@ -325,7 +332,7 @@ export default {
async phoneChange(){
let res = await this.$get(this.api.queryPhone, { phone: this.form.phone });
if(res.message.length != 0){
this.$message.warning('该手机号已存在');
// this.$message.warning('');
this.phoneRepeat = true
}else{
this.phoneRepeat = false
@ -377,9 +384,10 @@ export default {
this.isAdd = true
this.studentVisible = true
},
editStudent(row,isDetail){
editStudent(row,isDetail,isRepeat){
this.isAdd = false
this.isDetail = isDetail
this.isRepeat = isRepeat
this.studentVisible = true
this.form = Object.assign({},row)
this.originalWorkNumber = row.workNumber

@ -76,7 +76,7 @@
</div>
<div class="list-btn flex-around editor-btn">
<el-button type="text" icon="el-icon-edit" @click="editClass(item)">编辑</el-button>
<el-button type="text" icon="el-icon-delete" @click="delClass(item)">删除</el-button>
<el-button type="text" icon="el-icon-delete" @click="delClass(item,index)">删除</el-button>
</div>
</el-card>
</el-col>
@ -98,7 +98,7 @@
</el-form-item>
<el-form-item label="班级年份" prop="classYear">
<el-date-picker v-model="classForm.classYear" align="right" type="year" style="margin-left: 10px;"
placeholder="请选择班级年份" format="yyyy" value-format="yyyy" clearable></el-date-picker>
:picker-options="classYearOptions" @focus="clickYear" placeholder="请选择班级年份" format="yyyy" value-format="yyyy" clearable></el-date-picker>
</el-form-item>
<el-form-item label="所属学期" prop="classSemester">
<el-select v-model="classForm.classSemester" placeholder="请选择所属学期">
@ -192,7 +192,8 @@ export default {
pageNo: 1,
pageSize: 1000,
userId: this.$store.state.userLoginId,
roleId: Number(this.$store.state.userRoleId)
roleId: Number(this.$store.state.userRoleId),
classYearOptions: {}
};
},
watch: {
@ -269,6 +270,14 @@ export default {
}
}
},
//
clickYear(){
this.classYearOptions.disabledDate = time => {
if (time.getFullYear() > new Date().getFullYear()) {
return true
}
}
},
//
addClass(){
this.classId = ''
@ -290,7 +299,7 @@ export default {
}
},
//
delClass(item){
delClass(item,index){
this.$confirm('确定要删除该班级吗?', '提示', {
type: 'warning'
})

@ -7,13 +7,20 @@
let uploadURL = 'http://8.134.8.197:8001'
let host = ''
let host1 = ''
if(process.env.NODE_ENV === 'development'){
host = 'http://122.9.154.146'
// host = 'http://122.9.154.146'
host1 = 'http://192.168.31.137:8090'
host = 'http://192.168.31.137:9090'
}
export default {
<<<<<<< Updated upstream
logins: `${host}/liuwanr/userInfo/adminLogins`, //登录
queryToken: `${host}/liuwanr/userInfo/queryToken`,
=======
logins: `${host1}/liuwanr/userInfo/adminLogins`, //登录
>>>>>>> Stashed changes
fileupload: `${uploadURL}/oss/manage/fileupload`,
updateLogInNumber: `${host}/liuwanr/userInfo/updateLogInNumber`, //用户登录修改登录次数和登陆时间
@ -22,10 +29,10 @@ export default {
queryCity: `${host}/liuwanr/city/queryCity`, //查询城市
querySchoolData: `${host}/liuwanr/customer/querySchool`, //根据学校名称查询学校信息
queryAccountIsExist:`${host}/liuwanr/userInfo/queryAccountIsExist`,//查询员工,学生账号是否存在接口
queryAccountIsExist:`${host1}/liuwanr/userInfo/queryAccountIsExist`,//查询员工,学生账号是否存在接口
queryWorkNumberIsExist:`${host}/evaluation/tms/userInfo/queryWorkNumberIsExist`,//查询学号是否存在
queryWorkNumberIsExist1:`${host}/liuwanr/userInfo/queryWorkNumberIsExist`,//查询工号是否存在
querySchool: `${host}/liuwanr/customer/querySchool`, //根据学校名称查询学校信息
querySchool: `${host1}/liuwanr/customer/querySchool`, //根据学校名称查询学校信息
queryPersonalCenter:`${host}/liuwanr/personalCenter/queryPersonalCenter`,
addStaffPro: `${host}/liuwanr/staffProfessionalArchitecture/addStaffProfessionalArchitecture`, //添加员工专业
@ -179,6 +186,7 @@ export default {
queryStudentList: `${host}/evaluation/class/management/queryStudentList`, //学生列表
deleteStudents: `${host}/evaluation/class/management/deleteStudents`, //删除学生
addStudentToClass: `${host}/evaluation/class/management/addStudentToClass`, //新增学生
queryStudentMessage: `${host}/evaluation/tms/student/queryStudentMessage`, //根据院校和学号查询学生信息
uploadStudents: `${host}/evaluation/class/management/uploadFile`, //批量导入学生到班级
classAssessmentList: `${host}/evaluation/class/management/classAssessmentList`, //成绩管理列表

Loading…
Cancel
Save