Bläddra i källkod

12/31 优化学生考情列表展示

mo 4 år sedan
förälder
incheckning
335afbe0c7
1 ändrade filer med 52 tillägg och 45 borttagningar
  1. 52 45
      src/views/stuRecodeManager/index.vue

+ 52 - 45
src/views/stuRecodeManager/index.vue

@@ -22,7 +22,10 @@
           ></el-input>
         </el-form-item>
         <el-form-item prop="teacherId">
-          <remote-search :commit='"setTeachers"' v-model='searchForm.teacherId' />
+          <remote-search
+            :commit="'setTeachers'"
+            v-model="searchForm.teacherId"
+          />
         </el-form-item>
 
         <el-form-item prop="organId">
@@ -72,7 +75,7 @@
             ></el-option>
           </el-select>
         </el-form-item>
-         <el-form-item prop="courseScheduleType">
+        <el-form-item prop="courseScheduleType">
           <el-select
             v-model.trim="searchForm.courseScheduleType"
             clearable
@@ -100,14 +103,15 @@
             ></el-option>
           </el-select>
         </el-form-item>
-            <el-form-item prop="dates" >
+        <el-form-item prop="dates">
           <el-date-picker
-            v-model="dates"
+            v-model="searchForm.dates"
             type="daterange"
-            style="width: 405px;"
+            style="width: 405px"
             range-separator="至"
             start-placeholder="课程开始日期"
-            end-placeholder="课程结束日期">
+            end-placeholder="课程结束日期"
+          >
           </el-date-picker>
         </el-form-item>
         <el-form-item>
@@ -126,7 +130,12 @@
             prop="courseSchedule.organization.name"
             label="分部"
           ></el-table-column>
-          <el-table-column align="center" prop="username" label="学生姓名">
+          <el-table-column
+            align="center"
+            prop="username"
+            label="学生姓名"
+            width="110px"
+          >
             <template slot-scope="scope">
               <div>
                 {{ scope.row.username }}
@@ -140,6 +149,7 @@
           <el-table-column
             align="center"
             prop="courseSchedule.teacherName"
+            width="120px"
             label="老师姓名"
           >
             <template slot-scope="scope">
@@ -150,27 +160,23 @@
               </p>
             </template>
           </el-table-column>
-          <el-table-column
-            align="center"
-            prop="musicGroupId"
-            label="乐团编号"
-          >
-          <template slot-scope="scope">
-            <div>
-              <copy-text>{{ scope.row.musicGroupId }}</copy-text>
-            </div>
-          </template>
+          <el-table-column align="center" prop="musicGroupId" label="乐团编号">
+            <template slot-scope="scope">
+              <div>
+                <copy-text>{{ scope.row.musicGroupId }}</copy-text>
+              </div>
+            </template>
           </el-table-column>
           <el-table-column
             align="center"
             prop="courseScheduleId"
             label="课程编号"
           >
-              <template slot-scope="scope">
-            <div>
-              <copy-text>{{ scope.row.courseScheduleId }}</copy-text>
-            </div>
-          </template>
+            <template slot-scope="scope">
+              <div>
+                <copy-text>{{ scope.row.courseScheduleId }}</copy-text>
+              </div>
+            </template>
           </el-table-column>
 
           <el-table-column
@@ -178,24 +184,26 @@
             prop="courseSchedule.name"
             label="课程名称"
           ></el-table-column>
-          <el-table-column
+          <!-- <el-table-column
             align="center"
             prop="courseSchedule.classDate"
             label="上课日期"
           >
             <template slot-scope="scope">
               <div>
-                {{ scope.row.courseSchedule.classDate | dayjsFormat }}
+
               </div>
             </template>
-          </el-table-column>
+          </el-table-column> -->
           <el-table-column
+          width="180px"
             align="center"
             prop="startClassTime"
             label="上课时间"
           >
             <template slot-scope="scope">
               <div>
+                   {{ scope.row.courseSchedule.classDate | dayjsFormat }}
                 {{
                   scope.row.courseSchedule.startClassTime | dayjsFormatMinute
                 }}-{{
@@ -233,13 +241,10 @@
               </div>
             </template>
           </el-table-column>
-          <el-table-column
-            align="center"
-            label="是否被合并"
-          >
+          <el-table-column align="center" label="是否被合并">
             <template slot-scope="scope">
               <div>
-                {{ scope.row.courseSchedule.newCourseId > 0 ? '是' : '否' }}
+                {{ scope.row.courseSchedule.newCourseId > 0 ? "是" : "否" }}
               </div>
             </template>
           </el-table-column>
@@ -286,11 +291,7 @@ import qs from "qs";
 import { findStudentAttendance } from "@/api/buildTeam";
 
 // import { queryTeacherAttendances } from "@/api/recodeManager";
-import {
-  courseType,
-  courseListType,
-  stuAttendance,
-} from "@/utils/searchArray";
+import { courseType, courseListType, stuAttendance } from "@/utils/searchArray";
 export default {
   components: { pagination },
   data() {
@@ -301,14 +302,15 @@ export default {
         musicGroupId: "",
         courseScheduleId: "",
         status: "",
-        teacherId:'',
-        courseScheduleType:'',
-        organId:''
+        teacherId: "",
+        courseScheduleType: "",
+        organId: "",
+        dates: [],
       },
-      dates:[],
+
       courseType,
       courseListType,
-      attendanceStatus:stuAttendance,
+      attendanceStatus: stuAttendance,
       // teacherList: [],
       tableList: [],
       organList: [],
@@ -325,20 +327,25 @@ export default {
   created() {},
   //生命周期 - 挂载完成(可以访问DOM元素)
   mounted() {
+    if (this.searchForm.dates?.length < 1) {
+        this.searchForm.dates = [new Date(),new Date()]
+    }
     this.init();
   },
 
   methods: {
-   async init() {
-       await this.$store.dispatch('setBranchs')
+    async init() {
+      await this.$store.dispatch("setBranchs");
       this.getList();
     },
     getList() {
-      let obj = {
+      const { dates, ...rest } = this.searchForm;
+      let obj =  {
+        ...rest,
         page: this.rules.page,
         rows: this.rules.limit,
-        ...this.searchForm,
-        ...getTimes(this.dates, ["startDateOfCourse", "endDateOfCourse"],'YYYY-MM-DD'),
+        ...getTimes(dates, ["startDateOfCourse", "endDateOfCourse"],  "YYYY-MM-DD"),
+
       };
       findStudentAttendance(obj).then((res) => {
         if (res.code == 200) {