teacherHome.vue 15 KB

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