auditRecord.vue 2.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115
  1. <template>
  2. <view class="uni-container uni-container-bg">
  3. <view class="" v-if="tableData.length!=0">
  4. <uni-card v-for="(item, index) in tableData" :key="index">
  5. <view class="titles">{{item.taskName}}</view>
  6. <view style="float: left;">任务说明:</view>
  7. <rich-text :nodes="item.taskContent?item.taskContent:''" class="conts"></rich-text>
  8. <view class="an-niu">
  9. <text @click="addClickDetail(item.broadId)" class="detail">查看详情</text>
  10. </view>
  11. </uni-card>
  12. </view>
  13. <view style="text-align: center;">
  14. <view class="text-gray" style="padding-top: 20px;" v-if="tableData.length==0"> 暂无主动检查任务 </view>
  15. </view>
  16. <view>
  17. <!-- <image :src="Group" @click="addClick" class="tiantupian"></image> -->
  18. </view>
  19. </view>
  20. </template>
  21. <script>
  22. import {
  23. taskList, //获取除草稿箱以外的列表
  24. } from "@/api/check_active";
  25. export default {
  26. data() {
  27. return {
  28. tableData: [],
  29. // 数据总量
  30. total: 0,
  31. formdata: {
  32. pageNo: 1,
  33. pageSize: 10,
  34. // receiver: this.$store.state.user.id,
  35. taskStatus: 3
  36. },
  37. };
  38. },
  39. onShow() {
  40. this.tableData = []
  41. this.getData(this.formdata.pageNo)
  42. },
  43. methods:{
  44. // 获取数据
  45. getData(pageNo, value = '') {
  46. this.loading = true;
  47. this.formdata.pageNo = pageNo ? pageNo : 1;
  48. const json = JSON.stringify(this.formdata)
  49. taskList(json).then(response => {
  50. this.tableData = [...this.tableData, ...response.data.list]
  51. this.total = response.data.total
  52. this.loading = false;
  53. // console.log('this.tabk=-=======================',this.tableData);
  54. })
  55. },
  56. // 触底的事件
  57. onReachBottom() {
  58. // 判断是否还有下一页数据
  59. if (this.formdata.pageNo * this.formdata.pageSize >= this.total) return uni.showToast({
  60. title: `数据加载完毕`
  61. })
  62. // 判断是否正在请求其它数据,如果是,则不发起额外的请求
  63. if (this.loading) return
  64. this.formdata.pageNo += 1
  65. this.getData(this.formdata.pageNo)
  66. },
  67. }
  68. }
  69. </script>
  70. <style lang="scss"scoped>
  71. body {
  72. background-color: #F5F7F9;
  73. }
  74. page {
  75. background-color: #F5F7F9;
  76. }
  77. .an-niu {
  78. float: right;
  79. font-size: 10px;
  80. text-align: center;
  81. display: flex;
  82. padding-bottom: 30rpx;
  83. margin-top: 50rpx;
  84. color: #fff;
  85. .detail {
  86. width: 72px;
  87. height: 60rpx;
  88. border-radius: 30px;
  89. background-color: #F7C41E;
  90. margin-right: 20rpx;
  91. text-align: center;
  92. line-height: 60rpx;
  93. }
  94. }
  95. //列表样式
  96. .titles {
  97. font-weight: 600;
  98. margin-bottom: 10rpx;
  99. font-size: 14px;
  100. }
  101. /deep/.uni-card {
  102. box-shadow: 0px 0px 3px 0px rgba(86, 165, 168, 0.63) !important;
  103. border-radius: 30rpx;
  104. }
  105. rich-text {
  106. display: -webkit-box;
  107. -webkit-box-orient: vertical;
  108. -webkit-line-clamp: 1;
  109. overflow: hidden;
  110. }
  111. </style>