teacherHome.vue 15 KB

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