Forráskód Böngészése

请假乐团调整功能

lex-xin 5 éve
szülő
commit
0887938aa4

+ 156 - 47
src/views/journal/leaveOperation.vue

@@ -60,45 +60,71 @@
             <p>结束时间: {{ showMessage.endTime }}</p>
             <p>备注: {{ showMessage.remark }}</p>
           </div>
-          <div class="leaverecord">
-            <el-table :data="showMessage.coursesScheduleJson"
+          <div class="leaverecord" v-if="showMessage.vipCourse.length > 0">
+            <el-table :data="showMessage.vipCourse"
                       style="width: 100%"
                       :header-cell-style="{background:'#EDEEF0',color:'#444'}">
               <el-table-column label="类型"
-                               width="60px">
+                               width="100px">
                 <template slot-scope="scope">
-                  {{ scope.row.befor.type == "VIP" ? 'VIP课' : '乐团课' }}
+                  {{ scope.row.before.type == "VIP" ? 'VIP课' : '乐团课' }}
                 </template>
               </el-table-column>
-              <el-table-column prop="befor.name"
+              <el-table-column prop="before.name"
                                label="班名"
                                width="140px">
               </el-table-column>
               <el-table-column label="调整前日期">
                 <template slot-scope="scope">
-                  {{ scope.row.befor.classDate | formatTimer }}
+                  {{ scope.row.before.classDate | formatTimer }}
                 </template>
               </el-table-column>
               <el-table-column label="上课时间">
                 <template slot-scope="scope">
-                  {{ scope.row.befor.startClassTime | getFormatTime(scope.row.befor.endClassTime) }}
+                  {{ scope.row.before.startClassTime | getFormatTime(scope.row.before.endClassTime) }}
                 </template>
               </el-table-column>
               <el-table-column label="调整后日期">
-                <template slot-scope="scope">
+                <template slot-scope="scope" v-if="scope.row.before.type == 'VIP'">
                   {{ scope.row.after.classDate | formatTimer }}
                 </template>
               </el-table-column>
               <el-table-column label="调整后时间">
-                <template slot-scope="scope">
+                <template slot-scope="scope" v-if="scope.row.before.type == 'VIP'">
                   {{ scope.row.after.startClassTime | getFormatTime(scope.row.after.endClassTime) }}
                 </template>
               </el-table-column>
-              <!-- <el-table-column label="操作" v-if="showMessage.status == 'ING'">
+            </el-table>
+          </div>
+          <div class="leaverecord" v-if="showMessage.musicGroupCourse.length > 0">
+            <el-table :data="showMessage.musicGroupCourse"
+                      style="width: 100%; padding-top: 10px;"
+                      :header-cell-style="{background:'#EDEEF0',color:'#444'}">
+              <el-table-column label="类型"
+                               width="100px">
+                <template slot-scope="scope">
+                  {{ scope.row.before.type == "VIP" ? 'VIP课' : '乐团课' }}
+                </template>
+              </el-table-column>
+              <el-table-column prop="before.name"
+                               label="班名"
+                               width="140px">
+              </el-table-column>
+              <el-table-column label="调整前日期">
+                <template slot-scope="scope">
+                  {{ scope.row.before.classDate | formatTimer }}
+                </template>
+              </el-table-column>
+              <el-table-column label="上课时间">
+                <template slot-scope="scope">
+                  {{ scope.row.before.startClassTime | getFormatTime(scope.row.before.endClassTime) }}
+                </template>
+              </el-table-column>
+              <el-table-column label="操作" v-if="showMessage.status == 'PASS'">
                   <template slot-scope="scope">
                     <el-button @click="onClssTime(scope.row)" type="text">调整</el-button>
                   </template>
-                </el-table-column> -->
+                </el-table-column>
             </el-table>
           </div>
 
@@ -114,30 +140,71 @@
       </div>
     </div>
 
-    <el-dialog title="调整时间"
-               :visible.sync="dialogVisible"
-               width="30%">
-      <el-form ref="form"
-               label-width="80px">
-        <el-form-item label="调整日期">
-          <el-date-picker v-model="changeDate"
-                          value-format="yyyy-MM-dd HH:mm:SS"
-                          type="datetime"
+    <el-dialog title="课程调整"
+               width="400px"
+               :before-close="handleClose"
+               :visible.sync="dialogVisible">
+      <el-form :model="maskForm"
+               ref="maskForm"
+               :rules="maskRules"
+               label-position="right"
+               label-width="80px;"
+               :inline="true">
+        <el-form-item label="主教老师"
+                      prop="teacher">
+          <el-select v-model="maskForm.teacher"
+                     clearable
+                     filterable>
+            <el-option v-for="(item,index) in teacherList"
+                       :key="index"
+                       :value="item.id"
+                       :label="item.realName"></el-option>
+          </el-select>
+        </el-form-item>
+        <el-form-item label="上课日期"
+                      prop="date">
+          <el-date-picker v-model="maskForm.date"
+                          type="date"
+                          value-format="yyyy-MM-dd"
                           placeholder="选择日期">
           </el-date-picker>
         </el-form-item>
+        <el-form-item label="开始时间"
+                      prop="startTime">
+          <el-time-select placeholder="起始时间"
+                          v-model="maskForm.startTime"
+                          :picker-options="{
+                            start: '04:30',
+                            step: '00:05',
+                            end: '23:30'
+                            }">
+          </el-time-select>
+        </el-form-item>
+        <el-form-item label="结束时间"
+                      prop="endTime">
+          <el-time-select placeholder="结束时间"
+                          v-model="maskForm.endTime"
+                          :picker-options="{
+                            start: '04:30',
+                            step: '00:05',
+                            end: '23:30',
+                            minTime: maskForm.startTime
+                          }">
+          </el-time-select>
+        </el-form-item>
       </el-form>
-      <span slot="footer"
-            class="dialog-footer">
+      <div slot="footer"
+           class="dialog-footer">
         <el-button @click="dialogVisible = false">取 消</el-button>
         <el-button type="primary"
-                   @click="onDialogChange">确 定</el-button>
-      </span>
+                   @click="submitResetClass">确 定</el-button>
+      </div>
     </el-dialog>
   </div>
 </template>
 <script>
 import { queryCountOfUnread, sysMessageList, leaveQueryDetail, setRead, approve } from '@/api/journal'
+import { resetCourse, getTeacher } from '@/api/buildTeam'
 export default {
   name: 'leaveOperation',
   data () {
@@ -150,6 +217,7 @@ export default {
         boxicon: require('@/assets/images/base/boxicon.png'),
         Hboxicon: require('@/assets/images/base/boxicon-h.png')
       },
+      teacherList: [],
       pageInfo: {
         isSinglePage: false, // 是否只有一页
         limit: 10,
@@ -157,6 +225,19 @@ export default {
         readStatus: null,
         total: 0,
       },
+      maskForm: {
+        teacher: null,
+        date: null,
+        startTime: null,
+        endTime: null,
+        id: null
+      },
+      maskRules: {
+        teacher: [{ required: true, message: '请选择主教老师名称', trigger: 'blur' },],
+        date: [{ required: true, message: '请选择上课时间', trigger: 'blur' },],
+        startTime: [{ required: true, message: '请选择上课开始时间', trigger: 'blur' },],
+        endTime: [{ required: true, message: '请选择上课结束时间', trigger: 'blur' },],
+      },
       noReadMessage: 0, // 未读消息
       dataList: [],
       isCheckMessage: null,
@@ -181,11 +262,42 @@ export default {
           }
         }
       })
+
+      getTeacher().then(res => {
+        if (res.code == 200) {
+          this.teacherList = res.data;
+        }
+      })
+    },
+    handleClose () {
+      this.dialogVisible = false;
+      this.$refs['maskForm'].resetFields()
+    },
+    submitResetClass () {
+      this.$confirm('是否确定?', '提示', {
+        confirmButtonText: '确定',
+        cancelButtonText: '取消',
+        type: 'warning'
+      }).then(() => {
+        let obj = {
+          actualTeacherId: this.maskForm.teacher,
+          startClassTimeStr: this.maskForm.startTime,
+          endClassTimeStr: this.maskForm.endTime,
+          id: this.maskForm.id,
+          classDate: this.maskForm.date
+        }
+        resetCourse(obj).then(res => {
+          if (res.code == 200) {
+            this.$message.success('修改成功')
+            this.dialogVisible = false;
+          }
+        })
+      }).catch(() => { })
+
     },
     onSubmit (showMessage, type) {
       let params = {
         id: showMessage.id,
-        // remark: null,
         status: type,
         userId: showMessage.userId
       }
@@ -198,26 +310,6 @@ export default {
         }
       })
     },
-    onDialogChange () {
-      if (!this.changeDate) {
-        this.$message.error('请选择调整日期')
-        return
-      }
-
-      let tempDate = new Date(this.changeDate)
-      let startStr = '2019/10/10 ' + this.getDateInfo(this.dialogData.befor.startClassTime),
-        endStr = '2019/10/10 ' + this.getDateInfo(this.dialogData.befor.endClassTime)
-      let startDate = new Date(startStr),
-        endDate = new Date(endStr)
-      let m = parseInt(Math.abs(endDate.getTime() - startDate.getTime()) / 1000 / 60)
-      let tempLastDate = tempDate.setMinutes(tempDate.getMinutes() + m)
-
-
-      this.dialogData.after.classDate = this.getFormatDate(tempDate)
-      this.dialogData.after.startClassTime = this.getFormatDate(tempDate)
-      this.dialogData.after.endClassTime = this.getFormatDate(tempLastDate)
-      this.dialogVisible = false
-    },
     getFormatDate (data) {
       let tempDate = new Date(data)
       let month = (tempDate.getMonth() + 1) >= 10 ? (tempDate.getMonth() + 1) : '0' + (tempDate.getMonth() + 1)
@@ -239,7 +331,13 @@ export default {
     },
     onClssTime (row) {
       this.dialogVisible = true
-      this.dialogData = row
+      this.maskForm = {
+        teacher: row.before.actualTeacherId,
+        date: row.before.classDate,
+        startTime: row.before.startClassTime.split(' ')[1],
+        endTime: row.before.endClassTime.split(' ')[1],
+        id: row.before.id
+      }
     },
     sysMessageList () { // 列表
       sysMessageList({
@@ -292,7 +390,18 @@ export default {
         if (res.code == 200) {
           this.showRight = true
           if (res.data.coursesScheduleJson) {
-            res.data.coursesScheduleJson = JSON.parse(res.data.coursesScheduleJson)
+            let tempJson = JSON.parse(res.data.coursesScheduleJson) 
+            let musicGroupCourse = []
+            let vipCourse = []
+            tempJson.forEach(item => {
+              if(item.before.type == 'VIP') {
+                vipCourse.push(item)
+              } else {
+                musicGroupCourse.push(item)
+              }
+            })
+            res.data.musicGroupCourse = musicGroupCourse
+            res.data.vipCourse = vipCourse
           }
           this.showMessage = res.data
           this.remark = res.data.reason

+ 57 - 0
src/views/teamDetail/components/courseList.vue

@@ -135,6 +135,10 @@
                          prop="masterTeacherName"
                          label="指导老师">
         </el-table-column>
+        <el-table-column align='center'
+                         prop="masterTeacherName"
+                         label="备注">
+        </el-table-column>
         <!-- <el-table-column align='center'
                          prop="subTeacherName"
                          label="助教老师">
@@ -143,6 +147,10 @@
                          label="操作">
           <template slot-scope="scope">
             <div>
+              <el-button v-if="scope.row.courseScheduleStatus == 'OVER'"
+                         type="text" @click="onMarkAttendance(scope.row)">补考勤</el-button>
+              <el-button v-if="scope.row.courseScheduleStatus == 'OVER'"
+                         type="text" @click="rollCall.status = true">点名表</el-button>
               <!-- OVER -->
               <el-button v-if="scope.row.courseScheduleStatus == 'OVER'"
                          v-permission="'courseSchedule/classStartDateAdjust1'"
@@ -261,6 +269,41 @@
                    @click="batchAdjustmentTime">确 定</el-button>
       </div>
     </el-dialog>
+
+    <el-dialog title='补考勤'
+               width="400px"
+               :visible.sync="markAttendance.status">
+      <el-form>
+        <el-form-item label="签到状态">{{ markAttendance.dataInfo.signInStatus | attendanceType }} </el-form-item>
+        <el-form-item label="签到时间">{{ markAttendance.dataInfo.classDate + ' ' + markAttendance.dataInfo.startClassTime}}</el-form-item>
+        <el-form-item label="签退状态">{{ markAttendance.dataInfo.signOutStatus | attendanceOutType }} </el-form-item>
+        <el-form-item label="签到时间">{{ markAttendance.dataInfo.classDate + ' ' + markAttendance.dataInfo.endClassTime}}</el-form-item>
+      </el-form>
+      <div slot="footer"
+           class="dialog-footer">
+        <el-button @click="markAttendance.status = false">取 消</el-button>
+        <el-button type="primary" :disabled="markAttendance.dataInfo.signOutStatus == 1 && markAttendance.dataInfo.signInStatus == 1 ? true : false"
+                   @click="batchAdjustmentTime">确定补卡</el-button>
+      </div>
+    </el-dialog>
+
+    <el-dialog title='点名表'
+               width="700px"
+               :visible.sync="rollCall.status">
+      <el-table :data="rollCall.gridData">
+        <el-table-column property="date" label="学员姓名"></el-table-column>
+        <el-table-column property="name" label="手机号"></el-table-column>
+        <el-table-column property="address" label="学员声部"></el-table-column>
+        <el-table-column property="address" label="到课状态"></el-table-column>
+        <el-table-column label="操作">
+          <template slot-scope="scope">
+            <el-button size="small" type="primary" plain>主要按钮</el-button>
+            <el-button size="small" type="success" plain>成功按钮</el-button>
+            <el-button size="small" type="info" plain>信息按钮</el-button>
+          </template>
+        </el-table-column>
+      </el-table>
+    </el-dialog>
   </div>
 </template>
 <script>
@@ -308,6 +351,14 @@ export default {
       activeCourseList: [],
       timerMask: {
         timer: ''
+      },
+      markAttendance: { // 考勤状态
+        status: false,
+        dataInfo: {}
+      },
+      rollCall: { // 点名表
+        status: false,
+        gridData: []
       }
     }
 
@@ -343,6 +394,12 @@ export default {
         }
       })
     },
+    onMarkAttendance(item) { // 补考勤
+      this.markAttendance = {
+        status: true,
+        dataInfo: item
+      }
+    },
     search () {
       this.rules.page = 1;
       this.getList();

+ 3 - 3
vue.config.js

@@ -19,9 +19,9 @@ const name = defaultSettings.title || '管乐迷后台管理系统' // page titl
 // let target = 'https://online.dayaedu.com' //线上
 // let target = 'http://testadm.dayaedu.com/' //test环境
 // let target = 'http://192.168.3.27:8000' // 箭河
-let target = 'http://192.168.3.28:8000' //邹璇
-// let target = 'http://192.168.3.8:18000' //勇哥
-// let target = 'http://admin.dayaedu.com' // 测试服
+// let target = 'http://192.168.3.28:8000' //邹璇
+// let target = 'http://192.168.3.8:8000' //勇哥
+let target = 'http://admin.dayaedu.com' // 测试服
 // let target = 'http://192.168.3.48:8080' // 乔
 // All configuration item explanations can be find in https://cli.vuejs.org/config/
 module.exports = {