hiddenDangerItems.vue 17 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667
  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, 'checkFlag', null);
  187. this.$set(this.queryParams, 'page', 1);
  188. this.$set(this, 'curTabTow', value);
  189. this.$set(this, 'dataList', []);
  190. this.getList();
  191. },
  192. dialogOpen() {
  193. this.dialogVisible = true;
  194. },
  195. dialogClose() {
  196. this.dialogVisible = false;
  197. },
  198. //符合/不符合
  199. checkFlagChange(type) {
  200. if (this.checkFlag == type) {
  201. this.$set(this, 'checkFlag', null);
  202. } else {
  203. this.$set(this, 'checkFlag', type);
  204. }
  205. this.$set(this.queryParams, 'page', 1);
  206. this.getList()
  207. },
  208. checkItemModuleButton(type, item) {
  209. if (type == 'open') {
  210. let obj = {
  211. infoType: this.pageType,
  212. checkType: this.curTabTow,
  213. }
  214. if (this.curTabTow == 0) {
  215. //检查
  216. obj.manageId = this.newData.manageId
  217. } else if (this.curTabTow != 0) {
  218. //复查/整改
  219. obj.planId = this.newData.checkPlanSetVoList.planId;
  220. obj.planSetId = this.newData.checkPlanSetVoList.planSetId;
  221. obj.subId = this.newData.subId;
  222. }
  223. this.$set(this, 'propsData', obj);
  224. this.$set(this, 'checkItemModuleType', true);
  225. } else if (type == 'out') {
  226. this.$set(this, 'checkItemModuleType', false);
  227. this.$set(this, 'propsData', {});
  228. } else if (type == 'submit') {
  229. this.itemsClick(item);
  230. }
  231. },
  232. //检查项选中
  233. itemsClick(row) {
  234. let infoData = row;
  235. infoData.pageType = this.pageType;
  236. infoData.itemsStatus = this.curTabTow;
  237. if (this.pageType == 0 && this.curTabTow == 0) {
  238. //待检查
  239. uni.redirectTo({
  240. url: '/pages_safetyCheck/views/inspectManage/inspectAdd?infoData=' + encodeURIComponent(
  241. JSON
  242. .stringify(infoData))
  243. });
  244. }
  245. if (this.pageType == 0 && this.curTabTow == 2) {
  246. //检查中
  247. infoData.checkName=this.newData.checkPlanSetVoList.checkName;
  248. infoData.subName=this.newData.subName;
  249. infoData.roomNum=this.newData.roomNum;
  250. infoData.subRoom=this.newData.subRoom;
  251. uni.redirectTo({
  252. url: '/pages_safetyCheck/views/itemsManage/hiddenDangerItemsDetail?infoData=' +
  253. encodeURIComponent(JSON
  254. .stringify(infoData))
  255. });
  256. }
  257. if (this.pageType == 0 && this.curTabTow == 1) {
  258. //已检查
  259. uni.redirectTo({
  260. url: '/pages_safetyCheck/views/itemsManage/hiddenDangerItemsDetail?infoData=' +
  261. encodeURIComponent(JSON
  262. .stringify(infoData))
  263. });
  264. } else if (this.pageType == 1 && this.curTabTow == 0) {
  265. //待复查
  266. } else if (this.pageType == 1 && this.curTabTow == 0) {
  267. //待整改
  268. }
  269. },
  270. hiddenDangerClick(row) {
  271. let infoData = row;
  272. infoData.pageType = this.pageType;
  273. uni.redirectTo({
  274. url: '/pages_safetyCheck/views/inspectManage/hiddenDangerRecord?infoData=' +
  275. encodeURIComponent(JSON.stringify(infoData))
  276. });
  277. },
  278. //
  279. async getList() {
  280. let self = this;
  281. let obj = JSON.parse(JSON.stringify(this.queryParams))
  282. if (this.pageType == 0) {
  283. //检查任务
  284. obj.manageId = this.newData.manageId;
  285. obj.checkStatus = this.curTabTow;
  286. obj.checkFlag = this.checkFlag;
  287. const {
  288. data
  289. } = await securityAppCheckSetOptionList(obj);
  290. if (data.code == 200) {
  291. if (self.queryParams.page == 1) {
  292. this.dataList = data.data.records;
  293. this.total = data.data.total;
  294. if (data.data.total / self.queryParams.pageSize <= self.queryParams.page) {
  295. this.$set(this, 'getDataType', true);
  296. }
  297. } else {
  298. this.dataList = [...this.dataList, ...data.data.records]
  299. this.total = data.data.total;
  300. if (data.data.total / self.queryParams.pageSize <= self.queryParams.page) {
  301. this.$set(this, 'getDataType', true);
  302. }
  303. }
  304. }
  305. } else if (this.pageType == 1) {
  306. //复查验证
  307. obj.planId = this.newData.checkPlanSetVoList.planId;
  308. obj.planSetId = this.newData.checkPlanSetVoList.planSetId;
  309. obj.subId = this.newData.subId;
  310. obj.appReviewStatus = this.curTabTow;
  311. obj.pageFlag = true;
  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.checkPlanSetVoList.planId;
  333. obj.planSetId = this.newData.checkPlanSetVoList.planSetId;
  334. obj.subId = this.newData.subId;
  335. obj.appReviewStatus = this.curTabTow;
  336. obj.pageFlag = true;
  337. const {
  338. data
  339. } = await securityAppCheckDangerGetCheckDangerSubId(obj);
  340. if (data.code == 200) {
  341. if (self.queryParams.page == 1) {
  342. this.dataList = data.data.records;
  343. this.total = data.data.total;
  344. if (data.data.total / self.queryParams.pageSize <= self.queryParams.page) {
  345. this.$set(this, 'getDataType', true);
  346. }
  347. } else {
  348. this.dataList = [...this.dataList, ...data.data.records]
  349. this.total = data.data.total;
  350. if (data.data.total / self.queryParams.pageSize <= self.queryParams.page) {
  351. this.$set(this, 'getDataType', true);
  352. }
  353. }
  354. }
  355. }
  356. },
  357. //检查完成
  358. async submitBtn() {
  359. let obj = {
  360. manageId: this.newData.manageId,
  361. }
  362. const {
  363. data
  364. } = await securityAppCheckSetOptionFinishCheck(obj);
  365. if (data.code == 200) {
  366. let infoData=this.newData;
  367. uni.redirectTo({
  368. url: '/pages_safetyCheck/views/inspectManage/inspectList?infoData=' + encodeURIComponent(JSON
  369. .stringify(infoData))
  370. });
  371. }
  372. },
  373. }
  374. }
  375. </script>
  376. <style lang="stylus" scoped>
  377. .hiddenDangerItems {
  378. height: 100%;
  379. display flex;
  380. flex-direction: column;
  381. overflow: hidden;
  382. box-sizing: border-box;
  383. #totalColor-A {
  384. color: #0183FA;
  385. background: rgba(1, 131, 250, 0.2);
  386. }
  387. #totalColor-B {
  388. color: #16B531;
  389. background: rgba(22, 181, 49, 0.2);
  390. }
  391. #totalColor-C {
  392. color: #FF8C00;
  393. background: rgba(255, 140, 0, 0.2);
  394. }
  395. .header {
  396. width: 100%;
  397. height: 268rpx;
  398. overflow: hidden;
  399. background: #fff;
  400. .lotName {
  401. height: 70rpx;
  402. line-height: 70rpx;
  403. font-size: 28rpx;
  404. background: rgba(1, 131, 250, 0.2);
  405. color: #0183FA;
  406. text-align: center;
  407. }
  408. .lotNameOne {
  409. background: #F7E0C4;
  410. color: #FF8C00;
  411. }
  412. .tabTitle_tow {
  413. width: 520rpx;
  414. height: 80rpx;
  415. display flex;
  416. justify-content: flex-start;
  417. align-items: center;
  418. .tabTitle_tow_li {
  419. flex: 1;
  420. position: relative;
  421. text-align center;
  422. .tabTitle_tow_text {
  423. display: inline-block;
  424. font-size: 30rpx;
  425. font-family: PingFang SC;
  426. font-weight: 500;
  427. color: #333333;
  428. line-height: 46rpx;
  429. position: relative;
  430. &.on {
  431. color: #0183FA;
  432. }
  433. }
  434. .tabTitle_tow_across {
  435. width: 50rpx;
  436. height: 4rpx;
  437. background: #0183FA;
  438. border-radius: 2rpx;
  439. margin-left: 38%;
  440. display none;
  441. &.on {
  442. display block;
  443. }
  444. }
  445. }
  446. }
  447. .line {
  448. width: 100%;
  449. height: 13rpx;
  450. background: #F5F5F5;
  451. }
  452. .search {
  453. width: 750rpx;
  454. height: 80rpx;
  455. background: #FFFFFF;
  456. border-radius: 0rpx 0rpx 0rpx 0rpx;
  457. display: flex;
  458. justify-content: flex-start;
  459. align-items: center;
  460. .search-l {
  461. display: flex;
  462. justify-content: flex-start;
  463. align-items: center;
  464. margin: 0 20rpx 0 30rpx;
  465. .search-A {
  466. border-radius: 50rpx 50rpx 50rpx 50rpx;
  467. border: 1rpx solid #E0E0E0;
  468. width: 100rpx;
  469. height: 60rpx;
  470. background: #E0E0E0;
  471. font-weight: normal;
  472. font-size: 24rpx;
  473. color: #333333;
  474. line-height: 60rpx;
  475. text-align: center;
  476. margin-right: 10rpx;
  477. }
  478. .search-B {
  479. border-radius: 50rpx 50rpx 50rpx 50rpx;
  480. border: 1rpx solid #0183FA;
  481. width: 100rpx;
  482. height: 60rpx;
  483. background: #0183FA;
  484. font-weight: normal;
  485. font-size: 24rpx;
  486. color: #FFFFFF;
  487. line-height: 60rpx;
  488. text-align: center;
  489. margin-right: 10rpx;
  490. }
  491. }
  492. .search-r-margin {
  493. width: 700rpx !important;
  494. margin: 0 auto;
  495. }
  496. .search-r {
  497. width: 440rpx;
  498. height: 60rpx;
  499. background: #FFFFFF;
  500. border-radius: 50rpx 50rpx 50rpx 50rpx;
  501. border: 1rpx solid #E0E0E0;
  502. font-size: 24rpx;
  503. color: #999999;
  504. line-height: 60rpx;
  505. text-align: left;
  506. display: flex;
  507. justify-content: flex-start;
  508. align-items: center;
  509. padding: 0 20rpx;
  510. box-sizing: border-box;
  511. >img {
  512. width: 30rpx;
  513. height: 30rpx;
  514. margin-right: 20rpx;
  515. }
  516. }
  517. }
  518. }
  519. .list {
  520. width: 750rpx;
  521. background: #FFFFFF;
  522. padding-bottom: 20rpx;
  523. box-sizing: border-box;
  524. .total {
  525. display: inline-block;
  526. height: 50rpx;
  527. background: rgba(1, 131, 250, 0.2);
  528. border-radius: 0rpx 0rpx 20rpx 0rpx;
  529. font-size: 24rpx;
  530. color: #0183FA;
  531. line-height: 50rpx;
  532. text-align: left;
  533. padding: 0rpx 22rpx;
  534. box-sizing: border-box;
  535. margin-bottom: 20rpx;
  536. }
  537. .total-color-1 {
  538. background: rgba(1, 131, 250, 0.2);
  539. color: #0183FA;
  540. }
  541. .total-color-2 {
  542. background: rgba(22, 181, 49, 0.2);
  543. color: #16B531;
  544. }
  545. .total-color-3 {
  546. background: #F7E0C4;
  547. color: #FF8C00;
  548. }
  549. .list-li {
  550. margin: 0 30rpx;
  551. .list-li-t {
  552. width: 690rpx;
  553. background: #F5F5F5;
  554. border-radius: 10rpx 10rpx 10rpx 10rpx;
  555. display: flex;
  556. justify-content: flex-start;
  557. padding: 12rpx 20rpx 14rpx 14rpx;
  558. box-sizing: border-box;
  559. margin: 20rpx 0;
  560. >view:nth-of-type(1) {
  561. >img {
  562. width: 24rpx;
  563. height: 24rpx;
  564. margin-right: 30rpx;
  565. }
  566. }
  567. >view:nth-of-type(2) {
  568. flex: 1;
  569. font-size: 24rpx;
  570. color: #3D3D3D;
  571. line-height: 34rpx;
  572. text-align: left;
  573. }
  574. }
  575. .list-li-b {
  576. font-size: 24rpx;
  577. color: #3D3D3D;
  578. line-height: 24rpx;
  579. text-align: right;
  580. >text {
  581. color: #FF0000;
  582. }
  583. }
  584. }
  585. }
  586. .get-data-p {
  587. height: 100rpx;
  588. text-align: center;
  589. .get-data-img {
  590. width: 30rpx;
  591. height: 30rpx;
  592. margin: 0 auto;
  593. margin-top: 15rpx;
  594. }
  595. .get-data-text {
  596. text-align: center;
  597. }
  598. }
  599. .get-data-null-p {
  600. height: 100rpx;
  601. line-height: 100rpx;
  602. text-align: center;
  603. }
  604. .sub-btn {
  605. width: 686rpx;
  606. height: 100rpx;
  607. background: #0183FA;
  608. border-radius: 50rpx 50rpx 50rpx 50rpx;
  609. position: fixed;
  610. left: 30rpx;
  611. bottom: 30rpx;
  612. font-weight: 400;
  613. font-size: 30rpx;
  614. color: #FFFFFF;
  615. line-height: 100rpx;
  616. text-align: center;
  617. }
  618. }
  619. </style>