Kaynağa Gözat

0116

提交测试
mo 5 yıl önce
ebeveyn
işleme
4bef29c564

+ 27 - 1
src/api/buildTeam.js

@@ -827,7 +827,7 @@ export function updateStudentFee (data) {
     data: qs.stringify(data)
   })
 }
-
+// -----[-]
 // 获取学员签到列表
 export function findStudentAttendance (data) {
   return request({
@@ -835,4 +835,30 @@ export function findStudentAttendance (data) {
     method: 'get',
     params: data
   })
+}
+
+// 获取签到信息
+export function sumStudentAttendance (data) {
+  return request({
+    url: api + '/studentManage/sumStudentAttendance',
+    method: 'get',
+    params: data
+  })
+}
+// 获取签到经纬度
+export function getTeacherPersonalAttendance (data) {
+  return request({
+    url: api + '/teacherAttendance/getTeacherPersonalAttendance',
+    method: 'get',
+    params: data
+  })
+}
+
+// 获取作业列表
+export function findStudentCourseHomeworks (data) {
+  return request({
+    url: api + '/studentManage/findStudentCourseHomeworks',
+    method: 'get',
+    params: data
+  })
 }

+ 2 - 1
src/utils/vueFilter.js

@@ -277,7 +277,8 @@ Vue.filter('studentRecord', value => {
     NORMAL: "正常",
     TRUANT: "旷课",
     LEAVE: "请假",
-    DROP_OUT: "退学"
+    DROP_OUT: "退学",
+    '': '未签到'
   }
   return template[value]
 })

+ 65 - 1
src/views/teamBuild/components/teamResetSound.vue

@@ -574,7 +574,7 @@ export default {
   }
 }
 </script>
-<style lang="scss">
+<style lang="scss" scoped>
 .chioseWrap {
   margin-bottom: 30px;
   display: flex;
@@ -662,4 +662,68 @@ export default {
     }
   }
 }
+.soundWrap {
+  width: 100%;
+  overflow: auto;
+  .itemList {
+    display: flex;
+    flex-direction: row;
+    justify-content: flex-start;
+    flex-wrap: nowrap;
+    flex-grow: 1;
+    height: 300px;
+    max-height: 300px;
+    overflow: auto;
+    .categroy {
+      width: 150px;
+      min-width: 150px;
+      .el-checkbox {
+        height: 30px;
+        line-height: 30px;
+        display: block;
+        padding-left: 20px;
+      }
+      p {
+        height: 40px;
+        line-height: 40px;
+        background-color: #edeef0;
+        margin-bottom: 15px;
+        text-align: center;
+      }
+    }
+  }
+}
+.soundSubP {
+  height: 40px;
+  line-height: 40px;
+  background-color: #edeef0;
+  padding-left: 25px;
+}
+.btnWraps {
+  display: flex;
+  flex-direction: column;
+  align-items: center;
+  margin-top: 150px;
+  .dialogBtn {
+    width: 188px;
+    height: 40px;
+    background: rgba(249, 114, 21, 1);
+    border-radius: 4px;
+    line-height: 40px;
+    color: #fff;
+    text-align: center;
+    cursor: pointer;
+  }
+}
+.btnWrap {
+  margin-top: 40px;
+  .PrevBtn {
+    background-color: #444444;
+    width: 120px;
+  }
+  .submitBtn {
+    background-color: #f85043;
+    width: 120px;
+  }
+}
 </style>

+ 56 - 20
src/views/teamDetail/componentCourse/gpsLocation.vue

@@ -1,6 +1,6 @@
 <template>
   <div>
-    gps
+    <p class="title">打卡地相距教学点{{distance}}米</p>
     <!-- <el-amap-search-box class="search-box"
                         value="searchValue"
                         :search-option="searchOption"
@@ -14,7 +14,8 @@
       <!--  :events="markerEvents()" -->
       <el-amap-marker v-for="(marker, index) in markers"
                       :key="index"
-                      :position="marker"></el-amap-marker>
+                      :position="marker.location"
+                      :title="marker.title"></el-amap-marker>
     </el-amap>
   </div>
 </template> 
@@ -48,7 +49,9 @@ VueAMap.initAMapApiLoader({
   v: '1.4.4'
 })
 let amapManager = new VueAMap.AMapManager();
+import { getTeacherPersonalAttendance } from '@/api/buildTeam'
 export default {
+  props: ['courseScheduleId'],
   data () {
     return {
       zoom: 20,
@@ -63,37 +66,67 @@ export default {
       //     marker.setMap(o);
       //   }
       // },
-      markers: [
-        [114.34361, 30.55949],
-        [114.34381, 30.55949],
-      ],
+      markers: [],
       plugin: [],
+      distance: '-',
+      schoolLongitudeLatitude: null,
+      signInLongitudeLatitude: null,
+
     }
   },
   mounted () {
-    this.getDistance()
+    this.init()
   },
   activated () {
-    this.getDistance()
+    this.init()
   },
   methods: {
     // 地点搜索
     // searchOption () { },
     // 重置
+    init () {
+      getTeacherPersonalAttendance({ courseScheduleId: this.courseScheduleId }).then(res => {
+        if (res.code == 200) {
+          if (res.data.signInLongitudeLatitude) {
+            let add = {
+              title: '签到点',
+              location: res.data.signInLongitudeLatitude.split(',')
+            }
+            this.center = res.data.signInLongitudeLatitude.split(',');
+            this.signInLongitudeLatitude = res.data.signInLongitudeLatitude.split(',')
+            this.markers.push(add)
+          }
+          if (res.data.schoolLongitudeLatitude) {
+            let add = {
+              title: '教学点',
+              location: res.data.schoolLongitudeLatitude.split(',')
+            }
+            this.schoolLongitudeLatitude = res.data.schoolLongitudeLatitude.split(',')
+            this.center = res.data.schoolLongitudeLatitude.split(',');
+            this.markers.push(add)
+          }
+          this.getDistance(this.signInLongitudeLatitude, this.schoolLongitudeLatitude)
+        }
+      })
+      // this.getDistance()
+    },
     onSearchResult () { },
-    getDistance () {
-      let o = amapManager.getMap();
-      let marker1 = new AMap.Marker({
-        position: [121.59996, 31.177646]
-      });
-      let marker2 = new AMap.Marker({
-        position: [121.59976, 31.177646]
-      });
+    getDistance (sigin, school) {
+
+      if (sigin && sigin.length > 0 && school && school.length > 0) {
+        let o = amapManager.getMap();
+        let marker1 = new AMap.Marker({
+          position: sigin
+        });
+        let marker2 = new AMap.Marker({
+          position: school
+        });
 
-      let p1 = marker1.getPosition();
-      let p2 = marker2.getPosition();
-      var distance = Math.round(p1.distance(p2));
-      console.log(distance)
+        let p1 = marker1.getPosition();
+        let p2 = marker2.getPosition();
+        var distance = Math.round(p1.distance(p2));
+        this.distance = distance;
+      }
 
     }
   }
@@ -101,6 +134,9 @@ export default {
 </script>
 
 <style lang="scss" scoped>
+.title {
+  margin-bottom: 20px;
+}
 .amap-demo {
   height: 300px;
 }

+ 31 - 10
src/views/teamDetail/componentCourse/studentRollCall.vue

@@ -2,29 +2,38 @@
   <div>
     <el-form :inline="true">
       <el-form-item label="学生总数">
-        <el-input disabled></el-input>
+        <el-input disabled
+                  :value="studentNum"></el-input>
       </el-form-item>
       <el-form-item label="学生到课数">
-        <el-input disabled></el-input>
+        <el-input disabled
+                  :value="signInNum"></el-input>
       </el-form-item>
       <el-form-item label="学生请假总数">
-        <el-input disabled></el-input>
+        <el-input disabled
+                  :value="leaveNum"></el-input>
       </el-form-item>
     </el-form>
     <div class="tableWrap">
       <el-table :data='tableList'
                 :header-cell-style="{background:'#EDEEF0',color:'#444'}">
         <el-table-column align='center'
-                         prop="id"
+                         prop="username"
                          label="学生姓名">
         </el-table-column>
         <el-table-column align='center'
-                         prop="id"
+                         prop="phone"
                          label="手机号">
         </el-table-column>
         <el-table-column align='center'
-                         prop="id"
+                         prop="status"
                          label="学生状态">
+          <template slot-scope="scope">
+            <div>
+              <p v-if="scope.row.status">{{scope.row.status | studentRecord}}</p>
+              <p v-else>未签到</p>
+            </div>
+          </template>
         </el-table-column>
       </el-table>
       <pagination :total="rules.total"
@@ -35,7 +44,7 @@
   </div>
 </template>
 <script>
-import { findStudentAttendance } from '@/api/buildTeam'
+import { findStudentAttendance, sumStudentAttendance } from '@/api/buildTeam'
 import pagination from '@/components/Pagination/index'
 export default {
   props: ['courseScheduleId'],
@@ -48,8 +57,10 @@ export default {
         limit: 10, // 限制显示条数
         page: 1, // 当前页
         total: 0, // 总条数
-
       },
+      studentNum: null,
+      signInNum: null,
+      leaveNum: null
     }
   },
   mounted () {
@@ -60,14 +71,24 @@ export default {
   },
   methods: {
     init () {
-      console.log(this.courseScheduleId)
+      // console.log(this.courseScheduleId)
       this.getList()
 
       //  发请求获取学生签到信息
     },
     getList () {
       findStudentAttendance({ search: this.courseScheduleId }).then(res => {
-
+        if (res.code == 200) {
+          this.tableList = res.data.rows;
+          this.rules.total = res.data.total
+        }
+      })
+      sumStudentAttendance({ courseScheduleId: this.courseScheduleId }).then(res => {
+        if (res.code == 200) {
+          this.studentNum = res.data.studentNum;
+          this.signInNum = res.data.signInNum;
+          this.leaveNum = res.data.leaveNum
+        }
       })
     }
   }

+ 89 - 2
src/views/teamDetail/componentCourse/studentWork.vue

@@ -1,5 +1,92 @@
 <template>
   <div>
-    学生作业
+    <el-form :inline="true">
+      <el-form-item label="学生总数">
+        <el-input disabled
+                  :value="studentNum"></el-input>
+      </el-form-item>
+      <el-form-item label="已交作业">
+        <el-input disabled
+                  :value="homeworkNum"></el-input>
+      </el-form-item>
+      <el-form-item label="已评论">
+        <el-input disabled
+                  :value="repliedNum"></el-input>
+      </el-form-item>
+    </el-form>
+    <div class="tableWrap">
+      <el-table :data='tableList'
+                :header-cell-style="{background:'#EDEEF0',color:'#444'}">
+        <el-table-column align='center'
+                         prop="username"
+                         label="学生姓名">
+        </el-table-column>
+        <el-table-column align='center'
+                         prop="phone"
+                         label="手机号">
+        </el-table-column>
+        <el-table-column align='center'
+                         prop="status"
+                         label="交作业时间">
+        </el-table-column>
+        <el-table-column align='center'
+                         prop="status"
+                         label="老师回复时间">
+        </el-table-column>
+        <el-table-column align='center'
+                         prop="status"
+                         label="查看">
+        </el-table-column>
+      </el-table>
+      <pagination :total="rules.total"
+                  :page.sync="rules.page"
+                  :limit.sync="rules.limit"
+                  @pagination="getList" />
+    </div>
   </div>
-</template>
+</template>
+<script>
+import pagination from '@/components/Pagination/index'
+import { findStudentCourseHomeworks, sumStudentAttendance } from '@/api/buildTeam'
+export default {
+  props: ['courseScheduleId'],
+  components: { pagination },
+  data () {
+    return {
+      tableList: [],
+      rules: {
+        // 分页规则
+        limit: 10, // 限制显示条数
+        page: 1, // 当前页
+        total: 0, // 总条数
+      },
+      studentNum: null,
+      homeworkNum: null,
+      repliedNum: null
+    }
+  },
+  mounted () {
+    this.init()
+  },
+  activated () {
+    this.init()
+  },
+  methods: {
+    init () {
+      findStudentCourseHomeworks({ search: this.courseScheduleId }).then(res => {
+
+      })
+      sumStudentAttendance({ courseScheduleId: this.courseScheduleId }).then(res => {
+        if (res.code == 200) {
+          this.studentNum = res.data.studentNum;
+          this.homeworkNum = res.data.homeworkNum;
+          this.repliedNum = res.data.repliedNum
+        }
+      })
+    },
+    getList () {
+
+    }
+  }
+}
+</script>

+ 4 - 2
src/views/teamDetail/teamCourseList.vue

@@ -10,6 +10,7 @@
                v-model="searchForm">
         <el-form-item>
           <el-input v-model="searchForm.search"
+                    @keyup.enter.native='search'
                     placeholder="乐团名或VIP课名" />
         </el-form-item>
         <el-form-item>
@@ -235,15 +236,16 @@
           </div>
         </el-tab-pane>
         <el-tab-pane label="GPS定位"
+                     v-if="maskForm.teachMode == 'OFFLINE'"
                      name="second">
           <div v-if="activeName == 'second'">
-            <gpsLoction></gpsLoction>
+            <gpsLoction :courseScheduleId='maskForm.id'></gpsLoction>
           </div>
         </el-tab-pane>
         <el-tab-pane label="作业"
                      name="third">
           <div v-if="activeName == 'third'">
-            <studentWork></studentWork>
+            <studentWork :courseScheduleId='maskForm.id'></studentWork>
           </div>
         </el-tab-pane>
       </el-tabs>