hiddenDangerRecord.vue 4.7 KB

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