hiddenDangerItems.vue 9.6 KB

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