teacherHome.vue 14 KB

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