studentWorkbench.vue 13 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505
  1. <!-- 学生端工作台 -->
  2. <template>
  3. <view class="user-workbench" :style="{paddingTop:navHeight+'rpx'}">
  4. <nav-bar :title="title"></nav-bar>
  5. <img class="top-big-img" :src="homepageBanner">
  6. <view class="min-icon-button-box">
  7. <view @click="goPage('casuallyPat')">
  8. <img src="@/images/Version2.2/icon_sy_ssp.png">
  9. <view>随手拍</view>
  10. </view>
  11. <view @click="saoCode">
  12. <img src="@/images/Version2.2/btn_wd_jfdh.png">
  13. <view>积分兑换</view>
  14. </view>
  15. <view @click="goPage('safeAccess')">
  16. <img src="@/images/Version2.2/icon_sy_zrsq.png">
  17. <view>准入申请</view>
  18. </view>
  19. <view @click="goPage('safetyInspect')">
  20. <img src="@/images/Version2.2/icon_sy_aqjc.png">
  21. <view>安全检查</view>
  22. </view>
  23. <view @click="goPage('photoInspection')">
  24. <img src="@/images/icon_dzt_pzjc.png">
  25. <view>离开检查</view>
  26. </view>
  27. <view @click="goPage('gas')">
  28. <img src="@/images/Version3.0/icon_sy_qpgl.png">
  29. <view>气瓶管理</view>
  30. </view>
  31. <view @click="goPage('none')">
  32. <img src="@/images/Version3.0/icon_sy_hxp.png">
  33. <view>化学品管理</view>
  34. </view>
  35. <view @click="goPage('none')">
  36. <img src="@/images/Version3.0/icon_sy_tzsb.png">
  37. <view>特种设备</view>
  38. </view>
  39. </view>
  40. <!-- 分级管控 -->
  41. <view class="grading">
  42. <img class="grading_l" src="@/images/icon_sy_fjgk.png"/>
  43. <view class="grading_c">分级管控</view>
  44. <view class="grading_r" @click="goPage('grading')">{{gradingCount>0?gradingCount+'项工作待完成':''}}<img src="@/images/icon_wdwg_gd.png"/></view>
  45. </view>
  46. <view class="big-icon-button-box">
  47. <view class="left-box">
  48. <img class="left-top-img" @click="goNull" src="@/images/Version2.2/img_bg_cjcx.png">
  49. <img class="left-bottom-img" @click="goPage('meViolation')" src="@/images/Version2.2/img_bg_wgjl.png">
  50. </view>
  51. <img class="right-img" @click="goNull" src="@/images/Version2.2/img_bg_jfmx.png">
  52. </view>
  53. <view class="bottom-max-box">
  54. <view class="bottom-title">
  55. <img src="@/images/Version2.2/icon_sy_wdzs.png">
  56. <view>我的证书</view>
  57. </view>
  58. <view class="bottom-big-box">
  59. <view class="bottom-for-box" v-for="(item,index) in dataList" :key="index">
  60. <view class="bottom-top-box">{{item.certTitle}}</view>
  61. <view class="bottom-bottom-box">
  62. <view class="bottom-right-box">{{item.createTime}}获得</view>
  63. <view class="bottom-right-box">到期时间:{{item.expirationTime}}</view>
  64. </view>
  65. </view>
  66. <view class="null-view" v-if="!dataList[0]">暂无数据</view>
  67. </view>
  68. </view>
  69. <tab-bar></tab-bar>
  70. </view>
  71. </template>
  72. <script>
  73. import { myViolationCount,queryMyCert,outSubjectPhoto,gradingControl} from '@/api/index.js'
  74. import { tabBar } from '@/component/tabBar.vue'
  75. import { navBar } from '@/component/navbar.vue'
  76. export default {
  77. components: {
  78. tabBar,
  79. navBar
  80. },
  81. data() {
  82. return {
  83. tenantId:uni.getStorageSync('tenantId'),//0 系统 1化学与材料学院 2环境气候研究院
  84. navHeight: uni.getStorageSync('navHeight'),
  85. title:'实验室安全智能监测与控制系统',
  86. hintType:false,
  87. dataList:[],
  88. violationData:{},
  89. gradingCount:0,
  90. homepageBanner:uni.getStorageSync('homepageBanner'),
  91. }
  92. },
  93. created() {
  94. },
  95. mounted(){
  96. this.myViolationCount();
  97. this.getGrading();
  98. this.queryMyCert();
  99. },
  100. methods: {
  101. //获取分级管控未完成总数
  102. async getGrading(){
  103. let obj = {
  104. }
  105. const {data} = await gradingControl(obj)
  106. if(data.code==200){
  107. this.gradingCount=data.count;
  108. }
  109. },
  110. //暂无提示
  111. goNull(){
  112. uni.showToast({
  113. title: '暂未开放',
  114. mask:true,
  115. icon:"none",
  116. duration: 2000
  117. });
  118. },
  119. //调用摄像头
  120. saoCode(){
  121. uni.scanCode({
  122. onlyFromCamera: true,
  123. success: function (res) {
  124. uni.navigateTo({
  125. url: '/pages_student/mine/codeSuccess?q='+encodeURIComponent(JSON.stringify(res.result))
  126. });
  127. }
  128. });
  129. },
  130. // 查询违规记录列表 (用户端)
  131. async myViolationCount(){
  132. let self = this;
  133. let {data} = await myViolationCount()
  134. if(data.code == 200){
  135. this.violationData = data.data;
  136. }
  137. },
  138. // 查询证书列表 (用户端)
  139. async queryMyCert(){
  140. let self = this;
  141. let {data} = await queryMyCert({})
  142. if(data.code == 200){
  143. let list = [];
  144. for(let i=0;i<data.rows.length;i++){
  145. let timeOne = (new Date(data.rows[i].createTime)).getTime();
  146. let timeTwo = (new Date(data.rows[i].expirationTime)).getTime();
  147. data.rows[i].createTime = self.formatDate(timeOne);
  148. data.rows[i].expirationTime = self.formatDate(timeTwo);
  149. }
  150. this.dataList = data.rows;
  151. }
  152. },
  153. formatDate(date) {
  154. let newDate = new Date(date);
  155. let YY = newDate.getFullYear() + '-';
  156. let MM = (newDate.getMonth() + 1 < 10 ? '0' + (newDate.getMonth() + 1) : newDate.getMonth() + 1) + '-';
  157. let DD = (newDate.getDate() < 10 ? '0' + (newDate.getDate()) : newDate.getDate());
  158. return YY + MM + DD;
  159. },
  160. //页面跳转
  161. goPage(type){
  162. if(type == 'meViolation'){//我的违规
  163. uni.navigateTo({
  164. url: '/pages_student/workbench/meViolation',
  165. });
  166. }else if(type == 'photoInspection'){//离开检查
  167. this.outSubjectPhoto();
  168. }else if(type == 'resultInquiry'){//成绩查询
  169. uni.navigateTo({
  170. url: '/pages_student/workbench/resultInquiry',
  171. });
  172. }else if(type == 'casuallyPat'){//随手拍
  173. uni.navigateTo({
  174. url: '/pages/casuallyPat',//随手拍
  175. });
  176. }else if(type == 'safeAccess'){//安全准入
  177. uni.navigateTo({
  178. url: '/pages_student/workbench/safeAccess/safeAccess',
  179. });
  180. }else if(type == 'examList'){//在线考试
  181. uni.navigateTo({
  182. url: '/pages_student/workbench/exam/examList',
  183. });
  184. }else if(type == 'grading'){
  185. uni.navigateTo({
  186. url: '/pages_student/gradingControl/gradingControl',//分级管控
  187. });
  188. }else if(type == 'safetyInspect'){//安全检查
  189. uni.navigateTo({
  190. url: '/pages_manage/workbench/problemRectification/rectifyList',//安全检查
  191. });
  192. }else if(type == 'gas'){//气瓶管理
  193. if(this.tenantId==1){
  194. uni.showToast({
  195. title: '暂未开放',
  196. icon:"none",
  197. mask:true,
  198. duration: 2000
  199. });
  200. }else{
  201. uni.navigateTo({
  202. url: '/pages_student/gasManage/gasManage',
  203. });
  204. }
  205. }else if(type == 'none'){
  206. uni.showToast({
  207. title: '暂未开放',
  208. icon:"none",
  209. mask:true,
  210. duration: 2000
  211. });
  212. }
  213. },
  214. //获取拍照检查配置
  215. async outSubjectPhoto(){
  216. const {data} = await outSubjectPhoto();
  217. if(data.code == 200){
  218. if(data.data == null){
  219. //需要检查(重新填写)
  220. let obj = {
  221. sub:"实验室照片",
  222. subUrl:"",
  223. garbage:"垃圾桶清理后照片",
  224. garbageUrl:"",
  225. dangerous:"使用危险设备照片(选填)",
  226. dangerousUrl:"",
  227. sourceRisk:"危险源设备使用登记本照片(选填)",
  228. sourceRiskUrl:"",
  229. };
  230. uni.navigateTo({
  231. url: '/pages_student/workbench/photoInspection?newData='+encodeURIComponent(JSON.stringify(obj)),
  232. });
  233. }else if(data.data == false){
  234. //不需要检查
  235. uni.showToast({
  236. title: '暂无检查数据',
  237. icon:"none",
  238. mask:true,
  239. duration: 2000
  240. });
  241. }else{
  242. //需要检查(修改内容)
  243. let obj = {
  244. id:data.data.id,
  245. sub:"实验室照片",
  246. subUrl:data.data.subUrl,
  247. garbage:"垃圾桶清理后照片",
  248. garbageUrl:data.data.garbageUrl,
  249. dangerous:"使用危险设备照片(选填)",
  250. dangerousUrl:data.data.dangerousUrl,
  251. sourceRisk:"危险源设备使用登记本照片(选填)",
  252. sourceRiskUrl:data.data.sourceRiskUrl,
  253. };
  254. uni.navigateTo({
  255. url: '/pages_student/workbench/photoInspection?newData='+encodeURIComponent(JSON.stringify(obj)),
  256. });
  257. }
  258. }
  259. },
  260. }
  261. }
  262. </script>
  263. <style lang="stylus" scoped>
  264. .user-workbench{
  265. height:100%;
  266. flex:1;
  267. box-sizing: border-box;
  268. .top-big-img{
  269. height:342rpx;
  270. width:750rpx;
  271. background :#ffffff;
  272. }
  273. .min-icon-button-box{
  274. display flex;
  275. justify-content: flex-start;
  276. flex-wrap: wrap;
  277. width:710rpx;
  278. margin:20rpx;
  279. background :#ffffff;
  280. border-radius:20rpx;
  281. padding-bottom: 20rpx;
  282. view{
  283. width: 176rpx;
  284. img{
  285. height:75rpx;
  286. width:75rpx;
  287. margin:30rpx auto 10rpx;
  288. }
  289. view{
  290. text-align center
  291. font-size:24rpx;
  292. }
  293. }
  294. }
  295. /* 分级管控 */
  296. .grading{
  297. width :712rpx;
  298. height :80rpx;
  299. background: #FFFFFF;
  300. border-radius: 20rpx;
  301. margin-left:20rpx;
  302. margin-bottom :20rpx;
  303. display:flex;
  304. justify-content :flex-start;
  305. align-items :center;
  306. .grading_l{
  307. width :34rpx;
  308. height :34rpx;
  309. margin-left:16rpx;
  310. }
  311. .grading_c{
  312. font-size: 28rpx;
  313. font-family: PingFang SC;
  314. font-weight: 500;
  315. color: #333333;
  316. margin-left:16rpx;
  317. }
  318. .grading_r{
  319. width :504rpx;
  320. height :80rpx;
  321. font-size: 26rpx;
  322. font-family: PingFang SC;
  323. font-weight: 500;
  324. color: #EE3A3A;
  325. display :flex;
  326. justify-content :flex-end;
  327. align-items: center;
  328. >img{
  329. width: 20rpx;
  330. height: 20rpx;
  331. margin-left :20rpx;
  332. margin-top :8rpx;
  333. }
  334. }
  335. }
  336. .big-icon-button-box{
  337. width:710rpx;
  338. height:354rpx;
  339. margin:0 20rpx 20rpx;
  340. background :#ffffff;
  341. border-radius:20rpx;
  342. display flex
  343. .left-box{
  344. width:310rpx;
  345. height:310rpx;
  346. margin:22rpx 10rpx 22rpx 15rpx;
  347. .left-top-img{
  348. width:310rpx;
  349. height:150rpx;
  350. margin-bottom:14rpx;
  351. }
  352. .left-bottom-img{
  353. width:310rpx;
  354. height:150rpx;
  355. }
  356. }
  357. .right-img{
  358. width:362rpx;
  359. height:310rpx;
  360. margin:22rpx 13rpx 22rpx 0;
  361. }
  362. }
  363. .top-max-box{
  364. height:119rpx;
  365. background #fff
  366. overflow hidden
  367. .top-big-box{
  368. height:60rpx;
  369. width:649rpx;
  370. background: #F5F5F5;
  371. border-radius: 30px;
  372. margin:30rpx auto;
  373. padding:0 30rpx;
  374. }
  375. .top-big-one-type{
  376. color:#F95F5F;
  377. line-height:60rpx;
  378. font-size: 26rpx;
  379. }
  380. .top-big-two-type{
  381. line-height:60rpx;
  382. font-size: 26rpx;
  383. display flex
  384. .left-view{
  385. flex:1;
  386. display flex
  387. color:#333;
  388. .left-min-view{
  389. color:#e45656;
  390. }
  391. }
  392. .left-button-view{
  393. color:#0183fa;
  394. }
  395. }
  396. }
  397. .button-max-box{
  398. /*height:446rpx;*/
  399. background #fff
  400. margin-bottom:20rpx;
  401. .button-title{
  402. line-height:100rpx;
  403. border-bottom:1rpx solid #E0E0E0;
  404. padding-left:20rpx;
  405. }
  406. .button-max-box{
  407. /*height:345rpx;*/
  408. .button-min-box{
  409. width:250rpx;
  410. height:172rpx;
  411. display inline-block
  412. img{
  413. width:80rpx;
  414. height:80rpx;
  415. margin:34rpx auto 0;
  416. }
  417. view{
  418. line-height:50rpx;
  419. text-align center;
  420. font-size:28rpx;
  421. color: #333;
  422. }
  423. }
  424. }
  425. }
  426. .bottom-max-box{
  427. flex:1;
  428. background #fff
  429. margin:0 20rpx 100rpx;
  430. border-radius:20rpx;
  431. display flex
  432. flex-direction column
  433. overflow-y hidden
  434. .bottom-title{
  435. display flex
  436. border-bottom:1rpx solid #E0E0E0;
  437. img{
  438. width:34rpx;
  439. height:34rpx;
  440. margin:35rpx 16rpx 0 10rpx;
  441. }
  442. view{
  443. line-height:100rpx;
  444. }
  445. }
  446. .bottom-big-box{
  447. flex:1;
  448. overflow-y scroll
  449. .bottom-for-box:nth-child(1){
  450. border:none;
  451. }
  452. .bottom-for-box{
  453. height:154rpx;
  454. margin:0 20rpx;
  455. border-top:1rpx solid #E0E0E0;
  456. overflow hidden
  457. .bottom-top-box{
  458. font-size:28rpx;
  459. line-height:28rpx;
  460. color:#333;
  461. display:block;
  462. overflow:hidden;
  463. text-overflow:ellipsis;
  464. white-space:nowrap;
  465. margin:36rpx 0 30rpx;
  466. }
  467. .bottom-bottom-box{
  468. display flex
  469. view{
  470. flex:1;
  471. line-height:48rpx;
  472. font-size: 28rpx;
  473. color: #999999;
  474. display:block;
  475. overflow:hidden;
  476. text-overflow:ellipsis;
  477. white-space:nowrap;
  478. }
  479. view:nth-child(2){
  480. text-align right
  481. }
  482. }
  483. }
  484. .null-view{
  485. text-align center;
  486. color:#999;
  487. line-height:80rpx;
  488. font-size:28rpx;
  489. }
  490. }
  491. }
  492. }
  493. </style>