order.vue 16 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452
  1. <template>
  2. <div class="order">
  3. <!-- <header>
  4. <van-icon name="arrow-left" />
  5. 缴费详情
  6. <van-dropdown-menu>
  7. <van-dropdown-item @change="onChange" v-model="voicyPart" :options="voicyPartList" />
  8. </van-dropdown-menu>
  9. </header> -->
  10. <van-nav-bar
  11. title="缴费详情"
  12. right-text="按钮"
  13. fixed
  14. :left-arrow="plat == 'manager' ? true : false"
  15. z-index="999"
  16. @click-left="onClickLeft"
  17. >
  18. <template #right>
  19. <van-dropdown-menu z-index="999">
  20. <van-dropdown-item @change="onChange" v-model="voicyPart" :options="voicyPartList" />
  21. </van-dropdown-menu>
  22. </template>
  23. </van-nav-bar>
  24. <h2 style="margin-top: 46px;">{{musicGroupName}}</h2>
  25. <van-tabs color="#01C1B5">
  26. <van-tab title="缴费信息">
  27. <div class="table">
  28. <div class="title">
  29. <span></span>
  30. <span>姓名</span>
  31. <span>声部</span>
  32. <span>支付金额</span>
  33. <span>到账时间</span>
  34. </div>
  35. <div class="content">
  36. <div v-for="(data, index) in dataList" :key="data.id">
  37. <!-- <div> -->
  38. <span> {{ ++index }} </span>
  39. <span> {{ data.userName }} </span>
  40. <span> {{ data.subjectName }} </span>
  41. <span> {{ data.paymentAmount }} </span>
  42. <span> {{ data.payTime }} </span>
  43. </div>
  44. <p style="padding: 8px 8px 20px">缴费总额:{{ (amountCount).toFixed(2) }}元</p>
  45. </div>
  46. </div>
  47. </van-tab>
  48. <van-tab title="报名信息">
  49. <div class="table">
  50. <div class="title">
  51. <span></span>
  52. <span>姓名</span>
  53. <span>班级</span>
  54. <span>声部</span>
  55. <span>备注</span>
  56. <span>调剂</span>
  57. </div>
  58. <div class="content">
  59. <div v-for="(data, index) in studentList" :key="data.id">
  60. <!-- <div> -->
  61. <span> {{ ++index }} </span>
  62. <span> {{ data.userName }} </span>
  63. <span> {{ data.currentClass }} </span>
  64. <span> {{ data.subjectName }} </span>
  65. <span> {{ data.remark }} </span>
  66. <span><van-button
  67. :disabled="data.paymentStatus == 2 ? true : false"
  68. round
  69. @click = "adjust(data)"
  70. type = "danger"
  71. size = "small">调剂</van-button> </span>
  72. </div>
  73. </div>
  74. </div>
  75. <van-action-sheet
  76. v-model="adjustStatus"
  77. :actions="couresList"
  78. cancel-text="取消"
  79. @cancel="adjustStatus = false"
  80. @select="adjustSelect" />
  81. </van-tab>
  82. <van-tab title="数据统计">
  83. <van-cell class="countInfo" title="报名总人数" :value="config.regNum + '人'"></van-cell>
  84. <van-cell class="countInfo" title="缴费总人数" :value="config.payNum + '人'"></van-cell>
  85. <van-cell class="countInfo" title="家长会当日缴费人数" :value="config.firstDayPayNum + '人'"></van-cell>
  86. <van-cell class="countInfo" :value="config.payScale + '%'">
  87. <template #title>
  88. <div style="display: flex;align-items: center;">家长会当日缴费人数占比
  89. <van-icon name="question-o" @click="onTip" style="padding-left: .05rem;" />
  90. </div>
  91. </template>
  92. </van-cell>
  93. <div style="width: 100%;overflow-x: auto;">
  94. <div class="table" style="width: 145%;">
  95. <van-row style="border: 1px solid #eaeaea">
  96. <van-col span="1">&nbsp;</van-col>
  97. <van-col span="3">学员编号</van-col>
  98. <van-col span="2">姓名</van-col>
  99. <van-col span="2">声部</van-col>
  100. <van-col span="4">
  101. <div style="display: flex;align-items: center;justify-content: center;" @click="onChangeSort('1')">
  102. 预报名时间
  103. <div>
  104. <i class="box box-up" :class="[orderByPerRegister == 'ASC' ? 'active' : null]" style="margin-bottom: .02rem;"></i>
  105. <i class="box box-down" :class="[orderByPerRegister == 'DESC' ? 'active' : null]"></i>
  106. </div>
  107. </div>
  108. </van-col>
  109. <van-col span="4">预报名时间差</van-col>
  110. <van-col span="4">
  111. <div style="display: flex;align-items: center;justify-content: center;" @click="onChangeSort('2')">
  112. 缴费时间
  113. <div>
  114. <i class="box box-up" :class="[orderByPayTime == 'ASC' ? 'active' : null]" style="margin-bottom: .02rem;"></i>
  115. <i class="box box-down" :class="[orderByPayTime == 'DESC' ? 'active' : null]"></i>
  116. </div>
  117. </div>
  118. </van-col>
  119. <van-col span="4">缴费时间差</van-col>
  120. </van-row>
  121. <van-row v-for="(data, index) in countList" :key="data.id" style="border: 1px solid #ebedf0">
  122. <van-col span="1">{{ ++index }}</van-col>
  123. <van-col span="3">{{ data.userId }}</van-col>
  124. <van-col span="2">{{ data.studentName }}</van-col>
  125. <van-col span="2">{{ data.actualSubjectName }}</van-col>
  126. <van-col span="4">{{ data.perRegisterTime }}</van-col>
  127. <van-col span="4">{{ data.perRegIntervalStr }}</van-col>
  128. <van-col span="4">{{ data.payTime }}</van-col>
  129. <van-col span="4">{{ data.payIntervalStr }}</van-col>
  130. </van-row>
  131. </div>
  132. </div>
  133. </van-tab>
  134. </van-tabs>
  135. </div>
  136. </template>
  137. <script>
  138. import { queryStudentApply, querySubByMusicGroupId, getRegisterOrPreList, updateSubject } from '@/api/teacher'
  139. import setLoading from '@/utils/loading'
  140. import cleanDeep from 'clean-deep'
  141. export default {
  142. name: 'order',
  143. data() {
  144. let query = this.$route.query
  145. return {
  146. musicGroupId: query.musicGroupId,
  147. musicGroupName: query.musicGroupName,
  148. plat: query.plat,
  149. dataList: {}, // 订单列表
  150. amountCount: 0, // 总额
  151. studentList: {}, // 学生列表
  152. couresList: [],
  153. countList: [],
  154. voicyPart: 0,
  155. voicyPartList: [{
  156. text: '全部声部',
  157. value: 0
  158. }],
  159. adjustStatus: false, //
  160. changeStudent: null, // 修改的学生对象
  161. orderByPerRegister: null, // 预报名时间排序状态
  162. orderByPayTime: null, // 缴费时间排序状态
  163. config: {
  164. regNum: 0,
  165. firstDayPayNum: 0,
  166. payScale: 0,
  167. payNum: 0
  168. }
  169. }
  170. },
  171. async mounted() {
  172. window.localStorage.removeItem('userInfo') // 删除用户信息
  173. window.localStorage.removeItem('Authorization') // 删除用户信息
  174. setLoading(true)
  175. await querySubByMusicGroupId({ musicGroupId: this.musicGroupId }).then(res => {
  176. let result = res.data
  177. if(result.code == 200) {
  178. result.data.forEach(r => {
  179. this.voicyPartList.push({
  180. text: r.name,
  181. value: r.id
  182. })
  183. this.couresList.push({
  184. name: r.name,
  185. id: r.id
  186. })
  187. })
  188. }
  189. })
  190. setLoading(false)
  191. // 获取订单信息
  192. this.getOrderList()
  193. this.getOrderStudentList()
  194. this.getRegisterOrPreList()
  195. },
  196. methods: {
  197. onClickLeft() {
  198. window.history.go(-1)
  199. },
  200. adjust(item) {
  201. // 开始调剂
  202. if(item.paymentStatus != 2) {
  203. this.adjustStatus = true
  204. this.changeStudent = item
  205. }
  206. },
  207. adjustSelect(item) { // 修改专业
  208. updateSubject({
  209. musicGroupId: this.musicGroupId,
  210. subId: item.id,
  211. userId: this.changeStudent.userId
  212. }).then(res => {
  213. let result = res.data
  214. if(result.code == 200) {
  215. this.$toast('修改成功')
  216. this.adjustStatus = false
  217. this.getOrderStudentList()
  218. } else {
  219. this.$toast(result.msg)
  220. }
  221. })
  222. },
  223. getOrderList() {
  224. // 获取订单信息
  225. queryStudentApply({
  226. musicGroupId: this.musicGroupId,
  227. rows: 9999,
  228. subjectId: this.voicyPart ? this.voicyPart : '',
  229. paymentStatus: 2,
  230. page: 1
  231. }).then(res => {
  232. let result = res.data
  233. this.amountCount = 0
  234. if(result.code == 200) {
  235. this.dataList = result.data.rows
  236. result.data.rows.forEach(item => {
  237. this.amountCount += item.paymentAmount
  238. })
  239. }
  240. })
  241. },
  242. getOrderStudentList() {
  243. // 获取订单信息
  244. queryStudentApply({
  245. musicGroupId: this.musicGroupId,
  246. rows: 9999,
  247. subjectId: this.voicyPart ? this.voicyPart : '',
  248. page: 1
  249. }).then(res => {
  250. let result = res.data
  251. if(result.code == 200) {
  252. this.studentList = result.data.rows
  253. }
  254. })
  255. },
  256. async getRegisterOrPreList() {
  257. setLoading(true)
  258. // 获取订单信息
  259. await getRegisterOrPreList(cleanDeep({
  260. musicGroupId: this.musicGroupId,
  261. rows: 9999,
  262. subjectId: this.voicyPart ? this.voicyPart : '',
  263. orderByPerRegister: this.orderByPerRegister,
  264. orderByPayTime: this.orderByPayTime,
  265. page: 1
  266. })).then(res => {
  267. let result = res.data
  268. if(result.code == 200) {
  269. let tempDate = result.data
  270. let scale = 0
  271. if(tempDate.payNum > 0) {
  272. scale = ((tempDate.firstDayPayNum / tempDate.payNum) * 100)
  273. }
  274. this.config = {
  275. regNum: tempDate.regNum,
  276. firstDayPayNum: tempDate.firstDayPayNum,
  277. payScale: (scale).toFixed(2),
  278. payNum: tempDate.payNum
  279. }
  280. this.countList = tempDate.rows
  281. }
  282. })
  283. setLoading(false)
  284. },
  285. onChange() {
  286. // 切换声部时
  287. // let subId = value ? value : ''
  288. this.getOrderList(this.voicyPart)
  289. this.getOrderStudentList(this.voicyPart)
  290. this.getRegisterOrPreList(this.voicyPart)
  291. },
  292. onTip() {
  293. this.$dialog.alert({
  294. message: '家长会当日缴费人数 / 缴费总人数',
  295. }).then(() => {
  296. // on close
  297. });
  298. },
  299. async onChangeSort(sort) {
  300. if(sort == 1) {
  301. this.orderByPayTime = null
  302. if(this.orderByPerRegister == 'ASC') {
  303. this.orderByPerRegister = 'DESC'
  304. } else if(this.orderByPerRegister == 'DESC') {
  305. this.orderByPerRegister = null
  306. } else {
  307. this.orderByPerRegister = 'ASC'
  308. }
  309. } else if(sort == 2) {
  310. this.orderByPerRegister = null
  311. if(this.orderByPayTime == 'ASC') {
  312. this.orderByPayTime = 'DESC'
  313. } else if(this.orderByPayTime == 'DESC') {
  314. this.orderByPayTime = null
  315. } else {
  316. this.orderByPayTime = 'ASC'
  317. }
  318. }
  319. await this.getRegisterOrPreList()
  320. }
  321. }
  322. }
  323. </script>
  324. <style lang="less" scoped>
  325. .order {
  326. background: #fff;
  327. min-height: 100vh;
  328. }
  329. header {
  330. height: .40rem;
  331. line-height: .40rem;
  332. color: #fff;
  333. font-size: .17rem;
  334. background: #14928a;
  335. box-shadow: 0px 1px 8px 0px rgba(0,0,0,0.07);
  336. text-align: center;
  337. }
  338. h2 {
  339. font-size: .16rem;
  340. color: #000;
  341. padding: .1rem 0;
  342. text-align: center;
  343. background: #fff;
  344. }
  345. .table {
  346. .title {
  347. display: flex;
  348. align-items: center;
  349. text-align: center;
  350. border-bottom: 1px solid #eaeaea;
  351. }
  352. span {
  353. flex: 1;
  354. padding: .08rem 0;
  355. font-size: .14rem;
  356. &:first-child {
  357. width: .3rem;
  358. flex: inherit;
  359. }
  360. }
  361. .content > div{
  362. width: 100%;
  363. display: flex;
  364. align-items: center;
  365. text-align: center;
  366. &:nth-child(2n+2) {
  367. background: #eaeaea;
  368. }
  369. }
  370. }
  371. /deep/.van-dropdown-menu {
  372. height: 46px;
  373. // position: absolute;
  374. // right: .15rem;
  375. background: #14928a;
  376. // top: 0;
  377. .van-dropdown-menu__bar {
  378. height: .4rem;
  379. box-shadow: none;
  380. }
  381. .van-dropdown-menu__title {
  382. color: #fff;
  383. }
  384. }
  385. /deep/.van-nav-bar {
  386. background: #14928a;
  387. .van-icon {
  388. font-size: .18rem;
  389. color: #fff;
  390. }
  391. .van-nav-bar__title {
  392. color: #fff;
  393. }
  394. }
  395. /deep/.van-col {
  396. font-size: 0.14rem;
  397. text-align: center;
  398. padding: .08rem 0;
  399. }
  400. /deep/.van-row {
  401. &:nth-child(2n+3) {
  402. background: #eaeaea;
  403. }
  404. }
  405. .box {
  406. display: flex;
  407. flex-direction: row;
  408. align-items: center;
  409. margin-left: .02rem;
  410. }
  411. .box-up {
  412. width: 0;
  413. height: 0;
  414. border-left: 4px solid transparent;
  415. border-right: 4px solid transparent;
  416. border-bottom: 6px solid #ccc;
  417. &.active {
  418. border-bottom-color: #14928a;
  419. }
  420. }
  421. .box-down {
  422. width: 0;
  423. height: 0;
  424. border-left: 4px solid transparent;
  425. border-right: 4px solid transparent;
  426. border-top: 6px solid #ccc;
  427. &.active {
  428. border-top-color: #14928a;
  429. }
  430. }
  431. .countInfo {
  432. /deep/.van-cell__title {
  433. flex: 1 auto;
  434. }
  435. /deep/.van-cell__value {
  436. color: #14928a;
  437. }
  438. }
  439. </style>