|
@@ -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
|