teacherHome.vue 18 KB

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