studentComplain.vue 13 KB

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