hiddenDangerItems.vue 15 KB

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