hiddenDangerItems.vue 14 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534
  1. <!-- 隐患项 -->
  2. <template>
  3. <view class="hiddenDangerItems">
  4. <view class="header">
  5. <view class="lotName" :class="pageType != 0?'lotNameOne':''" v-if="lotName">{{lotName}}</view>
  6. <view class="line"></view>
  7. <view class="tabTitle_tow">
  8. <view class="tabTitle_tow_li" @tap="tabClickTow(item.value)" :key="index" v-for="(item,index) in tabTextTow">
  9. <view :class="{on:curTabTow==item.value}" class="tabTitle_tow_text">{{item.label}}</view>
  10. <view :class="{on:curTabTow==item.value}" class="tabTitle_tow_across"></view>
  11. </view>
  12. </view>
  13. <view class="line"></view>
  14. <view class="search">
  15. <view class="search-l" v-if="pageType == 0 && curTabTow != 0">
  16. <view :class="checkFlag == 1 ?'search-B':'search-A'" @click="checkFlagChange(1)">符合</view>
  17. <view :class="checkFlag == 0 ?'search-B':'search-A'" @click="checkFlagChange(0)">不符合</view>
  18. </view>
  19. <view class="search-r" :class="(pageType == 0 && curTabTow == 0)||(pageType != 0) ?'search-r-margin':''"
  20. @click="inspectionItemsClick()">
  21. <img src="@/pages_safetyCheck/images/icon_aqjc_ss.png">
  22. {{newData.hazardCheckCode?newData.hazardCheckCode:''}}{{newData.hazardCheckName?newData.hazardCheckName:'搜索检查项'}}
  23. </view>
  24. </view>
  25. <view class="line"></view>
  26. </view>
  27. <scroll-view scroll-y style="overflow-y: scroll;flex:1;" @scrolltolower="scrollGet" class="info-max-box">
  28. <view class="list">
  29. <view class="total" :class="curTabTow == 0?'total-color-1':(curTabTow == 2?'total-color-3':(curTabTow == 1?'total-color-2':''))" v-if="pageType == 0">
  30. {{curTabTow == 0?'待检查共'+total+'项':(curTabTow == 2?'检查中草稿箱共'+total+'项':(curTabTow == 1?'已检查共'+total+'项':''))}}
  31. </view>
  32. <view class="total" :class="curTabTow == 0?'total-color-1':(curTabTow == 1?'total-color-2':(curTabTow == 2?'total-color-3':''))"v-if="pageType == 1">
  33. {{curTabTow == 0?'待复查共'+total+'项':(curTabTow == 1?'复查完毕共'+total+'项':(curTabTow == 2?'退回整改共'+total+'项':''))}}
  34. </view>
  35. <view class="total" :class="curTabTow == 2?'total-color-1':(curTabTow == 0?'total-color-2':(curTabTow == 4?'total-color-3':''))"v-if="pageType == 2">
  36. {{curTabTow == 2?'待整改共'+total+'项':(curTabTow == 1?'已整改共'+total+'项':(curTabTow == 4?'暂无法整改共'+total+'项':''))}}
  37. </view>
  38. <view class="list-li" v-for="(item,index) in dataList" :key="index">
  39. <view class="list-li-t" @click="itemsClick(item)">
  40. <img v-if="item.rectifyStatus==0" src="@/pages_safetyCheck/images/icon_zg_zh@1x.png">
  41. <img v-if="item.rectifyStatus==1" src="@/pages_safetyCheck/images/icon_xz_fc@1x.png">
  42. <img v-if="item.rectifyStatus==2" src="@/pages_safetyCheck/images/icon_xz_zg@1x.png">
  43. <view >{{item.hazardCheckCode}}{{item.hazardCheckName}}</view>
  44. </view>
  45. <view v-if="item.hazardCheckId" class="list-li-b" @click="hiddenDangerClick(item)">
  46. 此检查项在当前实验室累计出现<text>{{item.hazardCheckNum}}</text>次隐患
  47. </view>
  48. </view>
  49. </view>
  50. <view class="get-data-p" v-if="!getDataType">
  51. <img class="get-data-img" src="@/pages_safetyCheck/images/icon_aqjc_sl.png">
  52. <view class="get-data-text">上拉加载</view>
  53. </view>
  54. <view class="get-data-null-p" v-if="getDataType">- 没有更多数据 -</view>
  55. </scroll-view>
  56. </view>
  57. </template>
  58. <script>
  59. import {
  60. config
  61. } from '@/api/request/config.js'
  62. import {
  63. securityAppCheckSetOptionList,
  64. securityAppCheckDangerReviewList,
  65. securityAppCheckDangerGetCheckDangerSubId,
  66. } from '@/pages_safetyCheck/api/index.js'
  67. export default {
  68. name: "hiddenDangerItems",
  69. components: {
  70. },
  71. data() {
  72. return {
  73. baseUrl: config.base_url,
  74. pageType: 1,
  75. tabTextTow: [],
  76. curTabTow: null,
  77. form: {
  78. imgDtoList: [],
  79. },
  80. lotName: null,
  81. newData: {
  82. },
  83. dialogVisible: false,
  84. // 查询参数
  85. queryParams: {
  86. page: 1,
  87. pageSize: 10,
  88. },
  89. //符合/不符合
  90. checkFlag:null,
  91. total: 0,
  92. dataList: [],
  93. getDataType: false,
  94. searchIndex: 0,
  95. }
  96. },
  97. onLoad(option) {
  98. let optionData = JSON.parse(decodeURIComponent(option.infoData));
  99. uni.setNavigationBarTitle({
  100. title: optionData.subName + '(' + (optionData.pageType == 0 ? optionData.roomNum : optionData.subRoom) + ')'
  101. })
  102. this.$set(this, 'pageType', optionData.pageType);
  103. this.$set(this, 'lotName',
  104. optionData.pageType == 0 ? optionData.checkPlanSetVoList.checkName : (
  105. optionData.checkPlanSetVoList.overdueUnrectify ? '整改期限' + optionData.checkPlanSetVoList.checkStartTime +
  106. '(逾期未完成整改关闭实验室)' : '整改期限' + optionData.checkPlanSetVoList.checkStartTime));
  107. this.$set(this, 'tabTextTow',
  108. optionData.pageType == 0 ? [{value: '0',label: '待检查'}, {value: '2',label: '检查中'}, {value: '1',label: '已检查'}] : (
  109. optionData.pageType == 1 ? [{value: '0',label: '待复查'}, {value: '1',label: '复查完毕'}, {value: '2',label: '退回整改'}] : (
  110. optionData.pageType == 2 ? [{value: '2',label: '待整改'}, {value: '1',label: '已整改'}, {value: '4',label: '暂无法整改'}] : []
  111. )))
  112. this.$set(this, 'curTabTow', optionData.pageType == 0 ? '0' : (optionData.pageType == 1 ? '0' : (optionData
  113. .pageType == 2 ? '2' : '')));
  114. this.$set(this, 'newData', optionData);
  115. this.$nextTick(() => {
  116. this.getList()
  117. })
  118. },
  119. onShow() {
  120. },
  121. mounted() {
  122. },
  123. methods: {
  124. //滚动事件
  125. scrollGet() {
  126. let self = this;
  127. if (self.total / self.queryParams.pageSize <= self.queryParams.page) {
  128. this.$set(this, 'getDataType', true);
  129. } else {
  130. this.queryParams.page += 1;
  131. this.$nextTick(() => {
  132. this.getList();
  133. })
  134. }
  135. },
  136. //顶部tab点击
  137. tabClickTow(value) {
  138. this.$set(this,'hazardCheckPro',null);
  139. this.$set(this,'checkFlag',null);
  140. this.$set(this.queryParams,'page',1);
  141. this.$set(this,'curTabTow',value);
  142. this.getList();
  143. },
  144. dialogOpen() {
  145. this.dialogVisible = true;
  146. },
  147. dialogClose() {
  148. this.dialogVisible = false;
  149. },
  150. //符合/不符合
  151. checkFlagChange(type){
  152. if(this.checkFlag == type){
  153. this.$set(this,'checkFlag',null);
  154. }else{
  155. this.$set(this,'checkFlag',type);
  156. }
  157. this.$set(this.queryParams,'page',1);
  158. this.getList()
  159. },
  160. //搜索项跳转
  161. inspectionItemsClick() {
  162. this.pageType = 2; //1随手拍检查项
  163. uni.redirectTo({
  164. url: '/pages_safetyCheck/views/itemsManage/hiddenDangerItemsSearch?form=' + encodeURIComponent(
  165. JSON.stringify(this.newData))
  166. });
  167. },
  168. itemsClick(row) {
  169. let infoData = row;
  170. infoData.pageType = this.pageType;
  171. uni.redirectTo({
  172. url: '/pages_safetyCheck/views/inspectManage/inspectAdd?infoData=' + encodeURIComponent(JSON
  173. .stringify(infoData))
  174. });
  175. },
  176. hiddenDangerClick(row) {
  177. let infoData = row;
  178. infoData.pageType = this.pageType;
  179. uni.redirectTo({
  180. url: '/pages_safetyCheck/views/inspectManage/hiddenDangerRecord?infoData=' +
  181. encodeURIComponent(JSON.stringify(infoData))
  182. });
  183. },
  184. //
  185. async getList() {
  186. let self = this;
  187. let obj = JSON.parse(JSON.stringify(this.queryParams))
  188. if (this.pageType == 0) {
  189. //检查任务
  190. obj.manageId = this.newData.manageId;
  191. obj.checkStatus = this.curTabTow;
  192. obj.checkFlag = this.checkFlag;
  193. const {
  194. data
  195. } = await securityAppCheckSetOptionList(obj);
  196. if (data.code == 200) {
  197. if (self.queryParams.page == 1) {
  198. this.dataList = data.data.records;
  199. this.total = data.data.total;
  200. if (data.data.total / self.queryParams.pageSize <= self.queryParams.page) {
  201. this.$set(this, 'getDataType', true);
  202. }
  203. } else {
  204. this.dataList = [...this.dataList, ...data.data.records]
  205. this.total = data.data.total;
  206. if (data.data.total / self.queryParams.pageSize <= self.queryParams.page) {
  207. this.$set(this, 'getDataType', true);
  208. }
  209. }
  210. }
  211. } else if (this.pageType == 1) {
  212. //复查验证
  213. obj.planId = this.newData.planId;
  214. obj.planSetId = this.newData.planSetId;
  215. obj.subId = this.newData.subId;
  216. obj.appReviewStatus = this.curTabTow;
  217. const {
  218. data
  219. } = await securityAppCheckDangerReviewList(obj);
  220. if (data.code == 200) {
  221. if (self.queryParams.page == 1) {
  222. this.dataList = data.data.records;
  223. this.total = data.data.total;
  224. if (data.data.total / self.queryParams.pageSize <= self.queryParams.page) {
  225. this.$set(this, 'getDataType', true);
  226. }
  227. } else {
  228. this.dataList = [...this.dataList, ...data.data.records]
  229. this.total = data.data.total;
  230. if (data.data.total / self.queryParams.pageSize <= self.queryParams.page) {
  231. this.$set(this, 'getDataType', true);
  232. }
  233. }
  234. }
  235. } else if (this.pageType == 2) {
  236. //隐患整改
  237. obj.planId = this.newData.planId;
  238. obj.planSetId = this.newData.planSetId;
  239. obj.subId = this.newData.subId;
  240. obj.appReviewStatus = this.curTabTow;
  241. const { data } = await securityAppCheckDangerGetCheckDangerSubId(obj);
  242. if (data.code == 200) {
  243. if (self.queryParams.page == 1) {
  244. this.dataList = data.data.records;
  245. this.total = data.data.total;
  246. if (data.data.total / self.queryParams.pageSize <= self.queryParams.page) {
  247. this.$set(this, 'getDataType', true);
  248. }
  249. } else {
  250. this.dataList = [...this.dataList, ...data.data.records]
  251. this.total = data.data.total;
  252. if (data.data.total / self.queryParams.pageSize <= self.queryParams.page) {
  253. this.$set(this, 'getDataType', true);
  254. }
  255. }
  256. }
  257. }
  258. },
  259. }
  260. }
  261. </script>
  262. <style lang="stylus" scoped>
  263. .hiddenDangerItems {
  264. height: 100%;
  265. display flex;
  266. flex-direction: column;
  267. overflow: hidden;
  268. box-sizing: border-box;
  269. #totalColor-A {
  270. color: #0183FA;
  271. background: rgba(1, 131, 250, 0.2);
  272. }
  273. #totalColor-B {
  274. color: #16B531;
  275. background: rgba(22, 181, 49, 0.2);
  276. }
  277. #totalColor-C {
  278. color: #FF8C00;
  279. background: rgba(255, 140, 0, 0.2);
  280. }
  281. .header {
  282. width: 100%;
  283. height: 268rpx;
  284. overflow: hidden;
  285. background: #fff;
  286. .lotName {
  287. height: 70rpx;
  288. line-height: 70rpx;
  289. font-size: 28rpx;
  290. background: rgba(1, 131, 250, 0.2);
  291. color: #0183FA;
  292. text-align: center;
  293. }
  294. .lotNameOne {
  295. background: #F7E0C4;
  296. color: #FF8C00;
  297. }
  298. .tabTitle_tow {
  299. width: 520rpx;
  300. height: 80rpx;
  301. display flex;
  302. justify-content: flex-start;
  303. align-items: center;
  304. .tabTitle_tow_li {
  305. flex: 1;
  306. position: relative;
  307. text-align center;
  308. .tabTitle_tow_text {
  309. display: inline-block;
  310. font-size: 30rpx;
  311. font-family: PingFang SC;
  312. font-weight: 500;
  313. color: #333333;
  314. line-height: 46rpx;
  315. position: relative;
  316. &.on {
  317. color: #0183FA;
  318. }
  319. }
  320. .tabTitle_tow_across {
  321. width: 50rpx;
  322. height: 4rpx;
  323. background: #0183FA;
  324. border-radius: 2rpx;
  325. margin-left: 38%;
  326. display none;
  327. &.on {
  328. display block;
  329. }
  330. }
  331. }
  332. }
  333. .line {
  334. width: 100%;
  335. height: 13rpx;
  336. background: #F5F5F5;
  337. }
  338. .search {
  339. width: 750rpx;
  340. height: 80rpx;
  341. background: #FFFFFF;
  342. border-radius: 0rpx 0rpx 0rpx 0rpx;
  343. display: flex;
  344. justify-content: flex-start;
  345. align-items: center;
  346. .search-l {
  347. display: flex;
  348. justify-content: flex-start;
  349. align-items: center;
  350. margin: 0 20rpx 0 30rpx;
  351. .search-A {
  352. border-radius: 50rpx 50rpx 50rpx 50rpx;
  353. border: 1rpx solid #E0E0E0;
  354. width: 100rpx;
  355. height: 60rpx;
  356. background: #E0E0E0;
  357. font-weight: normal;
  358. font-size: 24rpx;
  359. color: #333333;
  360. line-height: 60rpx;
  361. text-align: center;
  362. margin-right: 10rpx;
  363. }
  364. .search-B {
  365. border-radius: 50rpx 50rpx 50rpx 50rpx;
  366. border: 1rpx solid #0183FA;
  367. width: 100rpx;
  368. height: 60rpx;
  369. background: #0183FA;
  370. font-weight: normal;
  371. font-size: 24rpx;
  372. color: #FFFFFF;
  373. line-height: 60rpx;
  374. text-align: center;
  375. margin-right: 10rpx;
  376. }
  377. }
  378. .search-r-margin {
  379. width: 700rpx !important;
  380. margin: 0 auto;
  381. }
  382. .search-r {
  383. width: 440rpx;
  384. height: 60rpx;
  385. background: #FFFFFF;
  386. border-radius: 50rpx 50rpx 50rpx 50rpx;
  387. border: 1rpx solid #E0E0E0;
  388. font-size: 24rpx;
  389. color: #999999;
  390. line-height: 60rpx;
  391. text-align: left;
  392. display: flex;
  393. justify-content: flex-start;
  394. align-items: center;
  395. padding: 0 20rpx;
  396. box-sizing: border-box;
  397. >img {
  398. width: 30rpx;
  399. height: 30rpx;
  400. margin-right: 20rpx;
  401. }
  402. }
  403. }
  404. }
  405. .list {
  406. width: 750rpx;
  407. background: #FFFFFF;
  408. padding-bottom: 20rpx;
  409. box-sizing: border-box;
  410. .total {
  411. display: inline-block;
  412. height: 50rpx;
  413. background: rgba(1, 131, 250, 0.2);
  414. border-radius: 0rpx 0rpx 20rpx 0rpx;
  415. font-size: 24rpx;
  416. color: #0183FA;
  417. line-height: 50rpx;
  418. text-align: left;
  419. padding: 0rpx 22rpx;
  420. box-sizing: border-box;
  421. margin-bottom: 20rpx;
  422. }
  423. .total-color-1{
  424. background: rgba(1, 131, 250, 0.2);
  425. color: #0183FA;
  426. }
  427. .total-color-2{
  428. background: rgba(22,181,49,0.2);
  429. color: #16B531;
  430. }
  431. .total-color-3{
  432. background: #F7E0C4;
  433. color: #FF8C00;
  434. }
  435. .list-li {
  436. margin: 0 30rpx;
  437. .list-li-t {
  438. width: 690rpx;
  439. background: #F5F5F5;
  440. border-radius: 10rpx 10rpx 10rpx 10rpx;
  441. display: flex;
  442. justify-content: flex-start;
  443. padding: 12rpx 20rpx 14rpx 14rpx;
  444. box-sizing: border-box;
  445. margin: 20rpx 0;
  446. >img {
  447. width: 24rpx;
  448. height: 24rpx;
  449. margin-right: 30rpx;
  450. }
  451. >view {
  452. flex: 1;
  453. font-size: 24rpx;
  454. color: #3D3D3D;
  455. line-height: 34rpx;
  456. text-align: left;
  457. }
  458. }
  459. .list-li-b {
  460. font-size: 24rpx;
  461. color: #3D3D3D;
  462. line-height: 24rpx;
  463. text-align: right;
  464. >text {
  465. color: #FF0000;
  466. }
  467. }
  468. }
  469. }
  470. .get-data-p {
  471. height: 100rpx;
  472. text-align: center;
  473. .get-data-img {
  474. width: 30rpx;
  475. height: 30rpx;
  476. margin: 0 auto;
  477. margin-top: 15rpx;
  478. }
  479. .get-data-text {
  480. text-align: center;
  481. }
  482. }
  483. .get-data-null-p {
  484. height: 100rpx;
  485. line-height: 100rpx;
  486. text-align: center;
  487. }
  488. }
  489. </style>