|
@@ -23,6 +23,14 @@
|
|
|
:stuIdAndGroupId="stuIdAndGroupId"
|
|
|
:noGroupStudentNames="noGroupStudentNames"
|
|
|
:classid="this.user.classid"
|
|
|
+ @onSubmit="onSubmit"
|
|
|
+ @openClick="openClick"
|
|
|
+ @opanSubmit="opanSubmit"
|
|
|
+ :form="form"
|
|
|
+ :show="show"
|
|
|
+ :columns="columns"
|
|
|
+ @onvalue="onvalue"
|
|
|
+ @queren="queren"
|
|
|
></classList>
|
|
|
</span>
|
|
|
</el-col>
|
|
@@ -43,6 +51,8 @@ import { mapState, createNamespacedHelpers, mapGetters } from 'vuex';
|
|
|
const { mapActions: mapGroup } = createNamespacedHelpers('group');
|
|
|
const { mapActions: mapStudent } = createNamespacedHelpers('student');
|
|
|
const { mapActions: mapclasses } = createNamespacedHelpers('classes');
|
|
|
+const { mapActions: mapSethead } = createNamespacedHelpers('sethead');
|
|
|
+
|
|
|
export default {
|
|
|
metaInfo: { title: '班级名单' },
|
|
|
name: 'index',
|
|
@@ -54,6 +64,9 @@ export default {
|
|
|
footInfo, //底部导航
|
|
|
},
|
|
|
data: () => ({
|
|
|
+ form: {},
|
|
|
+ columns: [],
|
|
|
+ show: false,
|
|
|
// 班主任看班级名单
|
|
|
headClassList: [],
|
|
|
// 学生看学生名单
|
|
@@ -89,7 +102,9 @@ export default {
|
|
|
methods: {
|
|
|
...mapclasses({ classList: 'query', classFetch: 'fetch' }),
|
|
|
...mapStudent({ stuQery: 'query', add: 'create', fet: 'fetch', updates: 'update' }),
|
|
|
- ...mapGroup(['query', 'create', 'delete', 'insert', 'exit']),
|
|
|
+ ...mapGroup(['query', 'create', 'delete', 'insert', 'exit', 'update']),
|
|
|
+ ...mapSethead({ Setheadupdates: 'update' }),
|
|
|
+
|
|
|
// 班主任查询管理班级列表
|
|
|
async searchInfo() {
|
|
|
const res = await this.classList({ headteacherid: this.user.userid });
|
|
@@ -105,6 +120,9 @@ export default {
|
|
|
async searchstu() {
|
|
|
let classid = this.user.classid;
|
|
|
const res = await this.stuQery({ classid });
|
|
|
+
|
|
|
+ console.log(res.data);
|
|
|
+
|
|
|
this.$set(this, `stuNameList`, res.data);
|
|
|
},
|
|
|
// 查询组
|
|
@@ -112,12 +130,14 @@ export default {
|
|
|
let stuid = this.user.userid;
|
|
|
const result = await this.query();
|
|
|
const groupList = result.data;
|
|
|
+
|
|
|
this.$set(this, 'groupList', groupList);
|
|
|
// 找出登陆者在哪个组
|
|
|
// 找出组id
|
|
|
let groupId = '';
|
|
|
// 所有有组学生id
|
|
|
let studentIds = [];
|
|
|
+
|
|
|
var i = groupList.findIndex(value => {
|
|
|
var v = value.students.findIndex(value => {
|
|
|
studentIds.push(value.stuid);
|
|
@@ -125,6 +145,7 @@ export default {
|
|
|
});
|
|
|
return v != -1;
|
|
|
});
|
|
|
+ console.log(studentIds);
|
|
|
if (i != -1) {
|
|
|
groupId = groupList[i].id;
|
|
|
}
|
|
@@ -138,7 +159,10 @@ export default {
|
|
|
// let job = this.user.job;
|
|
|
// console.log(stuIdAndGroupId.job);
|
|
|
// stuIdAndGroupId.job = job;
|
|
|
+
|
|
|
this.$set(this, 'stuIdAndGroupId', stuIdAndGroupId);
|
|
|
+ console.log(stuIdAndGroupId);
|
|
|
+
|
|
|
let studentList = this.stuNameList;
|
|
|
// 没有组的学生名字
|
|
|
let noGroupStudentNames = [];
|
|
@@ -198,6 +222,28 @@ export default {
|
|
|
this.findGroup();
|
|
|
}
|
|
|
},
|
|
|
+ async openClick() {},
|
|
|
+ async onSubmit({ data }) {
|
|
|
+ console.log(data);
|
|
|
+ let res = await this.Setheadupdates(data);
|
|
|
+ console.log(res);
|
|
|
+ this.show = false;
|
|
|
+ },
|
|
|
+ opanSubmit(item) {
|
|
|
+ this.form.groupid = item.id;
|
|
|
+ this.$set(this, 'columns', item.students);
|
|
|
+ if (this.user.job === '班长') {
|
|
|
+ this.show = true;
|
|
|
+ }
|
|
|
+ },
|
|
|
+ onvalue(value) {
|
|
|
+ this.form.stuid = value.value.stuid;
|
|
|
+ },
|
|
|
+ async queren(item) {
|
|
|
+ item.status = '1';
|
|
|
+ console.log(item);
|
|
|
+ const res = await this.create(item);
|
|
|
+ },
|
|
|
},
|
|
|
};
|
|
|
</script>
|