hiddenDangerItems.vue 16 KB

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