teacherHome.vue 17 KB

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