checkRecord.vue 3.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129
  1. <template>
  2. <view>
  3. <roll-load :total="queryConditions.total"
  4. :size="queryConditions.limit"
  5. @lower="lower" @upper="upper" key="checkRecord-roll-load"
  6. :topBt='top' ref="roll-load" styles="height:100vh;">
  7. <template v-slot:cont>
  8. <block></block>
  9. <uni-list>
  10. <!-- {{item.checkRecordId}} -->
  11. <uni-list-item class="list-item" v-for="(item,index) in dataList" :key="index"
  12. :title="item.measureContent" :note="item.checkTime" @click="inspection(item)" clickable>
  13. <!-- 自定义 body -->
  14. <view slot="body" class="uni-padding-wrap uni-common-mt">
  15. <text class="slot-box slot-text">{{item.riskPointTitle}}</text>
  16. <view>
  17. 检查人:{{item.accountName}}
  18. </view>
  19. <view>
  20. 检查时间:{{item.checkTime}}
  21. </view>
  22. <view>
  23. 描述:{{item.checkDesc}}
  24. </view>
  25. </view>
  26. <view slot="footer" class="unilist_footer_tag">
  27. <template>
  28. <uni-tag v-if="item.checkResult===1" text="通过" type="success" size="small" inverted />
  29. <uni-tag v-if="item.checkResult===2" text="不通过" type="warning" size="small" inverted />
  30. <uni-tag v-if="item.checkResult===3" text="有隐患" type="error" size="small" inverted />
  31. <uni-tag v-if="item.checkResult===0" text="未检查" type="default" size="small" inverted />
  32. </template>
  33. </view>
  34. </uni-list-item>
  35. </uni-list>
  36. </template>
  37. </roll-load>
  38. </view>
  39. </template>
  40. <script>
  41. import RollLoad from '@/components/RollLoad/index.vue';
  42. import { getCheckRecordByPage } from '../../api/checkRecord.js'
  43. import { deepClone } from '@/libs'
  44. export default {
  45. components: {
  46. RollLoad
  47. },
  48. data() {
  49. return {
  50. scrollTop: 0,
  51. old: {
  52. scrollTop: 0
  53. },
  54. top: {
  55. show: true,
  56. style: "top:95%"
  57. },
  58. pageNumber: 1,
  59. items: [],
  60. dataList: [],
  61. queryConditions: {
  62. page: 1,
  63. limit: 10,
  64. total: 0,
  65. keywords: ''
  66. }
  67. }
  68. },
  69. onShow() {
  70. this.getCheckRecord();
  71. },
  72. methods: {
  73. upper: function(e) {
  74. console.log('upper')
  75. console.log(e)
  76. },
  77. lower: function(e) {
  78. console.log('lower')
  79. console.log(e)
  80. if (e.status) {
  81. this.queryConditions.page = e.pageNumber
  82. this.getCheckRecord(this.queryConditions);
  83. }
  84. },
  85. scroll: function(e) {
  86. this.old.scrollTop = e.detail.scrollTop
  87. },
  88. goTop: function(e) {
  89. this.scrollTop = this.old.scrollTop
  90. this.$nextTick(() => {
  91. this.scrollTop = 0
  92. });
  93. uni.showToast({
  94. icon: "none",
  95. title: "已经到顶了!"
  96. })
  97. },
  98. getCheckRecord() {
  99. getCheckRecordByPage(this.queryConditions).then((res) => {
  100. let items =[...this.dataList];
  101. let dataList=items.concat(res.data);
  102. this.dataList=dataList;
  103. this.$set(this.queryConditions, 'total', res.total)
  104. })
  105. },
  106. inspection(item){
  107. uni.setStorageSync('inspectionInfo',item);
  108. uni.navigateTo({
  109. url:'/views/checkRecord/inspectionDetail/inspectionDetail'
  110. })
  111. }
  112. }
  113. }
  114. </script>
  115. <style lang="scss" scoped>
  116. .slot-image {
  117. height: 35upx;
  118. }
  119. .list-item{
  120. position: relative;
  121. .unilist_footer_tag {
  122. position: absolute;
  123. right: 20upx;
  124. top: 50%;
  125. transform: translateY(-50%);
  126. }
  127. }
  128. </style>