zditem.vue 4.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172
  1. <template>
  2. <view class="allpage">
  3. <view class="listtop pfixed">
  4. <tab-searchone @getSearch='getSearch'></tab-searchone>
  5. <view class="flexc allpage_zd">
  6. <view class="allpage_zdl">本年度共计<text>{{total||0}}</text>个</view>
  7. <time-year @bindDateChange="bindDateChange" textAlign='right' :timedate="time"></time-year>
  8. </view>
  9. </view>
  10. <view class="alllist">
  11. <!-- :start="startDate" :end="endDate" -->
  12. <!-- l列表 -->
  13. <project-list :datalist="list" :wtdt="wtdt" @getDetail='goDetail'></project-list>
  14. </view>
  15. </view>
  16. </template>
  17. <script>
  18. import projectList from "@/components/projectlist/list.vue"
  19. import tabList from "@/components/toptab/tab.vue"
  20. import tabSearchone from "@/components/toptab/searchone.vue"
  21. import timeYear from "@/components/timedata/timeyear.vue"
  22. import { getsbbzblist} from '@/api/work/clue.js'
  23. export default{
  24. data(){
  25. return{
  26. upimg:require("@/static/images/index/up.png"),
  27. tabidx:0,
  28. year:'',
  29. list:[],
  30. pageSize: 10,
  31. pageNum: 1,
  32. reachflag:true,
  33. wtdt:'',
  34. total:0,
  35. year:'',
  36. beginTime:'',
  37. endTime:'',
  38. name:'',
  39. deptId:this.$store.state.user.deptId,
  40. time:""
  41. }
  42. },
  43. components:{
  44. projectList,tabList,tabSearchone,timeYear
  45. },
  46. onUnload(){
  47. uni.$off('refreshdatalist')
  48. },
  49. onLoad(e) {
  50. var y='';
  51. if(e.time){
  52. y=e.time
  53. }else{
  54. let date = new Date();
  55. y = date.getFullYear();
  56. }
  57. this.beginTime=y+'0101';
  58. this.endTime=y+'1231';
  59. this.time=y;
  60. uni.$on('refreshdatalist',(e) => {
  61. this.reachflag=true;
  62. this.pageNum=1;
  63. this.list=[];
  64. this.getDataFn();
  65. })
  66. // this.tabidx=Number(e.idx);
  67. this.getDataFn()
  68. },
  69. onReachBottom() {
  70. if (this.reachflag) {
  71. this.pageNum++
  72. this.getDataFn()
  73. }
  74. },
  75. methods:{
  76. bindDateChange(e){
  77. this.year=e;
  78. this.beginTime=e+'0101';
  79. this.endTime=e+'1231';
  80. this.reachflag=true;
  81. this.pageNum=1;
  82. this.list=[];
  83. this.getDataFn()
  84. },
  85. goCheck(data){
  86. this.tabidx=data
  87. },
  88. goDetail(e){
  89. this.$tab.navigateTo('/pages/work/cluedetails?id='+e.id)
  90. },
  91. getDataFn(){
  92. var params={
  93. pageSize:this.pageSize,
  94. pageNum: this.pageNum,
  95. xmxsmc:this.name,
  96. sfwlhxxxm:'Y',
  97. deptId:this.deptId
  98. }
  99. params['params[beginTime]']=this.beginTime
  100. params['params[endTime]']=this.endTime
  101. getsbbzblist(params).then(res=>{
  102. if(res.code==200){
  103. this.total=res.total;
  104. if (res.rows.length < this.pageSize) {
  105. this.reachflag = false
  106. this.wtdt = '到底了~';
  107. } else {
  108. var num = parseInt(res.rows.length) + parseInt(this.pageSize) * parseInt(this.pageNum - 1)
  109. if (num < res.total) {
  110. this.reachflag = true
  111. this.wtdt = '上拉加载更多'
  112. } else {
  113. this.reachflag = false
  114. this.wtdt = '到底了~';
  115. }
  116. }
  117. if (this.pageNum == 1) {
  118. this.list = res.rows;
  119. } else {
  120. this.list = this.list.concat(res.rows)
  121. }
  122. }else{
  123. this.$toast(res.msg)
  124. }
  125. })
  126. },
  127. getSearch(e){
  128. this.name=e;
  129. this.reachflag=true;
  130. this.pageNum=1;
  131. this.list=[];
  132. this.getDataFn()
  133. },
  134. }
  135. }
  136. </script>
  137. <style lang="scss" scoped>
  138. .allpage{min-height: 100vh;background: #ffffff;padding-top:190rpx;box-sizing: border-box;}
  139. .listtopa{border: 6rpx solid #FD5001;border-radius: 36rpx;height:72rpx;box-sizing: border-box;padding:0 140rpx 0 32rpx ;position: relative;
  140. input{}
  141. image{width: 30rpx;height: 30rpx;margin-right: 24rpx;}
  142. .btn{background: #FA5F03;border-radius: 36rpx;width: 140rpx;position: absolute;right: -2rpx;top: -2rpx;bottom:-2rpx;}
  143. }
  144. .listtopb{
  145. .tit{flex: 1;height: 130rpx;display: flex;flex-direction: column;justify-content: center;position: relative;
  146. view{text-align: center;}
  147. .tits{color: #666666;}
  148. .txt{color: #aaaaaa;}
  149. &.act{
  150. &::after{content: '';width: 100rpx;height: 6rpx;background:#FE5706 ;position: absolute;left: 50%;margin-left: -50rpx;bottom: 0;}
  151. .tits{color: #343434;}
  152. .txt{color: #FE5706;}
  153. }
  154. }
  155. }
  156. //统计
  157. .allpage_zd{background-color:#F2F2F2;padding: 0 28rpx;justify-content: space-between;
  158. .allpage_zdl{font-size: 30rpx;font-weight: 500;
  159. color: #666666;
  160. text{font-weight: bold;color: #FE5706;margin: 0 8rpx;}
  161. }
  162. }
  163. </style>