|
@@ -15,7 +15,7 @@
|
|
<div class="student_head">
|
|
<div class="student_head">
|
|
<div class="student_search">
|
|
<div class="student_search">
|
|
<span>
|
|
<span>
|
|
- <el-input placeholder="请输入班级名称" v-model="sClassName" clearable>
|
|
|
|
|
|
+ <el-input placeholder="请输入年级名称" v-model="sClassName" clearable>
|
|
</el-input>
|
|
</el-input>
|
|
</span>
|
|
</span>
|
|
<el-button type="primary" @click="searchClass">查询</el-button>
|
|
<el-button type="primary" @click="searchClass">查询</el-button>
|
|
@@ -35,7 +35,7 @@
|
|
<template slot-scope="scope">
|
|
<template slot-scope="scope">
|
|
<el-button type="primary" size="small" @click="getStudent(scope.row.id)">查看班级</el-button>
|
|
<el-button type="primary" size="small" @click="getStudent(scope.row.id)">查看班级</el-button>
|
|
<el-button type="primary" size="small" @click="openUpdate(scope.row.id, scope.row.name)">修改</el-button>
|
|
<el-button type="primary" size="small" @click="openUpdate(scope.row.id, scope.row.name)">修改</el-button>
|
|
- <el-button type="primary" size="small" @click="deleteClass(scope.row.id)">删除</el-button>
|
|
|
|
|
|
+ <el-button type="primary" size="small" @click="deleteGrade(scope.row.id)">删除</el-button>
|
|
</template>
|
|
</template>
|
|
</el-table-column>
|
|
</el-table-column>
|
|
</el-table>
|
|
</el-table>
|
|
@@ -60,16 +60,16 @@
|
|
</div>
|
|
</div>
|
|
<div class="student_head">
|
|
<div class="student_head">
|
|
<div class="head_left">
|
|
<div class="head_left">
|
|
- <el-input v-model="sPhoneUser" class="student_input" placeholder="请输入用户名"></el-input>
|
|
|
|
|
|
+ <el-input v-model="sPhoneUser" class="student_input" placeholder="请输入班级"></el-input>
|
|
<el-select disabled v-model="cid" placeholder="请选择班级" class="student_input" @change="searchStudent"
|
|
<el-select disabled v-model="cid" placeholder="请选择班级" class="student_input" @change="searchStudent"
|
|
style="margin:0 10px">
|
|
style="margin:0 10px">
|
|
- <el-option label="所有人" value=""></el-option>
|
|
|
|
|
|
+ <el-option label="全部年级" value=""></el-option>
|
|
<el-option v-for="(item, index) in classJuri" :key="index" :label="item.name" :value="item.id"></el-option>
|
|
<el-option v-for="(item, index) in classJuri" :key="index" :label="item.name" :value="item.id"></el-option>
|
|
</el-select>
|
|
</el-select>
|
|
<el-button class="student_button" @click="searchStudent">查询</el-button>
|
|
<el-button class="student_button" @click="searchStudent">查询</el-button>
|
|
</div>
|
|
</div>
|
|
<div class="head_right">
|
|
<div class="head_right">
|
|
- <el-button @click="addStudent">添加学生</el-button>
|
|
|
|
|
|
+ <el-button @click="addStudent">添加班级</el-button>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
@@ -78,43 +78,20 @@
|
|
<el-table v-if="ctype == 2" :key="2" ref="table2" :data="tableData2" border :height="tableHeight" :fit="true"
|
|
<el-table v-if="ctype == 2" :key="2" ref="table2" :data="tableData2" border :height="tableHeight" :fit="true"
|
|
v-loading="isLoading" style="width: 100%" :header-cell-style="{ background: '#f1f1f1', fontSize: '17px' }"
|
|
v-loading="isLoading" style="width: 100%" :header-cell-style="{ background: '#f1f1f1', fontSize: '17px' }"
|
|
:row-class-name="tableRowClassName">
|
|
:row-class-name="tableRowClassName">
|
|
- <el-table-column label="姓名" min-width="10" align="center">
|
|
|
|
|
|
+ <el-table-column label="班级" min-width="10" align="center">
|
|
<template slot-scope="scope">
|
|
<template slot-scope="scope">
|
|
- <div class="userImg">
|
|
|
|
- <div class="tx">
|
|
|
|
- <img :src="
|
|
|
|
- scope.row.headportrait != null
|
|
|
|
- ? scope.row.headportrait
|
|
|
|
- : tx
|
|
|
|
- " alt />
|
|
|
|
- </div>
|
|
|
|
- <div style="
|
|
|
|
- width: 150px;
|
|
|
|
- text-align: left;
|
|
|
|
- white-space: nowrap;
|
|
|
|
- overflow: hidden;
|
|
|
|
- text-overflow: ellipsis;
|
|
|
|
- ">
|
|
|
|
|
|
+ <div>
|
|
{{ scope.row.name }}
|
|
{{ scope.row.name }}
|
|
- </div>
|
|
|
|
</div>
|
|
</div>
|
|
</template>
|
|
</template>
|
|
</el-table-column>
|
|
</el-table-column>
|
|
- <el-table-column label="学生账号" min-width="15" align="center">
|
|
|
|
- <template slot-scope="scope">
|
|
|
|
- <div>{{ scope.row.un ? scope.row.un : "" }}</div>
|
|
|
|
- </template>
|
|
|
|
- </el-table-column>
|
|
|
|
- <el-table-column prop="classname2" label="班级" min-width="15" align="center">
|
|
|
|
|
|
+ <el-table-column prop="pnum" label="学生数" min-width="15" align="center">
|
|
</el-table-column>
|
|
</el-table-column>
|
|
<el-table-column label="操作" width="250px">
|
|
<el-table-column label="操作" width="250px">
|
|
<template slot-scope="scope">
|
|
<template slot-scope="scope">
|
|
<div class="btnBox">
|
|
<div class="btnBox">
|
|
<el-button class="de_button" type="primary" size="small"
|
|
<el-button class="de_button" type="primary" size="small"
|
|
- @click="iniPassword(scope.row.userid)">初始化密码</el-button>
|
|
|
|
- <el-button class="de_button" type="primary" size="small" @click="updateStudentA(scope.row)">修改</el-button>
|
|
|
|
- <el-button class="de_button" type="primary" size="small"
|
|
|
|
- @click="deleteClassStudent(scope.row.userid)">移除</el-button>
|
|
|
|
|
|
+ @click="deleteClassStudent(scope.row.id)">移除</el-button>
|
|
<!-- <div class="delete">
|
|
<!-- <div class="delete">
|
|
<img src="../../../assets/remove.png" alt @click="deleteStudent(scope.row.userid, scope.row.state)" />
|
|
<img src="../../../assets/remove.png" alt @click="deleteStudent(scope.row.userid, scope.row.state)" />
|
|
</div> -->
|
|
</div> -->
|
|
@@ -218,61 +195,55 @@
|
|
<el-button class="right" @click="updateStudent">修改</el-button>
|
|
<el-button class="right" @click="updateStudent">修改</el-button>
|
|
</span>
|
|
</span>
|
|
</el-dialog>
|
|
</el-dialog>
|
|
- <el-dialog title="添加班级" :visible.sync="dialogVisible" :append-to-body="true" width="25%" :before-close="handleClose"
|
|
|
|
|
|
+ <el-dialog title="添加年级" :visible.sync="dialogVisible" :append-to-body="true" width="400px" :before-close="handleClose"
|
|
class="dialog_diy">
|
|
class="dialog_diy">
|
|
<el-form>
|
|
<el-form>
|
|
- <el-form-item label="班级名称" :label-width="formLabelWidth">
|
|
|
|
- <el-input v-model="className" auto-complete="off" placeholder="请输入班级..."></el-input>
|
|
|
|
|
|
+ <el-form-item label="添加年级" :label-width="formLabelWidth">
|
|
|
|
+ <el-input v-model="className" auto-complete="off" placeholder="请输入年级..."></el-input>
|
|
</el-form-item>
|
|
</el-form-item>
|
|
</el-form>
|
|
</el-form>
|
|
<span slot="footer" class="dialog-footer">
|
|
<span slot="footer" class="dialog-footer">
|
|
<el-button @click="dialogVisible = false">取 消</el-button>
|
|
<el-button @click="dialogVisible = false">取 消</el-button>
|
|
- <el-button type="primary" @click="insertClass">确 定</el-button>
|
|
|
|
|
|
+ <el-button type="primary" @click="insertGrade">确 定</el-button>
|
|
</span>
|
|
</span>
|
|
</el-dialog>
|
|
</el-dialog>
|
|
- <el-dialog title="修改班级" :visible.sync="dialogVisible1" :append-to-body="true" width="25%" :before-close="handleClose"
|
|
|
|
|
|
+ <el-dialog title="修改年级" :visible.sync="dialogVisible1" :append-to-body="true" width="25%" :before-close="handleClose"
|
|
class="dialog_diy">
|
|
class="dialog_diy">
|
|
<el-form>
|
|
<el-form>
|
|
- <el-form-item label="班级名称" :label-width="formLabelWidth">
|
|
|
|
- <el-input v-model="className1" auto-complete="off" placeholder="请输入班级..."></el-input>
|
|
|
|
|
|
+ <el-form-item label="年级名称" :label-width="formLabelWidth">
|
|
|
|
+ <el-input v-model="className1" auto-complete="off" placeholder="请输入年级..."></el-input>
|
|
</el-form-item>
|
|
</el-form-item>
|
|
</el-form>
|
|
</el-form>
|
|
<span slot="footer" class="dialog-footer">
|
|
<span slot="footer" class="dialog-footer">
|
|
<el-button @click="dialogVisible1 = false">取 消</el-button>
|
|
<el-button @click="dialogVisible1 = false">取 消</el-button>
|
|
- <el-button type="primary" @click="updateClass">确 定</el-button>
|
|
|
|
|
|
+ <el-button type="primary" @click="updateGrade">确 定</el-button>
|
|
</span>
|
|
</span>
|
|
</el-dialog>
|
|
</el-dialog>
|
|
- <el-dialog title="添加学生" :visible.sync="dialogVisibleMember" :append-to-body="true" width="500px" height="80%"
|
|
|
|
|
|
+ <el-dialog title="选择班级" :visible.sync="dialogVisibleMember" :append-to-body="true" width="500px" height="80%"
|
|
:before-close="handleClose" class="addNewPP">
|
|
:before-close="handleClose" class="addNewPP">
|
|
<div class="people">
|
|
<div class="people">
|
|
<div class="people_top">
|
|
<div class="people_top">
|
|
<div class="people_top_right">
|
|
<div class="people_top_right">
|
|
<div class="people_search">
|
|
<div class="people_search">
|
|
- <el-input placeholder="搜索学生姓名" v-model="searchTN" @keyup.enter.native="getClassStudent"></el-input>
|
|
|
|
|
|
+ <el-input placeholder="搜索班级名称" v-model="searchTN" @keyup.enter.native="getClassStudent"></el-input>
|
|
<div class="search_img" @click="getClassStudent">
|
|
<div class="search_img" @click="getClassStudent">
|
|
<img src="../../../assets/icon/search.png" alt />
|
|
<img src="../../../assets/icon/search.png" alt />
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
- <div class="people_nav">选择成员</div>
|
|
|
|
|
|
+ <div class="people_nav">选择班级</div>
|
|
</div>
|
|
</div>
|
|
<div class="t_j_box" style="
|
|
<div class="t_j_box" style="
|
|
padding: 20px 0 0 25px;
|
|
padding: 20px 0 0 25px;
|
|
width: calc(100% - 55px);
|
|
width: calc(100% - 55px);
|
|
margin-left: 25px;
|
|
margin-left: 25px;
|
|
">
|
|
">
|
|
- <span>姓名</span>
|
|
|
|
- <span>账号</span>
|
|
|
|
|
|
+ <span>班级</span>
|
|
</div>
|
|
</div>
|
|
<el-checkbox-group v-model="checkboxList3" class="people_name" v-if="teacherJuri.length" v-loading="isLoading2">
|
|
<el-checkbox-group v-model="checkboxList3" class="people_name" v-if="teacherJuri.length" v-loading="isLoading2">
|
|
- <el-checkbox v-for="item in teacherJuri" :key="item.userid" :label="item.userid">
|
|
|
|
|
|
+ <el-checkbox v-for="item in teacherJuri" :key="item.id" :label="item.id">
|
|
<div class="t_j_box">
|
|
<div class="t_j_box">
|
|
- <el-tooltip placement="top" :content="item.name ? item.name : '暂无姓名'">
|
|
|
|
- <span>{{ item.name ? item.name : "暂无姓名" }}</span>
|
|
|
|
- </el-tooltip>
|
|
|
|
- <el-tooltip placement="top" :content="item.username">
|
|
|
|
- <span>{{ item.username }}</span>
|
|
|
|
- </el-tooltip>
|
|
|
|
|
|
+ <span>{{ item.name }}</span>
|
|
</div>
|
|
</div>
|
|
</el-checkbox>
|
|
</el-checkbox>
|
|
</el-checkbox-group>
|
|
</el-checkbox-group>
|
|
@@ -401,19 +372,19 @@
|
|
this.className1 = n;
|
|
this.className1 = n;
|
|
this.dialogVisible1 = true;
|
|
this.dialogVisible1 = true;
|
|
},
|
|
},
|
|
- //新增班级
|
|
|
|
- insertClass() {
|
|
|
|
|
|
+ //新增年级
|
|
|
|
+ insertGrade() {
|
|
let params = {
|
|
let params = {
|
|
name: this.className,
|
|
name: this.className,
|
|
oid: this.oid,
|
|
oid: this.oid,
|
|
uid: this.userid,
|
|
uid: this.userid,
|
|
};
|
|
};
|
|
this.ajax
|
|
this.ajax
|
|
- .get(this.$store.state.api + "insertClass", params)
|
|
|
|
|
|
+ .get(this.$store.state.api + "insertGrade", params)
|
|
.then((res) => {
|
|
.then((res) => {
|
|
if (res.data[0] && res.data[0][0].classname == 1) {
|
|
if (res.data[0] && res.data[0][0].classname == 1) {
|
|
this.$message({
|
|
this.$message({
|
|
- message: "不能与其他班级名称相同!",
|
|
|
|
|
|
+ message: "不能与其他年级名称相同!",
|
|
type: "error",
|
|
type: "error",
|
|
});
|
|
});
|
|
} else {
|
|
} else {
|
|
@@ -435,19 +406,19 @@
|
|
console.error(err);
|
|
console.error(err);
|
|
});
|
|
});
|
|
},
|
|
},
|
|
- //修改班级
|
|
|
|
- updateClass() {
|
|
|
|
|
|
+ //修改年级
|
|
|
|
+ updateGrade() {
|
|
let params = {
|
|
let params = {
|
|
id: this.classid,
|
|
id: this.classid,
|
|
n: this.className1,
|
|
n: this.className1,
|
|
oid: this.oid,
|
|
oid: this.oid,
|
|
};
|
|
};
|
|
this.ajax
|
|
this.ajax
|
|
- .get(this.$store.state.api + "updateClass", params)
|
|
|
|
|
|
+ .get(this.$store.state.api + "updateGrade", params)
|
|
.then((res) => {
|
|
.then((res) => {
|
|
if (res.data[0] && res.data[0][0].classname == 1) {
|
|
if (res.data[0] && res.data[0][0].classname == 1) {
|
|
this.$message({
|
|
this.$message({
|
|
- message: "不能与其他班级名称相同!",
|
|
|
|
|
|
+ message: "不能与其他年级名称相同!",
|
|
type: "error",
|
|
type: "error",
|
|
});
|
|
});
|
|
} else {
|
|
} else {
|
|
@@ -469,7 +440,7 @@
|
|
console.error(err);
|
|
console.error(err);
|
|
});
|
|
});
|
|
},
|
|
},
|
|
- //获取班级列表
|
|
|
|
|
|
+ //获取年级列表
|
|
getClass() {
|
|
getClass() {
|
|
this.isLoading = true;
|
|
this.isLoading = true;
|
|
let params = {
|
|
let params = {
|
|
@@ -480,7 +451,7 @@
|
|
page: this.page,
|
|
page: this.page,
|
|
};
|
|
};
|
|
this.ajax
|
|
this.ajax
|
|
- .get(this.$store.state.api + "selectClass", params)
|
|
|
|
|
|
+ .get(this.$store.state.api + "selectGrade", params)
|
|
.then((res) => {
|
|
.then((res) => {
|
|
this.isLoading = false;
|
|
this.isLoading = false;
|
|
this.total = res.data[0].length > 0 ? res.data[0][0].num : 0;
|
|
this.total = res.data[0].length > 0 ? res.data[0][0].num : 0;
|
|
@@ -491,20 +462,20 @@
|
|
console.error(err);
|
|
console.error(err);
|
|
});
|
|
});
|
|
},
|
|
},
|
|
- //删除班级
|
|
|
|
- deleteClass(id) {
|
|
|
|
|
|
+ //删除年级
|
|
|
|
+ deleteGrade(id) {
|
|
let params = {
|
|
let params = {
|
|
id: id,
|
|
id: id,
|
|
};
|
|
};
|
|
if (this.time()) {
|
|
if (this.time()) {
|
|
- this.$confirm("确定删除此班级吗?", "提示", {
|
|
|
|
|
|
+ this.$confirm("确定删除此年级吗?", "提示", {
|
|
confirmButtonText: "确定",
|
|
confirmButtonText: "确定",
|
|
cancelButtonText: "取消",
|
|
cancelButtonText: "取消",
|
|
type: "warning",
|
|
type: "warning",
|
|
})
|
|
})
|
|
.then(() => {
|
|
.then(() => {
|
|
this.ajax
|
|
this.ajax
|
|
- .get(this.$store.state.api + "deleteClass", params)
|
|
|
|
|
|
+ .get(this.$store.state.api + "deleteGrade", params)
|
|
.then((res) => {
|
|
.then((res) => {
|
|
this.$message({
|
|
this.$message({
|
|
message: "删除成功",
|
|
message: "删除成功",
|
|
@@ -633,7 +604,7 @@
|
|
this.$message.error("学生姓名不能为空");
|
|
this.$message.error("学生姓名不能为空");
|
|
return;
|
|
return;
|
|
} else if (!this.userinfo.classid) {
|
|
} else if (!this.userinfo.classid) {
|
|
- this.$message.error("请为学生选择班级");
|
|
|
|
|
|
+ this.$message.error("请为学生选择年级");
|
|
return;
|
|
return;
|
|
} else if (
|
|
} else if (
|
|
this.userinfo.phonenumber &&
|
|
this.userinfo.phonenumber &&
|
|
@@ -702,14 +673,14 @@
|
|
},
|
|
},
|
|
deleteClassStudent(id) {
|
|
deleteClassStudent(id) {
|
|
let params = [{ uid: id, cid: this.cid }];
|
|
let params = [{ uid: id, cid: this.cid }];
|
|
- this.$confirm("确定移除此学生在本班级吗?", "提示", {
|
|
|
|
|
|
+ this.$confirm("确定移除此班级在本年级吗?", "提示", {
|
|
confirmButtonText: "确定",
|
|
confirmButtonText: "确定",
|
|
cancelButtonText: "取消",
|
|
cancelButtonText: "取消",
|
|
type: "warning",
|
|
type: "warning",
|
|
})
|
|
})
|
|
.then(() => {
|
|
.then(() => {
|
|
this.ajax
|
|
this.ajax
|
|
- .post(this.$store.state.api + "deleteClassStudent", params)
|
|
|
|
|
|
+ .post(this.$store.state.api + "deleteGradeClass", params)
|
|
.then((res) => {
|
|
.then((res) => {
|
|
this.$message({
|
|
this.$message({
|
|
message: "操作成功",
|
|
message: "操作成功",
|
|
@@ -731,7 +702,7 @@
|
|
oid: this.oid,
|
|
oid: this.oid,
|
|
};
|
|
};
|
|
this.ajax
|
|
this.ajax
|
|
- .get(this.$store.state.api + "selectClassBySchool", params)
|
|
|
|
|
|
+ .get(this.$store.state.api + "selectGrageBySchool", params)
|
|
.then((res) => {
|
|
.then((res) => {
|
|
this.isLoading = false;
|
|
this.isLoading = false;
|
|
this.classJuri = res.data[0];
|
|
this.classJuri = res.data[0];
|
|
@@ -771,14 +742,13 @@
|
|
this.ctype = 2
|
|
this.ctype = 2
|
|
this.isLoading = true;
|
|
this.isLoading = true;
|
|
let params = {
|
|
let params = {
|
|
- oid: this.oid,
|
|
|
|
cid: this.cid,
|
|
cid: this.cid,
|
|
- cu: "",
|
|
|
|
|
|
+ oid: this.oid,
|
|
cn: this.sPhoneUser,
|
|
cn: this.sPhoneUser,
|
|
page: this.page2,
|
|
page: this.page2,
|
|
};
|
|
};
|
|
this.ajax
|
|
this.ajax
|
|
- .get(this.$store.state.api + "selectStudent2", params)
|
|
|
|
|
|
+ .get(this.$store.state.api + "selectClass2", params)
|
|
.then((res) => {
|
|
.then((res) => {
|
|
this.isLoading = false;
|
|
this.isLoading = false;
|
|
this.total2 = res.data[0].length > 0 ? res.data[0][0].num : 0;
|
|
this.total2 = res.data[0].length > 0 ? res.data[0][0].num : 0;
|
|
@@ -800,7 +770,7 @@
|
|
num: this.pageSize3,
|
|
num: this.pageSize3,
|
|
};
|
|
};
|
|
this.ajax
|
|
this.ajax
|
|
- .get(this.$store.state.api + "getClassStudent", params)
|
|
|
|
|
|
+ .get(this.$store.state.api + "getGradeClass", params)
|
|
.then((res) => {
|
|
.then((res) => {
|
|
this.isLoading2 = false;
|
|
this.isLoading2 = false;
|
|
this.total3 = res.data[0].length > 0 ? res.data[0][0].num : 0;
|
|
this.total3 = res.data[0].length > 0 ? res.data[0][0].num : 0;
|
|
@@ -813,7 +783,7 @@
|
|
},
|
|
},
|
|
addClassStudent() {
|
|
addClassStudent() {
|
|
if (!this.checkboxList3.length) {
|
|
if (!this.checkboxList3.length) {
|
|
- this.$message.error('请选择要添加班级的学生');
|
|
|
|
|
|
+ this.$message.error('请选择要添加的班级');
|
|
return;
|
|
return;
|
|
}
|
|
}
|
|
let params = [{
|
|
let params = [{
|
|
@@ -821,7 +791,7 @@
|
|
student: JSON.stringify(this.checkboxList3)
|
|
student: JSON.stringify(this.checkboxList3)
|
|
}];
|
|
}];
|
|
this.ajax
|
|
this.ajax
|
|
- .post(this.$store.state.api + "addClassStudent", params)
|
|
|
|
|
|
+ .post(this.$store.state.api + "addGradeClass", params)
|
|
.then((res) => {
|
|
.then((res) => {
|
|
this.checkboxList3 = []
|
|
this.checkboxList3 = []
|
|
this.dialogVisibleMember = false
|
|
this.dialogVisibleMember = false
|
|
@@ -1198,7 +1168,7 @@
|
|
}
|
|
}
|
|
|
|
|
|
.t_j_box span:nth-child(1) {
|
|
.t_j_box span:nth-child(1) {
|
|
- width: 50%;
|
|
|
|
|
|
+ width: 100%;
|
|
overflow: hidden;
|
|
overflow: hidden;
|
|
margin-right: 10px;
|
|
margin-right: 10px;
|
|
text-overflow: ellipsis;
|
|
text-overflow: ellipsis;
|