skitem.vue 5.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193
  1. <template>
  2. <view class="allpage">
  3. <view class="listtop pfixed">
  4. <tab-searchone @getSearch='getSearch'></tab-searchone>
  5. <tab-list :tablist='tablist' :tabidx="tabidx" @getCheck="goCheck" :height='90'></tab-list>
  6. <time-year @bindDateChange="bindDateChange" :timedate="time"></time-year>
  7. </view>
  8. <!-- <view style="height: 90rpx;"></view> -->
  9. <view class="zhanline"></view>
  10. <view class="alllist">
  11. <!-- :start="startDate" :end="endDate" -->
  12. <!-- l列表 -->
  13. <project-list :datalist="list" :wtdt="wtdt" type='shengku' @getDetail='goDetail'></project-list>
  14. </view>
  15. <!-- 新增 -->
  16. <block v-if="checkPermi(['projectV2:skxm:add'])">
  17. <view style="height: 100rpx;"></view>
  18. <view class="zdcount_btn" @click="getAddSkFn">新增申报</view>
  19. </block>
  20. </view>
  21. </template>
  22. <script>
  23. import projectList from "@/components/projectlist/list.vue"
  24. import tabList from "@/components/toptab/tab.vue"
  25. import tabSearchone from "@/components/toptab/searchone.vue"
  26. import timeYear from "@/components/timedata/timeyear.vue"
  27. import { getskxmList} from '@/api/work/addsk.js'
  28. import { checkPermi, checkRole } from "@/utils/permission"; // 权限判断函数
  29. export default{
  30. data(){
  31. return{
  32. upimg:require("@/static/images/index/up.png"),
  33. tabidx:0,
  34. year:'',
  35. list:[],
  36. tablist:[{tit:'全部',val:0,},{tit:'待审',val:1},{tit:'已审',val:2},{tit:'已拒',val:3}],
  37. pageSize: 10,
  38. pageNum: 1,
  39. reachflag:true,
  40. wtdt:'',
  41. year:'',
  42. beginTime:'',
  43. endTime:'',
  44. name:'',
  45. wtdt:'',
  46. deptId:this.$store.state.user.deptId,
  47. time:""
  48. }
  49. },
  50. components:{
  51. projectList,tabList,tabSearchone,timeYear
  52. },
  53. onUnload(){
  54. uni.$off('refreshdatalistsk')
  55. },
  56. onLoad(e) {
  57. uni.$on('refreshdatalistsk',(e) => {
  58. this.reachflag=true;
  59. this.pageNum=1;
  60. this.list=[];
  61. this.getDataFn();
  62. })
  63. var y='';
  64. if(e.time){
  65. y=e.time
  66. }else{
  67. let date = new Date();
  68. y = date.getFullYear();
  69. }
  70. this.beginTime=y+'0101';
  71. this.endTime=y+'1231';
  72. this.time=y;
  73. this.getDataFn()
  74. },
  75. onReachBottom() {
  76. if (this.reachflag) {
  77. this.pageNum++
  78. this.getDataFn()
  79. }
  80. },
  81. methods:{
  82. checkPermi, checkRole,
  83. bindDateChange(e){
  84. this.year=e;
  85. this.beginTime=e+'0101';
  86. this.endTime=e+'1231';
  87. this.reachflag=true;
  88. this.pageNum=1;
  89. this.list=[];
  90. this.getDataFn()
  91. },
  92. goCheck(data){
  93. this.tabidx=data;
  94. this.reachflag=true;
  95. this.pageNum=1;
  96. this.list=[];
  97. this.getDataFn()
  98. },
  99. goDetail(e){
  100. if(checkPermi(['projectV2:skxm:query'])){
  101. this.$tab.navigateTo('/pages/work/skproject/skdetail?id='+e.id)
  102. }
  103. },
  104. getAddSkFn(){
  105. this.$tab.navigateTo('/pages/work/skproject/addsk')
  106. },
  107. getDataFn(){
  108. var params={
  109. pageSize:this.pageSize,
  110. pageNum: this.pageNum,
  111. xmmc:this.name,
  112. deptId:this.deptId
  113. }
  114. params['params[beginTime]']=this.beginTime
  115. params['params[endTime]']=this.endTime
  116. if(this.tabidx>0){
  117. params.isSh=this.tabidx
  118. }
  119. // isSh
  120. // if(this.tabidx==1){
  121. // params.isSh='N'
  122. // }else if(this.tabidx==2){
  123. // params.isSh='Y'
  124. // }
  125. getskxmList(params).then(res=>{
  126. if(res.code==200){
  127. if (res.rows.length < this.pageSize) {
  128. this.reachflag = false
  129. this.wtdt = '到底了~';
  130. } else {
  131. var num = parseInt(res.rows.length) + parseInt(this.pageSize) * parseInt(this.pageNum - 1)
  132. if (num < res.total) {
  133. this.reachflag = true
  134. this.wtdt = '上拉加载更多'
  135. } else {
  136. this.reachflag = false
  137. this.wtdt = '到底了~';
  138. }
  139. }
  140. if (this.pageNum == 1) {
  141. this.list = res.rows;
  142. } else {
  143. this.list = this.list.concat(res.rows)
  144. }
  145. }else{
  146. this.$toast(res.msg)
  147. }
  148. })
  149. },
  150. getSearch(e){
  151. this.name=e;
  152. this.reachflag=true;
  153. this.pageNum=1;
  154. this.list=[];
  155. this.getDataFn()
  156. },
  157. }
  158. }
  159. </script>
  160. <style lang="scss" scoped>
  161. .allpage{min-height: 100vh;background: #ffffff;padding-top:280rpx;box-sizing: border-box;}
  162. .listtopa{border: 6rpx solid #FD5001;border-radius: 36rpx;height:72rpx;box-sizing: border-box;padding:0 140rpx 0 32rpx ;position: relative;
  163. input{}
  164. image{width: 30rpx;height: 30rpx;margin-right: 24rpx;}
  165. .btn{background: #FA5F03;border-radius: 36rpx;width: 140rpx;position: absolute;right: -2rpx;top: -2rpx;bottom:-2rpx;}
  166. }
  167. .listtopb{
  168. .tit{flex: 1;height: 130rpx;display: flex;flex-direction: column;justify-content: center;position: relative;
  169. view{text-align: center;}
  170. .tits{color: #666666;}
  171. .txt{color: #aaaaaa;}
  172. &.act{
  173. &::after{content: '';width: 100rpx;height: 6rpx;background:#FE5706 ;position: absolute;left: 50%;margin-left: -50rpx;bottom: 0;}
  174. .tits{color: #343434;}
  175. .txt{color: #FE5706;}
  176. }
  177. }
  178. }
  179. .alllist{padding-top:10rpx ;}
  180. .zdcount_btn{position: fixed;left: 0;right: 0;bottom: 0;z-index: 4;width: 100%;height: 100rpx;font-size: 32rpx;color: #ffffff;font-weight: 500;
  181. background: #FE5706;display: flex;align-items: center;justify-content: center;
  182. }
  183. </style>