hiddenDangerItems.vue 17 KB

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