addratelist.vue 4.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166
  1. <template>
  2. <view class="fgw">
  3. <view class="listtop">
  4. <view class="listtopa flexc">
  5. <image :src="dayimg" @click="getSeep"></image>
  6. <picker mode="date" :value="jdsj" fields="month" class="flex1" @change='bindDateChangetimea'>
  7. <view :class="jdsj?'f16 c3':'f16 co80'">{{jdsj||"请选择日期进行搜索"}}</view>
  8. </picker>
  9. <view class="btn f16 cf flexcc" @click="getSearch">搜索</view>
  10. </view>
  11. </view>
  12. <view class="zhanline"></view>
  13. <!-- @getDown="getDown" @getDelFn='getdbDelFn' @getPutFn="getdbPutFn" @getjdShFn="getjdShFn" @getCbFn="getCbFn" @getjzqklistFn="getjzqklistFn" -->
  14. <block v-if='list&&list.length'>
  15. <point :datainfo='list' @getHuiFn="getHuiFn" :jdflag='jdflag'></point>
  16. </block>
  17. <no-data v-else></no-data>
  18. <block >
  19. <view class="pfixedb">
  20. <view class="tstit"><text>*</text>汇报节点进度指汇报当前页面显示的本月节点进度,若汇报其他月份进度,请于搜索框搜索后再进行汇报</view>
  21. <view class=" flexc" v-if="checkPermi(['fgw:jzqk:add'])">
  22. <view style="height: 100rpx;"></view>
  23. <view class="cluebtn btn1" @click="getAddbFn('xm')">汇报项目进度</view>
  24. <view class="cluebtn btn2" @click="getAddbFn('jd')">汇报节点进度</view>
  25. </view>
  26. </view>
  27. </block>
  28. </view>
  29. </template>
  30. <script>
  31. import { checkPermi, checkRole } from "@/utils/permission"; // 权限判断函数
  32. import noData from "@/components/nodata/nodata.vue"
  33. import {getlistzdapdFn} from '@/api/zdwork/addclue.js'
  34. import point from "@/components/zdclue/point.vue" //节点安排
  35. export default{
  36. components:{
  37. noData,point
  38. },
  39. data(){
  40. return{
  41. dayimg:require('@/static/images/new/index/dayicon.png'),
  42. jdsj:'',
  43. pageSize: 10,
  44. pageNum: 1,
  45. reachflag:true,
  46. itemslist:[],
  47. year:'2023',
  48. month:'03',
  49. list:[],
  50. jdflag:false,
  51. datainfo:{}
  52. }
  53. },
  54. onLoad(e) {
  55. if(e.data){
  56. var newObj=JSON.parse(decodeURIComponent(e.data));
  57. this.datainfo.xmId=newObj.id;
  58. this.datainfo.xmmc=newObj.xmmc;
  59. this.getNowFormatDate();
  60. this.getDataFn()
  61. }
  62. },
  63. onReachBottom() {
  64. if (this.reachflag) {
  65. this.pageNum++
  66. this.getDataFn()
  67. }
  68. },
  69. methods:{
  70. checkPermi, checkRole,
  71. getNowFormatDate(){
  72. let date = new Date();
  73. let y = date.getFullYear();
  74. let m = date.getMonth() + 1;
  75. m = m < 10 ? "0" + m : m;
  76. let d = date.getDate();
  77. d = d < 10 ? "0" + d : d;
  78. const timeday = y + "-" + m;
  79. // this.year=y;
  80. // this.month=m;
  81. this.jdsj=timeday;
  82. // return timeday;
  83. },
  84. bindDateChangetimea(e){//完成时间
  85. this.jdsj = e.detail.value;
  86. this.reachflag=true;
  87. this.pageNum=1;
  88. this.list=[];
  89. this.getDataFn()
  90. },
  91. getSearch(){
  92. this.getDataFn();
  93. },
  94. getAddbFn(tit){
  95. var newobj={
  96. id:this.datainfo.xmId,
  97. xmmc:this.datainfo.xmmc,
  98. pagetype:'add',
  99. jzfrom:'ratelist'
  100. }
  101. if(tit=='jd'){
  102. if(this.list&&this.list.length){
  103. var titval=this.list[0];
  104. newobj.jdId=titval.id
  105. newobj.year=titval.year
  106. newobj.month=titval.month
  107. }
  108. }
  109. this.$tab.navigateTo('/pages/zdpages/work/addrate?data='+encodeURIComponent(JSON.stringify(newobj)))
  110. },
  111. getDataFn(){
  112. var params={
  113. pageSize:this.pageSize,
  114. pageNum: this.pageNum,
  115. jdsj:this.jdsj,
  116. xmId:this.datainfo.xmId,
  117. xmmc:this.datainfo.xmmc
  118. }
  119. getlistzdapdFn(params).then(res=>{
  120. if(res.code==200){
  121. if (res.rows.length < this.pageSize) {
  122. this.reachflag = false
  123. this.wtdt = '到底了~';
  124. } else {
  125. var num = parseInt(res.rows.length) + parseInt(this.pageSize) * parseInt(this.pageNum - 1)
  126. if (num < res.total) {
  127. this.reachflag = true
  128. this.wtdt = '上拉加载更多'
  129. } else {
  130. this.reachflag = false
  131. this.wtdt = '到底了~';
  132. }
  133. }
  134. if (this.pageNum == 1) {
  135. this.list = res.rows;
  136. } else {
  137. this.list = this.list.concat(res.rows)
  138. }
  139. }else{
  140. this.$toast(res.msg)
  141. }
  142. })
  143. },
  144. }
  145. }
  146. </script>
  147. <style lang="scss" scoped>
  148. .listtop{padding: 24rpx;}
  149. .listtopa{border: 6rpx solid #FD5001;border-radius: 32rpx;height:72rpx;box-sizing: border-box;padding:0 140rpx 0 32rpx ;position: relative;
  150. input{}
  151. image{width: 34rpx;height: 34rpx;margin-right: 24rpx;}
  152. .btn{background: #FA5F03;border-radius: 32rpx;width: 120rpx;position: absolute;right: -2rpx;top: -2rpx;bottom:-2rpx;}
  153. }
  154. .tstit{padding:24rpx;font-size:22rpx;color: #AAAAAA;line-height: 36rpx;
  155. text{color: #FF0000;}
  156. }
  157. // .jdlist /deep/ uni-picker{margin-top: -30rpx;margin-left: 24rpx;}
  158. </style>