musicGroup.vue 13 KB

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