|
@@ -1,33 +1,44 @@
|
|
|
<template>
|
|
|
<div class='infoWrap'>
|
|
|
<div class="left">
|
|
|
- <div class="unread" @click="onLookMessage('all')">全部</div>
|
|
|
- <div class="unread" @click="onLookMessage('0')"> <img :src="img.boxicon"
|
|
|
+ <div class="unread"
|
|
|
+ @click="onLookMessage('all')">全部</div>
|
|
|
+ <div class="unread"
|
|
|
+ @click="onLookMessage('0')"> <img :src="img.boxicon"
|
|
|
alt=""> 未读消息
|
|
|
- <div class="count" v-if="noReadMessage >= 1">{{ noReadMessage }}</div>
|
|
|
+ <div class="count"
|
|
|
+ v-if="noReadMessage >= 1">{{ noReadMessage }}</div>
|
|
|
</div>
|
|
|
- <div class="read" @click="onLookMessage('1')">
|
|
|
+ <div class="read"
|
|
|
+ @click="onLookMessage('1')">
|
|
|
<img :src="img.bookicon"
|
|
|
alt="">
|
|
|
已读消息</div>
|
|
|
</div>
|
|
|
<div class="middle">
|
|
|
- <div class="msgItem" :class="[isCheckMessage == item.id ? 'active' : '']" @click="onClickRead(item)" v-for="(item, index) in dataList" :key="index">
|
|
|
+ <div class="msgItem"
|
|
|
+ :class="[isCheckMessage == item.id ? 'active' : '']"
|
|
|
+ @click="onClickRead(item)"
|
|
|
+ v-for="(item, index) in dataList"
|
|
|
+ :key="index">
|
|
|
<!-- <h6 class="type"></h6> -->
|
|
|
<h4 class="name">请假处理<span class='time'>{{ item.createOn }}</span>
|
|
|
- <div class="dot" v-if="item.readStatus == 0"></div>
|
|
|
+ <div class="dot"
|
|
|
+ v-if="item.readStatus == 0"></div>
|
|
|
</h4>
|
|
|
<p class='msg'>{{ item.content }}</p>
|
|
|
</div>
|
|
|
<el-pagination style="text-align: right"
|
|
|
- small v-if="dataList.length > 0"
|
|
|
- @current-change="onChange"
|
|
|
- :hide-on-single-page="pageInfo.isSinglePage"
|
|
|
- layout="prev, pager, next"
|
|
|
- :total="pageInfo.total">
|
|
|
+ small
|
|
|
+ v-if="dataList.length > 0"
|
|
|
+ @current-change="onChange"
|
|
|
+ :hide-on-single-page="pageInfo.isSinglePage"
|
|
|
+ layout="prev, pager, next"
|
|
|
+ :total="pageInfo.total">
|
|
|
</el-pagination>
|
|
|
</div>
|
|
|
- <div class="right" v-if="showRight">
|
|
|
+ <div class="right"
|
|
|
+ v-if="showRight">
|
|
|
<div class="rightWrap">
|
|
|
<img src="@/assets/images/base/placehorder-icon.png"
|
|
|
class="header"
|
|
@@ -35,8 +46,12 @@
|
|
|
<div class="info">
|
|
|
<h2>{{ showMessage.user.username }}
|
|
|
<!-- <span class="phone">【{{ showMessage.user.phone }}】</span> -->
|
|
|
- <el-tag v-if="showMessage.status == 'PASS'" type="success" effect="plain">已处理</el-tag>
|
|
|
- <el-tag v-if="showMessage.status == 'REJECT'" type="danger" effect="plain">已拒绝</el-tag>
|
|
|
+ <el-tag v-if="showMessage.status == 'PASS'"
|
|
|
+ type="success"
|
|
|
+ effect="plain">已处理</el-tag>
|
|
|
+ <el-tag v-if="showMessage.status == 'REJECT'"
|
|
|
+ type="danger"
|
|
|
+ effect="plain">已拒绝</el-tag>
|
|
|
</h2>
|
|
|
<p class="subMsg">发至 <span class='san'></span> <span style="margin-left:30px">我</span></p>
|
|
|
<div class="textWrap">
|
|
@@ -46,35 +61,40 @@
|
|
|
<p>备注: {{ showMessage.remark }}</p>
|
|
|
</div>
|
|
|
<div class="leaverecord">
|
|
|
- <el-table :data="showMessage.coursesScheduleJson" style="width: 100%" :header-cell-style="{background:'#EDEEF0',color:'#444'}">
|
|
|
- <el-table-column label="类型" width="60px">
|
|
|
- <template slot-scope="scope">
|
|
|
- {{ scope.row.befor.type == "VIP" ? 'VIP课' : '乐团课' }}
|
|
|
- </template>
|
|
|
- </el-table-column>
|
|
|
- <el-table-column prop="befor.name" label="班名" width="140px">
|
|
|
- </el-table-column>
|
|
|
- <el-table-column label="调整前日期">
|
|
|
- <template slot-scope="scope">
|
|
|
- {{ scope.row.befor.classDate | formatTimer }}
|
|
|
- </template>
|
|
|
- </el-table-column>
|
|
|
- <el-table-column label="上课时间">
|
|
|
- <template slot-scope="scope">
|
|
|
- {{ scope.row.befor.startClassTime | getFormatTime(scope.row.befor.endClassTime) }}
|
|
|
- </template>
|
|
|
- </el-table-column>
|
|
|
- <el-table-column label="调整后日期">
|
|
|
- <template slot-scope="scope">
|
|
|
- {{ scope.row.after.classDate | formatTimer }}
|
|
|
- </template>
|
|
|
- </el-table-column>
|
|
|
- <el-table-column label="调整后时间">
|
|
|
- <template slot-scope="scope">
|
|
|
- {{ scope.row.after.startClassTime | getFormatTime(scope.row.after.endClassTime) }}
|
|
|
- </template>
|
|
|
- </el-table-column>
|
|
|
- <!-- <el-table-column label="操作" v-if="showMessage.status == 'ING'">
|
|
|
+ <el-table :data="showMessage.coursesScheduleJson"
|
|
|
+ style="width: 100%"
|
|
|
+ :header-cell-style="{background:'#EDEEF0',color:'#444'}">
|
|
|
+ <el-table-column label="类型"
|
|
|
+ width="60px">
|
|
|
+ <template slot-scope="scope">
|
|
|
+ {{ scope.row.befor.type == "VIP" ? 'VIP课' : '乐团课' }}
|
|
|
+ </template>
|
|
|
+ </el-table-column>
|
|
|
+ <el-table-column prop="befor.name"
|
|
|
+ label="班名"
|
|
|
+ width="140px">
|
|
|
+ </el-table-column>
|
|
|
+ <el-table-column label="调整前日期">
|
|
|
+ <template slot-scope="scope">
|
|
|
+ {{ scope.row.befor.classDate | formatTimer }}
|
|
|
+ </template>
|
|
|
+ </el-table-column>
|
|
|
+ <el-table-column label="上课时间">
|
|
|
+ <template slot-scope="scope">
|
|
|
+ {{ scope.row.befor.startClassTime | getFormatTime(scope.row.befor.endClassTime) }}
|
|
|
+ </template>
|
|
|
+ </el-table-column>
|
|
|
+ <el-table-column label="调整后日期">
|
|
|
+ <template slot-scope="scope">
|
|
|
+ {{ scope.row.after.classDate | formatTimer }}
|
|
|
+ </template>
|
|
|
+ </el-table-column>
|
|
|
+ <el-table-column label="调整后时间">
|
|
|
+ <template slot-scope="scope">
|
|
|
+ {{ scope.row.after.startClassTime | getFormatTime(scope.row.after.endClassTime) }}
|
|
|
+ </template>
|
|
|
+ </el-table-column>
|
|
|
+ <!-- <el-table-column label="操作" v-if="showMessage.status == 'ING'">
|
|
|
<template slot-scope="scope">
|
|
|
<el-button @click="onClssTime(scope.row)" type="text">调整</el-button>
|
|
|
</template>
|
|
@@ -84,35 +104,42 @@
|
|
|
|
|
|
</div>
|
|
|
</div>
|
|
|
- <div v-permission="'teacherLeaveRecord/approve'" class="infoFoot" v-if="showMessage.status == 'ING'">
|
|
|
- <div class="noBtn" @click="onSubmit(showMessage, 'REJECT')">拒绝</div>
|
|
|
- <div class="yesBtn" @click="onSubmit(showMessage, 'PASS')">同意</div>
|
|
|
+ <div v-permission="'teacherLeaveRecord/approve'"
|
|
|
+ class="infoFoot"
|
|
|
+ v-if="showMessage.status == 'ING'">
|
|
|
+ <div class="noBtn"
|
|
|
+ @click="onSubmit(showMessage, 'REJECT')">拒绝</div>
|
|
|
+ <div class="yesBtn"
|
|
|
+ @click="onSubmit(showMessage, 'PASS')">同意</div>
|
|
|
</div>
|
|
|
</div>
|
|
|
|
|
|
<el-dialog title="调整时间"
|
|
|
- :visible.sync="dialogVisible"
|
|
|
- width="30%">
|
|
|
- <el-form ref="form" label-width="80px">
|
|
|
+ :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"
|
|
|
- placeholder="选择日期">
|
|
|
- </el-date-picker>
|
|
|
+ <el-date-picker v-model="changeDate"
|
|
|
+ value-format="yyyy-MM-dd HH:mm:SS"
|
|
|
+ type="datetime"
|
|
|
+ placeholder="选择日期">
|
|
|
+ </el-date-picker>
|
|
|
</el-form-item>
|
|
|
</el-form>
|
|
|
- <span slot="footer" class="dialog-footer">
|
|
|
+ <span slot="footer"
|
|
|
+ class="dialog-footer">
|
|
|
<el-button @click="dialogVisible = false">取 消</el-button>
|
|
|
- <el-button type="primary" @click="onDialogChange">确 定</el-button>
|
|
|
+ <el-button type="primary"
|
|
|
+ @click="onDialogChange">确 定</el-button>
|
|
|
</span>
|
|
|
- </el-dialog>
|
|
|
+ </el-dialog>
|
|
|
</div>
|
|
|
</template>
|
|
|
<script>
|
|
|
-import { queryCountOfUnread, sysMessageList, leaveQueryDetail, setRead, approve } from '@/api/journal'
|
|
|
+import { queryCountOfUnread, sysMessageList, leaveQueryDetail, setRead, approve } from '@/api/journal'
|
|
|
export default {
|
|
|
+ name: 'leaveOperation',
|
|
|
data () {
|
|
|
return {
|
|
|
img: {
|
|
@@ -140,22 +167,22 @@ export default {
|
|
|
showMessage: {}
|
|
|
}
|
|
|
},
|
|
|
- mounted() {
|
|
|
+ mounted () {
|
|
|
this.__init()
|
|
|
this.sysMessageList()
|
|
|
},
|
|
|
methods: {
|
|
|
- __init() {
|
|
|
+ __init () {
|
|
|
// 未读消息
|
|
|
queryCountOfUnread().then(res => {
|
|
|
- if(res.code == 200) {
|
|
|
- if(res.data && res.data.LEAVE) {
|
|
|
+ if (res.code == 200) {
|
|
|
+ if (res.data && res.data.LEAVE) {
|
|
|
this.noReadMessage = res.data.LEAVE
|
|
|
}
|
|
|
}
|
|
|
})
|
|
|
},
|
|
|
- onSubmit(showMessage, type) {
|
|
|
+ onSubmit (showMessage, type) {
|
|
|
let params = {
|
|
|
id: showMessage.id,
|
|
|
// remark: null,
|
|
@@ -163,7 +190,7 @@ export default {
|
|
|
userId: showMessage.userId
|
|
|
}
|
|
|
approve(params).then(res => {
|
|
|
- if(res.code == 200) {
|
|
|
+ if (res.code == 200) {
|
|
|
this.$message.success('处理成功')
|
|
|
this.getLeaveItem(JSON.stringify({ leaveRecordId: showMessage.id }))
|
|
|
} else {
|
|
@@ -171,64 +198,64 @@ export default {
|
|
|
}
|
|
|
})
|
|
|
},
|
|
|
- onDialogChange() {
|
|
|
- if(!this.changeDate) {
|
|
|
+ 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)
|
|
|
+ endStr = '2019/10/10 ' + this.getDateInfo(this.dialogData.befor.endClassTime)
|
|
|
let startDate = new Date(startStr),
|
|
|
- endDate = new Date(endStr)
|
|
|
+ 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)
|
|
|
- let day = tempDate.getDate() >= 10 ? tempDate.getDate() : '0' + tempDate.getDate()
|
|
|
- let tDate = tempDate.getFullYear() + '-' + month + '-' + day
|
|
|
- let hours = tempDate.getHours() >= 10 ? tempDate.getHours() : '0' + tempDate.getHours()
|
|
|
- let min = tempDate.getMinutes() >= 10 ? tempDate.getMinutes() : '0' + tempDate.getMinutes()
|
|
|
- return tDate + ' ' + hours + ':' + min + ':00'
|
|
|
+ getFormatDate (data) {
|
|
|
+ let tempDate = new Date(data)
|
|
|
+ let month = (tempDate.getMonth() + 1) >= 10 ? (tempDate.getMonth() + 1) : '0' + (tempDate.getMonth() + 1)
|
|
|
+ let day = tempDate.getDate() >= 10 ? tempDate.getDate() : '0' + tempDate.getDate()
|
|
|
+ let tDate = tempDate.getFullYear() + '-' + month + '-' + day
|
|
|
+ let hours = tempDate.getHours() >= 10 ? tempDate.getHours() : '0' + tempDate.getHours()
|
|
|
+ let min = tempDate.getMinutes() >= 10 ? tempDate.getMinutes() : '0' + tempDate.getMinutes()
|
|
|
+ return tDate + ' ' + hours + ':' + min + ':00'
|
|
|
},
|
|
|
- getDateInfo(value) {
|
|
|
- let tempValue = value
|
|
|
- if(typeof value !== 'object') {
|
|
|
- tempValue = value.replace(/-/ig, '/')
|
|
|
- }
|
|
|
- let d = new Date(tempValue)
|
|
|
- let hour = d.getHours() >= 10 ? d.getHours() : '0' + d.getHours()
|
|
|
- let minute = d.getMinutes() >= 10 ? d.getMinutes() : '0' + d.getMinutes()
|
|
|
- return hour + ':' + minute + ':00'
|
|
|
+ getDateInfo (value) {
|
|
|
+ let tempValue = value
|
|
|
+ if (typeof value !== 'object') {
|
|
|
+ tempValue = value.replace(/-/ig, '/')
|
|
|
+ }
|
|
|
+ let d = new Date(tempValue)
|
|
|
+ let hour = d.getHours() >= 10 ? d.getHours() : '0' + d.getHours()
|
|
|
+ let minute = d.getMinutes() >= 10 ? d.getMinutes() : '0' + d.getMinutes()
|
|
|
+ return hour + ':' + minute + ':00'
|
|
|
},
|
|
|
- onClssTime(row) {
|
|
|
+ onClssTime (row) {
|
|
|
this.dialogVisible = true
|
|
|
this.dialogData = row
|
|
|
},
|
|
|
- sysMessageList() { // 列表
|
|
|
+ sysMessageList () { // 列表
|
|
|
sysMessageList({
|
|
|
group: 'LEAVE',
|
|
|
rows: this.pageInfo.limit,
|
|
|
page: this.pageInfo.page,
|
|
|
readStatus: this.pageInfo.readStatus
|
|
|
}).then(res => {
|
|
|
- if(res.code == 200) {
|
|
|
+ if (res.code == 200) {
|
|
|
this.dataList = res.data.rows
|
|
|
this.pageInfo.total = res.data.total
|
|
|
}
|
|
|
})
|
|
|
},
|
|
|
- onLookMessage(type) { // 查看对应的数据
|
|
|
- if(type == "all") {
|
|
|
+ onLookMessage (type) { // 查看对应的数据
|
|
|
+ if (type == "all") {
|
|
|
this.pageInfo.readStatus = null
|
|
|
} else {
|
|
|
this.pageInfo.readStatus = type
|
|
@@ -239,18 +266,18 @@ export default {
|
|
|
this.isCheckMessage = null
|
|
|
this.sysMessageList()
|
|
|
},
|
|
|
- onChange(page) { // 分页
|
|
|
+ onChange (page) { // 分页
|
|
|
this.pageInfo.page = page
|
|
|
this.sysMessageList()
|
|
|
},
|
|
|
- onClickRead(item) {
|
|
|
+ onClickRead (item) {
|
|
|
this.isCheckMessage = item.id
|
|
|
- if(item.readStatus == 1) {
|
|
|
+ if (item.readStatus == 1) {
|
|
|
this.getLeaveItem(item.memo)
|
|
|
} else {
|
|
|
setRead({ id: item.id }).then(res => {
|
|
|
let result = res.data
|
|
|
- if(res.code == 200) {
|
|
|
+ if (res.code == 200) {
|
|
|
item.readStatus = 1
|
|
|
this.getLeaveItem(item.memo)
|
|
|
|
|
@@ -259,12 +286,12 @@ export default {
|
|
|
})
|
|
|
}
|
|
|
},
|
|
|
- getLeaveItem(memo) {
|
|
|
+ getLeaveItem (memo) {
|
|
|
memo = JSON.parse(memo)
|
|
|
leaveQueryDetail({ id: memo.leaveRecordId }).then(res => {
|
|
|
- if(res.code == 200) {
|
|
|
+ if (res.code == 200) {
|
|
|
this.showRight = true
|
|
|
- if(res.data.coursesScheduleJson) {
|
|
|
+ if (res.data.coursesScheduleJson) {
|
|
|
res.data.coursesScheduleJson = JSON.parse(res.data.coursesScheduleJson)
|
|
|
}
|
|
|
this.showMessage = res.data
|
|
@@ -276,15 +303,15 @@ export default {
|
|
|
}
|
|
|
},
|
|
|
filters: {
|
|
|
- getFormatTime(tempA, tempB) {
|
|
|
- tempA = new Date(tempA.replace(/-/g, "/")),
|
|
|
+ getFormatTime (tempA, tempB) {
|
|
|
+ tempA = new Date(tempA.replace(/-/g, "/")),
|
|
|
tempB = new Date(tempB.replace(/-/g, "/"))
|
|
|
- let hours = Number(tempA.getHours()) >= 10 ? tempA.getHours() : '0' + tempA.getHours()
|
|
|
- let hours2 = Number(tempB.getHours()) >= 10 ? tempB.getHours() : '0' + tempB.getHours()
|
|
|
- let min = Number(tempA.getMinutes()) >= 10 ? tempA.getMinutes() : '0' + tempA.getMinutes()
|
|
|
- let min2 = Number(tempB.getMinutes()) >= 10 ? tempB.getMinutes() : '0' + tempB.getMinutes()
|
|
|
+ let hours = Number(tempA.getHours()) >= 10 ? tempA.getHours() : '0' + tempA.getHours()
|
|
|
+ let hours2 = Number(tempB.getHours()) >= 10 ? tempB.getHours() : '0' + tempB.getHours()
|
|
|
+ let min = Number(tempA.getMinutes()) >= 10 ? tempA.getMinutes() : '0' + tempA.getMinutes()
|
|
|
+ let min2 = Number(tempB.getMinutes()) >= 10 ? tempB.getMinutes() : '0' + tempB.getMinutes()
|
|
|
|
|
|
- return hours + ':' + min + '-' + hours2 + ':' + min2
|
|
|
+ return hours + ':' + min + '-' + hours2 + ':' + min2
|
|
|
}
|
|
|
}
|
|
|
}
|
|
@@ -310,7 +337,9 @@ export default {
|
|
|
top: 6px;
|
|
|
}
|
|
|
}
|
|
|
- .unread, .read, .recovery {
|
|
|
+ .unread,
|
|
|
+ .read,
|
|
|
+ .recovery {
|
|
|
cursor: pointer;
|
|
|
}
|
|
|
.unread {
|
|
@@ -526,5 +555,4 @@ export default {
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
-
|
|
|
</style>
|