tslist.vue 4.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155
  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 type='tslist' :datalist="list" :wtdt='wtdt' @getXmjzFn="getXmjzFn"></project-list>
  11. </view>
  12. <!-- 弹窗 -->
  13. <pop-up :type="poptype" @getClose='getClose' @getXmSubmitFn='getXmSubmitFn'></pop-up>
  14. </view>
  15. </template>
  16. <script>
  17. import projectList from "@/components/projectlist/list.vue"
  18. import tabSearchone from "@/components/toptab/searchone.vue"
  19. import timeYear from "@/components/timedata/timeyear.vue"
  20. import {gettslist,getjzqkFn} from "@/api/work/clue.js"
  21. import popUp from "@/components/popup/popup.vue"
  22. export default{
  23. data(){
  24. return{
  25. pageSize: 10,
  26. pageNum: 1,
  27. reachflag:true,
  28. itemslist:[],
  29. wtdt:'',
  30. tabidx:0,
  31. date:'',
  32. list:[],
  33. year:'',
  34. beginTime:'',
  35. endTime:'',
  36. name:'',
  37. census:'',
  38. deptId:this.$store.state.user.deptId,
  39. poptype:0,
  40. datainfo:{
  41. xmId:'',
  42. xmbh:'',
  43. xmmc:'',
  44. }
  45. }
  46. },
  47. components:{
  48. projectList,tabSearchone,timeYear,popUp
  49. },
  50. onUnload(){
  51. uni.$off('refreshdatalist')
  52. },
  53. onLoad(e) {
  54. this.getDataFn();
  55. },
  56. onReachBottom() {
  57. if (this.reachflag) {
  58. this.pageNum++
  59. this.getDataFn()
  60. }
  61. },
  62. methods:{
  63. getClose(){
  64. this.poptype=0;
  65. },
  66. getXmjzFn(data){
  67. this.datainfo.xmId=data.id;
  68. this.datainfo.xmbh=data.xmbh;
  69. this.datainfo.xmmc=data.xmmc;
  70. this.poptype=4;
  71. },
  72. getXmSubmitFn(data){
  73. var that=this;
  74. var params=JSON.parse(JSON.stringify(data))
  75. params.xmId=this.datainfo.xmId;
  76. params.xmmc=this.datainfo.xmmc;
  77. params.xmbh=this.datainfo.xmbh;
  78. getjzqkFn(params).then(res=>{
  79. if(res.code==200){
  80. that.$toast('添加项目进展成功')
  81. setTimeout(function(){
  82. that.poptype=0;
  83. that.pageNum=1;
  84. that.reachflag=true;
  85. that.list=[];
  86. that.getDataFn()
  87. },1500)
  88. }else{
  89. this.$toast(res.msg)
  90. }
  91. })
  92. },
  93. getDataFn(){
  94. var params={
  95. pageSize:this.pageSize,
  96. pageNum: this.pageNum,
  97. }
  98. gettslist(params).then(res=>{
  99. if(res.code==200){
  100. if (res.rows.length < this.pageSize) {
  101. this.reachflag = false
  102. this.wtdt = '到底了~';
  103. } else {
  104. var num = parseInt(res.rows.length) + parseInt(this.pageSize) * parseInt(this.pageNum - 1)
  105. if (num < res.total) {
  106. this.reachflag = true
  107. this.wtdt = '上拉加载更多'
  108. } else {
  109. this.reachflag = false
  110. this.wtdt = '到底了~';
  111. }
  112. }
  113. if (this.pageNum == 1) {
  114. this.list = res.rows;
  115. } else {
  116. this.list = this.list.concat(res.rows)
  117. }
  118. }else{
  119. this.$toast(res.msg)
  120. }
  121. })
  122. },
  123. }
  124. }
  125. </script>
  126. <style lang="scss" scoped>
  127. .allpage{min-height: 100vh;background: #ffffff;box-sizing: border-box;}
  128. .listtopa{border: 6rpx solid #FD5001;border-radius: 36rpx;height:72rpx;box-sizing: border-box;padding:0 140rpx 0 32rpx ;position: relative;
  129. input{}
  130. image{width: 30rpx;height: 30rpx;margin-right: 24rpx;}
  131. .btn{background: #FA5F03;border-radius: 36rpx;width: 140rpx;position: absolute;right: -2rpx;top: -2rpx;bottom:-2rpx;}
  132. }
  133. .listtopb{
  134. .tit{flex: 1;height: 130rpx;display: flex;flex-direction: column;justify-content: center;position: relative;
  135. view{text-align: center;}
  136. .tits{color: #666666;}
  137. .txt{color: #aaaaaa;}
  138. &.act{
  139. &::after{content: '';width: 100rpx;height: 6rpx;background:#FE5706 ;position: absolute;left: 50%;margin-left: -50rpx;bottom: 0;}
  140. .tits{color: #343434;}
  141. .txt{color: #FE5706;}
  142. }
  143. }
  144. }
  145. .alllist{padding-top:10rpx ;}
  146. // 操作按钮
  147. .cluebtn{
  148. 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;
  149. &.btn1{background-color: #1FB9F7;flex: 1;}
  150. &.btn2{background-color:#FF6400;flex: 1;}
  151. }
  152. </style>