hiddenDangerRecord.vue 4.8 KB

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