Browse Source

准备开始详情里的内容

1
mo 2 years ago
parent
commit
f94492cc4f

+ 35 - 1
src/views/attendanceManager/attendanceList/api.js

@@ -16,4 +16,38 @@ export function getHomePageList (data) {
 //     method: 'post',
 //     data: qs.stringify(data)
 //   })
-// }
+// }
+
+
+// 获取作业详情
+export function findCourseHomeworkDetail (data) {
+  return request({
+    url: api + '/teacher/findCourseHomeworkDetail',
+    method: 'get',
+    params: data
+  })
+}
+
+
+// 获取学生列表
+export function getHomeworkStudent (data) {
+  return request({
+    url: api + '/teacher/findCourseStudentsPublic/v2',
+    method: 'post',
+    data,
+    requestType: "json"
+
+  })
+}
+
+// 获取课程声部
+
+export function getHomeworkSubjectPublic (data) {
+  return request({
+    url: api + '/teacher/findCourseStudentsSubjectPublic/v2',
+    method: 'post',
+    data,
+    requestType: "json"
+
+  })
+}

+ 156 - 3
src/views/attendanceManager/attendanceList/components/courseWorkeDetail.vue

@@ -1,11 +1,164 @@
 <template>
-  <div></div>
+  <div>
+    <div class="teacherWrap">
+      <div class="teacherHeader">
+        <el-image
+          style="width: 50px; height: 50px"
+          :src="courseDetail.teacherImg ? courseDetail.teacherImg : tetacherIcon"
+        ></el-image>
+      </div>
+      <div class="courseInfo">
+        <h4>
+          {{ courseDetail.courseScheduleName }}
+        </h4>
+        <span>{{ courseDetail.teacherName }}</span>
+      </div>
+    </div>
+    <el-descriptions class="margin-top" :column="3" direction="vertical">
+      <el-descriptions-item
+        label="乐团"
+        label-class-name="my-label"
+        content-class-name="my-content"
+        >{{ courseDetail.musicGroupName }}</el-descriptions-item
+      >
+      <el-descriptions-item
+        label="课程编号"
+        label-class-name="my-label"
+        content-class-name="my-content"
+        >{{ courseDetail.courseScheduleId }}</el-descriptions-item
+      >
+      <el-descriptions-item
+        label="上课时间"
+        label-class-name="my-label"
+        content-class-name="my-content"
+      >
+        {{ courseDetail.classDate | dayjsFormat }}
+        {{ courseDetail.startTime | dayjsFormatMinute }}-{{
+          courseDetail.endTime | dayjsFormatMinute
+        }}</el-descriptions-item
+      >
+      <el-descriptions-item
+        label="布置时间"
+        label-class-name="my-label"
+        content-class-name="my-content"
+        >{{ courseDetail.assignTime }}</el-descriptions-item
+      >
+      <el-descriptions-item
+        label="截止时间"
+        label-class-name="my-label"
+        content-class-name="my-content"
+        >{{ courseDetail.expiryDate }}</el-descriptions-item
+      >
+      <el-descriptions-item
+        label="完成情况"
+        label-class-name="my-label"
+        content-class-name="my-content"
+        >{{ courseDetail.finishNum }} /
+        {{ courseDetail.studentNum }}</el-descriptions-item
+      >
+    </el-descriptions>
+    <el-tabs v-model.trim="activeName">
+      <el-tab-pane
+        label="学员列表"
+        name="first"
+        v-if="permission('/teamCourseListDetailStudnetList')"
+      >
+        <div v-if="activeName == 'first'">
+          <studentWroks ref="studentWroksRef" :courseScheduleId="courseScheduleId" />
+        </div>
+      </el-tab-pane>
+      <el-tab-pane
+        label="练习内容"
+        name="second"
+        v-if="permission('/teamCourseListDetailStudnetList')"
+      >
+        <div v-if="activeName == 'second'">练习内容</div>
+      </el-tab-pane>
+    </el-tabs>
+  </div>
 </template>
 <script>
+import tetacherIcon from "@/assets/images/base/woman.png";
+import { permission } from "@/utils/directivePage";
+import { findCourseHomeworkDetail } from "@/views/attendanceManager/attendanceList/api";
+import studentWroks from "./studentWroks.vue";
 export default {
+  props: ["courseScheduleId"],
+  components: { studentWroks },
   data() {
-    return {};
+    return {
+      tetacherIcon,
+      activeName: "first",
+      courseDetail: {
+        assignTime: "",
+        classDate: "",
+        startTime: "",
+        endTime: "",
+        classGroupName: "",
+        courseScheduleName: "",
+        musicGroupName: "",
+        expiryDate: "",
+        subjectName: "",
+        teacherName: "",
+        teacherImg: "",
+        courseScheduleId: "",
+        finishNum: "",
+        studentNum: "",
+      },
+      trainingDetailList: [],
+    };
+  },
+  mounted() {
+    console.log("courseScheduleId", this.courseScheduleId);
+    this.getWorkerDetail();
+  },
+  methods: {
+    async getWorkerDetail() {
+      try {
+        const res = await findCourseHomeworkDetail({
+          courseScheduleId: this.courseScheduleId,
+        });
+        this.courseDetail = { ...res.data };
+        this.trainingDetailList = res.data.trainingDetailList;
+      } catch (e) {
+        console.log(e);
+      }
+    },
+    permission(str, parent) {
+      return permission(str, parent);
+    },
   },
-  mounted() {},
 };
 </script>
+<style lang="scss" scoped>
+::v-deep .my-label {
+  font-size: 12px;
+  color: #999;
+}
+
+::v-deep .my-content {
+  color: #333;
+  font-size: 14px;
+  font-weight: bold !important;
+}
+.teacherWrap {
+  display: flex;
+  flex-direction: row;
+  align-items: center;
+  margin-bottom: 20px;
+  .teacherHeader {
+    margin-right: 10px;
+  }
+  .courseInfo {
+    h4 {
+      color: #101010;
+      font-size: 14px;
+      margin-bottom: 3px;
+    }
+    span {
+      color: #999;
+      font-size: 12px;
+    }
+  }
+}
+</style>

+ 101 - 0
src/views/attendanceManager/attendanceList/components/studentWroks.vue

@@ -0,0 +1,101 @@
+<template>
+  <div>
+    <div>
+      <el-checkbox-group
+        @change="checkSubject"
+        v-model="subjectId"
+        size="medium"
+        :max="1"
+        style="margin-bottom: 20px"
+      >
+        <el-checkbox-button
+          :class="subjectList.length == 1 ? 'one' : ''"
+          v-for="(item, index) in subjectList"
+          :key="index"
+          :label="item.id"
+          >{{ item.name }}</el-checkbox-button
+        >
+      </el-checkbox-group>
+      <el-table
+        style="width: 100%"
+        max-height="300px"
+        :header-cell-style="{ background: '#EDEEF0', color: '#444' }"
+        :data="list"
+      >
+        <el-table-column prop="userName" align="center" label="学生姓名">
+        </el-table-column>
+        <el-table-column prop="phone" align="center" label="手机号"> </el-table-column>
+        <el-table-column prop="subjectName" align="center" label="声部名称">
+        </el-table-column>
+        <el-table-column prop="submitTime" align="center" label="完成时间">
+          <template slot-scope="scope">
+            <div>{{ scope.row.submitTime | dateForMinFormat }}</div>
+          </template>
+        </el-table-column>
+        <el-table-column prop="finishFlag" align="center" label="训练情况">
+          <template slot-scope="scope">
+            <div>{{ scope.row.finishFlag ? "已完成" : "未完成" }}</div>
+          </template>
+        </el-table-column>
+      </el-table>
+    </div>
+  </div>
+</template>
+<script>
+import { getHomeworkStudent, getHomeworkSubjectPublic } from "../api";
+export default {
+  props: ["courseScheduleId"],
+  data() {
+    return {
+      subjectId: [],
+      list: [],
+      subjectList: [],
+    };
+  },
+  mounted() {
+    console.log(this.courseScheduleId, "mounted");
+    if (this.courseScheduleId) {
+      // this.getStudentList(this.courseScheduleId);
+      this.getPublicSubject();
+    }
+  },
+
+  methods: {
+    async getStudentList() {
+      try {
+        const res = await getHomeworkStudent({
+          courseScheduleId: this.courseScheduleId,
+          type: "HOMEWORK",
+          subjectId: this.subjectId[0] ? this.subjectId[0] : "",
+        });
+        this.list = res.data;
+      } catch (e) {
+        console.log(e);
+      }
+    },
+    async getPublicSubject() {
+      try {
+        const res = await getHomeworkSubjectPublic({
+          courseScheduleId: this.courseScheduleId,
+          type: "HOMEWORK",
+        });
+        this.subjectList = res.data;
+      } catch (e) {
+        console.log(e);
+      }
+    },
+    checkSubject(val) {
+      console.log(val, "checkSubject", this.subjectId);
+      this.getStudentList();
+    },
+  },
+};
+</script>
+
+<style lang="scss" scoped>
+::v-deep.one {
+  .el-checkbox-button__inner {
+    border-radius: 4px !important;
+  }
+}
+</style>

+ 5 - 3
src/views/attendanceManager/attendanceList/index.vue

@@ -167,10 +167,11 @@
           width="1000px"
           v-if="classVisible"
         >
-          <studentWork
+          <!-- <studentWork
             v-if="activeRow"
             :courseScheduleId="activeRow.courseScheduleId"
-          ></studentWork>
+          ></studentWork> -->
+          <courseWorkeDetail :courseScheduleId="activeRow.courseScheduleId" />
         </el-dialog>
       </div>
     </div>
@@ -183,8 +184,9 @@ import { courseListType } from "@/utils/searchArray";
 import studentWork from "@/views/teamDetail/componentCourse/studentWork";
 import { getHomePageList } from "./api.js";
 import { getTimes } from "@/utils";
+import courseWorkeDetail from "@/views/attendanceManager/attendanceList/components/courseWorkeDetail.vue";
 export default {
-  components: { pagination, studentWork },
+  components: { pagination, studentWork, courseWorkeDetail },
   data() {
     return {
       courseListType,

+ 36 - 94
src/views/teamDetail/teamCourseList.vue

@@ -117,9 +117,7 @@
                 <el-row style="margin-left: 64px">
                   <el-col :span="4">
                     <el-form-item label="考勤申诉:">
-                      <span>{{
-                        props.row.isComplaints == 1 ? "是" : "否"
-                      }}</span>
+                      <span>{{ props.row.isComplaints == 1 ? "是" : "否" }}</span>
                     </el-form-item></el-col
                   >
                   <el-col :span="4">
@@ -139,7 +137,7 @@
                     </el-form-item></el-col
                   >
                 </el-row>
-                <el-row style="margin-left: 64px"  v-if="props.row.newCourseId">
+                <el-row style="margin-left: 64px" v-if="props.row.newCourseId">
                   <el-col :span="4">
                     <el-form-item label="合并类型:">
                       <span>
@@ -164,21 +162,22 @@
                       </span>
                     </el-form-item>
                   </el-col>
-                  <el-col
-                    :span="4"
-
-                  >
+                  <el-col :span="4">
                     <el-form-item label="主课编号:">
                       <el-button type="text" @click="common(props.row)">
                         {{ props.row.newCourseId }}
                       </el-button>
                     </el-form-item></el-col
                   >
-                  <el-col :span="4" >
+                  <el-col :span="4">
                     <el-form-item label="被合并课编号:">
-
-                      <el-button type="text" @click="common1(item)" :key="index" v-for="(item,index) in props.row.mergedCourseIds.split(',')">
-                        {{item }}
+                      <el-button
+                        type="text"
+                        @click="common1(item)"
+                        :key="index"
+                        v-for="(item, index) in props.row.mergedCourseIds.split(',')"
+                      >
+                        {{ item }}
                       </el-button>
                     </el-form-item></el-col
                   >
@@ -198,10 +197,7 @@
             label="乐团/课程组编号"
           >
             <template slot-scope="scope">
-              <div
-                style="color: var(--color-primary)"
-                @click="gotoCourse(scope.row)"
-              >
+              <div style="color: var(--color-primary)" @click="gotoCourse(scope.row)">
                 <copy-text>{{ scope.row.musicGroupId }}</copy-text>
               </div>
             </template>
@@ -226,9 +222,7 @@
                       ? scope.row.startClassTime.substr(0, 16)
                       : ""
                   }}-{{
-                    scope.row.endClassTime
-                      ? scope.row.endClassTime.substr(11, 5)
-                      : ""
+                    scope.row.endClassTime ? scope.row.endClassTime.substr(11, 5) : ""
                   }}
                 </p>
               </div>
@@ -248,11 +242,7 @@
             </template>
           </el-table-column>
 
-          <el-table-column
-            align="center"
-            prop="schoolName"
-            label="教学模式/教学点"
-          >
+          <el-table-column align="center" prop="schoolName" label="教学模式/教学点">
             <template slot-scope="scope">
               <div>
                 <p style="color: #ff802c">
@@ -264,12 +254,7 @@
               </div>
             </template>
           </el-table-column>
-          <el-table-column
-            align="center"
-            label="详情"
-            fixed="right"
-            width="220px"
-          >
+          <el-table-column align="center" label="详情" fixed="right" width="220px">
             <template slot-scope="scope">
               <div>
                 <el-button
@@ -283,10 +268,7 @@
                   v-if="
                     permission('courseSchedule/classStartDateAdjust?hight') &&
                     !scope.row.isLock &&
-                    !(
-                      scope.row.newCourseId > 0 &&
-                      scope.row.newCourseId != scope.row.id
-                    )
+                    !(scope.row.newCourseId > 0 && scope.row.newCourseId != scope.row.id)
                   "
                   @click="resetClass(scope.row)"
                   >调整</el-button
@@ -354,47 +336,31 @@
     <el-dialog title="课表详情" :visible.sync="classVisible" width="1000px">
       <el-form :model="maskForm" :inline="true">
         <el-form-item label="老师姓名">
-
           <div class="inputStyle">{{ maskForm.teacherName }}</div>
         </el-form-item>
         <el-form-item label="课程模式">
-
           <div class="inputStyle">{{ maskForm.teachMode | teachMode }}</div>
-
         </el-form-item>
         <el-form-item label="课程类型">
-
           <div class="inputStyle">{{ maskForm.type | coursesType }}</div>
         </el-form-item>
 
         <el-form-item label="课程状态">
-
           <div class="inputStyle">{{ maskForm.status | coursesStatus }}</div>
         </el-form-item>
 
         <el-form-item label="是否点名">
-
           <div class="inputStyle">{{ maskForm.isCallNames | isCall }}</div>
         </el-form-item>
 
-
         <el-form-item label="上课时间">
-          {{
-            maskForm.startClassTime
-              ? maskForm.startClassTime.substr(0, 16)
-              : ""
-          }}-{{
+          {{ maskForm.startClassTime ? maskForm.startClassTime.substr(0, 16) : "" }}-{{
             maskForm.endClassTime ? maskForm.endClassTime.substr(11, 5) : ""
           }}
         </el-form-item>
         <el-form-item label="上课时长">
-          <div
-            class="inputStyle"
-            :class="maskForm.attendClassTime <= 120 ? '' : 'red'"
-          >
-            {{
-              maskForm.attendClassTime >= 0 ? maskForm.attendClassTime : 0
-            }}分钟
+          <div class="inputStyle" :class="maskForm.attendClassTime <= 120 ? '' : 'red'">
+            {{ maskForm.attendClassTime >= 0 ? maskForm.attendClassTime : 0 }}分钟
             <el-tooltip placement="top" popper-class="mTooltip">
               <div slot="content">学员和老师同时在教室里的时长。</div>
 
@@ -449,7 +415,6 @@
           v-if="permission('/teamCourseListDetailStudnetList')"
         >
           <div v-if="activeName == 'first'">
-
             <studentRollCall
               :courseScheduleId="maskForm.id"
               :isMainGo="isMainGo"
@@ -475,10 +440,7 @@
         <el-tab-pane
           label="训练"
           name="third"
-          v-if="
-            permission('/teamCourseListDetailWorkList') &&
-            maskForm.status == 'OVER'
-          "
+          v-if="permission('/teamCourseListDetailWorkList') && maskForm.status == 'OVER'"
         >
           <div v-if="activeName == 'third'">
             <studentWork :courseScheduleId="maskForm.id"></studentWork>
@@ -520,12 +482,7 @@
         :address="maskForm.school.address"
       />
     </el-dialog>
-    <el-dialog
-      title="更多选项"
-      :visible.sync="showMove"
-      v-if="showMove"
-      width="700px"
-    >
+    <el-dialog title="更多选项" :visible.sync="showMove" v-if="showMove" width="700px">
       <el-form
         :inline="true"
         class="searchForm"
@@ -711,7 +668,6 @@
       </span>
     </el-dialog>
 
-
     <addCompound
       ref="addCompound"
       :compoundList="deleteList"
@@ -753,11 +709,7 @@ import infoMsg from "./componentCourse/infoMsg";
 import cleanDeep from "clean-deep";
 let nowTime = new Date();
 nowTime =
-  nowTime.getFullYear() +
-  "-" +
-  (nowTime.getMonth() + 1) +
-  "-" +
-  nowTime.getDate();
+  nowTime.getFullYear() + "-" + (nowTime.getMonth() + 1) + "-" + nowTime.getDate();
 
 const initSearch = {
   teachMode: null, // 教学模式
@@ -825,7 +777,6 @@ export default {
     SchoolLocation,
   },
   created() {
-
     // this.searchForm.timer = [nowTime, nowTime];
   },
   computed: {
@@ -847,8 +798,7 @@ export default {
         this.searchForm.isCallNames ||
         this.searchForm.memberFlag ||
         this.searchForm.creatTimer?.length > 0 ||
-        (this.searchForm.courseTime?.length > 0 &&
-          this.searchForm.courseTime[0])
+        (this.searchForm.courseTime?.length > 0 && this.searchForm.courseTime[0])
       );
     },
   },
@@ -999,10 +949,7 @@ export default {
       for (let item in searchForm) {
         if (searchForm[item] && !Array.isArray(searchForm[item])) {
           count++;
-        } else if (
-          Array.isArray(searchForm[item]) &&
-          searchForm[item].length > 0
-        ) {
+        } else if (Array.isArray(searchForm[item]) && searchForm[item].length > 0) {
           count++;
         }
       }
@@ -1094,7 +1041,7 @@ export default {
             });
             this.isDetele = false;
           });
-          if( this.$refs.searchForm){
+          if (this.$refs.searchForm) {
             this.$refs.searchForm.save(this.searchForm);
           }
 
@@ -1111,17 +1058,15 @@ export default {
       this.maskForm = row;
       this.activeName = "first";
       this.classVisible = true;
-      getTeacherPersonalAttendanceDetail({ courseScheduleId: row.id }).then(
-        (res) => {
-          if (res.code == 200) {
-            this.maskForm = { ...this.maskForm, ...res.data };
-            this.maskForm.id = row.id;
-            this.activeName = "first";
-            this.classVisible = true;
-            this.isMainGo = this.$refs.filterSearch?.show;
-          }
+      getTeacherPersonalAttendanceDetail({ courseScheduleId: row.id }).then((res) => {
+        if (res.code == 200) {
+          this.maskForm = { ...this.maskForm, ...res.data };
+          this.maskForm.id = row.id;
+          this.activeName = "first";
+          this.classVisible = true;
+          this.isMainGo = this.$refs.filterSearch?.show;
         }
-      );
+      });
     },
     syncTeacherAttend() {
       if (this.maskForm.id) {
@@ -1251,12 +1196,9 @@ export default {
               // 删除这个元素
             }
           });
-          this.deleteList = this.$helpers.lodash.remove(
-            this.deleteList,
-            function (item) {
-              return tableIdList.indexOf(item.id) == -1;
-            }
-          );
+          this.deleteList = this.$helpers.lodash.remove(this.deleteList, function (item) {
+            return tableIdList.indexOf(item.id) == -1;
+          });
           if (this.deleteList.length <= 0) {
             this.clearCom();
           }