hiddenDangerRecord.vue 4.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205
  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: 20,
  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. infoData.checkPlanSetVoList.planId=row.planId;
  88. infoData.checkPlanSetVoList.planSetId=row.planSetId;
  89. infoData.subId=row.subId;
  90. infoData.hazardCheckPro=row.hazardCheckPro;
  91. uni.navigateTo({
  92. url: '/pages_safetyCheck/views/itemsManage/hiddenDangerItemsDetail?infoData=' +
  93. encodeURIComponent(JSON
  94. .stringify(infoData))
  95. });
  96. }else if(row.flagType==2){
  97. //上报时间
  98. let infoData=this.optionData;
  99. uni.redirectTo({
  100. url: '/pages_safetyCheck/views/snapshotManage/snapshotDetail?infoData=' + encodeURIComponent(JSON.stringify(infoData))
  101. });
  102. }
  103. },
  104. async getList() {
  105. let self = this;
  106. let obj = JSON.parse(JSON.stringify(this.queryParams))
  107. obj.hazardCheckPro = this.optionData.hazardCheckPro;
  108. obj.subId = this.optionData.subId;
  109. const {
  110. data
  111. } = await securityAppCheckDangerGetCheckDangerBySub(obj);
  112. if (data.code == 200) {
  113. if (self.queryParams.page == 1) {
  114. this.dataList = data.data.records;
  115. this.total = data.data.total;
  116. if (data.data.total / self.queryParams.pageSize <= self.queryParams.page) {
  117. this.$set(this, 'getDataType', true);
  118. }
  119. } else {
  120. this.dataList = [...this.dataList, ...data.data.records]
  121. this.total = data.data.total;
  122. if (data.data.total / self.queryParams.pageSize <= self.queryParams.page) {
  123. this.$set(this, 'getDataType', true);
  124. }
  125. }
  126. }
  127. },
  128. }
  129. }
  130. </script>
  131. <style lang="stylus" scoped>
  132. .hiddenDangerRecord {
  133. height: 100%;
  134. display flex;
  135. .tip {
  136. width: 750rpx;
  137. height: 80rpx;
  138. background: rgba(255, 140, 0, 0.2);
  139. border-radius: 0rpx 0rpx 0rpx 0rpx;
  140. font-size: 30rpx;
  141. color: #FF8C00;
  142. line-height: 80rpx;
  143. text-align: center;
  144. }
  145. .list {
  146. width: 690rpx;
  147. background: #FFFFFF;
  148. border-radius: 20rpx 20rpx 20rpx 20rpx;
  149. margin: 20rpx 30rpx 0;
  150. .list-li {
  151. display: flex;
  152. justify-content: space-between;
  153. align-items: center;
  154. border-bottom: 1rpx solid #E0E0E0;
  155. padding: 0 30rpx;
  156. box-sizing: border-box;
  157. >view:nth-of-type(1) {
  158. font-size: 30rpx;
  159. color: #333333;
  160. line-height: 100rpx;
  161. text-align: left;
  162. }
  163. >view:nth-of-type(2) {
  164. font-size: 28rpx;
  165. color: #666666;
  166. line-height: 100rpx;
  167. text-align: left;
  168. display: flex;
  169. justify-content: space-between;
  170. align-items: center;
  171. >img {
  172. width: 24rpx;
  173. height: 24rpx;
  174. margin-left: 10rpx;
  175. }
  176. }
  177. }
  178. .list-li:last-of-type {
  179. border: none;
  180. }
  181. }
  182. .get-data-null-p {
  183. height: 100rpx;
  184. line-height: 100rpx;
  185. text-align: center;
  186. }
  187. }
  188. </style>