hiddenDangerItems.vue 8.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385
  1. <!-- 隐患项 -->
  2. <template>
  3. <view class="hiddenDangerItems">
  4. <view class="header">
  5. <view class="tabTitle_tow">
  6. <view class="tabTitle_tow_li" @tap="tabClickTow(index)" :key="index" v-for="(item,index) in tabTextTow">
  7. <view :class="{on:curTabTow==index}" class="tabTitle_tow_text">{{item}}</view>
  8. <view :class="{on:curTabTow==index}" class="tabTitle_tow_across"></view>
  9. </view>
  10. </view>
  11. <view class="line"></view>
  12. <view class="search">
  13. <view class="search-l" @click="dialogOpen()">检查指标
  14. <img src="@/pages_safetyCheck/images/icon_06.png">
  15. </view>
  16. <view class="search-r" @click="inspectionItemsClick()">
  17. <img src="@/pages_safetyCheck/images/icon_aqjc_ss.png">
  18. 模糊搜索检查项
  19. </view>
  20. </view>
  21. </view>
  22. <scroll-view scroll-y @scrolltolower="scrollGet" class="info-max-box">
  23. <view class="list">
  24. <view class="total">待整改共{{total}}项</view>
  25. <view class="list-li" v-for="(item,index) in dataList">
  26. <view class="list-li-t" @click="itemsClick(item)">
  27. <img v-if="item.rectifyStatus==0" src="@/pages_safetyCheck/images/icon_zg_zh@1x.png">
  28. <img v-if="item.rectifyStatus==1" src="@/pages_safetyCheck/images/icon_xz_fc@1x.png">
  29. <img v-if="item.rectifyStatus==2" src="@/pages_safetyCheck/images/icon_xz_zg@1x.png">
  30. <view v-if="item.hazardCheckId">{{item.hazardCheckCode}}{{item.hazardCheckName}}</view>
  31. <view v-if="!item.hazardCheckId">{{item.hazardDescribe}}</view>
  32. </view>
  33. <view v-if="item.hazardCheckId" class="list-li-b" @click="hiddenDangerClick(item)">此检查项在当前实验室累计出现<text>{{item.hazardCheckNum}}</text>次隐患
  34. </view>
  35. </view>
  36. </view>
  37. <view class="get-data-null-p" v-if="getDataType">- 没有更多数据 -</view>
  38. </scroll-view>
  39. </view>
  40. </template>
  41. <script>
  42. import {
  43. config
  44. } from '@/api/request/config.js'
  45. import {
  46. securityAppCheckPhotoList,
  47. } from '@/pages_safetyCheck/api/index.js'
  48. export default {
  49. name: "hiddenDangerItems",
  50. components: {
  51. },
  52. data() {
  53. return {
  54. baseUrl: config.base_url,
  55. pageType: 1,
  56. tabTextTow: ['待整改', '已整改', '暂无法整改'],
  57. curTabTow: 0,
  58. form: {
  59. imgDtoList: [],
  60. },
  61. newData: {
  62. },
  63. dialogVisible: false,
  64. // 查询参数
  65. queryParams: {
  66. page: 1,
  67. pageSize: 10,
  68. subId:'',
  69. rectifyStatus:0,
  70. hazardCheckId:'',
  71. searchValue:'',
  72. },
  73. total: 0,
  74. dataList: [],
  75. getDataType: false,
  76. }
  77. },
  78. onLoad(option) {
  79. this.$set(this, 'newData', JSON.parse(decodeURIComponent(option.infoData)));
  80. this.pageType = this.newData.pageType;
  81. this.queryParams.subId=this.newData.subId?this.newData.subId:''
  82. this.queryParams.hazardCheckId=this.newData.hazardCheckId?this.newData.hazardCheckId:''
  83. uni.setNavigationBarTitle({
  84. title: '实验室名称(房间号)'
  85. })
  86. if (this.pageType == 0) {
  87. //检查
  88. this.tabTextTow = ['待检查', '检查中', '已检查']
  89. } else if (this.pageType == 1) {
  90. //复查
  91. this.tabTextTow = ['待复查', '复查完毕', '退回整改']
  92. } else if (this.pageType == 2) {
  93. //整改
  94. this.tabTextTow = ['待整改', '已整改', '暂无法整改']
  95. }
  96. },
  97. onShow() {
  98. },
  99. mounted() {
  100. this.getList()
  101. },
  102. methods: {
  103. //滚动事件
  104. scrollGet() {
  105. let self = this;
  106. if (self.total / self.queryParams.pageSize <= self.queryParams.page) {
  107. this.$set(this, 'getDataType', true);
  108. } else {
  109. this.queryParams.page += 1;
  110. this.$nextTick(() => {
  111. this.getList();
  112. })
  113. }
  114. },
  115. //顶部tab点击
  116. tabClickTow(index) {
  117. this.curTabTow = index;
  118. this.queryParams.rectifyStatus=index;
  119. this.getList()
  120. },
  121. dialogOpen() {
  122. this.dialogVisible = true;
  123. },
  124. dialogClose() {
  125. this.dialogVisible = false;
  126. },
  127. //搜索项跳转
  128. inspectionItemsClick() {
  129. this.newData.pageType=2;//1随手拍检查项
  130. uni.redirectTo({
  131. url: '/pages_safetyCheck/views/itemsManage/hiddenDangerItemsSearch?form=' + encodeURIComponent(
  132. JSON.stringify(this.newData))
  133. });
  134. },
  135. itemsClick(row) {
  136. let infoData = row;
  137. infoData.pageType = this.pageType;
  138. uni.redirectTo({
  139. url: '/pages_safetyCheck/views/inspectManage/inspectAdd?infoData=' + encodeURIComponent(JSON
  140. .stringify(infoData))
  141. });
  142. },
  143. hiddenDangerClick(row) {
  144. let infoData = row;
  145. infoData.pageType = this.pageType;
  146. uni.redirectTo({
  147. url: '/pages_safetyCheck/views/inspectManage/hiddenDangerRecord?infoData=' +
  148. encodeURIComponent(JSON.stringify(infoData))
  149. });
  150. },
  151. //
  152. async getList() {
  153. let self = this;
  154. const {
  155. data
  156. } = await securityAppCheckPhotoList(this.queryParams);
  157. if (data.code == 200) {
  158. if (self.queryParams.page == 1) {
  159. this.dataList = data.data.records;
  160. this.total = data.data.total;
  161. if (data.data.total / self.queryParams.pageSize <= self.queryParams.page) {
  162. this.$set(this, 'getDataType', true);
  163. }
  164. } else {
  165. this.dataList = [...this.dataList, ...data.data.records]
  166. this.total = data.data.total;
  167. if (data.data.total / self.queryParams.pageSize <= self.queryParams.page) {
  168. this.$set(this, 'getDataType', true);
  169. }
  170. }
  171. }
  172. },
  173. }
  174. }
  175. </script>
  176. <style lang="stylus" scoped>
  177. .hiddenDangerItems {
  178. height: 100%;
  179. display flex;
  180. box-sizing: border-box;
  181. #totalColor-A {
  182. color: #0183FA;
  183. background: rgba(1, 131, 250, 0.2);
  184. }
  185. #totalColor-B {
  186. color: #16B531;
  187. background: rgba(22, 181, 49, 0.2);
  188. }
  189. #totalColor-C {
  190. color: #FF8C00;
  191. background: rgba(255, 140, 0, 0.2);
  192. }
  193. .header {
  194. width: 100%;
  195. position: fixed;
  196. top: 0rpx;
  197. z-index: 100;
  198. background: #fff;
  199. .tabTitle_tow {
  200. width: 520rpx;
  201. height: 80rpx;
  202. display flex;
  203. justify-content: flex-start;
  204. align-items: center;
  205. .tabTitle_tow_li {
  206. flex: 1;
  207. position: relative;
  208. text-align center;
  209. .tabTitle_tow_text {
  210. display: inline-block;
  211. font-size: 30rpx;
  212. font-family: PingFang SC;
  213. font-weight: 500;
  214. color: #333333;
  215. line-height: 46rpx;
  216. position: relative;
  217. &.on {
  218. color: #0183FA;
  219. }
  220. }
  221. .tabTitle_tow_across {
  222. width: 50rpx;
  223. height: 4rpx;
  224. background: #0183FA;
  225. border-radius: 2rpx;
  226. margin-left: 38%;
  227. display none;
  228. &.on {
  229. display block;
  230. }
  231. }
  232. }
  233. }
  234. .line {
  235. width: 100%;
  236. height: 20rpx;
  237. background: #F5F5F5;
  238. }
  239. .search {
  240. width: 750rpx;
  241. height: 80rpx;
  242. background: #FFFFFF;
  243. border-radius: 0rpx 0rpx 0rpx 0rpx;
  244. display: flex;
  245. justify-content: flex-start;
  246. align-items: center;
  247. .search-l {
  248. width: 200rpx;
  249. height: 60rpx;
  250. border-radius: 50rpx 50rpx 50rpx 50rpx;
  251. border: 1rpx solid #E0E0E0;
  252. display: flex;
  253. justify-content: space-between;
  254. align-items: center;
  255. padding: 0 20rpx;
  256. box-sizing: border-box;
  257. margin: 0 32rpx 0 30rpx;
  258. >img {
  259. width: 24rpx;
  260. height: 12rpx;
  261. }
  262. }
  263. .search-r {
  264. width: 470rpx;
  265. height: 60rpx;
  266. background: #FFFFFF;
  267. border-radius: 50rpx 50rpx 50rpx 50rpx;
  268. border: 1rpx solid #E0E0E0;
  269. font-size: 24rpx;
  270. color: #999999;
  271. line-height: 60rpx;
  272. text-align: left;
  273. display: flex;
  274. justify-content: flex-start;
  275. align-items: center;
  276. padding: 0 20rpx;
  277. box-sizing: border-box;
  278. >img {
  279. width: 30rpx;
  280. height: 30rpx;
  281. margin-right: 20rpx;
  282. }
  283. }
  284. }
  285. }
  286. .list {
  287. width: 750rpx;
  288. background: #FFFFFF;
  289. margin-top: 200rpx;
  290. padding-bottom: 20rpx;
  291. box-sizing: border-box;
  292. .total {
  293. width: 180rpx;
  294. height: 50rpx;
  295. background: rgba(1, 131, 250, 0.2);
  296. border-radius: 0rpx 0rpx 20rpx 0rpx;
  297. font-size: 24rpx;
  298. color: #0183FA;
  299. line-height: 50rpx;
  300. text-align: left;
  301. padding: 0rpx 22rpx;
  302. box-sizing: border-box;
  303. margin-bottom: 20rpx;
  304. }
  305. .list-li {
  306. margin: 0 30rpx;
  307. .list-li-t {
  308. width: 690rpx;
  309. background: #F5F5F5;
  310. border-radius: 10rpx 10rpx 10rpx 10rpx;
  311. display: flex;
  312. justify-content: flex-start;
  313. padding: 12rpx 20rpx 14rpx 14rpx;
  314. box-sizing: border-box;
  315. margin: 20rpx 0;
  316. >img {
  317. width: 24rpx;
  318. height: 24rpx;
  319. margin-right: 30rpx;
  320. }
  321. >view {
  322. flex: 1;
  323. font-size: 24rpx;
  324. color: #3D3D3D;
  325. line-height: 34rpx;
  326. text-align: left;
  327. }
  328. }
  329. .list-li-b {
  330. font-size: 24rpx;
  331. color: #3D3D3D;
  332. line-height: 24rpx;
  333. text-align: right;
  334. >text {
  335. color: #FF0000;
  336. }
  337. }
  338. }
  339. }
  340. .get-data-null-p {
  341. text-align: center;
  342. height: 100rpx;
  343. line-height: 100rpx;
  344. color: #999;
  345. padding-bottom: 200rpx;
  346. }
  347. }
  348. </style>