Commit c8c928f4e0e75003e5459949cf4257a586a4e14d
1 parent
31fe9b9a
学生管理交互优化
Showing
1 changed file
with
55 additions
and
49 deletions
src/views/standard/setUp/student.vue
@@ -48,17 +48,8 @@ | @@ -48,17 +48,8 @@ | ||
48 | :value="item.value" | 48 | :value="item.value" |
49 | > | 49 | > |
50 | </el-option> | 50 | </el-option> |
51 | - </el-select> | ||
52 | - <el-select | ||
53 | - class="sel" | ||
54 | - v-model="query.status" | ||
55 | - @change="_QueryData(4)" | ||
56 | - placeholder="学生状态" | ||
57 | - > | ||
58 | - <el-option disabled label="请选择" :value=9></el-option> | ||
59 | - <el-option label="正常" :value="0"></el-option> | ||
60 | - <el-option label="未分配" :value="-1"></el-option> | ||
61 | - <el-option label="已毕业" :value="2"></el-option> | 51 | + <el-option label="未分配" :value="80"></el-option> |
52 | + <el-option label="已毕业" :value="81"></el-option> | ||
62 | </el-select> | 53 | </el-select> |
63 | <el-input | 54 | <el-input |
64 | placeholder="请输入学生姓名" | 55 | placeholder="请输入学生姓名" |
@@ -86,15 +77,29 @@ | @@ -86,15 +77,29 @@ | ||
86 | </el-input> | 77 | </el-input> |
87 | </div> | 78 | </div> |
88 | </div> | 79 | </div> |
89 | - <p class="total" v-if="studentList.length && !query.grade"> | 80 | + <p |
81 | + class="total" | ||
82 | + v-if=" | ||
83 | + studentList.length && | ||
84 | + (query.grade == 80 || query.grade == 81 || !query.grade) | ||
85 | + " | ||
86 | + > | ||
90 | 共筛选出{{ studentList.length }}名学生。 | 87 | 共筛选出{{ studentList.length }}名学生。 |
91 | </p> | 88 | </p> |
92 | - <p class="total" v-if="getStuTotal && query.grade"> | 89 | + <p |
90 | + class="total" | ||
91 | + v-if=" | ||
92 | + getStuTotal && query.grade && query.grade != 80 && query.grade != 81 | ||
93 | + " | ||
94 | + > | ||
93 | 共筛选出{{ getStuTotal }}名学生。 | 95 | 共筛选出{{ getStuTotal }}名学生。 |
94 | </p> | 96 | </p> |
95 | <div class="page-content"> | 97 | <div class="page-content"> |
96 | <div class="stu-box"> | 98 | <div class="stu-box"> |
97 | - <div class="stu-list" v-show="query.grade"> | 99 | + <div |
100 | + class="stu-list" | ||
101 | + v-show="query.grade && query.grade != 80 && query.grade != 81" | ||
102 | + > | ||
98 | <div class="h-title">班级列表</div> | 103 | <div class="h-title">班级列表</div> |
99 | <ul class="stu-ul"> | 104 | <ul class="stu-ul"> |
100 | <li | 105 | <li |
@@ -109,7 +114,15 @@ | @@ -109,7 +114,15 @@ | ||
109 | </ul> | 114 | </ul> |
110 | </div> | 115 | </div> |
111 | <div class="stu-detail" v-loading="loading"> | 116 | <div class="stu-detail" v-loading="loading"> |
112 | - <div class="clazz-detail" v-if="clazzDetail.stationSn && query.grade"> | 117 | + <div |
118 | + class="clazz-detail" | ||
119 | + v-if=" | ||
120 | + clazzDetail.stationSn && | ||
121 | + query.grade && | ||
122 | + query.grade != 80 && | ||
123 | + query.grade != 81 | ||
124 | + " | ||
125 | + > | ||
113 | <p>基站SN:{{ clazzDetail.stationSn }}</p> | 126 | <p>基站SN:{{ clazzDetail.stationSn }}</p> |
114 | <p>配对码:{{ clazzDetail.pairingCode }}</p> | 127 | <p>配对码:{{ clazzDetail.pairingCode }}</p> |
115 | <p>频点:{{ clazzDetail.frequency }}</p> | 128 | <p>频点:{{ clazzDetail.frequency }}</p> |
@@ -129,7 +142,7 @@ | @@ -129,7 +142,7 @@ | ||
129 | </el-popconfirm> | 142 | </el-popconfirm> |
130 | <i | 143 | <i |
131 | class="el-icon-user-solid" | 144 | class="el-icon-user-solid" |
132 | - v-if="!code && query.status != 2" | 145 | + v-if="!code && query.grade != 81" |
133 | @click.stop="openChangeClazz(item)" | 146 | @click.stop="openChangeClazz(item)" |
134 | ></i> | 147 | ></i> |
135 | <div class="s-li-box" @click="sayChange(item)"> | 148 | <div class="s-li-box" @click="sayChange(item)"> |
@@ -167,13 +180,14 @@ | @@ -167,13 +180,14 @@ | ||
167 | <el-form-item label="当前班级:"> | 180 | <el-form-item label="当前班级:"> |
168 | <span>{{ formStuCla.className }}</span> | 181 | <span>{{ formStuCla.className }}</span> |
169 | </el-form-item> | 182 | </el-form-item> |
170 | - <el-form-item label="调到班级:"> | 183 | + <el-form-item label="调到班级:" prop="classId"> |
171 | <el-col :span="10"> | 184 | <el-col :span="10"> |
172 | <el-select | 185 | <el-select |
173 | class="sel" | 186 | class="sel" |
174 | v-model="formStuCla.classId" | 187 | v-model="formStuCla.classId" |
175 | placeholder="选择年级" | 188 | placeholder="选择年级" |
176 | > | 189 | > |
190 | + <el-option disabled label="请选择" value=""></el-option> | ||
177 | <el-option | 191 | <el-option |
178 | v-for="item in classList" | 192 | v-for="item in classList" |
179 | :key="item.id" | 193 | :key="item.id" |
@@ -345,9 +359,7 @@ export default { | @@ -345,9 +359,7 @@ export default { | ||
345 | studentCode: "", | 359 | studentCode: "", |
346 | }, | 360 | }, |
347 | rulesStuCla: { | 361 | rulesStuCla: { |
348 | - className: [ | ||
349 | - { required: true, message: "请输入班级名称", trigger: "blur" }, | ||
350 | - ], | 362 | + classId: [{ required: true, message: "请选择班级", trigger: "blur" }], |
351 | studentCode: [ | 363 | studentCode: [ |
352 | { required: true, message: "请输入学生号", trigger: "blur" }, | 364 | { required: true, message: "请输入学生号", trigger: "blur" }, |
353 | ], | 365 | ], |
@@ -409,7 +421,7 @@ export default { | @@ -409,7 +421,7 @@ export default { | ||
409 | this._QueryData(3); | 421 | this._QueryData(3); |
410 | }, | 422 | }, |
411 | 423 | ||
412 | - upSuccess(res) { | 424 | + async upSuccess(res) { |
413 | this.$message.closeAll(); | 425 | this.$message.closeAll(); |
414 | this.$message({ | 426 | this.$message({ |
415 | showClose: true, | 427 | showClose: true, |
@@ -419,7 +431,8 @@ export default { | @@ -419,7 +431,8 @@ export default { | ||
419 | }); | 431 | }); |
420 | //导入成功 | 432 | //导入成功 |
421 | this.diaUp = false; | 433 | this.diaUp = false; |
422 | - this._QueryData(5); | 434 | + await this._QueryClazz(this.query.grade); |
435 | + this._QueryData(); | ||
423 | }, | 436 | }, |
424 | //添加学生 | 437 | //添加学生 |
425 | addStu() { | 438 | addStu() { |
@@ -449,6 +462,7 @@ export default { | @@ -449,6 +462,7 @@ export default { | ||
449 | if (status === 0) { | 462 | if (status === 0) { |
450 | this.$message.success(info); | 463 | this.$message.success(info); |
451 | this.diaStu = false; | 464 | this.diaStu = false; |
465 | + await this._QueryClazz(this.query.grade); | ||
452 | this._QueryData(); | 466 | this._QueryData(); |
453 | } else { | 467 | } else { |
454 | this.$message.error(info); | 468 | this.$message.error(info); |
@@ -465,13 +479,10 @@ export default { | @@ -465,13 +479,10 @@ export default { | ||
465 | }, | 479 | }, |
466 | //学生调班弹窗 | 480 | //学生调班弹窗 |
467 | openChangeClazz(obj) { | 481 | openChangeClazz(obj) { |
468 | - if (!this.query.grade) { | 482 | + if (this.query.grade == 80) { |
469 | this._QueryClazz(obj.grade); | 483 | this._QueryClazz(obj.grade); |
470 | - this.formStuCla.classId = ""; | ||
471 | - } else { | ||
472 | - this.formStuCla.classId = this.classList[0].id; | ||
473 | } | 484 | } |
474 | - | 485 | + this.formStuCla.classId = ""; |
475 | this.formStuCla.studentId = obj.id; | 486 | this.formStuCla.studentId = obj.id; |
476 | this.formStuCla.className = obj.className; | 487 | this.formStuCla.className = obj.className; |
477 | this.formStuCla.studentName = obj.studentName; | 488 | this.formStuCla.studentName = obj.studentName; |
@@ -484,6 +495,10 @@ export default { | @@ -484,6 +495,10 @@ export default { | ||
484 | function () { | 495 | function () { |
485 | this.$refs.formStuCla.validate(async (valid) => { | 496 | this.$refs.formStuCla.validate(async (valid) => { |
486 | if (valid) { | 497 | if (valid) { |
498 | + if (this.formStuCla.classId == this.formStuCla.oldClassId) { | ||
499 | + this.$message.warning("班级无变更~"); | ||
500 | + return; | ||
501 | + } | ||
487 | const { data, status, info } = | 502 | const { data, status, info } = |
488 | await this.$request.studentChangeClass({ | 503 | await this.$request.studentChangeClass({ |
489 | studentId: this.formStuCla.studentId, | 504 | studentId: this.formStuCla.studentId, |
@@ -494,6 +509,7 @@ export default { | @@ -494,6 +509,7 @@ export default { | ||
494 | if (status == 0) { | 509 | if (status == 0) { |
495 | this.diaChangeClass = false; | 510 | this.diaChangeClass = false; |
496 | this.$message.success(info); | 511 | this.$message.success(info); |
512 | + await this._QueryClazz(this.query.grade); | ||
497 | this._QueryData(); | 513 | this._QueryData(); |
498 | } else { | 514 | } else { |
499 | this.$message.error(info); | 515 | this.$message.error(info); |
@@ -528,7 +544,7 @@ export default { | @@ -528,7 +544,7 @@ export default { | ||
528 | }); | 544 | }); |
529 | if (status === 0) { | 545 | if (status === 0) { |
530 | this.$message.success("删除成功"); | 546 | this.$message.success("删除成功"); |
531 | - this.studentList.splice(index, 1); | 547 | + await this._QueryClazz(this.query.grade); |
532 | this._QueryData(); | 548 | this._QueryData(); |
533 | } else { | 549 | } else { |
534 | this.$message.error(info); | 550 | this.$message.error(info); |
@@ -539,7 +555,9 @@ export default { | @@ -539,7 +555,9 @@ export default { | ||
539 | this.query.classId = ""; | 555 | this.query.classId = ""; |
540 | this.query.studentName = ""; | 556 | this.query.studentName = ""; |
541 | this.query.studentCode = ""; | 557 | this.query.studentCode = ""; |
542 | - await this._QueryClass(val); | 558 | + if (val != 80 && val != 81) { |
559 | + await this._QueryClass(val); | ||
560 | + } | ||
543 | this._QueryData(3); | 561 | this._QueryData(3); |
544 | }, | 562 | }, |
545 | serQuery(type) { | 563 | serQuery(type) { |
@@ -550,44 +568,33 @@ export default { | @@ -550,44 +568,33 @@ export default { | ||
550 | return; | 568 | return; |
551 | } | 569 | } |
552 | this.query.classId = ""; | 570 | this.query.classId = ""; |
553 | - this.query.status = 9; | ||
554 | this.query.studentCode = ""; | 571 | this.query.studentCode = ""; |
555 | this.query.grade = ""; | 572 | this.query.grade = ""; |
556 | query.studentName = this.query.studentName; | 573 | query.studentName = this.query.studentName; |
557 | - query.status = this.query.status; | 574 | + query.status = 9; |
558 | } else if (type == 2) { | 575 | } else if (type == 2) { |
559 | if (!this.query.studentCode) { | 576 | if (!this.query.studentCode) { |
560 | this.$message.warning("输入学生学号~"); | 577 | this.$message.warning("输入学生学号~"); |
561 | return; | 578 | return; |
562 | } | 579 | } |
563 | this.query.classId = ""; | 580 | this.query.classId = ""; |
564 | - this.query.status = 9; | ||
565 | this.query.studentName = ""; | 581 | this.query.studentName = ""; |
566 | this.query.grade = ""; | 582 | this.query.grade = ""; |
567 | query.studentCode = this.query.studentCode; | 583 | query.studentCode = this.query.studentCode; |
568 | - query.status = this.query.status; | 584 | + query.status = 9; |
569 | } else if (type == 3) { | 585 | } else if (type == 3) { |
570 | this.query.studentName = ""; | 586 | this.query.studentName = ""; |
571 | this.query.studentCode = ""; | 587 | this.query.studentCode = ""; |
572 | - this.query.status = 0; | ||
573 | - query.grade = this.query.grade; | ||
574 | - query.classId = this.query.classId; | ||
575 | - } else if (type == 4) { | ||
576 | - this.clazzDetail.stationSn = ""; | ||
577 | - this.query.studentName = ""; | ||
578 | - this.query.studentCode = ""; | ||
579 | - if (this.query.status) { | ||
580 | - this.query.grade = ""; | ||
581 | - this.query.classId = ""; | 588 | + if (this.query.grade == 80) { |
589 | + query.status = -1; | ||
590 | + } else if (this.query.grade == 81) { | ||
591 | + query.status = 2; | ||
582 | } else { | 592 | } else { |
583 | - this.query.grade = this.gradeList[0]?.value; | ||
584 | - this.query.classId = this.classList[0]?.id; | ||
585 | query.grade = this.query.grade; | 593 | query.grade = this.query.grade; |
586 | query.classId = this.query.classId; | 594 | query.classId = this.query.classId; |
587 | } | 595 | } |
588 | - query.status = this.query.status; | ||
589 | } else { | 596 | } else { |
590 | - query = this.query; | 597 | + query = { ...this.query }; |
591 | } | 598 | } |
592 | return query; | 599 | return query; |
593 | }, | 600 | }, |
@@ -645,7 +652,6 @@ export default { | @@ -645,7 +652,6 @@ export default { | ||
645 | }); | 652 | }); |
646 | if (status === 0) { | 653 | if (status === 0) { |
647 | this.classList = (data.list && [...data?.list]) || []; | 654 | this.classList = (data.list && [...data?.list]) || []; |
648 | - this.formStuCla.classId = this.classList[0].id; | ||
649 | } else { | 655 | } else { |
650 | this.$message.error(info); | 656 | this.$message.error(info); |
651 | } | 657 | } |
@@ -774,7 +780,7 @@ export default { | @@ -774,7 +780,7 @@ export default { | ||
774 | box-shadow: 2px 2px 5px #7f7f7f; | 780 | box-shadow: 2px 2px 5px #7f7f7f; |
775 | margin: 0 20px 20px 0; | 781 | margin: 0 20px 20px 0; |
776 | .s-li-box { | 782 | .s-li-box { |
777 | - width: 180px; | 783 | + width: 160px; |
778 | border-radius: 10px; | 784 | border-radius: 10px; |
779 | min-height: 120px; | 785 | min-height: 120px; |
780 | padding: 0 12px 5px; | 786 | padding: 0 12px 5px; |