From c05e517726e3e81cbf216ca6fae763d84fde336b Mon Sep 17 00:00:00 2001
From: xiangpei <xiangpei@timesnew.cn>
Date: 星期一, 03 六月 2024 16:11:18 +0800
Subject: [PATCH] 提交信息

---
 src/views/Manage/ClassManagement/Class.vue |  252 +++++++++++++++++++++++++------------------------
 1 files changed, 128 insertions(+), 124 deletions(-)

diff --git a/src/views/Manage/ClassManagement/Class.vue b/src/views/Manage/ClassManagement/Class.vue
index a4c8e74..65511b8 100644
--- a/src/views/Manage/ClassManagement/Class.vue
+++ b/src/views/Manage/ClassManagement/Class.vue
@@ -3,31 +3,26 @@
   <div class="c">
     <div class="bg">
       <div class="main">
-        <TitleIndex title='鐝骇绠$悊' />
         <div class="main-1">
           <div
             class="main-btn flex"
             style="justify-content:space-between"
           >
             <div>
-              <s-button
-                colorType="deepBlue"
+              <el-button
+                type="primary"
                 style="margin-right:20px;"
-                @click="$router.push('/manage/class-management/Class-staff')"
-              >鏂板鐝骇</s-button>
+                @click="handlerAdd"
+              >鏂板鐝骇</el-button>
             </div>
             <div
               class="flex"
               style="align-items:center"
             >
-              <p style="padding-right:10px">鎺掑簭鏂瑰紡</p>
-              <el-select>
-                <el-option></el-option>
-              </el-select>
               <p style="margin-left:20px;margin-right: 10px;">鎵�鍦ㄥ崟浣�</p>
-              <el-select>
-                <el-option></el-option>
-              </el-select>
+<!--              <el-select v-model="searchData.deptId">-->
+<!--                <el-option></el-option>-->
+<!--              </el-select>-->
             </div>
           </div>
           <div>
@@ -89,19 +84,6 @@
                     <el-button>閫氱煡</el-button>
                     <el-button @click="routersTo()">鎴愬憳绠$悊</el-button>
                     <el-button>娣诲姞鎴愬憳</el-button>
-                    <el-select
-                      v-model="value"
-                      style="width:74px;margin-left: 10px;"
-                      placeholder="閫夋嫨"
-                    >
-                      <el-option
-                        v-for="item in options"
-                        :key="item.value"
-                        :label="item.label"
-                        :value="item.value"
-                      >
-                      </el-option>
-                    </el-select>
                   </template>
                 </el-table-column>
               </el-table>
@@ -110,125 +92,147 @@
               class="flex"
               style="justify-content:center;margin-top:20px;"
             >
-              <el-pagination
-                background
-                layout="prev, pager, next"
-                :total="1000"
-              >
-              </el-pagination>
+              <pagination v-show="total>0" :total="total" :page.sync="searchForm.pageIndex" :limit.sync="searchForm.pageSize"
+                          @pagination="page"/>
             </div>
           </div>
         </div>
       </div>
 
     </div>
+
+
+    <el-dialog
+      :title="title"
+      :visible.sync="open"
+      width="700px"
+      :before-close="handleClose">
+      <el-form :model="form" :rules="rules" ref="form" label-width="100px" class="demo-ruleForm">
+        <el-form-item label="鐝骇鍚嶇О" prop="className">
+          <el-input v-model="form.className" size="small"></el-input>
+        </el-form-item>
+        <el-form-item label="鐝骇鏃堕棿" required>
+          <el-col :span="11">
+            <el-form-item prop="startTime">
+              <el-date-picker
+                v-model="form.startTime"
+                type="date"
+                value-format="yyyy-MM-dd"
+                placeholder="寮�濮嬫棩鏈�">
+              </el-date-picker>
+            </el-form-item>
+          </el-col>
+          <el-col class="line" :span="2">-</el-col>
+          <el-col :span="11">
+            <el-form-item prop="endTime">
+              <el-date-picker
+                v-model="form.endTime"
+                type="date"
+                value-format="yyyy-MM-dd"
+                placeholder="缁撴潫鏃ユ湡">
+              </el-date-picker>
+            </el-form-item>
+          </el-col>
+        </el-form-item>
+
+        <el-form-item label="澶囨敞淇℃伅" prop="remark">
+          <el-input type="textarea" v-model="form.remark" size="small"></el-input>
+        </el-form-item>
+      </el-form>
+      <span slot="footer" class="dialog-footer">
+        <el-button @click="handleClose">鍙� 娑�</el-button>
+        <el-button type="primary" @click="submitForm">纭� 瀹�</el-button>
+      </span>
+    </el-dialog>
+
   </div>
 </template>
 
 <script>
+import { addClasses, editClasses, getClassess } from "@/api/classes";
+import Pagination from "@/components/Pagination"
 export default {
+  components: {Pagination},
   data() {
     return {
+      total: 0,
+      open: false,
+      title: "",
       value: "",
-      searchData: {
+      searchForm: {
         subject: null,
+        pageSize: 10,
+        pageNum: 1
+      },
+      form: {
+        id: null,
+        className: "",
+        status: "",
+        verifyStatus: "",
+        startTime: null,
+        endTime: null,
+        remark: ""
+      },
+      rules: {
+        className: [
+          { required: true, message: '璇疯緭鍏ョ彮绾у悕绉�', trigger: 'blur' },
+          { min: 1, max: 30, message: '闀垮害鍦� 1 鍒� 30 涓瓧绗�', trigger: 'blur' }
+        ],
+        startTime: [
+          { required: true, message: '璇烽�夋嫨鐝骇寮�濮嬫椂闂�', trigger: 'change' },
+        ],
+        endTime: [
+          { required: true, message: '璇烽�夋嫨鐝骇缁撴潫鏃堕棿', trigger: 'change' },
+        ],
       },
       tableData: [
-        {
-          class: "杞欢宸ョ▼",
-          grade: "2019绾�",
-          unit: "铻轰笣閮�",
-          teacher: "绉嬫ⅷ鑶�",
-          phone: "182-9384-9302",
-          email: "info@exaple.com",
-          openingTime: "2022/3/29",
-        },
-        {
-          class: "杞欢宸ョ▼",
-          grade: "2019绾�",
-          unit: "铻轰笣閮�",
-          teacher: "绉嬫ⅷ鑶�",
-          phone: "182-9384-9302",
-          email: "info@exaple.com",
-          openingTime: "2022/3/29",
-        },
-        {
-          class: "杞欢宸ョ▼",
-          grade: "2019绾�",
-          unit: "铻轰笣閮�",
-          teacher: "绉嬫ⅷ鑶�",
-          phone: "182-9384-9302",
-          email: "info@exaple.com",
-          openingTime: "2022/3/29",
-        },
-        {
-          class: "杞欢宸ョ▼",
-          grade: "2019绾�",
-          unit: "铻轰笣閮�",
-          teacher: "绉嬫ⅷ鑶�",
-          phone: "182-9384-9302",
-          email: "info@exaple.com",
-          openingTime: "2022/3/29",
-        },
-        {
-          class: "杞欢宸ョ▼",
-          grade: "2019绾�",
-          unit: "铻轰笣閮�",
-          teacher: "绉嬫ⅷ鑶�",
-          phone: "182-9384-9302",
-          email: "info@exaple.com",
-          openingTime: "2022/3/29",
-        },
-        {
-          class: "杞欢宸ョ▼",
-          grade: "2019绾�",
-          unit: "铻轰笣閮�",
-          teacher: "绉嬫ⅷ鑶�",
-          phone: "182-9384-9302",
-          email: "info@exaple.com",
-          openingTime: "2022/3/29",
-        },
-        {
-          class: "杞欢宸ョ▼",
-          grade: "2019绾�",
-          unit: "铻轰笣閮�",
-          teacher: "绉嬫ⅷ鑶�",
-          phone: "182-9384-9302",
-          email: "info@exaple.com",
-          openingTime: "2022/3/29",
-        },
-        {
-          class: "杞欢宸ョ▼",
-          grade: "2019绾�",
-          unit: "铻轰笣閮�",
-          teacher: "绉嬫ⅷ鑶�",
-          phone: "182-9384-9302",
-          email: "info@exaple.com",
-          openingTime: "2022/3/29",
-        },
-        {
-          class: "杞欢宸ョ▼",
-          grade: "2019绾�",
-          unit: "铻轰笣閮�",
-          teacher: "绉嬫ⅷ鑶�",
-          phone: "182-9384-9302",
-          email: "info@exaple.com",
-          openingTime: "2022/3/29",
-        },
+
       ],
-      pageData: {
-        size: 7,
-        page: 1,
-      },
     };
   },
   methods: {
-    // // 鏌ョ湅璇︽儏
-    // detailsTo() {
-    //   this.$router.push({
-    //     name: "teacherDetail",
-    //   });
-    // },
+    page() {
+      getClassess(this.searchForm).then(res => {
+        this.tableData = res.data.data
+      })
+    },
+    resetForm() {
+      this.form = {
+        id: null,
+        className: "",
+        status: "",
+        verifyStatus: "",
+        startTime: null,
+        endTime: null,
+        remark: ""
+      }
+    },
+    submitForm() {
+      this.$refs['form'].validate((valid) => {
+        if (valid) {
+          if (this.form.id) {
+            editClasses(this.form).then(res => {
+              this.$message.success("淇敼鎴愬姛")
+            })
+          } else {
+            addClasses(this.form).then(res => {
+              this.$message.success("娣诲姞鐝骇鎴愬姛")
+            })
+          }
+          this.resetForm()
+        } else {
+          return false;
+        }
+      });
+    },
+    handleClose() {
+      this.open = false
+      this.resetForm()
+    },
+    handlerAdd() {
+      this.open = true
+      this.title = "鏂板鐝骇"
+    },
     // 璺宠浆(鏌ョ湅鐝骇浜哄憳鎯呭喌)
     routersTo() {
       this.$router.push({
@@ -287,4 +291,4 @@
     background-color: rgb(45, 92, 248);
   }
 }
-</style>
\ No newline at end of file
+</style>

--
Gitblit v1.8.0