studentComplain.vue 12 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453
  1. <template>
  2. <div class='infoWrap'>
  3. <div class="left">
  4. <div class="unread"
  5. @click="onLookMessage('all')">全部</div>
  6. <div class="unread"
  7. @click="onLookMessage('0')"> <img :src="img.boxicon"
  8. alt=""> 未读消息
  9. <div class="count"
  10. v-if="noReadMessage >= 1">{{ noReadMessage }}</div>
  11. </div>
  12. <div class="read"
  13. @click="onLookMessage('1')">
  14. <img :src="img.bookicon"
  15. alt="">
  16. 已读消息</div>
  17. </div>
  18. <div class="middle">
  19. <div class="msgItem"
  20. :class="[isCheckMessage == item.id ? 'active' : '']"
  21. @click="onClickRead(item)"
  22. v-for="(item, index) in dataList"
  23. :key="index">
  24. <!-- <h6 class="type"></h6> -->
  25. <h4 class="name">学生申诉<span class='time'>{{ item.createOn }}</span>
  26. <div class="dot"
  27. v-if="item.readStatus == 0"></div>
  28. </h4>
  29. <p class='msg'>{{ item.content }}</p>
  30. </div>
  31. <el-pagination style="text-align: right"
  32. small
  33. v-if="dataList.length > 0"
  34. @current-change="onChange"
  35. :hide-on-single-page="pageInfo.isSinglePage"
  36. layout="prev, pager, next"
  37. :total="pageInfo.total">
  38. </el-pagination>
  39. </div>
  40. <div class="right"
  41. v-if="showRight">
  42. <el-row>
  43. <el-col :span="24">
  44. <h3 class="title">学员投诉
  45. <el-tag v-if="showMessage.complaints.status == 'PASS'"
  46. type="success"
  47. effect="plain">已处理</el-tag>
  48. <el-tag v-if="showMessage.complaints.status == 'REJECT'"
  49. type="danger"
  50. effect="plain">已拒绝</el-tag>
  51. <span class="time">发起投诉时间: {{ showMessage.courseSchedule.createTime }}</span>
  52. </h3>
  53. </el-col>
  54. </el-row>
  55. <el-row>
  56. <el-col :span="4"> 学员姓名: </el-col>
  57. <el-col :span="20"> {{ showMessage.complaints.user.username }} </el-col>
  58. </el-row>
  59. <el-row>
  60. <el-col :span="4"> 课程名称: </el-col>
  61. <el-col :span="20"> {{ showMessage.courseSchedule.name }} </el-col>
  62. </el-row>
  63. <el-row>
  64. <el-col :span="4"> 课程时间:</el-col>
  65. <el-col :span="20"> {{ showMessage.courseSchedule.classDate | formatTimer }} {{ showMessage.courseSchedule.startClassTime | timer }} </el-col>
  66. </el-row>
  67. <el-row>
  68. <el-col :span="4"> 老师名称: </el-col>
  69. <el-col :span="20"> {{ showMessage.courseSchedule.teacher.username }} </el-col>
  70. </el-row>
  71. <el-row>
  72. <el-col :span="4">投诉理由:</el-col>
  73. <el-col :span="20">
  74. {{ showMessage.complaints.reason }}
  75. </el-col>
  76. </el-row>
  77. <el-row>
  78. <el-col :span="4">
  79. 责任比:
  80. </el-col>
  81. <el-col :span="20"
  82. v-if="showMessage.complaints.status == 'ING'">
  83. <div style="padding-bottom: 8px;">
  84. <span style="padding-right: 8px;">老师</span>
  85. <el-input type="number"
  86. @mousewheel.native.prevent
  87. min="0"
  88. max="10"
  89. v-model="teacherRate"
  90. placeholder="请输入内容"></el-input>
  91. </div>
  92. <div>
  93. <span style="padding-right: 8px;">学生</span>
  94. <el-input type="number"
  95. @mousewheel.native.prevent
  96. min="0"
  97. max="10"
  98. v-model="studentRate"
  99. placeholder="请输入内容"></el-input>
  100. </div>
  101. </el-col>
  102. <el-col :span="20"
  103. v-else>
  104. <div style="padding-bottom: 8px;">
  105. <span style="padding-right: 8px;">老师</span>
  106. <el-input disabled
  107. type="number"
  108. @mousewheel.native.prevent
  109. min="0"
  110. max="10"
  111. v-model="teacherRate"
  112. placeholder="请输入内容"></el-input>
  113. </div>
  114. <div>
  115. <span style="padding-right: 8px;">学生</span>
  116. <el-input disabled
  117. type="number"
  118. @mousewheel.native.prevent
  119. min="0"
  120. max="10"
  121. v-model="studentRate"
  122. placeholder="请输入内容"></el-input>
  123. </div>
  124. </el-col>
  125. </el-row>
  126. <el-row v-permission="'courseSchedule/courseScheduleCommplaintAudit'"
  127. v-if="showMessage.complaints.status == 'ING'">
  128. <el-col :span="24">
  129. <el-button type="primary"
  130. @click="onSubmit(showMessage.complaints.id, 'submit')">确认</el-button>
  131. <el-button type="danger"
  132. @click="onSubmit(showMessage.complaints.id, 'reject')">拒绝</el-button>
  133. </el-col>
  134. </el-row>
  135. </div>
  136. </div>
  137. </template>
  138. <script>
  139. import { queryCountOfUnread, sysMessageList, setRead, queryCourseScheduleComplaintsDetail, courseScheduleCommplaintAudit } from '@/api/journal'
  140. export default {
  141. data () {
  142. return {
  143. img: {
  144. bookicon: require('@/assets/images/base/bookicon.png'),
  145. Hbookicon: require('@/assets/images/base/bookicon-h.png'),
  146. trashicon: require('@/assets/images/base/trashicon.png'),
  147. Htrashicon: require('@/assets/images/base/trashicon-h.png'),
  148. boxicon: require('@/assets/images/base/boxicon.png'),
  149. Hboxicon: require('@/assets/images/base/boxicon-h.png')
  150. },
  151. pageInfo: {
  152. isSinglePage: false, // 是否只有一页
  153. limit: 10,
  154. page: 1,
  155. readStatus: null,
  156. total: 0,
  157. },
  158. noReadMessage: 0, // 未读消息
  159. dataList: [],
  160. isCheckMessage: null,
  161. showRight: false,
  162. showMessage: {},
  163. teacherRate: null,
  164. studentRate: null
  165. }
  166. },
  167. mounted () {
  168. this.__init()
  169. this.sysMessageList()
  170. },
  171. methods: {
  172. __init () {
  173. // 未读消息
  174. queryCountOfUnread().then(res => {
  175. if (res.code == 200) {
  176. if (res.data && res.data.STUDENT) {
  177. this.noReadMessage = res.data.STUDENT
  178. }
  179. }
  180. })
  181. },
  182. sysMessageList () { // 列表
  183. sysMessageList({
  184. group: 'STUDENT',
  185. rows: this.pageInfo.limit,
  186. page: this.pageInfo.page,
  187. readStatus: this.pageInfo.readStatus
  188. }).then(res => {
  189. if (res.code == 200) {
  190. this.dataList = res.data.rows
  191. this.pageInfo.total = res.data.total
  192. }
  193. })
  194. },
  195. getCourseDetail (id) {
  196. queryCourseScheduleComplaintsDetail({ courseScheduleComplaintsId: id }).then(res => {
  197. let result = res.data
  198. if (res.code == 200) {
  199. this.showRight = true
  200. this.showMessage = result
  201. if (result.complaints.status != 'ING') {
  202. this.teacherRate = result.complaints.teacherLiabilityRatio
  203. this.studentRate = result.complaints.studentLiabilityRatio
  204. }
  205. }
  206. })
  207. },
  208. onLookMessage (type) { // 查看对应的数据
  209. if (type == "all") {
  210. this.pageInfo.readStatus = null
  211. } else {
  212. this.pageInfo.readStatus = type
  213. }
  214. this.pageInfo.page = 1
  215. this.showRight = false
  216. this.showMessage = {}
  217. this.isCheckMessage = null
  218. this.sysMessageList()
  219. },
  220. onChange (page) { // 分页
  221. this.pageInfo.page = page
  222. this.sysMessageList()
  223. },
  224. onClickRead (item) {
  225. this.isCheckMessage = item.id
  226. let memo = JSON.parse(item.memo)
  227. if (item.readStatus == 1) {
  228. this.getCourseDetail(memo.courseScheduleComplaintsId)
  229. } else {
  230. setRead({ id: item.id }).then(res => {
  231. let result = res.data
  232. if (res.code == 200) {
  233. item.readStatus = 1
  234. this.getCourseDetail(memo.courseScheduleComplaintsId)
  235. this.noReadMessage--
  236. }
  237. })
  238. }
  239. },
  240. onSubmit (id, type) {
  241. let params = {
  242. id: id
  243. }
  244. let teacherRate = this.teacherRate
  245. let studentRate = this.studentRate
  246. if (type == 'submit') {
  247. if (teacherRate < 0 || teacherRate > 10 || typeof teacherRate == 'string') {
  248. this.$message.error('老师责任比输入有误')
  249. return
  250. }
  251. if (studentRate < 0 || studentRate > 10 || typeof studentRate == 'string') {
  252. this.$message.error('学生责任比输入有误')
  253. return
  254. }
  255. if (studentRate + teacherRate != 10) {
  256. this.$message.error('责任比之和为必须为10')
  257. return
  258. }
  259. params.status = 'PASS'
  260. params.studentLiabilityRatio = studentRate
  261. params.teacherLiabilityRatio = teacherRate
  262. } else if (type == 'reject') {
  263. params.status = 'REJECT'
  264. params.studentLiabilityRatio = 0
  265. params.teacherLiabilityRatio = 0
  266. }
  267. courseScheduleCommplaintAudit(params).then(res => {
  268. if (res.code == 200) {
  269. this.$message.success('处理成功')
  270. this.getCourseDetail(id)
  271. } else {
  272. this.$message.errot(res.msg)
  273. }
  274. })
  275. }
  276. },
  277. watch: {
  278. teacherRate (newvalue, oldvalue) {
  279. if (newvalue) {
  280. this.studentRate = 10 - newvalue
  281. }
  282. },
  283. studentRate (newvalue, oldvalue) {
  284. if (newvalue) {
  285. this.teacherRate = 10 - newvalue
  286. }
  287. }
  288. }
  289. }
  290. </script>
  291. <style lang="scss" scoped>
  292. .infoWrap {
  293. display: flex;
  294. flex-direction: row;
  295. justify-content: flex-start;
  296. height: calc(100vh - 266px);
  297. overflow: auto;
  298. .left {
  299. padding-top: 24px;
  300. display: flex;
  301. flex-direction: column;
  302. align-items: left;
  303. > div {
  304. height: 26px;
  305. line-height: 26px;
  306. margin-top: 26px;
  307. img {
  308. position: relative;
  309. top: 6px;
  310. }
  311. }
  312. .unread,
  313. .read,
  314. .recovery {
  315. cursor: pointer;
  316. }
  317. .unread {
  318. position: relative;
  319. img {
  320. width: 26px;
  321. height: 25px;
  322. }
  323. .count {
  324. position: absolute;
  325. width: 38px;
  326. height: 23px;
  327. background: rgba(20, 146, 138, 0.5);
  328. border-radius: 100px;
  329. font-size: 12px;
  330. line-height: 23px;
  331. text-align: center;
  332. color: #225551;
  333. right: -44px;
  334. top: 8px;
  335. }
  336. }
  337. .read {
  338. img {
  339. width: 20px;
  340. height: 26px;
  341. }
  342. }
  343. .recovery {
  344. img {
  345. width: 19px;
  346. height: 26px;
  347. }
  348. }
  349. }
  350. .middle {
  351. width: 25%;
  352. margin-left: 76px;
  353. padding-top: 50px;
  354. overflow: auto;
  355. .msgItem {
  356. padding: 16px 18px 23px 30px;
  357. border-bottom: 1px solid #ccc;
  358. .type {
  359. font-size: 14px;
  360. color: #777;
  361. font-weight: 400;
  362. padding-bottom: 4px;
  363. }
  364. .name {
  365. position: relative;
  366. color: #444;
  367. font-size: 16px;
  368. padding-bottom: 9px;
  369. clear: both;
  370. .time {
  371. font-weight: 400;
  372. color: #aaa;
  373. float: right;
  374. }
  375. .dot {
  376. width: 7px;
  377. height: 7px;
  378. background-color: #f97215;
  379. border-radius: 50%;
  380. position: absolute;
  381. left: -13px;
  382. top: 4px;
  383. }
  384. }
  385. .msg {
  386. color: #444;
  387. font-size: 14px;
  388. line-height: 24px;
  389. text-overflow: -o-ellipsis-lastline;
  390. overflow: hidden;
  391. text-overflow: ellipsis;
  392. display: -webkit-box;
  393. -webkit-line-clamp: 2;
  394. -webkit-box-orient: vertical;
  395. }
  396. }
  397. .msgItem.active {
  398. background-color: #f3f4f8;
  399. border-radius: 5px;
  400. .msg {
  401. color: #aaa;
  402. }
  403. }
  404. }
  405. .right {
  406. border: 1px solid #e4e8eb;
  407. margin-left: 25px;
  408. position: relative;
  409. overflow: auto;
  410. padding: 20px;
  411. min-width: 50%;
  412. }
  413. }
  414. .el-timeline-item__dot {
  415. width: 20px;
  416. height: 20px;
  417. }
  418. .el-timeline-item {
  419. min-height: 80px !important;
  420. }
  421. .el-timeline-item__tail {
  422. left: 9px !important;
  423. }
  424. /deep/.el-row {
  425. padding-bottom: 10px;
  426. }
  427. /deep/.el-col-4 {
  428. font-size: 16px;
  429. }
  430. /deep/.el-col {
  431. .el-input {
  432. width: 200px;
  433. }
  434. }
  435. .title {
  436. font-size: 16px;
  437. .time {
  438. float: right;
  439. font-size: 12px;
  440. color: #ccc;
  441. }
  442. }
  443. </style>