teacherHome.vue 17 KB

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