list.vue 2.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124
  1. <template>
  2. <view>
  3. <view v-if='datalist.length>0'>
  4. <view class='wrap' v-for='item in datalist' @click='lookdetails(item)'>
  5. <view style='display:flex;justify-content: space-between;'>
  6. <view class='title'>
  7. {{item.businessType}}
  8. </view>
  9. <view v-if='item.approveStatus' style='color:#FD714F;'>
  10. {{item.approveStatus?item.approveStatus:item.status}}
  11. </view>
  12. <view v-if='item.status=="已驳回"' style='color:#FF4E4E;'>
  13. {{item.approveStatus?item.approveStatus:item.status}}
  14. </view>
  15. <view v-if='item.status=="已通过"' style='color:#22C572;'>
  16. {{item.approveStatus?item.approveStatus:item.status}}
  17. </view>
  18. </view>
  19. <view>{{item.createDate}}</view>
  20. </view>
  21. </view>
  22. <view v-if='show' style='text-align:center;background:#F2F6FA;margin-top: 20rpx;'>暂无更多数据</view>
  23. </view>
  24. </template>
  25. <script>
  26. import {
  27. mapState
  28. } from 'vuex';
  29. export default {
  30. data() {
  31. return {
  32. datalist:[],
  33. currentPage:1,
  34. show:false,
  35. pageSize:10
  36. }
  37. },
  38. onShow(){
  39. this.getList()
  40. },
  41. computed: {
  42. ...mapState(['hasLogin', 'userInfo','clientId']),
  43. },
  44. onReachBottom() { //上拉触底函数
  45. // if (this.statusFlag == 3) {
  46. if (!this.isLoadMore) { //此处判断,上锁,防止重复请求
  47. this.pageSize += 1
  48. this.currentPage += 1
  49. this.getList()
  50. }
  51. // }
  52. },
  53. methods: {
  54. lookdetails(row){
  55. uni.navigateTo({
  56. url:'/pages/universalityAudit/look?id='+row.id
  57. })
  58. },
  59. onNavigationBarButtonTap() {
  60. uni.navigateTo({
  61. url:'/pages/universalityAudit/addaduit'
  62. })
  63. },
  64. getList(){
  65. uni.showLoading({
  66. title: "正在加载"
  67. })
  68. this.$api.doRequest('get', '/generalAuditInfo/selectGeneralAuditInfo', {
  69. startDate: '',
  70. endDate: '',
  71. searchKeyWord: '',
  72. currentPage: this.currentPage,
  73. pageSize:this.pageSize,
  74. searchType: '',
  75. businessType: '',
  76. createUserId:this.userInfo.id,
  77. flag:1
  78. }).then(res => {
  79. if(res.data.code==200){
  80. uni.hideLoading()
  81. if(res.data.data.records.length>0){
  82. this.show=false
  83. if(this.currentPage==1){
  84. this.datalist=res.data.data.records
  85. }else{
  86. this.datalist=this.datalist.concat(res.data.data.records)
  87. }
  88. }else{
  89. this.show=true
  90. if(this.currentPage==1){
  91. this.datalist=[]
  92. }
  93. }
  94. }else{
  95. uni.hideLoading()
  96. uni.showToast({
  97. title: "系统异常,请联系管理员",
  98. icon: 'none',
  99. duration: 2000
  100. })
  101. }
  102. })
  103. }
  104. }
  105. }
  106. </script>
  107. <style lang="scss" scoped>
  108. .wrap{
  109. background:#fff;
  110. margin:10px;
  111. padding:20px;
  112. border-radius:10px;
  113. font-size:28rpx;
  114. line-height:36rpx;
  115. .title{
  116. font-size:36rpx;
  117. margin-bottom:10rpx;
  118. }
  119. }
  120. </style>