Commit 31fe9b9a97a702029e1add4b16c2d63ad1202ce6
1 parent
ea4f5fc9
班级修改删除即可偶调整
Showing
3 changed files
with
46 additions
and
32 deletions
src/api/apis/apis.js
| @@ -1554,4 +1554,12 @@ export default { | @@ -1554,4 +1554,12 @@ export default { | ||
| 1554 | data | 1554 | data |
| 1555 | }); | 1555 | }); |
| 1556 | }, | 1556 | }, |
| 1557 | + // 删除班级信息 | ||
| 1558 | + removeClass(data) { | ||
| 1559 | + return service({ | ||
| 1560 | + url: setUpUrls.removeClass, | ||
| 1561 | + method: "POST", | ||
| 1562 | + data | ||
| 1563 | + }); | ||
| 1564 | + }, | ||
| 1557 | }; | 1565 | }; |
src/api/urls/apis.js
| @@ -402,4 +402,7 @@ export default { | @@ -402,4 +402,7 @@ export default { | ||
| 402 | tenantAbnormalDeviceCount: "/api_html/tenant/abnormalDeviceCount", | 402 | tenantAbnormalDeviceCount: "/api_html/tenant/abnormalDeviceCount", |
| 403 | //设备异常备注 | 403 | //设备异常备注 |
| 404 | abnormalRemark: "/api_html/school/manager/abnormalRemark", | 404 | abnormalRemark: "/api_html/school/manager/abnormalRemark", |
| 405 | + | ||
| 406 | + // 删除班级信息 | ||
| 407 | + removeClass: "/api_html/school/manager/delClass", | ||
| 405 | } | 408 | } |
src/views/standard/setUp/clazz.vue
| @@ -26,7 +26,12 @@ | @@ -26,7 +26,12 @@ | ||
| 26 | ></el-button> | 26 | ></el-button> |
| 27 | </el-tooltip> | 27 | </el-tooltip> |
| 28 | <el-tooltip effect="dark" content="分班" placement="bottom"> | 28 | <el-tooltip effect="dark" content="分班" placement="bottom"> |
| 29 | - <img @click="toArchived" src="../../../assets/images/fenban.png" class="fenban" alt="" /> | 29 | + <img |
| 30 | + @click="toArchived" | ||
| 31 | + src="../../../assets/images/fenban.png" | ||
| 32 | + class="fenban" | ||
| 33 | + alt="" | ||
| 34 | + /> | ||
| 30 | </el-tooltip> | 35 | </el-tooltip> |
| 31 | </template> | 36 | </template> |
| 32 | </back-box> | 37 | </back-box> |
| @@ -76,11 +81,7 @@ | @@ -76,11 +81,7 @@ | ||
| 76 | </div> | 81 | </div> |
| 77 | </div> | 82 | </div> |
| 78 | <el-dialog title="导入班级名单" :visible.sync="diaUp" width="600"> | 83 | <el-dialog title="导入班级名单" :visible.sync="diaUp" width="600"> |
| 79 | - <up-load | ||
| 80 | - :url="url" | ||
| 81 | - @upSuccess="upSuccess" | ||
| 82 | - fileName="班级名单" | ||
| 83 | - > | 84 | + <up-load :url="url" @upSuccess="upSuccess" fileName="班级名单"> |
| 84 | <p class="down-txt" slot="down"> | 85 | <p class="down-txt" slot="down"> |
| 85 | 通过Excel名单导入班级名单,点击 | 86 | 通过Excel名单导入班级名单,点击 |
| 86 | <el-link type="danger" @click="downExcel">模板下载</el-link> 。 | 87 | <el-link type="danger" @click="downExcel">模板下载</el-link> 。 |
| @@ -124,7 +125,11 @@ | @@ -124,7 +125,11 @@ | ||
| 124 | <div class="dialog-footer" slot="footer"> | 125 | <div class="dialog-footer" slot="footer"> |
| 125 | <el-button @click="_SaveClass" type="primary">确 定</el-button> | 126 | <el-button @click="_SaveClass" type="primary">确 定</el-button> |
| 126 | <el-button @click="diaClass = false">取 消</el-button> | 127 | <el-button @click="diaClass = false">取 消</el-button> |
| 127 | - <el-popconfirm title="确定删除该班级吗?" @confirm="_RemoveClass"> | 128 | + <el-popconfirm |
| 129 | + v-if="!formClass.teacherCount && !formClass.studentCount" | ||
| 130 | + title="确定删除该班级吗?" | ||
| 131 | + @confirm="_RemoveClass" | ||
| 132 | + > | ||
| 128 | <el-button class="el-button-del" slot="reference" type="danger" plain | 133 | <el-button class="el-button-del" slot="reference" type="danger" plain |
| 129 | >删 除</el-button | 134 | >删 除</el-button |
| 130 | > | 135 | > |
| @@ -201,7 +206,7 @@ | @@ -201,7 +206,7 @@ | ||
| 201 | </template> | 206 | </template> |
| 202 | 207 | ||
| 203 | <script> | 208 | <script> |
| 204 | -import { downloadFile } from "@/utils"; | 209 | +import { downloadFile, formatDate } from "@/utils"; |
| 205 | import draggable from "vuedraggable"; | 210 | import draggable from "vuedraggable"; |
| 206 | export default { | 211 | export default { |
| 207 | components: { | 212 | components: { |
| @@ -224,6 +229,8 @@ export default { | @@ -224,6 +229,8 @@ export default { | ||
| 224 | className: "", | 229 | className: "", |
| 225 | classCode: "", | 230 | classCode: "", |
| 226 | intoSchoolYear: "", | 231 | intoSchoolYear: "", |
| 232 | + studentCount: "", | ||
| 233 | + teacherCount: "", | ||
| 227 | }, | 234 | }, |
| 228 | rulesClass: { | 235 | rulesClass: { |
| 229 | className: [ | 236 | className: [ |
| @@ -243,10 +250,10 @@ export default { | @@ -243,10 +250,10 @@ export default { | ||
| 243 | this._QuerySubject(); | 250 | this._QuerySubject(); |
| 244 | }, | 251 | }, |
| 245 | methods: { | 252 | methods: { |
| 246 | - toArchived(){ | 253 | + toArchived() { |
| 247 | this.$router.push({ | 254 | this.$router.push({ |
| 248 | - path:'/archived' | ||
| 249 | - }) | 255 | + path: "/archived", |
| 256 | + }); | ||
| 250 | }, | 257 | }, |
| 251 | openSubject(obj) { | 258 | openSubject(obj) { |
| 252 | this.formClass.gradeName = obj.gradeName; | 259 | this.formClass.gradeName = obj.gradeName; |
| @@ -275,6 +282,8 @@ export default { | @@ -275,6 +282,8 @@ export default { | ||
| 275 | this._QueryData(); | 282 | this._QueryData(); |
| 276 | }, | 283 | }, |
| 277 | setClass(obj, gradeName) { | 284 | setClass(obj, gradeName) { |
| 285 | + this.formClass.studentCount = obj.studentCount; | ||
| 286 | + this.formClass.teacherCount = obj.teacherCount; | ||
| 278 | this.formClass.gradeName = gradeName; | 287 | this.formClass.gradeName = gradeName; |
| 279 | this.formClass.classId = obj.id; | 288 | this.formClass.classId = obj.id; |
| 280 | this.formClass.className = obj.className; | 289 | this.formClass.className = obj.className; |
| @@ -284,24 +293,17 @@ export default { | @@ -284,24 +293,17 @@ export default { | ||
| 284 | : ""; | 293 | : ""; |
| 285 | this.diaClass = true; | 294 | this.diaClass = true; |
| 286 | }, | 295 | }, |
| 287 | - _RemoveClass() { | ||
| 288 | - this.$refs.formClass.validate(async (valid) => { | ||
| 289 | - if (valid) { | ||
| 290 | - const { data, status, info } = await this.$request.removeClass({ | ||
| 291 | - classId: this.formClass.classId, | ||
| 292 | - }); | ||
| 293 | - if (status === 0) { | ||
| 294 | - this.$message.success("修改成功"); | ||
| 295 | - this.diaClass = false; | ||
| 296 | - this._QueryData(); | ||
| 297 | - } else { | ||
| 298 | - this.$message.error(info); | ||
| 299 | - } | ||
| 300 | - } else { | ||
| 301 | - this.$message.warning("输入有误请检查!"); | ||
| 302 | - return false; | ||
| 303 | - } | 296 | + async _RemoveClass() { |
| 297 | + const { data, status, info } = await this.$request.removeClass({ | ||
| 298 | + classId: this.formClass.classId, | ||
| 304 | }); | 299 | }); |
| 300 | + if (status === 0) { | ||
| 301 | + this.$message.success("修改成功"); | ||
| 302 | + this.diaClass = false; | ||
| 303 | + this._QueryData(); | ||
| 304 | + } else { | ||
| 305 | + this.$message.error(info); | ||
| 306 | + } | ||
| 305 | }, | 307 | }, |
| 306 | _SaveClass() { | 308 | _SaveClass() { |
| 307 | this.$refs.formClass.validate(async (valid) => { | 309 | this.$refs.formClass.validate(async (valid) => { |
| @@ -309,7 +311,8 @@ export default { | @@ -309,7 +311,8 @@ export default { | ||
| 309 | const { data, status, info } = await this.$request.updateClass({ | 311 | const { data, status, info } = await this.$request.updateClass({ |
| 310 | classId: this.formClass.classId, | 312 | classId: this.formClass.classId, |
| 311 | className: this.formClass.className, | 313 | className: this.formClass.className, |
| 312 | - intoSchoolYear: this.formClass.intoSchoolYear, | 314 | + classCode: this.formClass.classCode, |
| 315 | + intoSchoolYear: formatDate(this.formClass.intoSchoolYear, "yyyy"), | ||
| 313 | }); | 316 | }); |
| 314 | if (status === 0) { | 317 | if (status === 0) { |
| 315 | this.$message.success("修改成功"); | 318 | this.$message.success("修改成功"); |
| @@ -468,9 +471,9 @@ export default { | @@ -468,9 +471,9 @@ export default { | ||
| 468 | </script> | 471 | </script> |
| 469 | 472 | ||
| 470 | <style lang="scss" scoped> | 473 | <style lang="scss" scoped> |
| 471 | -.fenban{ | ||
| 472 | - width:28px; | ||
| 473 | - margin-left:10px; | 474 | +.fenban { |
| 475 | + width: 28px; | ||
| 476 | + margin-left: 10px; | ||
| 474 | cursor: pointer; | 477 | cursor: pointer; |
| 475 | } | 478 | } |
| 476 | .page-tit { | 479 | .page-tit { |