hiddenDangerItems.vue 9.3 KB

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