hiddenDangerItems.vue 14 KB

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