Browse Source

11/18 15:05

11
mo 4 years ago
parent
commit
d7cc0560e3

+ 10 - 1
src/api/teacherManager.js

@@ -277,4 +277,13 @@ export function batchUpdateAdviser (data) {
     method: 'post',
     data: qs.stringify(data)
   })
-}
+}
+
+// 获取课程老师列表  
+export function getCourseTeachers (data) {
+  return request({
+    url: api + '/courseScheduleTeacherSalary/getCourseTeachers',
+    method: 'get',
+    params: data
+  })
+}

+ 9 - 0
src/utils/vueFilter.js

@@ -140,6 +140,15 @@ Vue.filter('dayjsFormat', (value) => {
     return value
   }
 })
+
+Vue.filter('dayjsFormatMinute', (value) => {
+  if (value) {
+    return dayjs(value).format('HH:mm')
+  } else {
+    return value
+  }
+})
+
 Vue.filter('formatTimer', (value) => {
   if (value) {
     return value.split(' ')[0]

+ 19 - 0
src/views/attendanceManager/attendanceList/api.js

@@ -0,0 +1,19 @@
+import request from '@/utils/request'
+import qs from 'qs'
+let api = '/api-web'
+
+export function getHomePageList (data) {
+  return request({
+    url: api + '/webCurseHomework/queryHomePage',
+    method: 'get',
+    params: data
+  })
+}
+
+// export function batchUpdateAdviser (data) {
+//   return request({
+//     url: api + '/studentManage/batchUpdateAdviser',
+//     method: 'post',
+//     data: qs.stringify(data)
+//   })
+// }

+ 71 - 30
src/views/attendanceManager/attendanceList/index.vue

@@ -10,12 +10,7 @@
         <el-form-item>
           <el-input v-model.trim="searchForm.search"
                     @keyup.enter.native="search"
-                    placeholder='请输入课程编号、名称'></el-input>
-        </el-form-item>
-        <el-form-item>
-          <el-input v-model.trim="searchForm.search"
-                    @keyup.enter.native="search"
-                    placeholder='请输入乐团名称'></el-input>
+                    placeholder='请输入课程编号、名称、乐团名称'></el-input>
         </el-form-item>
         <el-form-item prop="organId">
           <el-select class="multiple"
@@ -30,7 +25,19 @@
           </el-select>
         </el-form-item>
         <el-form-item>
-          <el-date-picker v-model.trim="searchForm.courseTimer"
+          <el-select v-model.trim="searchForm.groupType"
+                     class="organSelect"
+                     style=" margin-left: 15px; width:100%"
+                     filterable
+                     placeholder="请选择课程类型">
+            <el-option v-for="(item,index) in courseListType"
+                       :key="index"
+                       :label="item.label"
+                       :value="item.value"></el-option>
+          </el-select>
+        </el-form-item>
+        <el-form-item>
+          <el-date-picker v-model.trim="courseTimer"
                           style="width:420px;"
                           type="daterange"
                           value-format="yyyy-MM-dd"
@@ -53,31 +60,36 @@
                   :header-cell-style="{background:'#EDEEF0',color:'#444'}"
                   :data="tableList">
           <el-table-column align="center"
-                           prop="studentId"
+                           prop="courseScheduleId"
                            label="课程编号"></el-table-column>
           <el-table-column align="center"
-                           prop="studentId"
+                           prop="courseScheduleName"
                            label="课程名称"></el-table-column>
           <el-table-column align="center"
-                           prop="studentId"
+                           prop="organName"
                            label="分部"></el-table-column>
           <el-table-column align="center"
-                           prop="studentId"
+                           prop="groupName"
                            label="乐团名称"></el-table-column>
           <el-table-column align="center"
-                           prop="studentId"
-                           label="布置时间"></el-table-column>
+                           label="布置时间">
+            <template slot-scope="scope">
+              <div>
+                {{ scope.row.createTime ? scope.row.createTime.substr(0, 16): '' }}
+              </div>
+            </template>
+          </el-table-column>
           <el-table-column align="center"
-                           prop="studentId"
+                           prop="actualTeacherName"
                            label="布置老师"></el-table-column>
           <el-table-column align="center"
-                           prop="studentId"
+                           prop="expectNum"
                            label="应交人数"></el-table-column>
           <el-table-column align="center"
-                           prop="studentId"
+                           prop="completedNum"
                            label="已交人数"></el-table-column>
           <el-table-column align="center"
-                           prop="studentId"
+                           prop="repliedNum"
                            label="已回复数"></el-table-column>
           <el-table-column align="center"
                            prop="studentId"
@@ -85,6 +97,7 @@
             <template slot-scope="scope">
               <div>
                 <el-button type="text"
+                           v-permission="'studentManage/findStudentCourseHomeworks'"
                            @click="lookDetail(scope.row)">查看</el-button>
               </div>
             </template>
@@ -98,7 +111,8 @@
         <el-dialog title="作业详情"
                    :visible.sync="classVisible"
                    width="1000px">
-          <studentWork :courseScheduleId="activeRow.id"></studentWork>
+          <studentWork v-if="activeRow"
+                       :courseScheduleId="activeRow.courseScheduleId"></studentWork>
         </el-dialog>
       </div>
     </div>
@@ -110,17 +124,21 @@ import axios from "axios";
 import { getToken } from "@/utils/auth";
 import pagination from "@/components/Pagination/index";
 import load from "@/utils/loading";
-import { getTeacher, getEmployeeOrgan } from "@/api/buildTeam";
+import { courseListType } from '@/utils/searchArray'
+import { getEmployeeOrgan } from "@/api/buildTeam";
 import studentWork from "@/views/teamDetail/componentCourse/studentWork";
+import { getHomePageList } from "./api.js"
 export default {
   components: { pagination, studentWork },
   data () {
     return {
+      courseListType,
       searchForm: {
         search: null,
         organId: null,
-        courseTimer: null
+        groupType: 'MUSIC'
       },
+      courseTimer: [],
       teacherList: [],
       tableList: [],
       organList: [],
@@ -139,11 +157,6 @@ export default {
   created () { },
   //生命周期 - 挂载完成(可以访问DOM元素)
   mounted () {
-    getTeacher().then(res => {
-      if (res.code == 200) {
-        this.teacherList = res.data;
-      }
-    });
     getEmployeeOrgan().then(res => {
       if (res.code == 200) {
         this.organList = res.data;
@@ -155,22 +168,50 @@ export default {
 
 
   },
-  // activated () {
-  //   this.init();
-  // },
+  activated () {
+    this.init();
+  },
   methods: {
     init () {
+      this.getList()
+    },
+    getList () {
+      let date = this.searchForm;
+      let classStartDate, classEndDate;
+      if (this.courseTimer?.length > 0) {
+        classStartDate = this.courseTimer[0]
+        classEndDate = this.courseTimer[1]
+      } else {
+        classStartDate = null
+        classEndDate = null
+      }
+      date.classStartDate = classStartDate
+      date.classEndDate = classEndDate
+      date.page = this.rules.page
+      date.rows = this.rules.limit
+      getHomePageList(date).then(res => {
+        if (res.code == 200) {
+          this.tableList = res.data.rows
+          this.rules.total = res.data.total
+        }
+      })
     },
-    getList () { },
     search () {
       this.rules.page = 1
       this.getList()
     },
     onReSet () {
+      this.searchForm = {
+        search: null,
+        organId: null,
+        groupType: 'MUSIC'
+      }
+      this.courseTimer = []
       this.search()
     },
     lookDetail (row) {
-
+      this.activeRow = row
+      this.classVisible = true
     }
   }
 };

+ 70 - 45
src/views/teamDetail/componentCourse/gpsLocation.vue

@@ -6,6 +6,7 @@
                         :search-option="searchOption"
                         :on-search-result="onSearchResult"></el-amap-search-box> -->
     <el-amap :zoom="zoom"
+             ref='map'
              vid="amapDemo"
              :amap-manager="amapManager"
              :plugin="plugin"
@@ -45,27 +46,18 @@ import VueAMap from 'vue-amap'
 // Vue.use(VueAMap)
 VueAMap.initAMapApiLoader({
   key: 'b1e6ac2eb28902ce91a490edf194e000',
-  plugin: ['AMap.Geolocation', 'AMap.PlaceSearch', 'AMap.Geocoder'],
-  v: '1.4.4'
+  plugin: ['Autocomplete', 'PlaceSearch', 'Scale', 'OverView', 'ToolBar', 'MapType', 'PolyEditor', 'AMap.CircleEditor'],
+  v: '1.4.4',
 })
 let amapManager = new VueAMap.AMapManager();
 import { getTeacherPersonalAttendance } from '@/api/buildTeam'
 export default {
-  props: ['courseScheduleId'],
+  props: ['activeRow'],
   data () {
     return {
       zoom: 20,
       amapManager,
       center: [114.34371, 30.55939],
-      // events: {
-      //   init (o) {
-      //     let marker = new AMap.Marker({
-      //       position: [114.34371, 30.55939]
-      //     });
-
-      //     marker.setMap(o);
-      //   }
-      // },
       markers: [],
       plugin: [],
       distance: '-',
@@ -85,40 +77,73 @@ export default {
     // searchOption () { },
     // 重置
     init () {
-      getTeacherPersonalAttendance({ courseScheduleId: this.courseScheduleId }).then(res => {
-        if (res.code == 200) {
-          if (res.data && 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 && res.data.signOutLongitudeLatitude) {
-            let add = {
-              title: '签退点',
-              location: res.data.signOutLongitudeLatitude.split(',')
-            }
-            this.center = res.data.signOutLongitudeLatitude.split(',');
-            this.signOutLongitudeLatitude = res.data.signOutLongitudeLatitude.split(',')
-            this.markers.push(add)
-          }
-
-          if (res.data && 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)
+      if (this.activeRow.schoolLongitudeLatitude) {
+        let add = {
+          title: '教学点',
+          location: this.activeRow.schoolLongitudeLatitude.split(',')
         }
-      })
-      this.amapManager.setFitView();
+        this.center = this.activeRow.schoolLongitudeLatitude.split(',');
+        this.schoolLongitudeLatitude = this.activeRow.schoolLongitudeLatitude.split(',')
+        this.markers.push(add)
+      }
+      if (this.activeRow.signInLongitudeLatitude) {
+        let add = {
+          title: '签到点',
+          location: this.activeRow.signInLongitudeLatitude.split(',')
+        }
+        this.center = this.activeRow.signInLongitudeLatitude.split(',');
+        this.signInLongitudeLatitude = this.activeRow.signInLongitudeLatitude.split(',')
+        this.markers.push(add)
+      }
+      if (this.activeRow.signOutLongitudeLatitude) {
+        let add = {
+          title: '签退点',
+          location: this.activeRow.signOutLongitudeLatitude.split(',')
+        }
+        this.center = this.activeRow.signOutLongitudeLatitude.split(',');
+        this.signInLongitudeLatitude = this.activeRow.signOutLongitudeLatitude.split(',')
+        this.markers.push(add)
+      }
+      // this.$refs.map.$amap.setFitView(this.markers)
+      console.log(this.$refs.map)
+      this.getDistance(this.signInLongitudeLatitude, this.schoolLongitudeLatitude)
+
+      return
+      // getTeacherPersonalAttendance({ courseScheduleId: this.courseScheduleId }).then(res => {
+      //   if (res.code == 200) {
+      //     if (res.data && 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 && res.data.signOutLongitudeLatitude) {
+      //       let add = {
+      //         title: '签退点',
+      //         location: res.data.signOutLongitudeLatitude.split(',')
+      //       }
+      //       this.center = res.data.signOutLongitudeLatitude.split(',');
+      //       this.signOutLongitudeLatitude = res.data.signOutLongitudeLatitude.split(',')
+      //       this.markers.push(add)
+      //     }
+
+      //     if (res.data && 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)
+      //   }
+      // })
+      //   ;
+      // console.log(this.amapManager.setFitView)
       // this.getDistance()
     },
     onSearchResult () { },

+ 6 - 0
src/views/teamDetail/componentCourse/studentWork.vue

@@ -174,6 +174,12 @@ export default {
     closeWorkVisible () {
       this.activeUrl = "";
     }
+  }, watch: {
+    courseScheduleId (val) {
+      if (val) {
+        this.init()
+      }
+    }
   }
 };
 </script>

+ 57 - 11
src/views/teamDetail/componentCourse/teacherList.vue

@@ -4,38 +4,57 @@
               :header-cell-style="{background:'#EDEEF0',color:'#444'}">
       <el-table-column align='center'
                        prop="teacherName"
+                       width="150px"
                        label="老师姓名">
+        <template slot-scope="scope">
+          <div>
+            {{scope.row.teacherName}}({{scope.row.teacherId}})
+          </div>
+        </template>
       </el-table-column>
       <el-table-column align='center'
-                       prop="teacherId"
-                       label="老师编号">
-      </el-table-column>
-      <el-table-column align='center'
-                       prop="jobNature"
+                       prop="teacherRole"
                        label="老师类型">
         <template slot-scope="scope">
           <div>
-            {{ scope.row.jobNature|jobNature}}
+            {{ scope.row.teacherRole|workType}}
           </div>
         </template>
       </el-table-column>
       <el-table-column align='center'
                        prop="teacherPhone"
                        label="签到时间">
+        <template slot-scope="scope">
+          <div>
+            {{scope.row.signInTime | dayjsFormatMinute}}
+          </div>
+        </template>
       </el-table-column>
       <el-table-column align='center'
                        prop="teacherPhone"
                        label="签退时间">
+        <template slot-scope="scope">
+          <div>
+            {{scope.row.signOutTime | dayjsFormatMinute}}
+          </div>
+        </template>
       </el-table-column>
       <el-table-column align='center'
                        prop="teacherPhone"
                        label="签到状态">
+        <template slot-scope="scope">
+          <div>{{ scope.row.signInStatus | attendanceType}}</div>
+        </template>
       </el-table-column>
       <el-table-column align='center'
                        prop="teacherPhone"
                        label="签退状态">
+        <template slot-scope="scope">
+          <div>{{ scope.row.signOutStatus | attendanceOutType}}</div>
+        </template>
       </el-table-column>
       <el-table-column align='center'
+                       width="200px"
                        label="操作">
         <template slot-scope="scope">
           <div>
@@ -44,28 +63,55 @@
             <el-button type="text"
                        size="small">清除考勤</el-button>
             <el-button type="text"
-                       size="small">GPS定位</el-button>
+                       v-if="teachMode == 'OFFLINE'"
+                       size="small"
+                       @click="lookGPS(scope.row)">GPS定位</el-button>
           </div>
         </template>
       </el-table-column>
     </el-table>
+    <el-dialog width="1000px"
+               title="GPS"
+               :visible.sync="gpsVisible"
+               append-to-body>
+      <gpsLoction :activeRow='activeRow' />
+    </el-dialog>
   </div>
 </template>
 <script>
-import { getTeacherPersonalAttendanceDetail } from "@/api/teacherManager";
+import { getCourseTeachers } from "@/api/teacherManager";
+import gpsLoction from "../componentCourse/gpsLocation";
 export default {
+  components: { gpsLoction },
+  props: ['courseScheduleId', 'teachMode'],
   data () {
     return {
-      tableList: []
+      tableList: [],
+      gpsVisible: false,
+      activeRow: null
     }
   },
-  mounted () { },
+  mounted () {
+    this.init()
+    console.log(this.teachMode)
+  },
   activated () { },
   methods: {
     getList () {
 
+      getCourseTeachers({ courseScheduleId: this.courseScheduleId }).then(res => {
+        if (res.code == 200) {
+          this.tableList = res.data
+        }
+      })
     },
-    init () { }
+    init () {
+      this.getList()
+    },
+    lookGPS (row) {
+      this.activeRow = row;
+      this.gpsVisible = true
+    }
   },
 }
 </script>

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

@@ -337,7 +337,8 @@
         <el-tab-pane label="老师列表"
                      name="second">
           <div v-if="activeName == 'second'">
-            <teacherList :courseScheduleId="maskForm.id"></teacherList>
+            <teacherList :courseScheduleId="maskForm.id"
+                         :teachMode='maskForm.teachMode'></teacherList>
           </div>
         </el-tab-pane>
         <el-tab-pane label="作业"