From e8d84774b46145df1c36e5a27e4b60154df4a179 Mon Sep 17 00:00:00 2001 From: 龚焕茏 <2842157468@qq.com> Date: 星期五, 07 六月 2024 09:38:34 +0800 Subject: [PATCH] feat:成绩管理-考生展示 --- src/views/Manage/ClassManagement/Class.vue | 156 +++++++++++++++++++++++++++++++++++++++++----------- 1 files changed, 123 insertions(+), 33 deletions(-) diff --git a/src/views/Manage/ClassManagement/Class.vue b/src/views/Manage/ClassManagement/Class.vue index 65511b8..db5b41d 100644 --- a/src/views/Manage/ClassManagement/Class.vue +++ b/src/views/Manage/ClassManagement/Class.vue @@ -15,19 +15,25 @@ @click="handlerAdd" >鏂板鐝骇</el-button> </div> - <div - class="flex" - style="align-items:center" - > - <p style="margin-left:20px;margin-right: 10px;">鎵�鍦ㄥ崟浣�</p> -<!-- <el-select v-model="searchData.deptId">--> -<!-- <el-option></el-option>--> -<!-- </el-select>--> - </div> + <el-form :inline="true" :model="searchForm" class="demo-form-inline"> + <el-form-item label="鐝骇鍚嶇О"> + <el-input v-model="searchForm.className" clearable @clear="page" placeholder="鐝骇鍚嶇О"></el-input> + </el-form-item> + <el-form-item label="鐝骇鐘舵��"> + <el-select v-model="searchForm.status" clearable @change="page" placeholder="鐝骇鐘舵��"> + <el-option label="姝e父" value="normal"></el-option> + <el-option label="瑙f暎" value="dissolution"></el-option> + </el-select> + </el-form-item> + <el-form-item> + <el-button type="primary" @click="page">鏌ヨ</el-button> + </el-form-item> + </el-form> </div> <div> <div> <el-table + v-loading="loading" :data="tableData" border :row-style="{height:'42px'}" @@ -36,15 +42,20 @@ <el-table-column align="center" label="鐝骇" - prop="class" - width="80px" + prop="className" + width="180px" ></el-table-column> <el-table-column - label="骞寸骇" + label="鐘舵��" align="center" width="80px" - prop="grade" - ></el-table-column> + prop="status" + > + <template slot-scope="scope"> + <el-tag v-if="scope.row.status === '姝e父'" type="success">{{scope.row.status}}</el-tag> + <el-tag v-if="scope.row.status === '瑙f暎'" type="danger">{{scope.row.status}}</el-tag> + </template> + </el-table-column> <el-table-column width="100px" align="center" @@ -55,35 +66,37 @@ align="center" width="100px" label="鏁欏笀" - prop="teacher" + prop="createUserName" ></el-table-column> <el-table-column align="center" width="120px" label="鑱旂郴鐢佃瘽" - prop="phone" + prop="teacherPhone" ></el-table-column> <el-table-column width="140px" - label="鐢靛瓙閭欢" - align="center" - prop="email" - ></el-table-column> - <el-table-column - width="90px" label="寮�鐝椂闂�" align="center" - prop="openingTime" + prop="startTime" + ></el-table-column> + <el-table-column + width="140px" + label="缁撴潫鏃堕棿" + align="center" + prop="endTime" ></el-table-column> <el-table-column label="鎿嶄綔" align="center" + fixed="right" > <template slot-scope="scope"> - <el-button>鐝骇楠岃瘉</el-button> - <el-button>閫氱煡</el-button> - <el-button @click="routersTo()">鎴愬憳绠$悊</el-button> - <el-button>娣诲姞鎴愬憳</el-button> + <el-button size="small" @click="handlerEdit(scope.row)" type="primary">淇敼</el-button> + <el-button size="small" type="warning">鐝骇楠岃瘉</el-button> + <el-button size="small" @click="handlerOpenNotify(scope.row)" type="info">閫氱煡</el-button> + <el-button @click="studentManager(scope.row.id)" size="small" type="success">鎴愬憳绠$悊</el-button> + <el-button v-if="scope.row.status !== '瑙f暎'" @click="dissolution(scope.row.id)" type="danger" size="small">瑙f暎</el-button> </template> </el-table-column> </el-table> @@ -101,6 +114,24 @@ </div> + <el-dialog + title="鐝骇閫氱煡" + :visible.sync="notifyOpen" + width="600px" + :before-close="handleClose"> + <el-form :model="notifyForm" :rules="notifyRules" ref="notifyForm" label-width="100px" class="demo-ruleForm"> + <el-form-item label="閫氱煡鐝骇锛�" prop="className"> + <span>{{notifyForm.className}}</span> + </el-form-item> + <el-form-item label="閫氱煡鍐呭锛�" prop="notifyContent"> + <el-input type="textarea" v-model="notifyForm.notifyContent" size="small"></el-input> + </el-form-item> + </el-form> + <span slot="footer" class="dialog-footer"> + <el-button @click="handleNotifyClose">鍙� 娑�</el-button> + <el-button type="primary" @click="submitNotifyForm">纭� 瀹�</el-button> + </span> + </el-dialog> <el-dialog :title="title" @@ -149,17 +180,27 @@ </template> <script> -import { addClasses, editClasses, getClassess } from "@/api/classes"; +import { addClasses, editClasses, getClassess, dissolution } from "@/api/classes"; +import { addClassesNotify } from "@/api/classesNotify"; import Pagination from "@/components/Pagination" export default { components: {Pagination}, data() { return { + notifyOpen: false, + notifyForm: { + className: '', + notifyContent: '', + classesId: null + }, + loading: true, total: 0, open: false, title: "", value: "", searchForm: { + className:'', + status: '', subject: null, pageSize: 10, pageNum: 1 @@ -172,6 +213,12 @@ startTime: null, endTime: null, remark: "" + }, + notifyRules: { + notifyContent: [ + { required: true, message: '璇疯緭鍏ラ�氱煡鍐呭', trigger: 'blur' }, + { min: 1, max: 500, message: '闀垮害鍦� 1 鍒� 500 涓瓧绗�', trigger: 'blur' } + ], }, rules: { className: [ @@ -191,9 +238,38 @@ }; }, methods: { + handlerOpenNotify(row) { + this.notifyOpen = true + this.notifyForm.className = row.className + this.notifyForm.classesId = row.id + }, + submitNotifyForm() { + this.$refs['notifyForm'].validate((valid) => { + if (valid) { + let _this = this + addClassesNotify(_this.notifyForm).then(res => { + this.$message.success(res.data.message) + this.notifyOpen = false + this.clearNotifyForm() + }) + } + }) + }, + clearNotifyForm() { + this.notifyForm = { + className: '', + notifyContent: '' + } + }, + handleNotifyClose() { + this.notifyOpen = false + this.clearNotifyForm() + }, page() { getClassess(this.searchForm).then(res => { this.tableData = res.data.data + this.total = res.data.total + this.loading = false }) }, resetForm() { @@ -213,17 +289,30 @@ if (this.form.id) { editClasses(this.form).then(res => { this.$message.success("淇敼鎴愬姛") + this.resetForm() + this.open = false }) } else { addClasses(this.form).then(res => { this.$message.success("娣诲姞鐝骇鎴愬姛") + this.resetForm() + this.open = false }) } - this.resetForm() } else { return false; } }); + }, + dissolution(id) { + dissolution(id).then(res => { + this.$message.success(res.data.message) + this.page() + }) + }, + handlerEdit(row) { + this.form = row; + this.open = true }, handleClose() { this.open = false @@ -234,16 +323,17 @@ this.title = "鏂板鐝骇" }, // 璺宠浆(鏌ョ湅鐝骇浜哄憳鎯呭喌) - routersTo() { - this.$router.push({ - name: "ClassStaff", - }); + studentManager(classesId) { + this.$router.push({ path: "class-management/Class-staff", query: { classesId: classesId } }); }, // 杩斿洖涓婁竴涓〉闈� goBack() { this.$router.back(); }, }, + created() { + this.page() + }, }; </script> -- Gitblit v1.8.0