|
@@ -53,7 +53,7 @@
|
|
|
value="false"></el-option>
|
|
|
</el-select>
|
|
|
</el-form-item>
|
|
|
- <el-form-item prop="hasCourse">
|
|
|
+ <!-- <el-form-item prop="hasCourse">
|
|
|
<el-select class="multiple"
|
|
|
v-model.trim="searchForm.hasCourse"
|
|
|
clearable
|
|
@@ -63,7 +63,7 @@
|
|
|
<el-option label="无"
|
|
|
value="0"></el-option>
|
|
|
</el-select>
|
|
|
- </el-form-item>
|
|
|
+ </el-form-item> -->
|
|
|
<!-- <el-form-item prop="isMake">
|
|
|
<el-select
|
|
|
class="multiple"
|
|
@@ -75,7 +75,7 @@
|
|
|
<el-option label="否" value="false"></el-option>
|
|
|
</el-select>
|
|
|
</el-form-item> -->
|
|
|
- <el-form-item prop="hasPracticeCourse">
|
|
|
+ <!-- <el-form-item prop="hasPracticeCourse">
|
|
|
<el-select class="multiple"
|
|
|
v-model.trim="searchForm.hasPracticeCourse"
|
|
|
clearable
|
|
@@ -85,7 +85,7 @@
|
|
|
<el-option label="否"
|
|
|
value="false"></el-option>
|
|
|
</el-select>
|
|
|
- </el-form-item>
|
|
|
+ </el-form-item> -->
|
|
|
<el-form-item prop="hasCourse">
|
|
|
<el-select class="multiple"
|
|
|
v-model.trim="searchForm.operatingTag"
|
|
@@ -132,6 +132,9 @@
|
|
|
prop="organName"
|
|
|
label="所属分部"></el-table-column>
|
|
|
<el-table-column align="center"
|
|
|
+ prop="subjectName"
|
|
|
+ label="声部"></el-table-column>
|
|
|
+ <el-table-column align="center"
|
|
|
prop="teacherName"
|
|
|
label="指导老师"></el-table-column>
|
|
|
<el-table-column align="center"
|
|
@@ -183,7 +186,7 @@
|
|
|
width="180px"
|
|
|
label="操作">
|
|
|
<template slot-scope="scope">
|
|
|
- <router-link style="color:#409EFF"
|
|
|
+ <router-link style="color:#409EFF; padding-right: 10px;"
|
|
|
v-permission="'/studentDetail'"
|
|
|
:to="{path:`/business/studentDetail?userId=${scope.row.userId}`,query:{search:JSON.stringify(searchForm),rules:JSON.stringify(pageInfo),studentName:scope.row.username}}">查看</router-link>
|
|
|
<el-button type="text"
|
|
@@ -193,6 +196,9 @@
|
|
|
<el-button v-permission="'api-auth/user/updatePassword2'"
|
|
|
@click="resetPassWrod(scope.row)"
|
|
|
type="text">修改密码</el-button>
|
|
|
+ <el-button type="text"
|
|
|
+ @click="lookContracts(scope.row)"
|
|
|
+ v-permission="'sysUserContracts/getLatest'">下载协议</el-button>
|
|
|
</template>
|
|
|
</el-table-column>
|
|
|
</el-table>
|
|
@@ -205,15 +211,15 @@
|
|
|
</div>
|
|
|
<el-dialog :title="maskName"
|
|
|
width="700px"
|
|
|
- label-width="100px"
|
|
|
label-position="right"
|
|
|
class="studentInfo"
|
|
|
+ @close="onMaskClose('studentForm')"
|
|
|
:close-on-click-modal='false'
|
|
|
:visible.sync="studentVisible">
|
|
|
<el-divider>基本信息</el-divider>
|
|
|
<el-form :model="studentForm"
|
|
|
:inline="true"
|
|
|
- label-width="80px"
|
|
|
+ label-width="120px"
|
|
|
label-position="right"
|
|
|
ref="studentForm"
|
|
|
:rules="studentRules">
|
|
@@ -248,10 +254,26 @@
|
|
|
v-model.trim="studentForm.sex"
|
|
|
clearable
|
|
|
placeholder="请选择性别">
|
|
|
- <el-option :value="0"
|
|
|
- label="女"></el-option>
|
|
|
<el-option :value="1"
|
|
|
label="男"></el-option>
|
|
|
+ <el-option :value="0"
|
|
|
+ label="女"></el-option>
|
|
|
+ </el-select>
|
|
|
+ </el-form-item>
|
|
|
+ <el-form-item label="学生声部"
|
|
|
+ prop="subjectIdList">
|
|
|
+ <el-select v-model.trim="studentForm.subjectIdList"
|
|
|
+ filterable
|
|
|
+ clearable
|
|
|
+ placeholder="学员声部">
|
|
|
+ <el-option-group v-for="group in subjectList"
|
|
|
+ :key="group.label"
|
|
|
+ :label="group.label">
|
|
|
+ <el-option v-for="item in group.options"
|
|
|
+ :key="item.value"
|
|
|
+ :label="item.label"
|
|
|
+ :value="item.value"></el-option>
|
|
|
+ </el-option-group>
|
|
|
</el-select>
|
|
|
</el-form-item>
|
|
|
|
|
@@ -289,12 +311,13 @@
|
|
|
:key="index"></el-option>
|
|
|
</el-select>
|
|
|
</el-form-item>
|
|
|
- <el-form-item label="家长姓名">
|
|
|
+ <el-form-item label="家长姓名" prop="parseName">
|
|
|
<el-input v-model.trim="studentForm.parseName"></el-input>
|
|
|
</el-form-item>
|
|
|
|
|
|
- <el-form-item label="出生日期">
|
|
|
+ <el-form-item label="出生日期" prop="date">
|
|
|
<el-date-picker v-model.trim="studentForm.date"
|
|
|
+ style="width: 185px;"
|
|
|
value-format="yyyy-MM-dd"
|
|
|
type="date"
|
|
|
:picker-options="{
|
|
@@ -336,19 +359,19 @@
|
|
|
:inline="true">
|
|
|
<el-form-item label="手机号"
|
|
|
prop="phone"
|
|
|
- label-width="80px"
|
|
|
+ label-width="120px"
|
|
|
:rules="[{ required: true, message: '手机号不能为空',trigger: 'blur'},{pattern: /^1[3456789]\d{9}$/, message: '请输入正确的手机号',trigger: 'blur' }]">
|
|
|
<el-input v-model.trim="passwrodForm.phone"></el-input>
|
|
|
</el-form-item>
|
|
|
<el-form-item label="输入密码"
|
|
|
prop="password"
|
|
|
- label-width="80px"
|
|
|
+ label-width="120px"
|
|
|
:rules="[{ required: true, message: '密码不能为空',trigger: 'blur'},{pattern:/^[\w]{6,20}$/,message:'密码为6-20位',trigger: 'blur'}]">
|
|
|
<el-input v-model.trim="passwrodForm.password"></el-input>
|
|
|
</el-form-item>
|
|
|
<el-form-item label="再次输入"
|
|
|
prop="password2"
|
|
|
- label-width="80px"
|
|
|
+ label-width="120px"
|
|
|
:rules="[{ required: true, message: '密码不能为空',trigger: 'blur'},{pattern:/^[\w]{6,20}$/,message:'密码为6-20位',trigger: 'blur'}]">
|
|
|
<el-input v-model.trim="passwrodForm.password2"></el-input>
|
|
|
</el-form-item>
|
|
@@ -369,11 +392,13 @@ import {
|
|
|
getStudentInfoByPhone,
|
|
|
registerStudent,
|
|
|
updateStudent,
|
|
|
- studentHasCourse
|
|
|
+ studentHasCourse,
|
|
|
+ getLatest
|
|
|
} from "@/api/studentManager";
|
|
|
import cleanDeep from 'clean-deep'
|
|
|
import { vaildStudentUrl } from "@/utils/validate";
|
|
|
import { getEmployeeOrgan, resetPassword2, getTeacher } from "@/api/buildTeam";
|
|
|
+import { subjectListTree } from '@/api/specialSetting'
|
|
|
import QRCode from "qrcodejs2";
|
|
|
import store from "@/store";
|
|
|
import axios from "axios";
|
|
@@ -404,6 +429,7 @@ export default {
|
|
|
organList: [],
|
|
|
teacherList: [],
|
|
|
maskTeacherList: [],
|
|
|
+ subjectList: [], // 声部列表
|
|
|
pageInfo: {
|
|
|
// 分页规则
|
|
|
limit: 10, // 限制显示条数
|
|
@@ -418,17 +444,17 @@ export default {
|
|
|
sex: "",
|
|
|
parseName: "",
|
|
|
date: "",
|
|
|
- nation: "",
|
|
|
serviceTag: null,
|
|
|
operatingTag: null,
|
|
|
- teacherId: null
|
|
|
+ teacherId: null,
|
|
|
+ subjectIdList: null
|
|
|
},
|
|
|
studentRules: {
|
|
|
name: [{ required: true, message: "请输入学生姓名" }],
|
|
|
sex: [{ required: true, message: "请选择学生性别" }],
|
|
|
date: [{ required: true, message: "请选择出生日期" }],
|
|
|
organId: [{ required: true, message: "请选择分部" }],
|
|
|
- nation: [{ required: true, message: "请输入名族" }],
|
|
|
+ subjectIdList: [{ required: true, message: "请选择声部" }],
|
|
|
serviceTag: [{ required: true, message: "请选择是否参与服务" }],
|
|
|
operatingTag: [{ required: true, message: "请选择是否参与运营" }],
|
|
|
teacherId: [{ required: true, message: "请选择指导老师" }]
|
|
@@ -467,7 +493,6 @@ export default {
|
|
|
getTeacher().then(res => {
|
|
|
if (res.code == 200) {
|
|
|
this.teacherList = res.data;
|
|
|
- console.log(this.teacherList.length)
|
|
|
}
|
|
|
});
|
|
|
this.getList();
|
|
@@ -580,7 +605,7 @@ export default {
|
|
|
nowTime.getFullYear() +
|
|
|
(nowTime.getMonth() + 1) +
|
|
|
nowTime.getDate();
|
|
|
- let fname = `导出学员名单` + ymd; //下载文件的名字
|
|
|
+ let fname = `导出学员名单` + ymd + '.xlsx'; //下载文件的名字
|
|
|
link.href = objectUrl;
|
|
|
link.setAttribute("download", fname);
|
|
|
document.body.appendChild(link);
|
|
@@ -608,7 +633,7 @@ export default {
|
|
|
name: res.data.name,
|
|
|
sex: res.data.gender,
|
|
|
parseName: res.data.parentsName,
|
|
|
- // sound: parseInt(res.data.subjectId),
|
|
|
+ // sound: parseInt(res.data.subjectIdList),
|
|
|
phone: val,
|
|
|
date: res.data.birthdate
|
|
|
};
|
|
@@ -618,20 +643,21 @@ export default {
|
|
|
}
|
|
|
},
|
|
|
submitAddStudent () {
|
|
|
+ const studentForm = this.studentForm
|
|
|
// 效验 然后组数据提交
|
|
|
this.$refs["studentForm"].validate(item => {
|
|
|
if (item) {
|
|
|
let obj = {
|
|
|
- phone: this.studentForm.phone,
|
|
|
- username: this.studentForm.name,
|
|
|
- gender: this.studentForm.sex,
|
|
|
- realName: this.studentForm.parseName,
|
|
|
- birthdate: this.studentForm.date,
|
|
|
- organId: this.studentForm.organId,
|
|
|
- nation: this.studentForm.nation,
|
|
|
- serviceTag: this.studentForm.serviceTag,
|
|
|
- operatingTag: this.studentForm.operatingTag,
|
|
|
- teacherId: this.studentForm.teacherId
|
|
|
+ phone: studentForm.phone,
|
|
|
+ username: studentForm.name,
|
|
|
+ gender: studentForm.sex,
|
|
|
+ realName: studentForm.parseName,
|
|
|
+ birthdate: studentForm.date,
|
|
|
+ organId: studentForm.organId,
|
|
|
+ serviceTag: studentForm.serviceTag,
|
|
|
+ operatingTag: studentForm.operatingTag,
|
|
|
+ teacherId: studentForm.teacherId,
|
|
|
+ subjectIdList: studentForm.subjectIdList
|
|
|
};
|
|
|
registerStudent(obj).then(res => {
|
|
|
if (res.code == 200) {
|
|
@@ -645,20 +671,21 @@ export default {
|
|
|
},
|
|
|
// 修改学生信息
|
|
|
resetStudentSubmie () {
|
|
|
+ const studentForm = this.studentForm
|
|
|
this.$refs["studentForm"].validate(item => {
|
|
|
if (item) {
|
|
|
let obj = {
|
|
|
- phone: this.studentForm.phone,
|
|
|
- username: this.studentForm.name,
|
|
|
- gender: this.studentForm.sex,
|
|
|
- realName: this.studentForm.parseName,
|
|
|
- birthdate: this.studentForm.date,
|
|
|
- organId: this.studentForm.organId,
|
|
|
+ phone: studentForm.phone,
|
|
|
+ username: studentForm.name,
|
|
|
+ gender: studentForm.sex,
|
|
|
+ realName: studentForm.parseName,
|
|
|
+ birthdate: studentForm.date,
|
|
|
+ organId: studentForm.organId,
|
|
|
id: this.active.userId,
|
|
|
- nation: this.studentForm.nation,
|
|
|
- serviceTag: this.studentForm.serviceTag,
|
|
|
- operatingTag: this.studentForm.operatingTag,
|
|
|
- teacherId: this.studentForm.teacherId
|
|
|
+ serviceTag: studentForm.serviceTag,
|
|
|
+ operatingTag: studentForm.operatingTag,
|
|
|
+ teacherId: studentForm.teacherId,
|
|
|
+ subjectIdList: studentForm.subjectIdList
|
|
|
};
|
|
|
updateStudent(obj).then(res => {
|
|
|
if (res.code == 200) {
|
|
@@ -670,42 +697,63 @@ export default {
|
|
|
}
|
|
|
});
|
|
|
},
|
|
|
- addStudent () {
|
|
|
- getTeacher().then(res => {
|
|
|
+ async getSubjectList () {
|
|
|
+ await subjectListTree({
|
|
|
+ delFlag: 0,
|
|
|
+ rows: 9999
|
|
|
+ }).then(res => {
|
|
|
+ let result = res.data;
|
|
|
if (res.code == 200) {
|
|
|
- this.maskTeacherList = res.data;
|
|
|
- this.isNew = true;
|
|
|
- this.studentVisible = true;
|
|
|
- this.maskName = "新增学员";
|
|
|
+ let tempArray = [];
|
|
|
+ result.rows.forEach((item, index) => {
|
|
|
+ let subject = [];
|
|
|
+ item.subjects.forEach(s => {
|
|
|
+ subject.push({
|
|
|
+ value: s.id,
|
|
|
+ label: s.name
|
|
|
+ });
|
|
|
+ });
|
|
|
+
|
|
|
+ tempArray[index] = {
|
|
|
+ label: item.name,
|
|
|
+ options: subject
|
|
|
+ };
|
|
|
+ });
|
|
|
+ this.subjectList = tempArray;
|
|
|
}
|
|
|
});
|
|
|
},
|
|
|
- resetStudent (row) {
|
|
|
+ async addStudent () {
|
|
|
+ await this.getSubjectList()
|
|
|
+ this.isNew = true;
|
|
|
+ this.studentVisible = true;
|
|
|
+ this.maskName = "新增学员";
|
|
|
+ },
|
|
|
+ async resetStudent (row) {
|
|
|
let organId = row.organId;
|
|
|
- getTeacher({ organId }).then(res => {
|
|
|
- if (res.code == 200) {
|
|
|
- this.maskTeacherList = res.data;
|
|
|
- this.isNew = false;
|
|
|
- this.active = row;
|
|
|
- this.studentVisible = true;
|
|
|
- this.maskName = "修改学员";
|
|
|
- console.log(row)
|
|
|
- this.studentForm = {
|
|
|
- phone: row.parentsPhone || null,
|
|
|
- name: row.username || null,
|
|
|
- sex: row.gender,
|
|
|
- parseName: row.realName || null,
|
|
|
- date: row.birthdate || null,
|
|
|
- organId: row.organId || null,
|
|
|
- nation: row.nation || null,
|
|
|
- serviceTag: row.serviceTag || null,
|
|
|
- operatingTag: row.operatingTag || null,
|
|
|
- teacherId: row.teacherId || null
|
|
|
- }
|
|
|
-
|
|
|
-
|
|
|
+ await this.getSubjectList()
|
|
|
+ await this.changeStudentOrgan(row.organId)
|
|
|
+ this.isNew = false;
|
|
|
+ this.active = row;
|
|
|
+ this.studentVisible = true;
|
|
|
+ this.maskName = "修改学员";
|
|
|
+ this.$nextTick(() => {
|
|
|
+ this.studentForm = {
|
|
|
+ phone: row.parentsPhone || null,
|
|
|
+ name: row.username || null,
|
|
|
+ sex: row.gender,
|
|
|
+ parseName: row.realName || null,
|
|
|
+ date: row.birthdate || null,
|
|
|
+ organId: row.organId || null,
|
|
|
+ serviceTag: row.serviceTag,
|
|
|
+ operatingTag: row.operatingTag,
|
|
|
+ teacherId: row.teacherId || null,
|
|
|
+ subjectIdList: Number(row.subjectIdList) || null
|
|
|
}
|
|
|
- });
|
|
|
+ })
|
|
|
+ },
|
|
|
+ onMaskClose(formName) {
|
|
|
+ this.$refs[formName].resetFields()
|
|
|
},
|
|
|
resetPassWrod (row) {
|
|
|
this.activatedRow = row;
|
|
@@ -744,31 +792,20 @@ export default {
|
|
|
}
|
|
|
});
|
|
|
},
|
|
|
- changeStudentOrgan (val) {
|
|
|
- getTeacher({ organId: val }).then(res => {
|
|
|
+ async changeStudentOrgan (val) {
|
|
|
+ this.studentForm.teacherId = null
|
|
|
+ await getTeacher({ organId: val }).then(res => {
|
|
|
if (res.code == 200) {
|
|
|
this.maskTeacherList = res.data;
|
|
|
}
|
|
|
});
|
|
|
- }
|
|
|
- },
|
|
|
- watch: {
|
|
|
- studentVisible (val) {
|
|
|
- if (!val) {
|
|
|
- this.studentForm = {
|
|
|
- phone: "",
|
|
|
- organId: "",
|
|
|
- name: "",
|
|
|
- sex: "",
|
|
|
- parseName: "",
|
|
|
- date: "",
|
|
|
- nation: "",
|
|
|
- serviceTag: null,
|
|
|
- operatingTag: null,
|
|
|
- teacherId: null
|
|
|
- };
|
|
|
- this.$refs["studentForm"].resetFields();
|
|
|
- }
|
|
|
+ },
|
|
|
+ lookContracts (row) {
|
|
|
+ getLatest({ userId: row.userId }).then(res => {
|
|
|
+ if (res.code == 200) {
|
|
|
+ window.open(res.data.url)
|
|
|
+ }
|
|
|
+ })
|
|
|
}
|
|
|
}
|
|
|
};
|