Commit 4623f67f025ac70245b70fe0d842e9505ee00c1f
1 parent
8ad80958
隋唐问以及教师学生设置
Showing
3 changed files
with
42 additions
and
28 deletions
src/views/basic/ask/index.vue
... | ... | @@ -94,10 +94,10 @@ export default { |
94 | 94 | this.query.endDay = new Date(); |
95 | 95 | } |
96 | 96 | }, |
97 | - | |
97 | + | |
98 | 98 | methods: { |
99 | 99 | handleCheckAllChange(val) { |
100 | - this.checkedCities = val ? this.subjectList : []; | |
100 | + this.query.subjectNames = val ? this.subjectList : []; | |
101 | 101 | this.allSubject = false; |
102 | 102 | }, |
103 | 103 | handleChecked(value) { | ... | ... |
src/views/basic/setUp/student.vue
... | ... | @@ -8,14 +8,14 @@ |
8 | 8 | <el-tooltip effect="dark" content="设置答题器" placement="bottom"> |
9 | 9 | <el-button type="primary" icon="el-icon-upload2" size="mini" plain circle @click="diaUp = true"></el-button> |
10 | 10 | </el-tooltip> |
11 | - <el-tooltip v-if="!code" effect="dark" content="添加学生" placement="bottom"> | |
11 | + <el-tooltip v-if="!code && query.classType == 0" effect="dark" content="添加学生" placement="bottom"> | |
12 | 12 | <el-button type="primary" icon="el-icon-plus" size="mini" plain circle @click="openAddDia"></el-button> |
13 | 13 | </el-tooltip> |
14 | 14 | </template> |
15 | 15 | </back-box> |
16 | 16 | <div class="answer-header"> |
17 | 17 | <div class="sel-box"> |
18 | - <el-select class="sel" v-model="classType" @change="changeGrade(query.grade)" placeholder="选择类型"> | |
18 | + <el-select class="sel" v-model="query.classType" @change="changeGrade(query.grade)" placeholder="选择类型"> | |
19 | 19 | <el-option label="行政班" :value="0"></el-option> |
20 | 20 | <el-option label="教学班" :value="1"></el-option> |
21 | 21 | </el-select> |
... | ... | @@ -188,7 +188,7 @@ |
188 | 188 | </div> |
189 | 189 | </el-dialog> |
190 | 190 | <el-dialog :close-on-click-modal="false" title="学生答题器绑定" :visible.sync="diaUp" width="600"> |
191 | - <upload id="downTeacher" :url="url" @upSuccess="upSuccess" fileName="学生答题器绑定模板"> | |
191 | + <upload id="downTeacher" :url="url" :params="{ type: query.classType }" @upSuccess="upSuccess" fileName="学生答题器绑定模板"> | |
192 | 192 | <p class="down-txt" slot="down"> |
193 | 193 | 通过Excel名单导入学生答题器绑定模板,点击 |
194 | 194 | <el-link type="danger" @click="downExcel">模板下载</el-link> 。 |
... | ... | @@ -224,6 +224,7 @@ export default { |
224 | 224 | }, |
225 | 225 | clazzDetail: { stationSn: "", pairingCode: "", frequency: "" }, |
226 | 226 | query: { |
227 | + classType: 0, //0行政 1教学班 | |
227 | 228 | grade: "", |
228 | 229 | classId: "", |
229 | 230 | status: 0, |
... | ... | @@ -276,7 +277,6 @@ export default { |
276 | 277 | teacherCourseList: [], |
277 | 278 | teacherGradeList: [], |
278 | 279 | }, |
279 | - classType: 0 //0行政 1教学班 | |
280 | 280 | }; |
281 | 281 | |
282 | 282 | }, |
... | ... | @@ -444,6 +444,7 @@ export default { |
444 | 444 | }, |
445 | 445 | async removeStu(obj, index, $event) { |
446 | 446 | const { data, status, info } = await this.$request.delStudent({ |
447 | + type: this.query.classType, | |
447 | 448 | studentId: obj.id, |
448 | 449 | }); |
449 | 450 | if (status === 0) { |
... | ... | @@ -459,6 +460,11 @@ export default { |
459 | 460 | this.query.classId = ""; |
460 | 461 | this.query.studentName = ""; |
461 | 462 | this.query.studentCode = ""; |
463 | + | |
464 | + this.formStu.className = ""; | |
465 | + this.clazzDetail.stationSn = ""; | |
466 | + this.clazzDetail.pairingCode = ""; | |
467 | + this.clazzDetail.frequency = ""; | |
462 | 468 | if (val != 80 && val != 81) { |
463 | 469 | await this._QueryClass(val); |
464 | 470 | } |
... | ... | @@ -512,6 +518,7 @@ export default { |
512 | 518 | this.loading = true; |
513 | 519 | this.studentList = []; |
514 | 520 | const { data, status, info } = await this.$request.studentList({ |
521 | + type: this.query.classType, | |
515 | 522 | ...query, |
516 | 523 | }); |
517 | 524 | this.loading = false; |
... | ... | @@ -542,7 +549,7 @@ export default { |
542 | 549 | this.classList = []; |
543 | 550 | const { data, status, info } = await this.$request.schoolClassList({ |
544 | 551 | grade: value || this.query.grade, |
545 | - type: this.classType | |
552 | + type: this.query.classType | |
546 | 553 | }); |
547 | 554 | if (status === 0) { |
548 | 555 | this.classList = (data.list && [...data?.list]) || []; |
... | ... | @@ -559,6 +566,7 @@ export default { |
559 | 566 | this.classList = []; |
560 | 567 | const { data, status, info } = await this.$request.schoolClassList({ |
561 | 568 | grade: value, |
569 | + type: this.query.classType | |
562 | 570 | }); |
563 | 571 | if (status === 0) { |
564 | 572 | this.classList = (data.list && [...data?.list]) || []; | ... | ... |
src/views/basic/setUp/teacher.vue
... | ... | @@ -316,7 +316,7 @@ export default { |
316 | 316 | this.code = localStorage.getItem("csCode") || ""; |
317 | 317 | this._QueryData(4); |
318 | 318 | await this._QueryDataGrade(); |
319 | - this._RoleList(); | |
319 | + // this._RoleList(); | |
320 | 320 | }, |
321 | 321 | methods: { |
322 | 322 | async changeType() { |
... | ... | @@ -342,6 +342,7 @@ export default { |
342 | 342 | this.indeterminate = |
343 | 343 | checkedCount > 0 && checkedCount < this.teacherList.length; |
344 | 344 | }, |
345 | + //清除教师绑定班级信息 | |
345 | 346 | async remove() { |
346 | 347 | if (!this.clearTeacher.length) { |
347 | 348 | this.$message.warning("请选择要格式化的老师") |
... | ... | @@ -374,8 +375,8 @@ export default { |
374 | 375 | gradeName(type) { |
375 | 376 | return setGradeName(type); |
376 | 377 | }, |
378 | + //导入成功 | |
377 | 379 | upSuccess(res) { |
378 | - //导入成功 | |
379 | 380 | this.$message.closeAll(); |
380 | 381 | this.$message({ |
381 | 382 | showClose: true, |
... | ... | @@ -386,20 +387,20 @@ export default { |
386 | 387 | this.diaUp = false; |
387 | 388 | this._QueryData(5); |
388 | 389 | }, |
390 | + //添加教师角色 | |
389 | 391 | addRoleList() { |
390 | - //添加教师角色 | |
391 | 392 | this.formTeacher.roleList.push({ |
392 | 393 | id: randomWord(true, 16, 20), |
393 | 394 | roleId: "", |
394 | 395 | classId: [], |
395 | 396 | }); |
396 | 397 | }, |
398 | + //删除教师角色 | |
397 | 399 | removeRoleList(index) { |
398 | - //删除教师角色 | |
399 | 400 | this.formTeacher.roleList.splice(index, 1); |
400 | 401 | }, |
402 | + //添加教师弹窗 | |
401 | 403 | addTeacherDia() { |
402 | - //添加教师弹窗 | |
403 | 404 | this.isAdd = true; |
404 | 405 | this.formTeacher = { |
405 | 406 | teacherName: "", |
... | ... | @@ -409,8 +410,8 @@ export default { |
409 | 410 | }; |
410 | 411 | this.diaTeacher = true; |
411 | 412 | }, |
413 | + //教师角色数量 | |
412 | 414 | setClass(obj) { |
413 | - //教师角色数量 | |
414 | 415 | return ( |
415 | 416 | obj.managerList?.length + |
416 | 417 | obj.teacherCourseList?.length + |
... | ... | @@ -426,8 +427,8 @@ export default { |
426 | 427 | }); |
427 | 428 | return name; |
428 | 429 | }, |
430 | + //教师详细数据 | |
429 | 431 | showTeacher(obj) { |
430 | - //教师详细数据 | |
431 | 432 | this.showTId = obj.id; |
432 | 433 | this.teacherDetail = { ...obj }; |
433 | 434 | }, |
... | ... | @@ -444,8 +445,8 @@ export default { |
444 | 445 | } |
445 | 446 | this.toTeacherForm(); |
446 | 447 | }, |
448 | + //添加教师 | |
447 | 449 | addTeacher() { |
448 | - //添加教师 | |
449 | 450 | this.$refs.formTeacher.validate(async (valid) => { |
450 | 451 | if (valid) { |
451 | 452 | let obj = this.setTeacharForm(); |
... | ... | @@ -485,8 +486,8 @@ export default { |
485 | 486 | } |
486 | 487 | }); |
487 | 488 | }, |
489 | + //转换保存教师数据格式 | |
488 | 490 | setTeacharForm() { |
489 | - //转换保存教师数据格式 | |
490 | 491 | let ERR_OK = true; |
491 | 492 | this.formTeacher.roleList.map((item) => { |
492 | 493 | if (item.classId.length == 0) { |
... | ... | @@ -532,8 +533,8 @@ export default { |
532 | 533 | return false; |
533 | 534 | } |
534 | 535 | }, |
536 | + //教师角色数据转换为form格式数据 | |
535 | 537 | toTeacherForm() { |
536 | - //教师角色数据转换为form格式数据 | |
537 | 538 | this.formTeacher.roleList = []; |
538 | 539 | this.formTeacher.managerList?.map((item) => { |
539 | 540 | this.formTeacher.roleList.push({ |
... | ... | @@ -579,6 +580,7 @@ export default { |
579 | 580 | }); |
580 | 581 | }); |
581 | 582 | }, |
583 | + //删除教师角色 | |
582 | 584 | async delTeacherManager(obj, type) { |
583 | 585 | let query; |
584 | 586 | switch (type) { |
... | ... | @@ -604,23 +606,24 @@ export default { |
604 | 606 | //角色 |
605 | 607 | const { data, status, info } = await this.$request.delTeacherManager({ |
606 | 608 | teacherId: obj.teacherId, |
609 | + type: this.query.classType, | |
607 | 610 | ...query, |
608 | 611 | }); |
609 | 612 | if (status === 0) { |
610 | - this._QueryD6; | |
611 | - } else { | |
612 | - this.$message.error(info); | |
613 | - } | |
614 | - }, | |
615 | - async _RoleList() { | |
616 | - //角色 | |
617 | - const { data, status, info } = await this.$request.roleList(); | |
618 | - if (status === 0) { | |
619 | - this.roleList = data.list || []; | |
613 | + this._QueryData(6); | |
620 | 614 | } else { |
621 | 615 | this.$message.error(info); |
622 | 616 | } |
623 | 617 | }, |
618 | + //角色列表 | |
619 | + // async _RoleList() { | |
620 | + // const { data, status, info } = await this.$request.roleList(); | |
621 | + // if (status === 0) { | |
622 | + // this.roleList = data.list || []; | |
623 | + // } else { | |
624 | + // this.$message.error(info); | |
625 | + // } | |
626 | + // }, | |
624 | 627 | setQuery(type) { |
625 | 628 | let query = {}; |
626 | 629 | if (type == 1) { |
... | ... | @@ -701,7 +704,7 @@ export default { |
701 | 704 | query.teacherName.length ? "" : delete query.teacherName; |
702 | 705 | query.phone.length ? "" : delete query.phone; |
703 | 706 | } |
704 | - | |
707 | + query.classType = this.query.classType | |
705 | 708 | return query; |
706 | 709 | }, |
707 | 710 | async _QueryData(type) { |
... | ... | @@ -749,6 +752,9 @@ export default { |
749 | 752 | }); |
750 | 753 | if (status === 0) { |
751 | 754 | this.classList = [] |
755 | + this.gradeClassList = [] | |
756 | + this.gradeClassSubList = [] | |
757 | + this.gradeSubListClass = [] | |
752 | 758 | this.gradeList = |
753 | 759 | data.list?.map((item) => { |
754 | 760 | let subList = item.subjectNames?.map((items) => { | ... | ... |