vipApply.vue 13 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473
  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">VIP申请审核<span class='time'>{{ item.createOn }}</span>
  18. <div class="dot" v-if="item.readStatus == 0"></div>
  19. </h4>
  20. <p class='msg'>{{ item.content }}</p>
  21. </div>
  22. <el-pagination style="text-align: right"
  23. small v-if="dataList.length > 0"
  24. @current-change="onChange"
  25. :hide-on-single-page="pageInfo.isSinglePage"
  26. layout="prev, pager, next"
  27. :total="pageInfo.total">
  28. </el-pagination>
  29. </div>
  30. <div class="right" v-if="showRight">
  31. <div class="rightWrap">
  32. <img src="@/assets/images/base/placehorder-icon.png"
  33. class="header"
  34. alt="">
  35. <div class="info">
  36. <h2>{{ showMessage.userName }}
  37. <el-tag v-if="showMessage.auditStatus == 'PASS'" type="success" effect="plain">已处理</el-tag>
  38. <el-tag v-if="showMessage.auditStatus == 'REJECT'" type="danger" effect="plain">已拒绝</el-tag>
  39. </h2>
  40. <!-- <span class="subMsg">发至 <span class='san'></span> <span style="margin-left:30px">我</span></p> -->
  41. <div class="textWrap">
  42. <p>审批事项: VIP申请</p>
  43. <p>开始时间: {{ showMessage.createTime }}</p>
  44. </div>
  45. <div class="leaverecord">
  46. <el-form :inline="true" label-width="100px">
  47. <el-form-item label="老师姓名">
  48. <el-input disabled :value="showMessage.userName" ></el-input>
  49. </el-form-item>
  50. <el-form-item label="线上课数">
  51. <el-input disabled :value="showMessage.onlineClassesNum" ></el-input>
  52. </el-form-item>
  53. <el-form-item label="线下课数">
  54. <el-input disabled :value="showMessage.offlineClassesNum" ></el-input>
  55. </el-form-item>
  56. <el-form-item label="科目名">
  57. <el-input disabled :value="showMessage.subjectName" ></el-input>
  58. </el-form-item>
  59. <el-form-item label="线上课单价">
  60. <el-input disabled :value="showMessage.onlineClassesUnitPrice"></el-input>
  61. </el-form-item>
  62. <el-form-item label="线下课单价">
  63. <el-input disabled :value="showMessage.offlineClassesUnitPrice"></el-input>
  64. </el-form-item>
  65. <el-form-item label="活动名称">
  66. <el-input disabled :value="showMessage.vipGroupActivityName"></el-input>
  67. </el-form-item>
  68. <el-form-item label="线上课课酬">
  69. <el-input disabled :value="showMessage.onlineTeacherSalary"></el-input>
  70. </el-form-item>
  71. <el-form-item label="线下课课酬">
  72. <el-input disabled :value="showMessage.offlineTeacherSalary" ></el-input>
  73. </el-form-item>
  74. <el-form-item label="商品价格">
  75. <el-input disabled :value="showMessage.totalPrice"></el-input>
  76. </el-form-item>
  77. <el-form-item label="原因">
  78. <el-input :disabled="showMessage.auditStatus != 'ING'" type="textarea" v-model="reason"></el-input>
  79. </el-form-item>
  80. </el-form>
  81. </div>
  82. </div>
  83. </div>
  84. <div v-permission="'vipGroupManage/vipApplyAudit'" class="infoFoot" v-if="showMessage.auditStatus == 'ING'">
  85. <div class="noBtn" @click="onSubmit(showMessage, 'REJECT')">拒绝</div>
  86. <div class="yesBtn" @click="onSubmit(showMessage, 'PASS')">同意</div>
  87. </div>
  88. </div>
  89. </div>
  90. </template>
  91. <script>
  92. import { getVipGroupDetail } from '@/api/vipSeting'
  93. import { queryCountOfUnread, sysMessageList, setRead, vipApplyAudit } from '@/api/journal'
  94. export default {
  95. data () {
  96. return {
  97. img: {
  98. bookicon: require('@/assets/images/base/bookicon.png'),
  99. Hbookicon: require('@/assets/images/base/bookicon-h.png'),
  100. trashicon: require('@/assets/images/base/trashicon.png'),
  101. Htrashicon: require('@/assets/images/base/trashicon-h.png'),
  102. boxicon: require('@/assets/images/base/boxicon.png'),
  103. Hboxicon: require('@/assets/images/base/boxicon-h.png')
  104. },
  105. pageInfo: {
  106. isSinglePage: false, // 是否只有一页
  107. limit: 10,
  108. page: 1,
  109. readStatus: null,
  110. total: 0,
  111. },
  112. noReadMessage: 0, // 未读消息
  113. dataList: [],
  114. isCheckMessage: null,
  115. showRight: false,
  116. reason: null,
  117. showMessage: {}
  118. }
  119. },
  120. mounted() {
  121. this.__init()
  122. this.sysMessageList()
  123. },
  124. methods: {
  125. __init() {
  126. // 未读消息
  127. queryCountOfUnread().then(res => {
  128. if(res.code == 200) {
  129. if(res.data && res.data.VIPAPPLY) {
  130. this.noReadMessage = res.data.VIPAPPLY
  131. }
  132. }
  133. })
  134. },
  135. onSubmit(showMessage, type) {
  136. if(!this.reason || this.reason == '') {
  137. this.$message.error('请输入原因')
  138. return
  139. }
  140. let params = {
  141. vipGroupId: showMessage.id,
  142. reason: this.reason,
  143. auditStatus: type,
  144. }
  145. vipApplyAudit(params).then(res => {
  146. if(res.code == 200) {
  147. this.$message.success('处理成功')
  148. this.getVipGroupItem(JSON.stringify({ vipGroupId: showMessage.id }))
  149. } else {
  150. this.$message.error(res.msg)
  151. }
  152. })
  153. },
  154. sysMessageList() { // 列表
  155. sysMessageList({
  156. group: 'VIPAPPLY',
  157. rows: this.pageInfo.limit,
  158. page: this.pageInfo.page,
  159. readStatus: this.pageInfo.readStatus
  160. }).then(res => {
  161. if(res.code == 200) {
  162. this.dataList = res.data.rows
  163. this.pageInfo.total = res.data.total
  164. }
  165. })
  166. },
  167. onLookMessage(type) { // 查看对应的数据
  168. if(type == "all") {
  169. this.pageInfo.readStatus = null
  170. } else {
  171. this.pageInfo.readStatus = type
  172. }
  173. this.pageInfo.page = 1
  174. this.showRight = false
  175. this.showMessage = {}
  176. this.isCheckMessage = null
  177. this.sysMessageList()
  178. },
  179. onChange(page) { // 分页
  180. this.pageInfo.page = page
  181. this.sysMessageList()
  182. },
  183. onClickRead(item) {
  184. this.isCheckMessage = item.id
  185. if(item.readStatus == 1) {
  186. this.getVipGroupItem(item.memo)
  187. } else {
  188. setRead({ id: item.id }).then(res => {
  189. let result = res.data
  190. if(res.code == 200) {
  191. item.readStatus = 1
  192. this.getVipGroupItem(item.memo)
  193. this.noReadMessage--
  194. }
  195. })
  196. }
  197. },
  198. getVipGroupItem(memo) {
  199. memo = JSON.parse(memo)
  200. getVipGroupDetail({ vipGroupId: memo.vipGroupId }).then(res => {
  201. if(res.code == 200) {
  202. this.showRight = true
  203. this.showMessage = res.data
  204. this.reason = res.data.stopReason
  205. } else {
  206. this.$message.error(res.msg)
  207. }
  208. })
  209. }
  210. },
  211. filters: {
  212. getFormatTime(tempA, tempB) {
  213. tempA = new Date(tempA.replace(/-/g, "/")),
  214. tempB = new Date(tempB.replace(/-/g, "/"))
  215. let hours = Number(tempA.getHours()) >= 10 ? tempA.getHours() : '0' + tempA.getHours()
  216. let hours2 = Number(tempB.getHours()) >= 10 ? tempB.getHours() : '0' + tempB.getHours()
  217. let min = Number(tempA.getMinutes()) >= 10 ? tempA.getMinutes() : '0' + tempA.getMinutes()
  218. let min2 = Number(tempB.getMinutes()) >= 10 ? tempB.getMinutes() : '0' + tempB.getMinutes()
  219. return hours + ':' + min + '-' + hours2 + ':' + min2
  220. }
  221. }
  222. }
  223. </script>
  224. <style lang="scss" scoped>
  225. .infoWrap {
  226. display: flex;
  227. flex-direction: row;
  228. justify-content: flex-start;
  229. height: calc(100vh - 266px);
  230. overflow: auto;
  231. .left {
  232. padding-top: 24px;
  233. display: flex;
  234. flex-direction: column;
  235. align-items: left;
  236. > div {
  237. height: 26px;
  238. line-height: 26px;
  239. margin-top: 26px;
  240. img {
  241. position: relative;
  242. top: 6px;
  243. }
  244. }
  245. .unread, .read, .recovery {
  246. cursor: pointer;
  247. }
  248. .unread {
  249. position: relative;
  250. img {
  251. width: 26px;
  252. height: 25px;
  253. }
  254. .count {
  255. position: absolute;
  256. width: 38px;
  257. height: 23px;
  258. background: rgba(20, 146, 138, 0.5);
  259. border-radius: 100px;
  260. font-size: 12px;
  261. line-height: 23px;
  262. text-align: center;
  263. color: #225551;
  264. right: -44px;
  265. top: 8px;
  266. }
  267. }
  268. .read {
  269. img {
  270. width: 20px;
  271. height: 26px;
  272. }
  273. }
  274. .recovery {
  275. img {
  276. width: 19px;
  277. height: 26px;
  278. }
  279. }
  280. }
  281. .middle {
  282. width: 25%;
  283. margin-left: 76px;
  284. padding-top: 50px;
  285. overflow: auto;
  286. .msgItem {
  287. padding: 16px 18px 23px 30px;
  288. border-bottom: 1px solid #ccc;
  289. .type {
  290. font-size: 14px;
  291. color: #777;
  292. font-weight: 400;
  293. padding-bottom: 4px;
  294. }
  295. .name {
  296. position: relative;
  297. color: #444;
  298. font-size: 16px;
  299. padding-bottom: 9px;
  300. clear: both;
  301. .time {
  302. font-weight: 400;
  303. color: #aaa;
  304. float: right;
  305. }
  306. .dot {
  307. width: 7px;
  308. height: 7px;
  309. background-color: #f97215;
  310. border-radius: 50%;
  311. position: absolute;
  312. left: -13px;
  313. top: 4px;
  314. }
  315. }
  316. .msg {
  317. color: #444;
  318. font-size: 14px;
  319. line-height: 24px;
  320. text-overflow: -o-ellipsis-lastline;
  321. overflow: hidden;
  322. text-overflow: ellipsis;
  323. display: -webkit-box;
  324. -webkit-line-clamp: 2;
  325. -webkit-box-orient: vertical;
  326. }
  327. }
  328. .msgItem.active {
  329. background-color: #f3f4f8;
  330. border-radius: 5px;
  331. .msg {
  332. color: #aaa;
  333. }
  334. }
  335. }
  336. .right {
  337. display: flex;
  338. flex-direction: column;
  339. justify-content: space-between;
  340. border: 1px solid #e4e8eb;
  341. margin-left: 25px;
  342. position: relative;
  343. overflow: auto;
  344. width: 50%;
  345. .rightWrap {
  346. // overflow: auto;
  347. padding: 18px 24px;
  348. display: flex;
  349. flex-direction: row;
  350. justify-content: flex-start;
  351. box-sizing: border-box;
  352. .header {
  353. width: 30px;
  354. height: 30px;
  355. position: relative;
  356. top: 7px;
  357. border-radius: 50%;
  358. margin-right: 12px;
  359. }
  360. .info {
  361. position: relative;
  362. width: 100%;
  363. h2 {
  364. color: #212223;
  365. font-size: 16px;
  366. margin-bottom: 0px;
  367. .phone {
  368. font-size: 12px;
  369. color: #444;
  370. }
  371. }
  372. .subMsg {
  373. position: relative;
  374. font-size: 12px;
  375. color: #444;
  376. margin-bottom: 12px;
  377. .san {
  378. // margin-left: 110px;
  379. float: left;
  380. position: absolute;
  381. top: 0px;
  382. width: 0;
  383. height: 0;
  384. border-width: 5px;
  385. border-style: solid;
  386. border-color: transparent #909191 transparent transparent;
  387. transform: rotate(180deg); /*顺时针旋转90°*/
  388. margin: 0 8px;
  389. }
  390. }
  391. .textWrap {
  392. width: 316px;
  393. line-height: 21px;
  394. font-size: 14px;
  395. color: #212223;
  396. margin: 12px 0 34px;
  397. }
  398. .dot {
  399. width: 20px;
  400. height: 20px;
  401. }
  402. .timeMsg {
  403. position: relative;
  404. top: 5px;
  405. margin-left: 20px;
  406. .name {
  407. font-size: #444;
  408. font-size: 16px;
  409. margin-bottom: 3px;
  410. font-weight: 600;
  411. }
  412. .status {
  413. font-size: 14px;
  414. color: #62a070;
  415. }
  416. .status.waring {
  417. color: #f97215;
  418. }
  419. .status.end {
  420. color: #aaaaaa;
  421. }
  422. }
  423. }
  424. }
  425. .infoFoot {
  426. min-height: 60px;
  427. height: 60px;
  428. line-height: 60px;
  429. border-top: 1px solid #e4e8eb;
  430. width: 100%;
  431. display: flex;
  432. flex-direction: row;
  433. justify-content: flex-start;
  434. align-items: center;
  435. .noBtn {
  436. cursor: pointer;
  437. width: 100px;
  438. height: 32px;
  439. line-height: 32px;
  440. color: #444;
  441. border-radius: 3px;
  442. border: 1px solid rgba(228, 232, 235, 1);
  443. text-align: center;
  444. margin-left: 70px;
  445. }
  446. .yesBtn {
  447. cursor: pointer;
  448. margin-left: 15px;
  449. text-align: center;
  450. width: 100px;
  451. height: 32px;
  452. line-height: 32px;
  453. background: rgba(249, 114, 21, 1);
  454. border-radius: 3px;
  455. color: #fff;
  456. }
  457. // width: 570px;
  458. }
  459. }
  460. }
  461. </style>