studentWorkbench.vue 13 KB

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