addcluelist.vue 4.1 KB

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