report.vue 4.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172
  1. <template>
  2. <view class="default_page adffc" :style="{'height':h+'px', 'padding-top':mt+'px'}">
  3. <cus-header title='我的报告' bgColor="transparent"></cus-header>
  4. <image class="top_bg" :src="imgBase+'report_bg.png'" mode="widthFix"></image>
  5. <view class="tab adfac">
  6. <view class="tab-pre" :class="{'active':tindex===0}" @click="changeTab(0)">我收到的</view>
  7. <view class="tab-pre" :class="{'active':tindex===1}" @click="changeTab(1)">我生成的</view>
  8. <view class="tab-pre" :class="{'active':tindex===2}" @click="changeTab(2)">我发送的</view>
  9. </view>
  10. <view class="query adfacjb">
  11. <u-icon name="search" size="38rpx" color="#B3BFC8"></u-icon>
  12. <view class="query-inp">
  13. <u-input v-model="queryParams.teamName" border="none" fontSize="26rpx" color="#002846" clearable
  14. placeholder="请输入团队名称查询" @confirm="getList"></u-input>
  15. </view>
  16. </view>
  17. <view class="box" v-if="list.length">
  18. <template v-if="tindex===0">
  19. <receive-list :list="list" @scrolltolower="scrolltolower"></receive-list>
  20. </template>
  21. <template v-else-if="tindex===1">
  22. <generate-list :list="list" @scrolltolower="scrolltolower" @reSendReport="reSendReport"></generate-list>
  23. </template>
  24. <template v-else-if="tindex===2">
  25. <send-list :list="list" @scrolltolower="scrolltolower"></send-list>
  26. </template>
  27. </view>
  28. <view style="flex: 1;" v-else>
  29. <page-empty text='暂无报告'></page-empty>
  30. </view>
  31. </view>
  32. </template>
  33. <script>
  34. import ReceiveList from './components/report/receiveList.vue'
  35. import GenerateList from './components/report/generateList.vue'
  36. import SendList from './components/report/sendList.vue'
  37. import PageEmpty from '@/components/pageEmpty/index.vue'
  38. export default {
  39. components:{
  40. ReceiveList,
  41. GenerateList,
  42. SendList,
  43. PageEmpty
  44. },
  45. data(){
  46. return {
  47. tindex:0,
  48. queryParams:{
  49. page:1,
  50. limit:10,
  51. teamName:''
  52. },
  53. list:[],
  54. isOver:false
  55. }
  56. },
  57. onLoad() {
  58. this.getList();
  59. },
  60. methods:{
  61. changeTab(index){
  62. this.tindex = index;
  63. this.initList();
  64. this.getList();
  65. },
  66. initList(){
  67. this.queryParams.page = 1;
  68. this.isOver = false;
  69. this.list = [];
  70. },
  71. getList(){
  72. if(this.tindex===0) this.getReceiveList()
  73. else if(this.tindex===1) this.getGenerateList()
  74. else if(this.tindex===2) this.getSendList()
  75. },
  76. getReceiveList(){
  77. this.$api.get('/core/report/receivedReportList',this.queryParams).then(({data:res})=>{
  78. if(res.code!==0) return this.$showToast(res.msg)
  79. this.list = [...this.list,...res.data.list];
  80. this.queryParams.page++;
  81. if(res.data.list.length===0) this.isOver = true;
  82. })
  83. },
  84. getGenerateList(){
  85. this.$api.get('/core/report/generatedReportList',this.queryParams).then(({data:res})=>{
  86. if(res.code!==0) return this.$showToast(res.msg)
  87. this.list = [...this.list,...res.data.list];
  88. this.queryParams.page++;
  89. if(res.data.list.length===0) this.isOver = true;
  90. })
  91. },
  92. getSendList(){
  93. this.list = [{id:1},{id:2},{id:3}];
  94. },
  95. reSendReport(){
  96. this.initList();
  97. this.getList()
  98. this.$showToast('重新生成成功')
  99. },
  100. scrolltolower(){
  101. if(this.isOver) return
  102. this.getList()
  103. }
  104. }
  105. }
  106. </script>
  107. <style scoped lang="scss">
  108. .default_page{
  109. padding: 0 24rpx 40rpx;
  110. background: #F7F7F7;
  111. box-sizing: border-box;
  112. .top_bg{
  113. width: 100%;
  114. position: absolute;
  115. left: 0;
  116. top: 0;
  117. }
  118. .query{
  119. width: calc(100% - 12rpx);
  120. margin: 40rpx 6rpx 0;
  121. height: 72rpx;
  122. background: #FFFFFF;
  123. border-radius: 36rpx;
  124. padding: 0 36rpx;
  125. box-sizing: border-box;
  126. position: relative;
  127. &-inp{
  128. width: calc(100% - 55rpx);
  129. }
  130. }
  131. .box{
  132. flex: 1;
  133. overflow-y: auto;
  134. }
  135. .tab{
  136. margin-top: 20rpx;
  137. position: relative;
  138. &-pre{
  139. width: 50%;
  140. font-family: PingFangSC, PingFang SC;
  141. font-weight: 400;
  142. font-size: 30rpx;
  143. color: #002846;
  144. line-height: 42rpx;
  145. text-align: center;
  146. &.active{
  147. font-weight: bold;
  148. font-size: 32rpx;
  149. line-height: 45rpx;
  150. position: relative;
  151. &::after{
  152. content: '';
  153. width: 48rpx;
  154. height: 6rpx;
  155. background: #335368;
  156. border-radius: 9rpx;
  157. position: absolute;
  158. left: 50%;
  159. margin-left: -24rpx;
  160. bottom: -22rpx;
  161. }
  162. }
  163. }
  164. }
  165. }
  166. </style>