MonthAppeal.vue 4.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179
  1. <template>
  2. <div class="wrap">
  3. <m-header v-if="headerStatus" :backUrl="backUrl">
  4. <template slot="right">
  5. <div @click="onAppealRecord">申诉记录</div>
  6. </template>
  7. </m-header>
  8. <van-dropdown-menu active-color="#01C1B5">
  9. <van-dropdown-item v-model="value1" :options="option1" @change="getList" />
  10. </van-dropdown-menu>
  11. <div v-if="dataShow">
  12. <van-cell-group>
  13. <!-- :class="item.isNow ? '' : 'disabled'" -->
  14. <van-cell v-for="(item, index) in dataList" :key="index" is-link @click="onSure(item)">
  15. <template #title>
  16. {{ item.monthStr }}
  17. <van-tag v-if="item.confirmStatus != 2" color="#FF8282">未确认</van-tag>
  18. <van-tag v-if="item.confirmStatus == 2" >已确认</van-tag>
  19. </template>
  20. <template #default>
  21. 总计:<span class="countMoney">{{ item.totalActualSalary }}元</span>
  22. </template>
  23. </van-cell>
  24. </van-cell-group>
  25. <div class="allCount">
  26. 合计:<span class="allMoney">{{ totalSalary }}<i>元</i></span>
  27. </div>
  28. </div>
  29. <m-empty class="empty" msg="暂无数据" v-else key="data" />
  30. </div>
  31. </template>
  32. <script>
  33. import MHeader from "@/components/MHeader"
  34. import MEmpty from "@/components/MEmpty"
  35. import { getSTD, browser } from '@/common/common'
  36. import { findTeacherYearSalarys } from '@/api/audition'
  37. export default {
  38. name: "teacherList",
  39. components: { MHeader, MEmpty },
  40. data() {
  41. return {
  42. headerStatus: true,
  43. value1: new Date().getFullYear(),
  44. option1: [
  45. { text: '2020年', value: 2020 },
  46. { text: '2021年', value: 2021 },
  47. { text: '2022年', value: 2022 }
  48. ],
  49. dataShow: true,
  50. dataList: [],
  51. totalSalary: 0,
  52. backUrl: {
  53. callBack: () => {
  54. if (browser().android) {
  55. // eslint-disable-next-line
  56. DAYA.postMessage(JSON.stringify({ api: 'back' }))
  57. } else if (browser().iPhone) {
  58. window.webkit.messageHandlers.DAYA.postMessage(JSON.stringify({ api: 'back' }))
  59. }
  60. }
  61. },
  62. };
  63. },
  64. mounted() {
  65. let params = this.$route.query;
  66. if (params.Authorization) {
  67. localStorage.setItem("Authorization", decodeURI(params.Authorization));
  68. localStorage.setItem("userInfo", decodeURI(params.Authorization));
  69. }
  70. document.title = "月度课酬列表";
  71. // if (browser().android || browser().iPhone) {
  72. // this.headerStatus = false;
  73. // }
  74. this.getList()
  75. },
  76. methods: {
  77. getList() {
  78. this.$toast.loading({
  79. duration: 0, // 持续展示 toast
  80. forbidClick: true,
  81. message: '加载中...',
  82. });
  83. findTeacherYearSalarys({ year: this.value1 }).then(res => {
  84. let result = res.data
  85. this.$toast.clear()
  86. if(result.code == 200) {
  87. this.totalSalary = result.data.totalSalary
  88. let t = new Date()
  89. t.setMonth(t.getMonth() - 1)
  90. let temp = t.getFullYear() + '-' + getSTD(t.getMonth() + 1)
  91. result.data.monthSalarys.forEach(item => {
  92. if(item.month == temp) {
  93. item.isNow = true
  94. } else {
  95. item.isNow = false
  96. }
  97. let tempDate = new Date(item.month + '-01')
  98. item.monthStr = (tempDate.getMonth() + 1) + '月'
  99. })
  100. this.dataList = result.data.monthSalarys.reverse()
  101. if(this.dataList.length <= 0) {
  102. this.dataShow = false
  103. } else {
  104. this.dataShow = true
  105. }
  106. } else {
  107. this.$toast(result.msg)
  108. }
  109. })
  110. },
  111. onSure(item) {
  112. // console.log(item)
  113. this.$router.push({
  114. path: '/remuneration',
  115. query: {
  116. month: item.month,
  117. isHide: 1
  118. }
  119. })
  120. },
  121. onAppealRecord() {
  122. this.$router.push({
  123. path: 'appealRecord'
  124. })
  125. }
  126. }
  127. };
  128. </script>
  129. <style lang="less" scoped>
  130. @import url("../../assets/commonLess/variable.less");
  131. .wrap {
  132. min-height: 100vh;
  133. overflow-y: auto;
  134. overflow-x: hidden;
  135. background-color: #f3f4f8;
  136. }
  137. /deep/.van-dropdown-menu__title, /deep/.van-cell {
  138. font-size: .16rem;
  139. line-height: .18rem;
  140. }
  141. /deep/.van-cell {
  142. padding-top: .14rem;
  143. padding-bottom: .14rem;
  144. }
  145. .countMoney {
  146. color: #FF433F;
  147. }
  148. .disabled {
  149. opacity: .5;
  150. }
  151. /deep/.van-cell-group {
  152. margin-bottom: .55rem;
  153. }
  154. .allCount {
  155. padding: 0 .16rem;
  156. line-height: .55rem;
  157. background: #fff;
  158. font-size: .17rem;
  159. color: #1A1A1A;
  160. display: flex;
  161. justify-content: space-between;
  162. position: fixed;
  163. width: calc(100% - .32rem);
  164. bottom: 0;
  165. left: 0;
  166. .allMoney {
  167. font-size: .22rem;
  168. color: #F85043;
  169. i {
  170. font-style: normal;
  171. font-size: .16rem;
  172. }
  173. }
  174. }
  175. </style>