123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487 |
- <template>
- <div class='infoWrap'>
- <div class="left">
- <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>
- <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">
- <!-- <h6 class="type"></h6> -->
- <h4 class="name">学生申诉<span class='time'>{{ item.createOn | dateForMinFormat }}</span>
- <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">
- </el-pagination>
- </div>
- <div class="right"
- v-if="showRight">
- <el-row>
- <el-col :span="24">
- <h3 class="title">学员投诉
- <el-tag v-if="showMessage.complaints.status == 'PASS'"
- type="success"
- effect="plain">已处理</el-tag>
- <el-tag v-if="showMessage.complaints.status == 'REJECT'"
- type="danger"
- effect="plain">已拒绝</el-tag>
- <span class="time">发起投诉时间: {{ showMessage.courseSchedule.createTime | dateForMinFormat}}</span>
- </h3>
- </el-col>
- </el-row>
- <el-row>
- <el-col :span="4"> 学员姓名: </el-col>
- <el-col :span="20"> {{ showMessage.complaints.user.username }} </el-col>
- </el-row>
- <el-row>
- <el-col :span="4"> 课程名称: </el-col>
- <el-col :span="20"> {{ showMessage.courseSchedule.name }} </el-col>
- </el-row>
- <el-row>
- <el-col :span="4"> 课程时间:</el-col>
- <el-col :span="20"> {{ showMessage.courseSchedule.classDate | formatTimer }} {{ showMessage.courseSchedule.startClassTime | timer }} </el-col>
- </el-row>
- <el-row>
- <el-col :span="4"> 老师名称: </el-col>
- <el-col :span="20"> {{ showMessage.courseSchedule.teacher.username }} </el-col>
- </el-row>
- <el-row>
- <el-col :span="4">投诉理由:</el-col>
- <el-col :span="20">
- {{ showMessage.complaints.reason }}
- </el-col>
- </el-row>
- <el-row>
- <el-col :span="4"
- style="height:40px;line-height:40px;">
- 责任比:
- </el-col>
- <el-col :span="20"
- v-if="showMessage.complaints.status == 'ING'">
- <div style="padding-bottom: 8px;">
- <span style="padding-right: 8px;">老师</span>
- <el-input type="number"
- @mousewheel.native.prevent
- min="0"
- max="100"
- v-model.trim="teacherRate"
- placeholder="请输入内容">
- <template slot="append">%</template></el-input>
- </el-input>
- </div>
- <div>
- <span style="padding-right: 8px;">学生</span>
- <el-input type="number"
- @mousewheel.native.prevent
- min="0"
- max="100"
- v-model.trim="studentRate"
- placeholder="请输入内容">
- <template slot="append">%</template></el-input>
- </div>
- </el-col>
- <el-col :span="20"
- v-else>
- <div style="padding-bottom: 8px;">
- <span style="padding-right: 8px;">老师</span>
- <el-input disabled
- type="number"
- @mousewheel.native.prevent
- min="0"
- max="100"
- v-model.trim="teacherRate"
- placeholder="请输入内容">
- <template slot="append">%</template>
- </el-input>
- </div>
- <div>
- <span style="padding-right: 8px;">学生</span>
- <el-input disabled
- type="number"
- @mousewheel.native.prevent
- min="0"
- max="100"
- v-model.trim="studentRate"
- placeholder="请输入内容">
- <template slot="append">%</template>
- </el-input>
- </div>
- </el-col>
- </el-row>
- <!-- <el-row >
- <el-col :span="4" style="height:40px;line-height:40px;">发放比例:</el-col>
- <el-col :span="20">
- <div>
- <span style="padding-right: 8px;">课酬</span>
- <el-input disabled
-
- :disabled='true'
- @mousewheel.native.prevent
- min="0"
- max="10"
- v-model.trim="studentRate"
- placeholder="">
- <template slot="append">%</template></el-input>
- </div>
- </el-col>
- </el-row> -->
- <el-row v-permission="'courseSchedule/courseScheduleCommplaintAudit'"
- v-if="showMessage.complaints.status == 'ING'">
- <el-col :span="24">
- <el-button type="primary"
- @click="onSubmit(showMessage.complaints.id, 'submit')">确认</el-button>
- <el-button type="danger"
- @click="onSubmit(showMessage.complaints.id, 'reject')">拒绝</el-button>
- </el-col>
- </el-row>
- </div>
- </div>
- </template>
- <script>
- import { queryCountOfUnread, sysMessageList, setRead, queryCourseScheduleComplaintsDetail, courseScheduleCommplaintAudit } from '@/api/journal'
- export default {
- name: 'studentComplain',
- data () {
- return {
- img: {
- bookicon: require('@/assets/images/base/bookicon.png'),
- Hbookicon: require('@/assets/images/base/bookicon-h.png'),
- trashicon: require('@/assets/images/base/trashicon.png'),
- Htrashicon: require('@/assets/images/base/trashicon-h.png'),
- boxicon: require('@/assets/images/base/boxicon.png'),
- Hboxicon: require('@/assets/images/base/boxicon-h.png')
- },
- pageInfo: {
- isSinglePage: false, // 是否只有一页
- limit: 10,
- page: 1,
- readStatus: null,
- total: 0,
- },
- noReadMessage: 0, // 未读消息
- dataList: [],
- isCheckMessage: null,
- showRight: false,
- showMessage: {},
- teacherRate: null,
- studentRate: null
- }
- },
- mounted () {
- this.__init()
- this.sysMessageList()
- },
- methods: {
- __init () {
- // 未读消息
- queryCountOfUnread().then(res => {
- if (res.code == 200) {
- if (res.data && res.data.STUDENT) {
- this.noReadMessage = res.data.STUDENT
- }
- }
- })
- },
- sysMessageList () { // 列表
- sysMessageList({
- group: 'STUDENT',
- rows: this.pageInfo.limit,
- page: this.pageInfo.page,
- readStatus: this.pageInfo.readStatus
- }).then(res => {
- if (res.code == 200) {
- this.dataList = res.data.rows
- this.pageInfo.total = res.data.total
- }
- })
- },
- getCourseDetail (id) {
- queryCourseScheduleComplaintsDetail({ courseScheduleComplaintsId: id }).then(res => {
- let result = res.data
- if (res.code == 200) {
- this.showRight = true
- this.showMessage = result
- if (result.complaints.status != 'ING') {
- this.teacherRate = result.complaints.teacherLiabilityRatio * 10
- this.studentRate = result.complaints.studentLiabilityRatio * 10
- }
- }
- })
- },
- onLookMessage (type) { // 查看对应的数据
- if (type == "all") {
- this.pageInfo.readStatus = null
- } else {
- this.pageInfo.readStatus = type
- }
- this.pageInfo.page = 1
- this.showRight = false
- this.showMessage = {}
- this.isCheckMessage = null
- this.sysMessageList()
- },
- onChange (page) { // 分页
- this.pageInfo.page = page
- this.sysMessageList()
- },
- onClickRead (item) {
- this.isCheckMessage = item.id
- let memo = JSON.parse(item.memo)
- this.teacherRate = null;
- this.studentRate = null;
- if (item.readStatus == 1) {
- this.getCourseDetail(memo.courseScheduleComplaintsId)
- } else {
- setRead({ id: item.id }).then(res => {
- let result = res.data
- if (res.code == 200) {
- item.readStatus = 1
- this.getCourseDetail(memo.courseScheduleComplaintsId)
- this.noReadMessage--
- }
- })
- }
- },
- onSubmit (id, type) {
- let params = {
- id: id
- }
- let teacherRate = this.teacherRate / 10
- let studentRate = this.studentRate / 10
- if (type == 'submit') {
- if (teacherRate < 0 || teacherRate > 100 || Number(teacherRate) == NaN) {
- this.$message.error('老师责任比输入有误')
- return
- }
- if (studentRate < 0 || studentRate > 100 || Number(studentRate) == NaN) {
- this.$message.error('学生责任比输入有误')
- return
- }
- if (studentRate + teacherRate != 10) {
- this.$message.error('责任比之和为必须为100')
- return
- }
- params.status = 'PASS'
- params.studentLiabilityRatio = studentRate
- params.teacherLiabilityRatio = teacherRate
- } else if (type == 'reject') {
- params.status = 'REJECT'
- params.studentLiabilityRatio = 0
- params.teacherLiabilityRatio = 0
- }
- courseScheduleCommplaintAudit(params).then(res => {
- if (res.code == 200) {
- this.$message.success('处理成功')
- this.getCourseDetail(id)
- } else {
- this.$message.error(res.msg)
- }
- })
- }
- },
- watch: {
- teacherRate (newvalue, oldvalue) {
- if (newvalue) {
- this.studentRate = parseInt(100 - newvalue)
- }
- },
- studentRate (newvalue, oldvalue) {
- if (newvalue) {
- this.teacherRate = parseInt(100 - newvalue)
- }
- }
- },
- computed: {
- }
- }
- </script>
- <style lang="scss" scoped>
- .infoWrap {
- display: flex;
- flex-direction: row;
- justify-content: flex-start;
- height: calc(100vh - 266px);
- overflow: auto;
- .left {
- padding-top: 24px;
- display: flex;
- flex-direction: column;
- align-items: left;
- > div {
- height: 26px;
- line-height: 26px;
- margin-top: 26px;
- img {
- position: relative;
- top: 6px;
- }
- }
- .unread,
- .read,
- .recovery {
- cursor: pointer;
- }
- .unread {
- position: relative;
- img {
- width: 26px;
- height: 25px;
- }
- .count {
- position: absolute;
- width: 38px;
- height: 23px;
- background: rgba(20, 146, 138, 0.5);
- border-radius: 100px;
- font-size: 12px;
- line-height: 23px;
- text-align: center;
- color: #225551;
- right: -44px;
- top: 8px;
- }
- }
- .read {
- img {
- width: 20px;
- height: 26px;
- }
- }
- .recovery {
- img {
- width: 19px;
- height: 26px;
- }
- }
- }
- .middle {
- width: 25%;
- margin-left: 76px;
- padding-top: 50px;
- overflow: auto;
- .msgItem {
- padding: 16px 18px 23px 30px;
- border-bottom: 1px solid #ccc;
- .type {
- font-size: 14px;
- color: #777;
- font-weight: 400;
- padding-bottom: 4px;
- }
- .name {
- position: relative;
- color: #444;
- font-size: 16px;
- padding-bottom: 9px;
- clear: both;
- .time {
- font-weight: 400;
- color: #aaa;
- float: right;
- }
- .dot {
- width: 7px;
- height: 7px;
- background-color: #f97215;
- border-radius: 50%;
- position: absolute;
- left: -13px;
- top: 4px;
- }
- }
- .msg {
- color: #444;
- font-size: 14px;
- line-height: 24px;
- text-overflow: -o-ellipsis-lastline;
- overflow: hidden;
- text-overflow: ellipsis;
- display: -webkit-box;
- -webkit-line-clamp: 2;
- -webkit-box-orient: vertical;
- }
- }
- .msgItem.active {
- background-color: #f3f4f8;
- border-radius: 5px;
- .msg {
- color: #aaa;
- }
- }
- }
- .right {
- border: 1px solid #e4e8eb;
- margin-left: 25px;
- position: relative;
- overflow: auto;
- padding: 20px;
- min-width: 50%;
- }
- }
- .el-timeline-item__dot {
- width: 20px;
- height: 20px;
- }
- .el-timeline-item {
- min-height: 80px !important;
- }
- .el-timeline-item__tail {
- left: 9px !important;
- }
- /deep/.el-row {
- padding-bottom: 10px;
- }
- /deep/.el-col-4 {
- font-size: 16px;
- }
- /deep/.el-col {
- .el-input {
- width: 200px;
- }
- }
- .title {
- font-size: 16px;
- .time {
- float: right;
- font-size: 12px;
- color: #ccc;
- }
- }
- </style>
|