teacherHome.vue 13 KB

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