|
@@ -70,15 +70,7 @@ export default {
|
|
|
},
|
|
|
],
|
|
|
form: {},
|
|
|
- list: [
|
|
|
- {
|
|
|
- stuname: '测试学生',
|
|
|
- date: '2020-07-20',
|
|
|
- time: '14:00',
|
|
|
- type: '0',
|
|
|
- status: '0',
|
|
|
- },
|
|
|
- ],
|
|
|
+ list: [],
|
|
|
total: 0,
|
|
|
// 特殊班一键签到选中列表
|
|
|
selected: [],
|
|
@@ -88,7 +80,7 @@ export default {
|
|
|
},
|
|
|
computed: { ...mapState(['user', 'defaultOption']) },
|
|
|
methods: {
|
|
|
- ...attendance(['query', 'delete']),
|
|
|
+ ...attendance(['query', 'delete', 'attendancecreateList']),
|
|
|
...student({ stuquery: 'query' }),
|
|
|
...trainplan({ planfetch: 'fetch' }),
|
|
|
...classes({ classesquery: 'query' }),
|
|
@@ -110,7 +102,8 @@ export default {
|
|
|
},
|
|
|
async getClasses(batchid) {
|
|
|
const res = await this.classesquery({ batchid });
|
|
|
- this.$set(this, `classList`, res.data);
|
|
|
+ var arr = res.data.filter(item => item.type === '1');
|
|
|
+ this.$set(this, `classList`, arr);
|
|
|
},
|
|
|
async onsearch({ skip = 0, limit = 10, ...info } = {}) {
|
|
|
const res = await this.query({ termid: this.form.termid, classid: this.form.classid, ...info });
|
|
@@ -132,8 +125,16 @@ export default {
|
|
|
this.$set(this, `selected`, selecteds);
|
|
|
},
|
|
|
// 一键签到
|
|
|
- onekeyBtn() {
|
|
|
- console.log(this.selected);
|
|
|
+ async onekeyBtn() {
|
|
|
+ let studentIds = this.selected.map(i => i._id);
|
|
|
+ // TODO连接接口去导出多个批次的学生
|
|
|
+ const res = await this.attendancecreateList(studentIds);
|
|
|
+ if (this.$checkRes(res)) {
|
|
|
+ this.$message({
|
|
|
+ message: '考勤成功',
|
|
|
+ type: 'success',
|
|
|
+ });
|
|
|
+ }
|
|
|
},
|
|
|
},
|
|
|
watch: {
|