teacherHome.vue 16 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619
  1. <!-- 教师首页 -->
  2. <template>
  3. <view class="teacherHome">
  4. <dataBoard v-if="pageType == 1" style="display: flex;flex-direction:column;flex:1;"></dataBoard>
  5. <view class="home-page" v-if="pageType == 2">
  6. <nav-bar :title="title" :background="background"></nav-bar>
  7. <view class="top-back-img" :style="{top:navHeight+'rpx'}">
  8. <img class="position-data-button" @click="goPage('dataBoard')" v-if="dataPageType" :src="imagesUrl('home/icon_sy_sjmb@1x.png')">
  9. <img class="position-img" :src="rectangleLogo">
  10. </view>
  11. <view class="button-one-box">
  12. <view class="button-min" @click="goPage('securityExamination')" style="margin:23rpx 0 0 20rpx;">
  13. <img class="button-img" :src="imagesUrl('home/icon_sy_aqks@1x.png')">
  14. <view class="button-name">教育考试</view>
  15. </view>
  16. <view class="button-min" @click="goPage('securityAdmittance')" style="margin:23rpx 65rpx 0;">
  17. <img class="button-img" :src="imagesUrl('home/icon_sy_aqzr@1x.png')">
  18. <view class="button-name">安全准入</view>
  19. </view>
  20. <view class="button-min" @click="goPage('hierarchicalControl')" style="margin:23rpx 20rpx 0 0;">
  21. <img class="button-img" :src="imagesUrl('home/icon_sy_fjgk@1x.png')">
  22. <view class="button-name">分级管控</view>
  23. </view>
  24. <view class="button-min" @click="goPage('securityCheck')" style="margin:23rpx 0 0 20rpx;">
  25. <img class="button-img" :src="imagesUrl('home/icon_sy_aqjc@1x.png')">
  26. <view class="button-name">安全检查</view>
  27. </view>
  28. <!-- <view class="button-min" @click="goPage('securityResponsibility')">
  29. <img class="button-img" :src="imagesUrl('home/icon_sy_aqzrr@1x.png')">
  30. <view class="button-name">安全责任</view>
  31. </view> -->
  32. <view class="button-min" @click="goPage('deviceManagement')" style="margin:23rpx 65rpx 0;">
  33. <img class="button-img" :src="imagesUrl('home/icon_sy_sbgl@1x.png')">
  34. <view class="button-name">设备管理</view>
  35. </view>
  36. <view class="button-min" @click="goPage('emergencyDisposal')" style="margin:23rpx 20rpx 0 0;">
  37. <img class="button-img" :src="imagesUrl('home/icon_sy_yjcz@1x.png')">
  38. <view class="button-name">应急处置</view>
  39. </view>
  40. <view class="button-min" @click="goPage('hazardousWasteRecyclingPupil')" style="margin:23rpx 0 0 20rpx;">
  41. <img class="button-img" :src="imagesUrl('home/icon_sy_hxp@1x.png')">
  42. <view class="button-name">危废回收</view>
  43. </view>
  44. <!-- <view class="button-min" @click="goPage('cageSiteManagement')">
  45. <img class="button-img" :src="imagesUrl('home/icon_sy_lwgl@1x.png')">
  46. <view class="button-name">笼位管理</view>
  47. </view> -->
  48. </view>
  49. <topWarn></topWarn>
  50. <view class="button-two-box">
  51. <view class="button-big-box" @click="goPage('snapshot')"
  52. style="background-color: #DFF0FF;margin-right:20rpx;">
  53. <img :src="imagesUrl('home/icon_sy_ssp@1x.png')">
  54. <view class="button-min-box">
  55. <view>随手拍</view>
  56. <view>隐患上报</view>
  57. </view>
  58. </view>
  59. <view class="button-big-box" @click="goPage('remoteDoorOpening')" style="background-color: #D6EBDA;">
  60. <img :src="imagesUrl('home/img_sy_yckm@1x.png')">
  61. <view class="button-min-box">
  62. <view>远程开门</view>
  63. <view>打开门禁</view>
  64. </view>
  65. </view>
  66. </view>
  67. <view class="button-two-box">
  68. <view class="button-big-box" @click="goPage('leaveCheckPupilTeacher')"
  69. style="background-color: #FFF0DD;margin-right:20rpx;">
  70. <img :src="imagesUrl('home/home_button_04.png')">
  71. <view class="button-min-box">
  72. <view>离开检查</view>
  73. <view>拍照上传</view>
  74. </view>
  75. </view>
  76. <view class="button-big-box" @click="goPage('cageSiteManagement')"
  77. style="background-color: rgba(201,159,255,0.2);">
  78. <img :src="imagesUrl('home/home_button_03.png')">
  79. <view class="button-min-box">
  80. <view>笼位管理</view>
  81. <view>实验动物中心</view>
  82. </view>
  83. </view>
  84. </view>
  85. <view class="button-three-box">
  86. <view class="button-big-box button-big-box-1" @click="goPage('facilityReservation')">
  87. <img :src="imagesUrl('home/img_ssyy@1x.png')">
  88. <view class="button-min-box">
  89. <view>设施预约</view>
  90. <view>预约审批 | 设施确认 | 费用结算</view>
  91. </view>
  92. </view>
  93. </view>
  94. <!-- <view class="button-three-box-1">
  95. <view class="button-big-box" @click="goPage('leaveCheckPupilTeacher')">
  96. <img :src="imagesUrl('home/img_lkjc@1x.png')">
  97. <view class="button-min-box">
  98. <view>离开检查</view>
  99. <view>拍照上传</view>
  100. </view>
  101. </view>
  102. </view>
  103. <view class="button-three-box">
  104. <view class="button-big-box" @click="goPage('cageSiteManagement')">
  105. <img :src="imagesUrl('home/img_lwgl@1x.png')">
  106. <view class="button-min-box">
  107. <view>笼位管理</view>
  108. <view>实验动物中心</view>
  109. </view>
  110. </view>
  111. </view> -->
  112. <!-- <view class="button-three-box">
  113. <view class="button-big-box" @click="goPage()">
  114. <img :src="imagesUrl('home/img_bg_hxpgk@1x.png')">
  115. <view class="button-min-box">
  116. <view>化学品智能管控</view>
  117. <view>申购审批丨使用台账丨实验室库存</view>
  118. </view>
  119. </view>
  120. </view> -->
  121. <img class="scan_btn" @click.stop="saoCode" :src="imagesUrl('commonality/icon_xyxc_sm.png')">
  122. <tab-bar></tab-bar>
  123. </view>
  124. </view>
  125. </template>
  126. <script>
  127. import {
  128. pageRestrictVerify
  129. } from '@/utils/index'
  130. import {
  131. chemicalAppletSelectStockInfo,
  132. laboratorySubPassOutIsotopeSubSign,
  133. systemUserProfile,
  134. } from '@/pages/api/index.js'
  135. import {
  136. tabBar
  137. } from '@/pages/component/tabBar.vue'
  138. import {
  139. navBar
  140. } from '@/pages/component/navbar.vue'
  141. import {
  142. topWarn
  143. } from '@/pages/component/topWarn.vue'
  144. import {
  145. dataBoard
  146. } from '@/pages/views/dataBoard/dataBoard.vue'
  147. export default {
  148. name: "teacherHome",
  149. components: {
  150. tabBar,
  151. navBar,
  152. topWarn,
  153. dataBoard,
  154. },
  155. data() {
  156. return {
  157. pageType: 2,
  158. navHeight: uni.getStorageSync('navHeight'),
  159. dataPageType: false,
  160. title: '实验室安全智慧化管控系统',
  161. background: '#0183FA',
  162. rectangleLogo: uni.getStorageSync('rectangleLogo'),
  163. identityData:uni.getStorageSync('identityData'),
  164. }
  165. },
  166. created() {
  167. if (pageRestrictVerify('dataBoard')) {
  168. this.dataPageType = true;
  169. if (!uni.getStorageSync('dataBoardType')) {
  170. this.pageType = 1;
  171. uni.setStorageSync('dataBoardType', true);
  172. }
  173. }
  174. },
  175. mounted() {
  176. this.systemUserProfile();
  177. },
  178. methods: {
  179. //获取个人信息
  180. async systemUserProfile() {
  181. const {
  182. data
  183. } = await systemUserProfile();
  184. if (data.code == 200) {
  185. this.$set(this, 'userData', data.data)
  186. uni.setStorageSync('userDeptId', data.data.deptId);
  187. uni.setStorageSync('userDeptName', data.data.deptName);
  188. }
  189. },
  190. goHome() {
  191. this.pageType = 2;
  192. },
  193. goPage(type) {
  194. if (!type) {
  195. uni.showToast({
  196. title: '暂未开放',
  197. icon: "none",
  198. mask: true,
  199. duration: 2000
  200. });
  201. return
  202. }
  203. if (!pageRestrictVerify(type)) {
  204. uni.showToast({
  205. title: '没有相关权限,请联系管理员',
  206. icon: "none",
  207. mask: true,
  208. duration: 2000
  209. });
  210. return
  211. }
  212. if (type == 'dataBoard') {
  213. //数据看板
  214. this.pageType = 1;
  215. } else if (type == 'securityCheck') {
  216. //安全检查
  217. uni.navigateTo({
  218. url: "/pages_safetyCheck/views/safetyCheck",
  219. });
  220. /* if(this.identityData){
  221. uni.navigateTo({
  222. url: "/pages_safetyCheck/views/safetyCheck",
  223. });
  224. }else{
  225. uni.showToast({
  226. mask: true,
  227. icon: "none",
  228. position: "center",
  229. title: '您不是校/院级管理员或督导组成员,无法使用该功能.',
  230. duration: 2000
  231. });
  232. } */
  233. } else if (type == 'securityExamination') {
  234. //安全考试
  235. uni.navigateTo({
  236. url: "/pages_basics/views/deviceCageSitePage?pageType=3",
  237. });
  238. } else if (type == 'securityAdmittance') {
  239. //安全准入
  240. uni.navigateTo({
  241. url: "/pages_manage/views/accessQualification/accessQualification",
  242. });
  243. } else if (type == 'hierarchicalControl') {
  244. //分级管控
  245. uni.navigateTo({
  246. url: "/pages_basics/views/gradingControl/gradingControl",
  247. });
  248. } else if (type == 'securityResponsibility') {
  249. //安全责任
  250. uni.navigateTo({
  251. url: "/pages_basics/views/deviceCageSitePage?pageType=4",
  252. });
  253. } else if (type == 'deviceManagement') {
  254. //设备管理
  255. uni.navigateTo({
  256. url: "/pages_basics/views/deviceCageSitePage?pageType=1",
  257. });
  258. } else if (type == 'emergencyDisposal') {
  259. //应急处置
  260. // uni.navigateTo({
  261. // url: "/pages_manage/views/emergencyEvacuationBig",
  262. // });
  263. uni.navigateTo({
  264. url: "/pages_manage/views/emergencyEvacuationSubList",
  265. });
  266. } else if (type == 'cageSiteManagement') {
  267. //笼位管理
  268. uni.navigateTo({
  269. url: "/pages_basics/views/deviceCageSitePage?pageType=2",
  270. });
  271. } else if (type == 'snapshot') {
  272. //随手拍
  273. uni.navigateTo({
  274. url: "/pages_safetyCheck/views/snapshotManage/snapshotList",
  275. });
  276. /* uni.navigateTo({
  277. url: "/pages_safetyExamine/views/snapshotManage/snapshotAdd",
  278. }); */
  279. } else if (type == 'remoteDoorOpening') {
  280. //远程开门
  281. uni.navigateTo({
  282. url: "/pages_manage/views/accessControl/remoteOpen",
  283. });
  284. } else if (type == 'leaveCheckPupilTeacher') {
  285. //离开检查
  286. uni.navigateTo({
  287. url: "/pages_basics/views/photoInspection",
  288. });
  289. } else if (type == 'chemicalsManagement') {
  290. //化学品管控
  291. } else if (type == 'facilityReservation'){
  292. //设施预约
  293. uni.navigateTo({
  294. url: "/pages_basics/views/deviceCageSitePage?pageType=5",
  295. });
  296. }else if(type == 'hazardousWasteRecyclingPupil'){
  297. //危废回收
  298. //判断1.没有任何权限 跳转危废回收权限申请页面
  299. //判断2.有权限/有申请 跳转危废回收首页
  300. uni.navigateTo({
  301. url: "/pages_hazardousWasteRecycling/views/home/home",
  302. });
  303. }
  304. },
  305. /* 扫一扫*/
  306. saoCode() {
  307. let self = this;
  308. uni.scanCode({
  309. onlyFromCamera: true,
  310. success: function(res) {
  311. if(res.result.indexOf('type') != -1){
  312. //项目二维码
  313. let list = res.result.split("?")[1].split("&");
  314. let codeData = {};
  315. list.forEach((item) => {
  316. codeData[item.split("=")[0]] = item.split("=")[1];
  317. })
  318. if (codeData.type == 1 || codeData.type == 2 || codeData.type == 3 || codeData.type == 7 ||
  319. codeData.type == 8 || codeData.type == 10 ||
  320. codeData.type == 11 || codeData.type == 12 || codeData.type == 13 || codeData.type == 14) {
  321. uni.reLaunch({
  322. url: '/pages/views/saoCode/saoCode?q=' + encodeURIComponent(res.result)
  323. });
  324. }else if(codeData.type == 5){
  325. self.laboratorySubPassOutIsotopeSubSign(codeData.subId,res.result);
  326. }else if(codeData.type == 9){
  327. self.chemicalAppletSelectStockInfo(codeData.code);
  328. }
  329. }else{
  330. self.chemicalAppletSelectStockInfo(res.result);
  331. }
  332. }
  333. });
  334. },
  335. //扫码查询-化学品基本信息
  336. async chemicalAppletSelectStockInfo(code) {
  337. const {
  338. data
  339. } = await chemicalAppletSelectStockInfo({tagCode:code});
  340. if (data.code == 200) {
  341. if(data.data){
  342. data.data.code = code;
  343. //化学品信息
  344. uni.navigateTo({
  345. url: "/pages_basics/views/chemicalsInfo/chemicalsInfo?item=" + encodeURIComponent(JSON.stringify(data.data)),
  346. });
  347. }else{
  348. uni.showToast({
  349. mask: true,
  350. icon: "none",
  351. position: "center",
  352. title: '未找到相关信息,请扫描正确的二维码',
  353. duration: 2000
  354. });
  355. }
  356. }
  357. },
  358. //查询是否是同位素实验并且有签退
  359. async laboratorySubPassOutIsotopeSubSign(subId,result) {
  360. const {
  361. data
  362. } = await laboratorySubPassOutIsotopeSubSign({subId:subId});
  363. if (data.code == 200) {
  364. if(data.data.isotope){
  365. let obj = {
  366. subId:subId,
  367. subName:data.data.subName,
  368. passOutId:data.data.passOutId,
  369. }
  370. uni.navigateTo({
  371. url: "/pages_basics/views/photoInspection?item=" + encodeURIComponent(JSON.stringify(obj)),
  372. });
  373. }else{
  374. uni.reLaunch({
  375. url: '/pages/views/saoCode/saoCode?q=' + encodeURIComponent(result)
  376. });
  377. }
  378. }
  379. },
  380. }
  381. }
  382. </script>
  383. <style lang="stylus" scoped>
  384. @import '@/api/request/imagesUrl.styl';
  385. .teacherHome {
  386. flex: 1;
  387. display: flex;
  388. flex-direction: column;
  389. overflow: hidden;
  390. .data-board {
  391. flex: 1;
  392. display: flex;
  393. flex-direction: column;
  394. overflow: hidden;
  395. }
  396. .home-page {
  397. flex: 1;
  398. display: flex;
  399. flex-direction: column;
  400. overflow-y: scroll;
  401. overflow-x: hidden;
  402. padding-bottom:120rpx;
  403. .top-page-title {
  404. text-align: center;
  405. font-size: 28rpx;
  406. background-color: #0183FA;
  407. color: #fff;
  408. }
  409. .top-back-img {
  410. position: absolute;
  411. top: 0;
  412. left: 0;
  413. width: 750rpx;
  414. height: 539rpx;
  415. background: url($imagesUrl+'home/img_sy_bg@1x.png') no-repeat;
  416. background-size:100%;
  417. background-repeat: no-repeat;
  418. .position-img {
  419. z-index: 5;
  420. position: absolute;
  421. left: 0;
  422. top: 10rpx;
  423. width: 400rpx;
  424. height: 88rpx;
  425. }
  426. .position-data-button {
  427. z-index: 5;
  428. position: fixed;
  429. right: 0;
  430. top: 180rpx;
  431. width: 130rpx;
  432. height: 109rpx;
  433. /* line-height: 50rpx;
  434. background-color: #0183fa;
  435. color: #fff;
  436. font-size: 28rpx;
  437. text-align: center;
  438. border-top-left-radius: 30rpx;
  439. border-bottom-left-radius: 30rpx; */
  440. }
  441. }
  442. .button-one-box {
  443. z-index: 5;
  444. background: #fff;
  445. width: 690rpx;
  446. border-radius: 20rpx;
  447. padding: 13px 0 20px;
  448. overflow: hidden;
  449. margin: 490rpx 30rpx 0;
  450. .button-min {
  451. display: inline-block;
  452. overflow: hidden;
  453. width: 172rpx;
  454. height: 123rpx;
  455. margin-top: 23rpx;
  456. .button-img {
  457. display: block;
  458. width: 80rpx;
  459. height: 80rpx;
  460. margin: 0 auto;
  461. }
  462. .button-name {
  463. margin-top: 15rpx;
  464. height: 28rpx;
  465. line-height: 28rpx;
  466. font-size: 28rpx;
  467. text-align: center;
  468. color: #333;
  469. }
  470. }
  471. }
  472. .button-two-box {
  473. z-index: 5;
  474. width: 690rpx;
  475. height: 120rpx;
  476. display: flex;
  477. margin: 20rpx 30rpx 0;
  478. .button-big-box {
  479. width: 335rpx;
  480. display: flex;
  481. border-radius: 20rpx;
  482. img {
  483. display: block;
  484. margin: 20rpx 25rpx 0 25rpx;
  485. height: 80rpx;
  486. width: 80rpx;
  487. }
  488. .button-min-box {
  489. view:nth-child(1) {
  490. line-height: 32rpx;
  491. height: 32rpx;
  492. font-size: 30rpx;
  493. color: #333;
  494. margin: 20rpx 0 18rpx;
  495. }
  496. view:nth-child(2) {
  497. line-height: 28rpx;
  498. height: 28rpx;
  499. font-size: 26rpx;
  500. color: #999;
  501. }
  502. }
  503. }
  504. }
  505. .button-three-box-1 {
  506. z-index: 5;
  507. width: 690rpx;
  508. height: 130rpx;
  509. margin: 20rpx 30rpx 0;
  510. .button-big-box {
  511. border-radius: 20rpx;
  512. background-color: #CDE7FF;
  513. display: flex;
  514. img {
  515. display: block;
  516. width: 134rpx;
  517. height: 104rpx;
  518. margin: 23rpx 34rpx 0 30rpx;
  519. }
  520. .button-min-box {
  521. view:nth-child(1) {
  522. line-height: 30rpx;
  523. height: 30rpx;
  524. font-size: 30rpx;
  525. color: #0183FA;
  526. margin: 27rpx 0 15rpx;
  527. }
  528. view:nth-child(2) {
  529. line-height: 26rpx;
  530. height: 26rpx;
  531. font-size: 26rpx;
  532. color: #666666;
  533. }
  534. }
  535. }
  536. }
  537. .button-three-box {
  538. z-index: 5;
  539. width: 690rpx;
  540. height: 130rpx;
  541. margin: 20rpx 30rpx 0;
  542. .button-big-box-1{
  543. background: #CDE7FF;
  544. .button-min-box{
  545. view:nth-child(1){
  546. color: #0183FA;
  547. }
  548. view:nth-child(2){
  549. color: #666666;
  550. }
  551. }
  552. }
  553. .button-big-box {
  554. height:130rpx;
  555. border-radius: 20rpx;
  556. display: flex;
  557. img {
  558. display: block;
  559. width: 134rpx;
  560. height: 104rpx;
  561. margin: 23rpx 34rpx 0 30rpx;
  562. }
  563. .button-min-box {
  564. view:nth-child(1) {
  565. line-height: 30rpx;
  566. height: 30rpx;
  567. font-size: 30rpx;
  568. margin: 30rpx 0 15rpx;
  569. }
  570. view:nth-child(2) {
  571. line-height: 26rpx;
  572. height: 26rpx;
  573. font-size: 26rpx;
  574. }
  575. }
  576. }
  577. }
  578. .scan_btn {
  579. z-index: 10;
  580. position: fixed;
  581. bottom: 210rpx;
  582. right: 0rpx;
  583. width: 140rpx;
  584. height: 140rpx;
  585. }
  586. }
  587. }
  588. </style>