safetyCheck.vue 16 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738
  1. <!-- 计划列表 -->
  2. <template>
  3. <view class="planDetail">
  4. <view class="header">
  5. <img class="header-bg" :src="imagesUrl('commonality/bg_1.png')">
  6. <view class="tabTitle">
  7. <view class="tabTitle_li" @tap="tabClick(index)" :key="index" v-for="(item,index) in tabText">
  8. <view class="tabTitle_text">
  9. <img :src="item.img">
  10. <view
  11. :id="curTab==index && curTab==0?'fontColor-A':(curTab==index && curTab==1?'fontColor-B':'')">
  12. {{item.name}}
  13. </view>
  14. <view>{{item.title}}</view>
  15. </view>
  16. <view class="line"></view>
  17. <view :class="{on:curTab==index}" class="tabTitle_across">
  18. <img :src="imagesUrl('commonality/img_xyzc_bg@1x.png')">
  19. </view>
  20. </view>
  21. </view>
  22. </view>
  23. <!-- 列表部分 -->
  24. <scroll-view scroll-y @scrolltolower="scrollGet" class="for-max-box">
  25. <view class="list">
  26. <view class="list-li" @click="planClick(item)" v-for="(item,index) in dataList">
  27. <img :src="imagesUrl('safetyCheck/icon_aqjc_jh@1x.png')">
  28. <view>{{item.planTitle}}</view>
  29. <img :src="imagesUrl('commonality/icon_wd_gd@1x.png')">
  30. </view>
  31. </view>
  32. <view class="get-data-p" v-if="!getDataType">
  33. <img class="get-data-img" :src="imagesUrl('safetyCheck/icon_aqjc_sl.png')">
  34. <view class="get-data-text">上拉加载</view>
  35. </view>
  36. <view class="get-data-null-p" v-if="getDataType">- 没有更多数据 -</view>
  37. </scroll-view>
  38. <view class="subBtn">
  39. <img class="subBtn-img" @click="saoCode()"
  40. :src="imagesUrl('safetyCheck/icon_aqjc_saoma.png')">
  41. </view>
  42. <!-- 弹窗部分 -->
  43. <view class="shade" v-if="dialogVisible">
  44. <view class="null-box" @click="dialogClose()"></view>
  45. <view class="shade_n">
  46. <view class="title">
  47. <view>检查批次</view>
  48. </view>
  49. <view class="batch">
  50. <view class="batch-li" @click="batchClick(item)"
  51. v-for="(item,index) in batchList.checkPlanSetVoList">
  52. <view class="batch-li-l">
  53. <text>{{item.checkName}}</text>
  54. <text>开始检查日期:{{item.checkStartTime}}</text>
  55. </view>
  56. <view class="batch-li-r">检查进度{{item.checkSetProgress}}%
  57. <img :src="imagesUrl('commonality/icon_wd_gd@1x.png')">
  58. </view>
  59. </view>
  60. </view>
  61. </view>
  62. </view>
  63. <view class="shade-box" v-if="securityCheck">
  64. <view class="null-box" @click="goPage('securityCheck',false)"></view>
  65. <view class="shade_n">
  66. <view class="title">
  67. <view>请选择实验室</view>
  68. </view>
  69. <view class="batch">
  70. <view class="batch-li" @click="batchClickTow(item)" v-for="(item,index) in subjectData">
  71. <view class="batch-li-l">
  72. <text>{{item.planTitle}}-{{item.checkName}}</text>
  73. <text>{{item.subName}}{{item.roomNum?'('+item.roomNum+')':''}}</text>
  74. </view>
  75. <view class="batch-li-r">
  76. <img :src="imagesUrl('commonality/icon_wd_gd@1x.png')">
  77. </view>
  78. </view>
  79. </view>
  80. </view>
  81. </view>
  82. </view>
  83. </template>
  84. <script>
  85. import {
  86. config
  87. } from '@/api/request/config.js'
  88. import {
  89. securityAppCheckPlanTitleList,
  90. } from '@/pages_safetyCheck/api/index.js'
  91. import {
  92. securityAppCheckPlanScanCode,
  93. } from '@/pages_safetyCheck/api/index.js'
  94. import { pageScanCode } from '@/utils/scanTheCode'
  95. export default {
  96. name: "planDetail",
  97. data() {
  98. return {
  99. pageType: 0,
  100. tabText: [{
  101. name: '校级检查',
  102. title: '学校检查计划',
  103. img: this.imagesUrl('safetyCheck/icon_aqjc_xjjc@1x.png'),
  104. },
  105. {
  106. name: '学院自查',
  107. title: '学院自查计划',
  108. img: this.imagesUrl('safetyCheck/icon_aqjc_xxzc@1x.png'),
  109. },
  110. // {
  111. // name: '现场检查',
  112. // title: '检查隐患草稿',
  113. // img: this.imagesUrl('safetyCheck/icon_aqjc_xcjc@1x.png'),
  114. // },
  115. {
  116. name: '随手拍',
  117. title: '隐患上报整改',
  118. img: this.imagesUrl('safetyCheck/icon_aqjc_ssp@1x.png'),
  119. },
  120. ],
  121. //校级/院级
  122. curTab: 0,
  123. queryParams: {
  124. page: 1,
  125. pageSize: 20,
  126. checkCategory: 1, //1校院巡查 2学院自查
  127. },
  128. total: 0,
  129. dataList: [],
  130. getDataType: false,
  131. dialogVisible: false,
  132. batchList: [],
  133. batchData: {},
  134. securityCheck:false,
  135. subjectData: [],
  136. }
  137. },
  138. onLoad(option) {
  139. this.$set(this,'securityCheck',false)
  140. this.getList()
  141. },
  142. onShow() {
  143. this.acceptSaoCode();
  144. },
  145. onHide() {
  146. uni.$off('acceptSaoCode');
  147. },
  148. mounted() {
  149. },
  150. methods: {
  151. //滚动加载事件
  152. scrollGet() {
  153. let self = this;
  154. if (self.total / self.queryParams.pageSize <= self.queryParams.page) {
  155. this.$set(this, 'getDataType', true);
  156. } else {
  157. this.queryParams.page += 1;
  158. this.$nextTick(() => {
  159. this.getList();
  160. })
  161. }
  162. },
  163. /******调用摄像头******/
  164. saoCode() {
  165. pageScanCode();
  166. },
  167. acceptSaoCode(){
  168. let self = this;
  169. uni.$on('acceptSaoCode', (codeData) => {
  170. if (codeData.subId) {
  171. self.securityAppCheckPlanScanCode(codeData.subId,self.planSetId);
  172. } else {
  173. uni.showToast({
  174. title: '请扫描正确的二维码',
  175. icon: "none",
  176. mask: true,
  177. duration: 2000
  178. });
  179. }
  180. });
  181. },
  182. //查询计划
  183. async securityAppCheckPlanScanCode(subId,planSetId) {
  184. let self = this;
  185. let checkCategory = null;
  186. if(uni.getStorageSync('identityData')){
  187. if(uni.getStorageSync('identityData').type=='collegeAdmin'){
  188. checkCategory=2
  189. }else if(uni.getStorageSync('identityData').type=='schoolAdmin'){
  190. checkCategory=1
  191. }
  192. }
  193. let obj = {
  194. subId:subId,
  195. checkCategory:checkCategory,
  196. };
  197. if(planSetId){
  198. obj.planSetId = planSetId;
  199. }
  200. const {
  201. data
  202. } = await securityAppCheckPlanScanCode(obj);
  203. if (data.code == 200) {
  204. if(data.data[0]){
  205. if(data.data[1]){
  206. //多个
  207. self.$set(self,'subjectData',data.data);
  208. self.$set(self,'securityCheck',true);
  209. }else{
  210. //单个
  211. let infoData = data.data[0];
  212. infoData.pageType = 0;
  213. uni.navigateTo({
  214. url: '/pages_safetyCheck/views/itemsManage/hiddenDangerItems?infoData=' + encodeURIComponent(
  215. JSON.stringify(infoData))
  216. });
  217. }
  218. }else{
  219. //没有
  220. uni.showToast({
  221. title: '该实验室暂无检查计划!',
  222. icon: "none",
  223. mask: true,
  224. duration: 2000
  225. });
  226. }
  227. }
  228. },
  229. batchClickTow(row) {
  230. let infoData = row;
  231. infoData.pageType = 0;
  232. uni.navigateTo({
  233. url: '/pages_safetyCheck/views/itemsManage/hiddenDangerItems?infoData=' + encodeURIComponent(
  234. JSON.stringify(infoData))
  235. });
  236. },
  237. //安全检查扫码控制显示隐藏
  238. goPage(type,status) {
  239. if (type == 'securityCheck') {
  240. if(status){
  241. this.$set(this, "securityCheck", true)
  242. }else{
  243. this.$set(this, "securityCheck", false)
  244. }
  245. }
  246. },
  247. //顶部tab点击
  248. tabClick(index) {
  249. this.$set(this.queryParams, 'page', 1);
  250. this.$set(this, 'total', 0);
  251. if (this.curTab != index) {
  252. this.$set(this, 'dataList', []);
  253. if (index == 0) {
  254. //校级检查
  255. this.$set(this, 'curTab', index);
  256. this.$set(this.queryParams, 'checkCategory', 1);
  257. this.getList()
  258. } else if (index == 1) {
  259. //学院自查
  260. this.$set(this, 'curTab', index);
  261. this.$set(this.queryParams, 'checkCategory', 2);
  262. this.getList()
  263. } else if (index == 2) {
  264. //随手拍
  265. uni.navigateTo({
  266. url: "/pages_safetyCheck/views/snapshotManage/snapshotList",
  267. });
  268. }
  269. }
  270. },
  271. //检查批次点击
  272. batchClick(row) {
  273. this.$set(this.batchData, 'checkPlanSetVoList', row);
  274. this.$nextTick(() => {
  275. uni.navigateTo({
  276. url: '/pages_safetyCheck/views/inspectManage/inspectList?infoData=' +
  277. encodeURIComponent(JSON.stringify(this.batchData))
  278. });
  279. })
  280. },
  281. planClick(row) {
  282. if (row.checkPlanSetVoList.length > 1) {
  283. this.$set(this, 'batchData', {
  284. planId: row.planId,
  285. planTitle: row.planTitle,
  286. checkCategory: row.checkCategory,
  287. checkTypeName: row.checkTypeName,
  288. crossCheck: row.crossCheck,
  289. });
  290. this.$set(this, 'batchList', row);
  291. this.dialogVisible = true;
  292. } else {
  293. //如果只有1个检查批次不弹窗
  294. this.$set(this, 'batchData', {
  295. planId: row.planId,
  296. planTitle: row.planTitle,
  297. checkCategory: row.checkCategory,
  298. checkTypeName: row.checkTypeName,
  299. crossCheck: row.crossCheck,
  300. checkPlanSetVoList: row.checkPlanSetVoList[0]
  301. });
  302. this.$nextTick(() => {
  303. uni.navigateTo({
  304. url: '/pages_safetyCheck/views/inspectManage/inspectList?infoData=' +
  305. encodeURIComponent(JSON.stringify(this.batchData))
  306. });
  307. })
  308. }
  309. },
  310. dialogClose() {
  311. this.dialogVisible = false;
  312. },
  313. async getList() {
  314. let self = this;
  315. const {
  316. data
  317. } = await securityAppCheckPlanTitleList(this.queryParams);
  318. if (data.code == 200) {
  319. if (self.queryParams.page == 1) {
  320. this.dataList = data.data.records;
  321. this.total = data.data.total;
  322. if (data.data.total / self.queryParams.pageSize <= self.queryParams.page) {
  323. this.$set(this, 'getDataType', true);
  324. }
  325. } else {
  326. this.dataList = [...this.dataList, ...data.data.records]
  327. this.total = data.data.total;
  328. if (data.data.total / self.queryParams.pageSize <= self.queryParams.page) {
  329. this.$set(this, 'getDataType', true);
  330. }
  331. }
  332. }
  333. },
  334. },
  335. }
  336. </script>
  337. <style lang="stylus" scoped>
  338. .planDetail {
  339. height: 100%;
  340. display: flex;
  341. flex-direction: column;
  342. .header {
  343. width: 100%;
  344. height: 482rpx;
  345. // position: fixed;
  346. // top: 0rpx;
  347. // z-index: 100;
  348. .header-bg {
  349. width: 750rpx;
  350. height: 310rpx;
  351. position: absolute;
  352. }
  353. .tabTitle {
  354. width: 690rpx;
  355. height: 242rpx;
  356. background: #FFFFFF;
  357. border-radius: 20rpx 20rpx 20rpx 20rpx;
  358. display flex;
  359. justify-content: flex-start;
  360. align-items: center;
  361. position: absolute;
  362. left: 30rpx;
  363. top: 208rpx;
  364. .tabTitle_li {
  365. height: 242rpx;
  366. flex: 1;
  367. position: relative;
  368. text-align center;
  369. .line {
  370. width: 2rpx;
  371. height: 20rpx;
  372. background: #D8D8D8;
  373. border-radius: 0rpx 0rpx 0rpx 0rpx;
  374. position: absolute;
  375. top: 40%;
  376. }
  377. .tabTitle_text {
  378. display: flex;
  379. justify-content: center;
  380. flex-direction: column;
  381. align-items: center;
  382. >img {
  383. width: 82rpx;
  384. height: 82rpx;
  385. margin-top: 44rpx;
  386. }
  387. >view:nth-of-type(1) {
  388. font-size: 30rpx;
  389. color: #333333;
  390. line-height: 40rpx;
  391. text-align: left;
  392. margin-top: 8rpx;
  393. }
  394. >view:nth-of-type(2) {
  395. font-size: 24rpx;
  396. color: #666666;
  397. line-height: 30rpx;
  398. text-align: left;
  399. margin-top: 6rpx;
  400. }
  401. position: relative;
  402. &.on {}
  403. }
  404. .tabTitle_across {
  405. /* width: 50rpx;
  406. height: 4rpx;
  407. background: #0183FA;
  408. border-radius: 2rpx; */
  409. margin-left: 38%;
  410. margin-top: 37rpx;
  411. display none;
  412. >img {
  413. width: 40rpx;
  414. height: 26rpx;
  415. }
  416. &.on {
  417. display block;
  418. }
  419. }
  420. }
  421. }
  422. }
  423. .for-max-box {
  424. flex: 1;
  425. overflow-y scroll;
  426. .list {
  427. width: 690rpx;
  428. margin-left: 30rpx;
  429. background: #FFFFFF;
  430. border-radius: 20rpx 20rpx 20rpx 20rpx;
  431. .list-li:nth-child(1) {
  432. border-top: none;
  433. }
  434. .list-li {
  435. border-top: 1rpx dashed #E0E0E0;
  436. height: 100rpx;
  437. display: flex;
  438. justify-content: flex-start;
  439. align-items: center;
  440. padding: 0 30rpx;
  441. box-sizing: border-box;
  442. >view:nth-of-type(1) {
  443. flex: 1;
  444. font-size: 28rpx;
  445. color: #333333;
  446. line-height: 39rpx;
  447. text-align: left;
  448. margin: 0 52rpx 0 20rpx;
  449. overflow: hidden;
  450. text-overflow: ellipsis;
  451. white-space: nowrap;
  452. }
  453. >img:nth-of-type(1) {
  454. width: 42rpx;
  455. height: 42rpx;
  456. }
  457. >img:nth-of-type(2) {
  458. width: 24rpx;
  459. height: 24rpx;
  460. }
  461. }
  462. }
  463. .get-data-p {
  464. height: 100rpx;
  465. text-align: center;
  466. .get-data-img {
  467. width: 30rpx;
  468. height: 30rpx;
  469. margin: 0 auto;
  470. margin-top: 15rpx;
  471. }
  472. .get-data-text {
  473. text-align: center;
  474. }
  475. }
  476. .get-data-null-p {
  477. height: 100rpx;
  478. line-height: 100rpx;
  479. text-align: center;
  480. }
  481. }
  482. .shade {
  483. height: 100%;
  484. width: 100%;
  485. position: fixed;
  486. display: flex;
  487. flex-direction: column;
  488. z-index: 200;
  489. background: rgba(0, 0, 0, 0.2);
  490. .null-box {
  491. flex: 1;
  492. }
  493. .shade_n {
  494. position: absolute;
  495. bottom: 0;
  496. left: 0;
  497. width: 750rpx;
  498. height: 466rpx;
  499. background: #FFFFFF;
  500. border-radius: 20rpx 20rpx 0rpx 0rpx;
  501. overflow-y: auto;
  502. .title {
  503. display: flex;
  504. justify-content: space-between;
  505. align-items: center;
  506. padding: 0 50rpx 0 284rpx;
  507. box-sizing: border-box;
  508. border-bottom: 1rpx solid #E0E0E0;
  509. >view {
  510. font-size: 30rpx;
  511. color: #3D3D3D;
  512. line-height: 90rpx;
  513. text-align: left;
  514. }
  515. >img {
  516. width: 24rpx;
  517. height: 12rpx;
  518. }
  519. }
  520. .batch {
  521. padding: 0 30rpx;
  522. box-sizing: border-box;
  523. .batch-li {
  524. display: flex;
  525. justify-content: space-between;
  526. align-items: center;
  527. border-bottom: 1rpx solid #E0E0E0;
  528. padding: 20rpx 0 16rpx 0rpx;
  529. box-sizing: border-box;
  530. .batch-li-l {
  531. >text:nth-of-type(1) {
  532. display: block;
  533. font-size: 30rpx;
  534. color: #333333;
  535. line-height: 42rpx;
  536. text-align: left;
  537. }
  538. >text:nth-of-type(2) {
  539. display: block;
  540. font-size: 28rpx;
  541. color: #666666;
  542. line-height: 39rpx;
  543. text-align: left;
  544. margin-top: 6rpx;
  545. }
  546. }
  547. .batch-li-r {
  548. font-size: 28rpx;
  549. color: #666666;
  550. line-height: 39rpx;
  551. text-align: left;
  552. display: flex;
  553. justify-content: flex-start;
  554. align-items: center;
  555. >img {
  556. width: 24rpx;
  557. height: 24rpx;
  558. margin-left: 9rpx;
  559. }
  560. }
  561. }
  562. }
  563. }
  564. }
  565. #fontColor-A {
  566. color: #0040C1;
  567. }
  568. #fontColor-B {
  569. color: #009519;
  570. }
  571. #bgColor-A {
  572. color: #0183FA;
  573. background: rgba(1, 131, 250, 0.2);
  574. }
  575. #bgColor-B {
  576. color: #16B531;
  577. background: rgba(22, 181, 49, 0.2);
  578. }
  579. .subBtn{
  580. position: fixed;
  581. bottom: 90rpx;
  582. left: 295rpx;
  583. z-index: 100;
  584. .subBtn-img{
  585. width: 160rpx;
  586. height: 160rpx;
  587. }
  588. }
  589. .shade-box {
  590. height: 100%;
  591. width: 100%;
  592. position: fixed;
  593. display: flex;
  594. flex-direction: column;
  595. z-index: 200;
  596. background: rgba(0, 0, 0, 0.2);
  597. top: 0;
  598. .null-box {
  599. flex: 1;
  600. }
  601. .shade_n {
  602. position: absolute;
  603. bottom: 0;
  604. left: 0;
  605. width: 750rpx;
  606. height: 466rpx;
  607. background: #FFFFFF;
  608. border-radius: 20rpx 20rpx 0rpx 0rpx;
  609. overflow-y: auto;
  610. .title {
  611. display: flex;
  612. justify-content: space-between;
  613. align-items: center;
  614. padding: 0 50rpx 0 284rpx;
  615. box-sizing: border-box;
  616. border-bottom: 1rpx solid #E0E0E0;
  617. >view {
  618. font-size: 30rpx;
  619. color: #3D3D3D;
  620. line-height: 90rpx;
  621. text-align: left;
  622. }
  623. >img {
  624. width: 24rpx;
  625. height: 12rpx;
  626. }
  627. }
  628. .batch {
  629. padding: 0 30rpx;
  630. box-sizing: border-box;
  631. .batch-li {
  632. display: flex;
  633. justify-content: space-between;
  634. align-items: center;
  635. border-bottom: 1rpx solid #E0E0E0;
  636. padding: 20rpx 0 16rpx 0rpx;
  637. box-sizing: border-box;
  638. .batch-li-l {
  639. >text:nth-of-type(1) {
  640. display: block;
  641. font-size: 30rpx;
  642. color: #333333;
  643. line-height: 42rpx;
  644. text-align: left;
  645. }
  646. >text:nth-of-type(2) {
  647. display: block;
  648. font-size: 28rpx;
  649. color: #666666;
  650. line-height: 39rpx;
  651. text-align: left;
  652. margin-top: 6rpx;
  653. }
  654. }
  655. .batch-li-r {
  656. font-size: 28rpx;
  657. color: #666666;
  658. line-height: 39rpx;
  659. text-align: left;
  660. display: flex;
  661. justify-content: flex-start;
  662. align-items: center;
  663. >img {
  664. width: 24rpx;
  665. height: 24rpx;
  666. margin-left: 9rpx;
  667. }
  668. }
  669. }
  670. }
  671. }
  672. }
  673. }
  674. </style>