From 0af507deb2a8b08a606b795d73c660d02ecb7f49 Mon Sep 17 00:00:00 2001
From: fuliqi <fuliqi@qq.com>
Date: 星期四, 06 六月 2024 17:11:23 +0800
Subject: [PATCH] Merge remote-tracking branch 'origin/master'

---
 src/views/Manage/ClassManagement/Class.vue |  117 +++++++++++++++++++++++++++++++++++++++++++++++-----------
 1 files changed, 94 insertions(+), 23 deletions(-)

diff --git a/src/views/Manage/ClassManagement/Class.vue b/src/views/Manage/ClassManagement/Class.vue
index 6bfa2e3..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'}"
@@ -40,11 +46,16 @@
                   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"
@@ -83,9 +94,9 @@
                   <template slot-scope="scope">
                     <el-button size="small" @click="handlerEdit(scope.row)" type="primary">淇敼</el-button>
                     <el-button size="small" type="warning">鐝骇楠岃瘉</el-button>
-                    <el-button size="small" type="info">閫氱煡</el-button>
-                    <el-button @click="routersTo()" size="small" type="success">鎴愬憳绠$悊</el-button>
-                    <el-button @click="remove(scope.row.id)" type="danger" size="small">鍒犻櫎</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>
@@ -103,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"
@@ -151,17 +180,27 @@
 </template>
 
 <script>
-import { addClasses, editClasses, getClassess, deleteClassesById } 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
@@ -174,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: [
@@ -193,10 +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() {
@@ -231,9 +304,9 @@
         }
       });
     },
-    remove(id) {
-      deleteClassesById(id).then(res => {
-        this.$message.success("鍒犻櫎鎴愬姛")
+    dissolution(id) {
+      dissolution(id).then(res => {
+        this.$message.success(res.data.message)
         this.page()
       })
     },
@@ -250,10 +323,8 @@
       this.title = "鏂板鐝骇"
     },
     // 璺宠浆(鏌ョ湅鐝骇浜哄憳鎯呭喌)
-    routersTo() {
-      this.$router.push({
-        name: "ClassStaff",
-      });
+    studentManager(classesId) {
+      this.$router.push({ path: "class-management/Class-staff", query: { classesId: classesId } });
     },
     // 杩斿洖涓婁竴涓〉闈�
     goBack() {

--
Gitblit v1.8.0