studentWorkbench.vue 13 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494
  1. <!-- 学生端工作台 -->
  2. <template>
  3. <view class="user-workbench">
  4. <!-- <img class="top-big-img" src="@/images/Version2.2/ing_bg_banner.png"> -->
  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="goNull">
  24. <img src="@/images/Version2.2/icon_sy_aqxx.png">
  25. <view>安全学习</view>
  26. </view> -->
  27. <view @click="goPage('photoInspection')">
  28. <img src="@/images/icon_dzt_pzjc.png">
  29. <view>拍照检查</view>
  30. </view>
  31. <view @click="goPage('gas')">
  32. <img src="@/images/Version3.0/icon_sy_qpgl.png">
  33. <view>气瓶管理</view>
  34. </view>
  35. <view @click="goPage('none')">
  36. <img src="@/images/Version3.0/icon_sy_hxp.png">
  37. <view>化学品管理</view>
  38. </view>
  39. <view @click="goPage('none')">
  40. <img src="@/images/Version3.0/icon_sy_tzsb.png">
  41. <view>特种设备</view>
  42. </view>
  43. </view>
  44. <!-- 分级管控 -->
  45. <view class="grading">
  46. <img class="grading_l" src="@/images/icon_sy_fjgk.png"/>
  47. <view class="grading_c">分级管控</view>
  48. <view class="grading_r" @click="goPage('grading')">{{gradingCount>0?gradingCount+'项工作待完成':''}}<img src="@/images/icon_wdwg_gd.png"/></view>
  49. </view>
  50. <view class="big-icon-button-box">
  51. <view class="left-box">
  52. <img class="left-top-img" @click="goNull" src="@/images/Version2.2/img_bg_cjcx.png">
  53. <img class="left-bottom-img" @click="goPage('meViolation')" src="@/images/Version2.2/img_bg_wgjl.png">
  54. </view>
  55. <img class="right-img" @click="goNull" src="@/images/Version2.2/img_bg_jfmx.png">
  56. </view>
  57. <view class="bottom-max-box">
  58. <view class="bottom-title">
  59. <img src="@/images/Version2.2/icon_sy_wdzs.png">
  60. <view>我的证书</view>
  61. </view>
  62. <view class="bottom-big-box">
  63. <view class="bottom-for-box" v-for="(item,index) in dataList" :key="index">
  64. <view class="bottom-top-box">{{item.certTitle}}</view>
  65. <view class="bottom-bottom-box">
  66. <view class="bottom-right-box">{{item.createTime}}获得</view>
  67. <view class="bottom-right-box">到期时间:{{item.expirationTime}}</view>
  68. </view>
  69. </view>
  70. <view class="null-view" v-if="!dataList[0]">暂无数据</view>
  71. </view>
  72. </view>
  73. <tab-bar></tab-bar>
  74. </view>
  75. </template>
  76. <script>
  77. import { myViolationCount,queryMyCert,outSubjectPhoto,gradingControl} from '@/api/index.js'
  78. import { tabBar } from '@/component/tabBar.vue'
  79. export default {
  80. components: {
  81. tabBar
  82. },
  83. data() {
  84. return {
  85. hintType:false,
  86. dataList:[],
  87. violationData:{},
  88. gradingCount:0,
  89. homepageBanner:uni.getStorageSync('homepageBanner'),
  90. }
  91. },
  92. created() {
  93. },
  94. mounted(){
  95. console.log("user-workbench")
  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/gradingControl/gradingControl',//分级管控
  187. });
  188. }else if(type == 'safetyInspect'){//安全检查
  189. uni.navigateTo({
  190. url: '/pages_manage/workbench/securityCheck/safetyInspect',//安全检查
  191. });
  192. }else if(type == 'gas'){//气瓶管理
  193. uni.navigateTo({
  194. url: '/pages_student/gasManage/gasManage',
  195. });
  196. }else if(type == 'none'){
  197. uni.showToast({
  198. title: '暂未开放',
  199. icon:"none",
  200. mask:true,
  201. duration: 2000
  202. });
  203. }
  204. },
  205. //获取拍照检查配置
  206. async outSubjectPhoto(){
  207. const {data} = await outSubjectPhoto();
  208. if(data.code == 200){
  209. if(data.data == null){
  210. //需要检查(重新填写)
  211. let obj = {
  212. sub:"实验室照片",
  213. subUrl:"",
  214. garbage:"垃圾桶清理后照片",
  215. garbageUrl:"",
  216. dangerous:"使用危险设备照片(选填)",
  217. dangerousUrl:"",
  218. sourceRisk:"危险源设备使用登记本照片(选填)",
  219. sourceRiskUrl:"",
  220. };
  221. uni.navigateTo({
  222. url: '/pages_student/workbench/photoInspection?newData='+encodeURIComponent(JSON.stringify(obj)),
  223. });
  224. }else if(data.data == false){
  225. //不需要检查
  226. uni.showToast({
  227. title: '暂无检查数据',
  228. icon:"none",
  229. mask:true,
  230. duration: 2000
  231. });
  232. }else{
  233. //需要检查(修改内容)
  234. let obj = {
  235. id:data.data.id,
  236. sub:"实验室照片",
  237. subUrl:data.data.subUrl,
  238. garbage:"垃圾桶清理后照片",
  239. garbageUrl:data.data.garbageUrl,
  240. dangerous:"使用危险设备照片(选填)",
  241. dangerousUrl:data.data.dangerousUrl,
  242. sourceRisk:"危险源设备使用登记本照片(选填)",
  243. sourceRiskUrl:data.data.sourceRiskUrl,
  244. };
  245. uni.navigateTo({
  246. url: '/pages_student/workbench/photoInspection?newData='+encodeURIComponent(JSON.stringify(obj)),
  247. });
  248. }
  249. }
  250. },
  251. }
  252. }
  253. </script>
  254. <style lang="stylus" scoped>
  255. .user-workbench{
  256. height:100%;
  257. flex:1;
  258. .top-big-img{
  259. height:342rpx;
  260. width:750rpx;
  261. background :#ffffff;
  262. }
  263. .min-icon-button-box{
  264. display flex;
  265. justify-content: flex-start;
  266. flex-wrap: wrap;
  267. width:710rpx;
  268. margin:20rpx;
  269. background :#ffffff;
  270. border-radius:20rpx;
  271. padding-bottom: 20rpx;
  272. view{
  273. width: 176rpx;
  274. img{
  275. height:75rpx;
  276. width:75rpx;
  277. margin:30rpx auto 10rpx;
  278. }
  279. view{
  280. text-align center
  281. font-size:24rpx;
  282. }
  283. }
  284. }
  285. /* 分级管控 */
  286. .grading{
  287. width :712rpx;
  288. height :80rpx;
  289. background: #FFFFFF;
  290. border-radius: 20rpx;
  291. margin-left:20rpx;
  292. margin-bottom :20rpx;
  293. display:flex;
  294. justify-content :flex-start;
  295. align-items :center;
  296. .grading_l{
  297. width :34rpx;
  298. height :34rpx;
  299. margin-left:16rpx;
  300. }
  301. .grading_c{
  302. font-size: 28rpx;
  303. font-family: PingFang SC;
  304. font-weight: 500;
  305. color: #333333;
  306. margin-left:16rpx;
  307. }
  308. .grading_r{
  309. width :504rpx;
  310. height :80rpx;
  311. font-size: 26rpx;
  312. font-family: PingFang SC;
  313. font-weight: 500;
  314. color: #EE3A3A;
  315. display :flex;
  316. justify-content :flex-end;
  317. align-items: center;
  318. >img{
  319. width: 20rpx;
  320. height: 20rpx;
  321. margin-left :20rpx;
  322. margin-top :8rpx;
  323. }
  324. }
  325. }
  326. .big-icon-button-box{
  327. width:710rpx;
  328. height:354rpx;
  329. margin:0 20rpx 20rpx;
  330. background :#ffffff;
  331. border-radius:20rpx;
  332. display flex
  333. .left-box{
  334. width:310rpx;
  335. height:310rpx;
  336. margin:22rpx 10rpx 22rpx 15rpx;
  337. .left-top-img{
  338. width:310rpx;
  339. height:150rpx;
  340. margin-bottom:14rpx;
  341. }
  342. .left-bottom-img{
  343. width:310rpx;
  344. height:150rpx;
  345. }
  346. }
  347. .right-img{
  348. width:362rpx;
  349. height:310rpx;
  350. margin:22rpx 13rpx 22rpx 0;
  351. }
  352. }
  353. .top-max-box{
  354. height:119rpx;
  355. background #fff
  356. overflow hidden
  357. .top-big-box{
  358. height:60rpx;
  359. width:649rpx;
  360. background: #F5F5F5;
  361. border-radius: 30px;
  362. margin:30rpx auto;
  363. padding:0 30rpx;
  364. }
  365. .top-big-one-type{
  366. color:#F95F5F;
  367. line-height:60rpx;
  368. font-size: 26rpx;
  369. }
  370. .top-big-two-type{
  371. line-height:60rpx;
  372. font-size: 26rpx;
  373. display flex
  374. .left-view{
  375. flex:1;
  376. display flex
  377. color:#333;
  378. .left-min-view{
  379. color:#e45656;
  380. }
  381. }
  382. .left-button-view{
  383. color:#0183fa;
  384. }
  385. }
  386. }
  387. .button-max-box{
  388. /*height:446rpx;*/
  389. background #fff
  390. margin-bottom:20rpx;
  391. .button-title{
  392. line-height:100rpx;
  393. border-bottom:1rpx solid #E0E0E0;
  394. padding-left:20rpx;
  395. }
  396. .button-max-box{
  397. /*height:345rpx;*/
  398. .button-min-box{
  399. width:250rpx;
  400. height:172rpx;
  401. display inline-block
  402. img{
  403. width:80rpx;
  404. height:80rpx;
  405. margin:34rpx auto 0;
  406. }
  407. view{
  408. line-height:50rpx;
  409. text-align center;
  410. font-size:28rpx;
  411. color: #333;
  412. }
  413. }
  414. }
  415. }
  416. .bottom-max-box{
  417. flex:1;
  418. background #fff
  419. margin:0 20rpx 100rpx;
  420. border-radius:20rpx;
  421. display flex
  422. flex-direction column
  423. overflow-y hidden
  424. .bottom-title{
  425. display flex
  426. border-bottom:1rpx solid #E0E0E0;
  427. img{
  428. width:34rpx;
  429. height:34rpx;
  430. margin:35rpx 16rpx 0 10rpx;
  431. }
  432. view{
  433. line-height:100rpx;
  434. }
  435. }
  436. .bottom-big-box{
  437. flex:1;
  438. overflow-y scroll
  439. .bottom-for-box:nth-child(1){
  440. border:none;
  441. }
  442. .bottom-for-box{
  443. height:154rpx;
  444. margin:0 20rpx;
  445. border-top:1rpx solid #E0E0E0;
  446. overflow hidden
  447. .bottom-top-box{
  448. font-size:28rpx;
  449. line-height:28rpx;
  450. color:#333;
  451. display:block;
  452. overflow:hidden;
  453. text-overflow:ellipsis;
  454. white-space:nowrap;
  455. margin:36rpx 0 30rpx;
  456. }
  457. .bottom-bottom-box{
  458. display flex
  459. view{
  460. flex:1;
  461. line-height:48rpx;
  462. font-size: 28rpx;
  463. color: #999999;
  464. display:block;
  465. overflow:hidden;
  466. text-overflow:ellipsis;
  467. white-space:nowrap;
  468. }
  469. view:nth-child(2){
  470. text-align right
  471. }
  472. }
  473. }
  474. .null-view{
  475. text-align center;
  476. color:#999;
  477. line-height:80rpx;
  478. font-size:28rpx;
  479. }
  480. }
  481. }
  482. }
  483. </style>