teacherHome.vue 13 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541
  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. data.data.code = code;
  273. //化学品信息
  274. uni.navigateTo({
  275. url: "/pages_basics/views/chemicalsInfo/chemicalsInfo?item=" + encodeURIComponent(JSON.stringify(data.data)),
  276. });
  277. }else{
  278. uni.showToast({
  279. mask: true,
  280. icon: "none",
  281. position: "center",
  282. title: '未找到相关信息,请扫描正确的二维码',
  283. duration: 2000
  284. });
  285. }
  286. }
  287. },
  288. //查询是否是同位素实验并且有签退
  289. async laboratorySubPassOutIsotopeSubSign(subId,result) {
  290. const {
  291. data
  292. } = await laboratorySubPassOutIsotopeSubSign({subId:subId});
  293. if (data.code == 200) {
  294. if(data.data.isotope){
  295. let obj = {
  296. subId:subId,
  297. subName:data.data.subName,
  298. passOutId:data.data.passOutId,
  299. }
  300. uni.navigateTo({
  301. url: "/pages_basics/views/photoInspection?item=" + encodeURIComponent(JSON.stringify(obj)),
  302. });
  303. }else{
  304. uni.reLaunch({
  305. url: '/pages/views/saoCode/saoCode?q=' + encodeURIComponent(result)
  306. });
  307. }
  308. }
  309. },
  310. }
  311. }
  312. </script>
  313. <style lang="stylus" scoped>
  314. @import '@/api/request/imagesUrl.styl';
  315. .teacherHome {
  316. flex: 1;
  317. display: flex;
  318. flex-direction: column;
  319. overflow: hidden;
  320. .data-board {
  321. flex: 1;
  322. display: flex;
  323. flex-direction: column;
  324. overflow: hidden;
  325. }
  326. .home-page {
  327. flex: 1;
  328. display: flex;
  329. flex-direction: column;
  330. overflow-y: scroll;
  331. overflow-x: hidden;
  332. padding-bottom:120rpx;
  333. .top-page-title {
  334. text-align: center;
  335. font-size: 28rpx;
  336. background-color: #0183FA;
  337. color: #fff;
  338. }
  339. .top-back-img {
  340. position: absolute;
  341. top: 0;
  342. left: 0;
  343. width: 750rpx;
  344. height: 539rpx;
  345. background: url($imagesUrl+'home/img_sy_bg@1x.png') no-repeat;
  346. background-size:100%;
  347. background-repeat: no-repeat;
  348. .position-img {
  349. z-index: 5;
  350. position: absolute;
  351. left: 0;
  352. top: 10rpx;
  353. width: 400rpx;
  354. height: 88rpx;
  355. }
  356. .position-data-button {
  357. z-index: 5;
  358. position: fixed;
  359. right: 0;
  360. top: 180rpx;
  361. width: 130rpx;
  362. height: 109rpx;
  363. /* line-height: 50rpx;
  364. background-color: #0183fa;
  365. color: #fff;
  366. font-size: 28rpx;
  367. text-align: center;
  368. border-top-left-radius: 30rpx;
  369. border-bottom-left-radius: 30rpx; */
  370. }
  371. }
  372. .button-one-box {
  373. z-index: 5;
  374. background: #fff;
  375. width: 690rpx;
  376. border-radius: 20rpx;
  377. padding: 13px 0 20px;
  378. overflow: hidden;
  379. margin: 490rpx 30rpx 0;
  380. .button-min {
  381. display: inline-block;
  382. overflow: hidden;
  383. width: 172rpx;
  384. height: 123rpx;
  385. margin-top: 23rpx;
  386. .button-img {
  387. display: block;
  388. width: 80rpx;
  389. height: 80rpx;
  390. margin: 0 auto;
  391. }
  392. .button-name {
  393. margin-top: 15rpx;
  394. height: 28rpx;
  395. line-height: 28rpx;
  396. font-size: 28rpx;
  397. text-align: center;
  398. color: #333;
  399. }
  400. }
  401. }
  402. .button-two-box {
  403. z-index: 5;
  404. width: 690rpx;
  405. height: 120rpx;
  406. display: flex;
  407. margin: 20rpx 30rpx 0;
  408. .button-big-box {
  409. width: 335rpx;
  410. display: flex;
  411. border-radius: 20rpx;
  412. img {
  413. display: block;
  414. margin: 20rpx 31rpx 0 36rpx;
  415. height: 80rpx;
  416. width: 80rpx;
  417. }
  418. .button-min-box {
  419. view:nth-child(1) {
  420. line-height: 32rpx;
  421. height: 32rpx;
  422. font-size: 32rpx;
  423. color: #333;
  424. margin: 20rpx 0 18rpx;
  425. }
  426. view:nth-child(2) {
  427. line-height: 28rpx;
  428. height: 28rpx;
  429. font-size: 28rpx;
  430. color: #999;
  431. }
  432. }
  433. }
  434. }
  435. .button-three-box-1 {
  436. z-index: 5;
  437. width: 690rpx;
  438. height: 130rpx;
  439. margin: 20rpx 30rpx 0;
  440. .button-big-box {
  441. border-radius: 20rpx;
  442. background-color: #CDE7FF;
  443. display: flex;
  444. img {
  445. display: block;
  446. width: 134rpx;
  447. height: 104rpx;
  448. margin: 23rpx 34rpx 0 30rpx;
  449. }
  450. .button-min-box {
  451. view:nth-child(1) {
  452. line-height: 30rpx;
  453. height: 30rpx;
  454. font-size: 30rpx;
  455. color: #0183FA;
  456. margin: 27rpx 0 15rpx;
  457. }
  458. view:nth-child(2) {
  459. line-height: 26rpx;
  460. height: 26rpx;
  461. font-size: 26rpx;
  462. color: #666666;
  463. }
  464. }
  465. }
  466. }
  467. .button-three-box {
  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: #FFF0DD;
  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: #FF8C00;
  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. .scan_btn {
  500. z-index: 10;
  501. position: fixed;
  502. bottom: 210rpx;
  503. right: 0rpx;
  504. width: 140rpx;
  505. height: 140rpx;
  506. }
  507. }
  508. }
  509. </style>