hiddenDangerRecord.vue 4.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200
  1. <!-- 隐患记录 -->
  2. <template>
  3. <view class="hiddenDangerRecord">
  4. <scroll-view scroll-y @scrolltolower="scrollGet" class="info-max-box">
  5. <view class="tip">此检查项在当前实验室累计出现 {{total}} 次隐患</view>
  6. <view class="list">
  7. <view class="list-li" v-for="(item,index) in dataList" @click="clickInfo(item)">
  8. <view>{{item.flagType==1?'检查时间':'上报时间'}}</view>
  9. <view>{{item.checkTime}}
  10. <img src="@/pages_safetyCheck/images/icon_wd_gd@1x.png">
  11. </view>
  12. </view>
  13. </view>
  14. <view class="get-data-null-p" v-if="getDataType">- 没有更多数据 -</view>
  15. </scroll-view>
  16. </view>
  17. </template>
  18. <script>
  19. import {
  20. config
  21. } from '@/api/request/config.js'
  22. import {} from '@/pages/api/index.js'
  23. import {
  24. securityAppCheckDangerGetCheckDangerBySub
  25. } from '@/pages_safetyCheck/api/index.js'
  26. export default {
  27. name: "hiddenDangerRecord",
  28. components: {
  29. },
  30. data() {
  31. return {
  32. baseUrl: config.base_url,
  33. pageType: 0,
  34. // 查询参数
  35. queryParams: {
  36. page: 1,
  37. pageSize: 10,
  38. },
  39. total:0,
  40. getDataType: false,
  41. optionData:null,
  42. dataList: [{
  43. name: '检查时间',
  44. time: '2024-09-06',
  45. },
  46. {
  47. name: '检查时间',
  48. time: '2024-09-06',
  49. },
  50. {
  51. name: '检查时间',
  52. time: '2024-09-06',
  53. },
  54. ]
  55. }
  56. },
  57. onLoad(option) {
  58. let optionData = JSON.parse(decodeURIComponent(option.infoData));
  59. uni.setNavigationBarTitle({
  60. title: optionData.subName + '(' + (optionData.pageType == 0 ? optionData.roomNum : optionData
  61. .subRoom) + ')'
  62. })
  63. this.$set(this, 'optionData', optionData);
  64. },
  65. onShow() {
  66. },
  67. mounted() {
  68. this.getList();
  69. },
  70. methods: {
  71. //滚动事件
  72. scrollGet() {
  73. let self = this;
  74. if (self.total / self.queryParams.pageSize <= self.queryParams.page) {
  75. this.$set(this, 'getDataType', true);
  76. } else {
  77. this.queryParams.page += 1;
  78. this.$nextTick(() => {
  79. this.getList();
  80. })
  81. }
  82. },
  83. clickInfo(row){
  84. let infoData = this.optionData;
  85. if(row.flagType==1){
  86. //检查时间
  87. uni.navigateTo({
  88. url: '/pages_safetyCheck/views/itemsManage/hiddenDangerItemsDetail?infoData=' +
  89. encodeURIComponent(JSON
  90. .stringify(infoData))
  91. });
  92. }else if(row.flagType==2){
  93. //上报时间
  94. let infoData=this.optionData;
  95. uni.redirectTo({
  96. url: '/pages_safetyCheck/views/snapshotManage/snapshotDetail?infoData=' + encodeURIComponent(JSON.stringify(infoData))
  97. });
  98. }
  99. },
  100. async getList() {
  101. let self = this;
  102. let obj = JSON.parse(JSON.stringify(this.queryParams))
  103. obj.hazardCheckPro = this.optionData.hazardCheckPro;
  104. obj.subId = this.optionData.subId;
  105. const {
  106. data
  107. } = await securityAppCheckDangerGetCheckDangerBySub(obj);
  108. if (data.code == 200) {
  109. if (self.queryParams.page == 1) {
  110. this.dataList = data.data.records;
  111. this.total = data.data.total;
  112. if (data.data.total / self.queryParams.pageSize <= self.queryParams.page) {
  113. this.$set(this, 'getDataType', true);
  114. }
  115. } else {
  116. this.dataList = [...this.dataList, ...data.data.records]
  117. this.total = data.data.total;
  118. if (data.data.total / self.queryParams.pageSize <= self.queryParams.page) {
  119. this.$set(this, 'getDataType', true);
  120. }
  121. }
  122. }
  123. },
  124. }
  125. }
  126. </script>
  127. <style lang="stylus" scoped>
  128. .hiddenDangerRecord {
  129. height: 100%;
  130. display flex;
  131. .tip {
  132. width: 750rpx;
  133. height: 80rpx;
  134. background: rgba(255, 140, 0, 0.2);
  135. border-radius: 0rpx 0rpx 0rpx 0rpx;
  136. font-size: 30rpx;
  137. color: #FF8C00;
  138. line-height: 80rpx;
  139. text-align: center;
  140. }
  141. .list {
  142. width: 690rpx;
  143. background: #FFFFFF;
  144. border-radius: 20rpx 20rpx 20rpx 20rpx;
  145. margin: 20rpx 30rpx 0;
  146. .list-li {
  147. display: flex;
  148. justify-content: space-between;
  149. align-items: center;
  150. border-bottom: 1rpx solid #E0E0E0;
  151. padding: 0 30rpx;
  152. box-sizing: border-box;
  153. >view:nth-of-type(1) {
  154. font-size: 30rpx;
  155. color: #333333;
  156. line-height: 100rpx;
  157. text-align: left;
  158. }
  159. >view:nth-of-type(2) {
  160. font-size: 28rpx;
  161. color: #666666;
  162. line-height: 100rpx;
  163. text-align: left;
  164. display: flex;
  165. justify-content: space-between;
  166. align-items: center;
  167. >img {
  168. width: 24rpx;
  169. height: 24rpx;
  170. margin-left: 10rpx;
  171. }
  172. }
  173. }
  174. .list-li:last-of-type {
  175. border: none;
  176. }
  177. }
  178. .get-data-null-p {
  179. height: 100rpx;
  180. line-height: 100rpx;
  181. text-align: center;
  182. }
  183. }
  184. </style>