|
@@ -8,6 +8,8 @@
|
|
<el-col :span="24" class="main">
|
|
<el-col :span="24" class="main">
|
|
<headStuList
|
|
<headStuList
|
|
:headStuList="headStuList"
|
|
:headStuList="headStuList"
|
|
|
|
+ :groupStuList="groupStuList"
|
|
|
|
+ :noGroupStuList="noGroupStuList"
|
|
:assignShow="assignShow"
|
|
:assignShow="assignShow"
|
|
:assignForm="assignForm"
|
|
:assignForm="assignForm"
|
|
:job_list="job_list"
|
|
:job_list="job_list"
|
|
@@ -26,8 +28,10 @@
|
|
<script>
|
|
<script>
|
|
import NavBar from '@/layout/common/topInfo.vue';
|
|
import NavBar from '@/layout/common/topInfo.vue';
|
|
import headStuList from './info/headStuList.vue';
|
|
import headStuList from './info/headStuList.vue';
|
|
|
|
+import _ from 'lodash';
|
|
import { mapState, createNamespacedHelpers, mapGetters } from 'vuex';
|
|
import { mapState, createNamespacedHelpers, mapGetters } from 'vuex';
|
|
const { mapActions: mapStudent } = createNamespacedHelpers('student');
|
|
const { mapActions: mapStudent } = createNamespacedHelpers('student');
|
|
|
|
+const { mapActions: mapGroup } = createNamespacedHelpers('group');
|
|
export default {
|
|
export default {
|
|
name: 'classStuList',
|
|
name: 'classStuList',
|
|
props: {},
|
|
props: {},
|
|
@@ -37,6 +41,8 @@ export default {
|
|
},
|
|
},
|
|
data: () => ({
|
|
data: () => ({
|
|
headStuList: [],
|
|
headStuList: [],
|
|
|
|
+ noGroupStuList: [],
|
|
|
|
+ groupStuList: [],
|
|
assignShow: false,
|
|
assignShow: false,
|
|
assignForm: {},
|
|
assignForm: {},
|
|
job_list: [],
|
|
job_list: [],
|
|
@@ -103,12 +109,21 @@ export default {
|
|
},
|
|
},
|
|
methods: {
|
|
methods: {
|
|
...mapStudent({ list: 'query', add: 'create', fet: 'fetch', updates: 'update' }),
|
|
...mapStudent({ list: 'query', add: 'create', fet: 'fetch', updates: 'update' }),
|
|
|
|
+ ...mapGroup({ groupQuery: 'query' }),
|
|
// 查询学生列表-并带有职务
|
|
// 查询学生列表-并带有职务
|
|
async searchInfo() {
|
|
async searchInfo() {
|
|
let classid = this.id;
|
|
let classid = this.id;
|
|
|
|
+ // 班级所有学生
|
|
const res = await this.list({ classid });
|
|
const res = await this.list({ classid });
|
|
|
|
+ // 班级所有组
|
|
|
|
+ const groups = await this.groupQuery({ classid });
|
|
|
|
+ //班级所有进组的学生id
|
|
|
|
+ let groupstuids = _.map(_.flattenDeep(_.map(groups.data, 'students')), 'stuid');
|
|
|
|
+ let noGroupStuList = res.data.filter(f => !groupstuids.includes(f.id));
|
|
if (this.$checkRes(res)) {
|
|
if (this.$checkRes(res)) {
|
|
|
|
+ this.$set(this, `groupStuList`, groups.data);
|
|
this.$set(this, `headStuList`, res.data);
|
|
this.$set(this, `headStuList`, res.data);
|
|
|
|
+ this.$set(this, `noGroupStuList`, noGroupStuList);
|
|
}
|
|
}
|
|
},
|
|
},
|
|
//点击派遣
|
|
//点击派遣
|