musicGroup.vue 17 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559
  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">
  26. {{ item.memo.type == 'VIPGROUP' ? '学员退课' : '学生退团' }}
  27. <span class='time'>{{ item.createOn | dateForMinFormat}}</span>
  28. <div class="dot"
  29. v-if="item.readStatus == 0"></div>
  30. </h4>
  31. <p class='msg'>{{ item.content }}</p>
  32. </div>
  33. <el-pagination style="text-align: right"
  34. small
  35. v-if="dataList.length > 0"
  36. @current-change="onChange"
  37. :hide-on-single-page="pageInfo.isSinglePage"
  38. layout="prev, pager, next"
  39. :total="pageInfo.total">
  40. </el-pagination>
  41. </div>
  42. <div class="right"
  43. v-if="showRight">
  44. <div v-if="showMessage.type == 'VIPGROUP'"
  45. kay="group">
  46. <el-row>
  47. <el-col :span="24">
  48. <h3 class="title">学员退课
  49. <el-tag v-if="showMessage.studentApplyRefunds.status == 'DONE'"
  50. type="success"
  51. effect="plain">已处理</el-tag>
  52. <el-tag v-if="showMessage.studentApplyRefunds.status == 'REJECT'"
  53. type="danger"
  54. effect="plain">已拒绝</el-tag>
  55. <span class="time">时间: {{ showMessage.studentApplyRefunds.createTime | dateForMinFormat}}</span>
  56. </h3>
  57. </el-col>
  58. </el-row>
  59. <el-row>
  60. <el-col :span="4"> 学员姓名: </el-col>
  61. <el-col :span="20"> {{ showMessage.student }} </el-col>
  62. </el-row>
  63. <el-row>
  64. <el-col :span="4">课程名称: </el-col>
  65. <el-col :span="20"> {{ showMessage.className }}</el-col>
  66. </el-row>
  67. <el-row>
  68. <el-col :span="4"> 应退金额: </el-col>
  69. <el-col :span="20"> {{ showMessage.studentApplyRefunds.expectAmount }}元 </el-col>
  70. </el-row>
  71. <el-row>
  72. <el-col :span="24">
  73. <el-input :disabled="showMessage.studentApplyRefunds.status != 'ING'"
  74. type="textarea"
  75. :rows="8"
  76. placeholder="请输入内容"
  77. v-model.trim="remark"> </el-input>
  78. </el-col>
  79. </el-row>
  80. <el-row>
  81. <el-col :span="4"> 实退金额: </el-col>
  82. <el-col :span="20">
  83. <el-input :disabled="showMessage.studentApplyRefunds.status != 'ING'"
  84. type="number"
  85. placeholder="请输入内容"
  86. @mousewheel.native.prevent
  87. v-model.trim="actualAmount">
  88. <template slot="append">元</template>
  89. </el-input>
  90. </el-col>
  91. </el-row>
  92. <el-row v-permission="'vipGroupManage/applyRefundAudit'">
  93. <el-col :span="24"
  94. v-if="showMessage.studentApplyRefunds.status == 'ING'">
  95. <el-button type="primary"
  96. @click="onSubmit(showMessage.studentApplyRefunds.id, showMessage.type, 'DONE')">确认</el-button>
  97. <el-button type="danger"
  98. @click="onSubmit(showMessage.studentApplyRefunds.id, showMessage.type, 'REJECT')">拒绝</el-button>
  99. </el-col>
  100. </el-row>
  101. </div>
  102. <div v-else
  103. kay="group">
  104. <el-row>
  105. <el-col :span="24">
  106. <h3 class="title">乐团名称
  107. <el-tag v-if="showMessage.status == 'APPROVED'"
  108. type="success"
  109. effect="plain">已处理</el-tag>
  110. <el-tag v-if="showMessage.status == 'DENIED'"
  111. type="danger"
  112. effect="plain">已拒绝</el-tag>
  113. <span class="time">时间: {{ showMessage.createTime }}</span>
  114. </h3>
  115. </el-col>
  116. </el-row>
  117. <el-row>
  118. <el-col :span="4"> 学员姓名: </el-col>
  119. <el-col :span="20"> {{ showMessage.user.username }} </el-col>
  120. </el-row>
  121. <el-row>
  122. <el-col :span="4">乐团名称: </el-col>
  123. <el-col :span="20"> {{ showMessage.musicGroup.name }}</el-col>
  124. </el-row>
  125. <el-row>
  126. <el-col :span="4">用户备注: </el-col>
  127. <el-col :span="20"> {{ showMessage.userComment }}</el-col>
  128. </el-row>
  129. <!-- <el-row>
  130. <el-col :span="24">
  131. <el-input :disabled="showMessage.status != 'PROCESSING'"
  132. type="textarea"
  133. :rows="8"
  134. placeholder="请输入内容"
  135. v-model.trim="remark"> </el-input>
  136. </el-col>
  137. </el-row> -->
  138. <el-form :model="quitForm"
  139. status-icon
  140. ref="quitForm"
  141. :rules="quitRules">
  142. <el-form-item label="退还课程费用" v-if="showMessage.status == 'PROCESSING'"
  143. prop="isRefundCourseFee">
  144. <el-radio v-model.trim="quitForm.isRefundCourseFee"
  145. :label="true">是</el-radio>
  146. <el-radio v-model.trim="quitForm.isRefundCourseFee"
  147. :label="false">否</el-radio>
  148. </el-form-item>
  149. <el-form-item label="退还乐器费用" v-if="showMessage.status == 'PROCESSING'"
  150. prop="isRefundInstrumentFee">
  151. <el-radio v-model.trim="quitForm.isRefundInstrumentFee"
  152. :label="true">是</el-radio>
  153. <el-radio v-model.trim="quitForm.isRefundInstrumentFee"
  154. :label="false">否</el-radio>
  155. </el-form-item>
  156. <el-form-item label="退还教辅费用" v-if="showMessage.status == 'PROCESSING'"
  157. prop="isRefundTeachingAssistantsFee">
  158. <el-radio v-model.trim="quitForm.isRefundTeachingAssistantsFee"
  159. :label="true">是</el-radio>
  160. <el-radio v-model.trim="quitForm.isRefundTeachingAssistantsFee"
  161. :label="false">否</el-radio>
  162. </el-form-item>
  163. <el-form-item label="退团原因"
  164. prop="reason">
  165. <el-input type="textarea" :disabled="showMessage.status != 'PROCESSING'"
  166. v-model.trim="quitForm.reason"></el-input>
  167. </el-form-item>
  168. </el-form>
  169. <el-row v-permission="'musicGroupQuit/quitMusicGroup'">
  170. <el-col :span="24"
  171. v-if="showMessage.status == 'PROCESSING'">
  172. <el-button type="primary"
  173. @click="onSubmitGroup(showMessage, 'APPROVED')">确认</el-button>
  174. <el-button type="danger"
  175. @click="onSubmitGroup(showMessage, 'DENIED')">拒绝</el-button>
  176. </el-col>
  177. </el-row>
  178. <!-- <div class="infoFoot" v-if="showMessage.auditStatus == 'ING'">
  179. <div class="noBtn" @click="onSubmit(showMessage, 'REJECT')">拒绝</div>
  180. <div class="yesBtn" @click="onSubmit(showMessage, 'PASS')">同意</div>
  181. </div> -->
  182. </div>
  183. </div>
  184. </div>
  185. </template>
  186. <script>
  187. import { queryCountOfUnread, sysMessageList, setRead,
  188. queryApplyRefundDetail, applyRefundAudit, musicGroupQuit, quitMusicGroup} from '@/api/journal'
  189. import cleanDeep from 'clean-deep'
  190. export default {
  191. name: 'musicGroup',
  192. data () {
  193. return {
  194. img: {
  195. bookicon: require('@/assets/images/base/bookicon.png'),
  196. Hbookicon: require('@/assets/images/base/bookicon-h.png'),
  197. trashicon: require('@/assets/images/base/trashicon.png'),
  198. Htrashicon: require('@/assets/images/base/trashicon-h.png'),
  199. boxicon: require('@/assets/images/base/boxicon.png'),
  200. Hboxicon: require('@/assets/images/base/boxicon-h.png')
  201. },
  202. quitForm: {
  203. // 退团信息确认
  204. isRefundCourseFee: null,
  205. isRefundInstrumentFee: null,
  206. isRefundTeachingAssistantsFee: null,
  207. reason: ""
  208. },
  209. quitRules: {
  210. isRefundCourseFee: [
  211. { required: true, message: "请选择是否退还课程费用", trigger: 'change' }
  212. ],
  213. isRefundInstrumentFee: [
  214. { required: true, message: "选择是否退还乐器费用", trigger: 'change' }
  215. ],
  216. isRefundTeachingAssistantsFee: [
  217. { required: true, message: "选择是否退还教辅费用", trigger: 'change' }
  218. ],
  219. reason: [{ required: true, message: "请填写退团退费原因" }]
  220. },
  221. pageInfo: {
  222. isSinglePage: false, // 是否只有一页
  223. limit: 10,
  224. page: 1,
  225. readStatus: null,
  226. total: 0,
  227. },
  228. remark: null,
  229. actualAmount: null,
  230. noReadMessage: 0, // 未读消息
  231. dataList: [],
  232. isCheckMessage: null,
  233. showRight: false,
  234. showMessage: {}
  235. }
  236. },
  237. mounted () {
  238. this.__init()
  239. this.sysMessageList()
  240. },
  241. methods: {
  242. __init () {
  243. // 未读消息
  244. queryCountOfUnread().then(res => {
  245. if (res.code == 200) {
  246. if (res.data && res.data.MUSICGROUP) {
  247. this.noReadMessage = res.data.MUSICGROUP
  248. }
  249. }
  250. })
  251. },
  252. sysMessageList () { // 列表
  253. sysMessageList({
  254. group: 'MUSICGROUP',
  255. rows: this.pageInfo.limit,
  256. page: this.pageInfo.page,
  257. readStatus: this.pageInfo.readStatus
  258. }).then(res => {
  259. if (res.code == 200) {
  260. res.data.rows.forEach(item => {
  261. item.memo = JSON.parse(item.memo)
  262. })
  263. this.dataList = res.data.rows
  264. this.pageInfo.total = res.data.total
  265. }
  266. })
  267. },
  268. onLookMessage (type) { // 查看对应的数据
  269. if (type == "all") {
  270. this.pageInfo.readStatus = null
  271. } else {
  272. this.pageInfo.readStatus = type
  273. }
  274. this.pageInfo.page = 1
  275. this.showRight = false
  276. this.showMessage = {}
  277. this.isCheckMessage = null
  278. this.sysMessageList()
  279. },
  280. onChange (page) { // 分页
  281. this.pageInfo.page = page
  282. this.sysMessageList()
  283. },
  284. onClickRead (item) {
  285. this.isCheckMessage = item.id
  286. if (item.readStatus == 1) {
  287. this.getItemInfo(item.memo)
  288. } else {
  289. setRead({ id: item.id }).then(res => {
  290. let result = res.data
  291. if (res.code == 200) {
  292. item.readStatus = 1
  293. this.getItemInfo(item.memo)
  294. this.noReadMessage--
  295. }
  296. })
  297. }
  298. },
  299. getItemInfo (memo) {
  300. if (memo.type == 'VIPGROUP') {
  301. queryApplyRefundDetail({ id: memo.Id }).then(res => {
  302. if (res.code == 200) {
  303. this.showRight = true
  304. this.showMessage = res.data
  305. this.showMessage.type = memo.type
  306. this.remark = res.data.studentApplyRefunds.remark
  307. this.actualAmount = res.data.studentApplyRefunds.actualAmount
  308. //
  309. } else {
  310. this.$message.error(res.msg)
  311. }
  312. })
  313. } else if (memo.type == 'MUSICGROUP') {
  314. musicGroupQuit({ id: memo.Id }).then(res => {
  315. if (res.code == 200) {
  316. this.showRight = true
  317. this.showMessage = res.data
  318. this.showMessage.type = memo.type
  319. this.remark = res.data.reason
  320. if(this.$refs.quitForm){
  321. this.$refs.quitForm.resetFields()
  322. }
  323. this.quitForm.reason = res.data.reason
  324. } else {
  325. this.$message.error(res.msg)
  326. }
  327. })
  328. }
  329. },
  330. onSubmitGroup (params, status) {
  331. if(status == 'DENIED') {
  332. this.$refs['quitForm'].resetFields()
  333. this.$refs['quitForm'].validateField('reason', res => {
  334. if(!res) {
  335. this.onSubmitGroups(params, status)
  336. }
  337. })
  338. } else {
  339. this.$refs["quitForm"].validate(res => {
  340. if (res) {
  341. this.onSubmitGroups(params, status)
  342. }
  343. });
  344. }
  345. },
  346. onSubmitGroups(params, status) {
  347. this.$confirm("确定此操作吗?", "提示", {
  348. confirmButtonText: "确定",
  349. cancelButtonText: "取消",
  350. type: "warning"
  351. }).then(async () => {
  352. let query = this.quitForm
  353. query.id = params.id,
  354. query.status = status
  355. await quitMusicGroup(cleanDeep(query)).then(res => {
  356. this.$message.success('处理成功')
  357. this.getItemInfo({
  358. Id: params.id,
  359. type: params.type
  360. })
  361. })
  362. }).catch(() => { });
  363. },
  364. onSubmit (id, str, type) {
  365. if (!this.remark || this.remark == '') {
  366. this.$message.error('请输入退课理由')
  367. return
  368. }
  369. if (!this.actualAmount && typeof this.actualAmount == 'string') {
  370. this.$message.error('退课金额输入有误')
  371. return
  372. }
  373. applyRefundAudit({
  374. id: id,
  375. remark: this.remark,
  376. status: type,
  377. amount: this.actualAmount
  378. }).then(res => {
  379. if (res.code == 200) {
  380. this.$message.success('处理成功')
  381. this.getItemInfo({
  382. Id: id,
  383. type: str
  384. })
  385. } else {
  386. this.$message.errot(res.msg)
  387. }
  388. })
  389. }
  390. }
  391. }
  392. </script>
  393. <style lang="scss" scoped>
  394. .infoWrap {
  395. display: flex;
  396. flex-direction: row;
  397. justify-content: flex-start;
  398. height: calc(100vh - 266px);
  399. overflow: auto;
  400. .left {
  401. padding-top: 24px;
  402. display: flex;
  403. flex-direction: column;
  404. align-items: left;
  405. > div {
  406. height: 26px;
  407. line-height: 26px;
  408. margin-top: 26px;
  409. img {
  410. position: relative;
  411. top: 6px;
  412. }
  413. }
  414. .unread,
  415. .read,
  416. .recovery {
  417. cursor: pointer;
  418. }
  419. .unread {
  420. position: relative;
  421. img {
  422. width: 26px;
  423. height: 25px;
  424. }
  425. .count {
  426. position: absolute;
  427. width: 38px;
  428. height: 23px;
  429. background: rgba(20, 146, 138, 0.5);
  430. border-radius: 100px;
  431. font-size: 12px;
  432. line-height: 23px;
  433. text-align: center;
  434. color: #225551;
  435. right: -44px;
  436. top: 8px;
  437. }
  438. }
  439. .read {
  440. img {
  441. width: 20px;
  442. height: 26px;
  443. }
  444. }
  445. .recovery {
  446. img {
  447. width: 19px;
  448. height: 26px;
  449. }
  450. }
  451. }
  452. .middle {
  453. width: 25%;
  454. margin-left: 76px;
  455. padding-top: 50px;
  456. overflow: auto;
  457. .msgItem {
  458. padding: 16px 18px 23px 30px;
  459. border-bottom: 1px solid #ccc;
  460. .type {
  461. font-size: 14px;
  462. color: #777;
  463. font-weight: 400;
  464. padding-bottom: 4px;
  465. }
  466. .name {
  467. position: relative;
  468. color: #444;
  469. font-size: 16px;
  470. padding-bottom: 9px;
  471. clear: both;
  472. .time {
  473. font-weight: 400;
  474. color: #aaa;
  475. float: right;
  476. }
  477. .dot {
  478. width: 7px;
  479. height: 7px;
  480. background-color: #f97215;
  481. border-radius: 50%;
  482. position: absolute;
  483. left: -13px;
  484. top: 4px;
  485. }
  486. }
  487. .msg {
  488. color: #444;
  489. font-size: 14px;
  490. line-height: 24px;
  491. text-overflow: -o-ellipsis-lastline;
  492. overflow: hidden;
  493. text-overflow: ellipsis;
  494. display: -webkit-box;
  495. -webkit-line-clamp: 2;
  496. -webkit-box-orient: vertical;
  497. }
  498. }
  499. .msgItem.active {
  500. background-color: #f3f4f8;
  501. border-radius: 5px;
  502. .msg {
  503. color: #aaa;
  504. }
  505. }
  506. }
  507. .right {
  508. border: 1px solid #e4e8eb;
  509. margin-left: 25px;
  510. position: relative;
  511. overflow: auto;
  512. padding: 20px;
  513. min-width: 50%;
  514. }
  515. }
  516. .el-timeline-item__dot {
  517. width: 20px;
  518. height: 20px;
  519. }
  520. .el-timeline-item {
  521. min-height: 80px !important;
  522. }
  523. .el-timeline-item__tail {
  524. left: 9px !important;
  525. }
  526. /deep/.el-row {
  527. padding-bottom: 10px;
  528. display: flex;
  529. align-items: center;
  530. }
  531. /deep/.el-col-4 {
  532. font-size: 16px;
  533. }
  534. /deep/.el-col {
  535. .el-input {
  536. width: 200px;
  537. }
  538. }
  539. .title {
  540. font-size: 16px;
  541. .time {
  542. float: right;
  543. font-size: 12px;
  544. color: #ccc;
  545. }
  546. }
  547. </style>