safetyCardScan.vue 15 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687
  1. <!-- 安全检查扫一扫 实验室详情 -->
  2. <template>
  3. <view class="safetyCardScan">
  4. <view class="header">
  5. <view class="tabTitle">
  6. <view class="tabTitle_li" @tap="tabClick(index)" :key="index" v-for="(item,index) in tabText">
  7. <view class="tabTitle_text">
  8. <img :src="item.img">
  9. <view
  10. :id="pageType==index&&index==0?'fontColor-A':(pageType==1&&index==1?'fontColor-B':(pageType==2&&index==2?'fontColor-C':''))">
  11. {{item.name}}
  12. </view>
  13. </view>
  14. <view :class="{on:pageType==index}" class="tabTitle_across">
  15. <img src="@/pages_safetyCheck/images/img_xyzc_bg@1x.png">
  16. </view>
  17. <view class="line"></view>
  18. </view>
  19. </view>
  20. </view>
  21. <view class="safetyCard" v-if="pageType==0">
  22. <view class="lab-info">
  23. <view class="lab-info-t">
  24. <view>{{newData.levelName}}</view>
  25. <view>{{newData.labClassTypeList[0].typeName}}</view>
  26. <view>{{newData.subName}}({{newData.roomNum}})</view>
  27. </view>
  28. <view class="lab-info-b">
  29. <img src="@/pages_safetyCheck/images/icon_sys_xz@1x.png">
  30. {{newData.buildName}}{{newData.floorName}}
  31. </view>
  32. </view>
  33. <view class="liability-unit">
  34. <view>学院单位</view>
  35. <view>{{newData.deptName}}</view>
  36. </view>
  37. <view class="small-title-new" @click="unfoldPackUp('subAdminShowType')">
  38. <view>实验室负责人</view>
  39. <uni-icons :type="newData.subAdminShowType?'up':'down'" size="12" color='#A2A2A2'></uni-icons>
  40. </view>
  41. <view class="sub-head" v-if="newData.subAdminShowType">
  42. <view>{{newData.adminName}}</view>
  43. <view @click="callPhone(newData.adminPhone)">
  44. <img src="@/pages_manage/images/icon_aqxxp_dh.png">
  45. <view>{{newData.adminPhone}}</view>
  46. </view>
  47. </view>
  48. <view class="small-title-new" @click="unfoldPackUp('adminShowType')">
  49. <view>安全员</view>
  50. <uni-icons :type="newData.adminShowType?'up':'down'" size="12" color='#A2A2A2'></uni-icons>
  51. </view>
  52. <view v-if="newData.adminShowType">
  53. <view class="sub-head" v-for="(item,index) in newData.safeUserList" :key="index">
  54. <view>{{item.safeUserName}}</view>
  55. <view @click="callPhone(item.safeUserPhone)">
  56. <img src="@/pages_manage/images/icon_aqxxp_dh.png">
  57. <view>{{item.safeUserPhone}}</view>
  58. </view>
  59. </view>
  60. </view>
  61. <view class="classify" v-for="(item,index) in newData.labInfoBrandModels" :key="index">
  62. <view v-if="item.privateList.length>0" class="small-title-new" @click="unfoldPackUp('list',index)">
  63. <view>{{item.brandName}}</view>
  64. <uni-icons :type="item.showType?'up':'down'" size="12" color='#A2A2A2'></uni-icons>
  65. </view>
  66. <view v-if="item.privateList.length>0 && item.brandType==1 && !item.isSpecial&&item.showType">
  67. <view class="small-items-new" v-for="(item2,index2) in item.privateList" :key="index2">
  68. <view>{{index2+1}}. </view>
  69. <view>{{item2.infoName}}</view>
  70. </view>
  71. </view>
  72. <view v-if="item.privateList.length>0 && item.brandType==1 && item.isSpecial&&item.showType">
  73. <view class="small-items-new" v-for="(item2,index2) in item.privateList" :key="index2">
  74. <view></view>
  75. <view>{{item2.infoName}}</view>
  76. </view>
  77. </view>
  78. <view v-if="item.privateList.length>0 && item.brandType==2&&item.showType">
  79. <view class="logotype-img-new">
  80. <img v-for="(item3,index3) in item.privateList" :key="index3" :src="baseUrl+item3.infoContent">
  81. </view>
  82. </view>
  83. </view>
  84. </view>
  85. <view class="position-button-box">
  86. <view class="position-button-p-null"></view>
  87. <view class="position-button-p-1" @click="goPage('securityCheck')">安全检查</view>
  88. <view class="position-button-p-4" @click="goPage('snapshot')">随手拍</view>
  89. <view class="position-button-p-null"></view>
  90. </view>
  91. <!-- 物联控制 -->
  92. <iotControl ref="iotControl" v-if="pageType == 1" :subjectData="subjectData"></iotControl>
  93. <!-- 进出记录 -->
  94. <accessRecord v-if="pageType == 2" :subjectData="subjectData"></accessRecord>
  95. </view>
  96. </template>
  97. <script>
  98. import {
  99. pageRestrictVerify
  100. } from '@/utils/index'
  101. import {
  102. iotControl
  103. } from '@/pages_manage/views/laboratory/iotControl.vue'
  104. import {
  105. accessRecord
  106. } from '@/pages_manage/views/laboratory/accessRecord.vue'
  107. import {
  108. config
  109. } from '@/api/request/config.js'
  110. import {
  111. } from '@/pages/api/index.js'
  112. export default {
  113. name: "safetyCardScan",
  114. components: {
  115. iotControl,
  116. accessRecord,
  117. },
  118. data() {
  119. return {
  120. baseUrl: config.base_url,
  121. pageType: 1,
  122. tabText: [{
  123. name: '安全信息牌',
  124. img: require('@/pages_safetyCheck/images/icon_sys_aqxxp@1x.png'),
  125. },
  126. {
  127. name: '监测控制',
  128. img: require('@/pages_safetyCheck/images/icon_sys_jckz@1x.png'),
  129. },
  130. {
  131. name: '进出记录',
  132. img: require('@/pages_safetyCheck/images/icon_sys_jcjl@1x.png'),
  133. },
  134. ],
  135. pageType: 0,
  136. newData: {
  137. adminName: '',
  138. adminPhone: '',
  139. safeUserList: [],
  140. labInfoBrandModels: [],
  141. },
  142. subjectData: null,
  143. identityData: uni.getStorageSync('identityData'),
  144. }
  145. },
  146. // 父页面
  147. onReachBottom() {
  148. uni.$emit('onReachBottom') // 设置监听事件
  149. },
  150. onPullDownRefresh() {
  151. uni.$emit('onPullDownRefresh') // 设置监听事件
  152. },
  153. onLoad(option) {
  154. let newData = JSON.parse(decodeURIComponent(option.infoData));
  155. newData.subAdminShowType = true;
  156. newData.adminShowType = true;
  157. if (newData.labInfoBrandModels) {
  158. for (let i = 0; i < newData.labInfoBrandModels.length; i++) {
  159. newData.labInfoBrandModels[i].showType = true;
  160. }
  161. }
  162. this.$nextTick(() => {
  163. this.$set(this, 'newData', newData);
  164. this.$set(this, 'subjectData', newData);
  165. this.$set(this, 'pageType', 0);
  166. })
  167. },
  168. onShow() {
  169. },
  170. mounted() {
  171. },
  172. methods: {
  173. //展开/收起操作
  174. unfoldPackUp(type, index) {
  175. if (type == 'subAdminShowType') {
  176. this.$set(this.newData, 'subAdminShowType', !this.newData.subAdminShowType);
  177. } else if (type == 'adminShowType') {
  178. this.$set(this.newData, 'adminShowType', !this.newData.adminShowType);
  179. } else if (type == 'list') {
  180. this.$set(this.newData.labInfoBrandModels[index], 'showType', !this.newData.labInfoBrandModels[index].showType);
  181. }
  182. },
  183. //顶部tab点击
  184. tabClick(index) {
  185. if (this.pageType != index) {
  186. this.$set(this, 'pageType', index);
  187. }
  188. },
  189. goPage(type){
  190. if (!pageRestrictVerify(type)) {
  191. uni.showToast({
  192. title: '没有相关权限,请联系管理员',
  193. icon: "none",
  194. mask: true,
  195. duration: 2000
  196. });
  197. return
  198. }
  199. if (type == 'securityCheck') {
  200. //安全检查
  201. if(this.identityData){
  202. uni.navigateTo({
  203. url: "/pages_safetyCheck/views/safetyCheck",
  204. });
  205. }else{
  206. uni.showToast({
  207. mask: true,
  208. icon: "none",
  209. position: "center",
  210. title: '您不是校/院级管理员或督导组成员,无法使用该功能.',
  211. duration: 2000
  212. });
  213. }
  214. } else if (type == 'snapshot') {
  215. //随手拍
  216. uni.navigateTo({
  217. url: "/pages_safetyCheck/views/snapshotManage/snapshotList",
  218. });
  219. }
  220. },
  221. }
  222. }
  223. </script>
  224. <style lang="stylus" scoped>
  225. .safetyCardScan {
  226. height: 100%;
  227. display: flex;
  228. flex-direction: column;
  229. overflow: hidden;
  230. #fontColor-A {
  231. color: #00DEDE;
  232. }
  233. #fontColor-B {
  234. color: #FF8C00;
  235. }
  236. #fontColor-C {
  237. color: #0083FD;
  238. }
  239. .header {
  240. width: 100%;
  241. // position: fixed;
  242. // top: 0rpx;
  243. // z-index: 100;
  244. background: #fff;
  245. .tabTitle {
  246. width: 750rpx;
  247. height: 188rpx;
  248. display flex;
  249. justify-content: flex-start;
  250. align-items: center;
  251. border-bottom: 4rpx solid #F5F5F5;
  252. .tabTitle_li {
  253. height: 188rpx;
  254. flex: 1;
  255. position: relative;
  256. text-align center;
  257. .tabTitle_text {
  258. display: flex;
  259. justify-content: center;
  260. flex-direction: column;
  261. align-items: center;
  262. >img {
  263. width: 80rpx;
  264. height: 80rpx;
  265. margin-top: 20rpx;
  266. }
  267. >view:nth-of-type(1) {
  268. font-size: 30rpx;
  269. color: #333333;
  270. line-height: 42rpx;
  271. text-align: left;
  272. margin-top: 10rpx;
  273. }
  274. >view:nth-of-type(2) {
  275. font-size: 24rpx;
  276. color: #666666;
  277. line-height: 34rpx;
  278. text-align: left;
  279. }
  280. position: relative;
  281. &.on {}
  282. }
  283. .line {
  284. width: 2rpx;
  285. height: 40rpx;
  286. background: #D8D8D8;
  287. position: absolute;
  288. top: 40%;
  289. }
  290. .tabTitle_across {
  291. /* width: 50rpx;
  292. height: 4rpx;
  293. background: #0183FA;
  294. border-radius: 2rpx; */
  295. margin-left: 38%;
  296. margin-top: 12rpx;
  297. display none;
  298. >img {
  299. width: 40rpx;
  300. height: 26rpx;
  301. }
  302. &.on {
  303. display block;
  304. }
  305. }
  306. }
  307. }
  308. }
  309. /* 安全信息牌 */
  310. .safetyCard {
  311. flex: 1;
  312. overflow-y: scroll;
  313. padding-bottom: 150rpx;
  314. .lab-info {
  315. background: #FFFFFF;
  316. .lab-info-t {
  317. width: 750rpx;
  318. height: 80rpx;
  319. border-bottom: 2rpx dashed #E0E0E0;
  320. display: flex;
  321. justify-content: flex-start;
  322. align-items: center;
  323. padding: 0 30rpx;
  324. box-sizing: border-box;
  325. >view:nth-of-type(1) {
  326. width: 100rpx;
  327. height: 60rpx;
  328. background: #FF0000;
  329. border-radius: 50rpx 50rpx 50rpx 50rpx;
  330. font-size: 30rpx;
  331. color: #FFFFFF;
  332. line-height: 60rpx;
  333. text-align: center;
  334. }
  335. >view:nth-of-type(2) {
  336. width: 130rpx;
  337. height: 60rpx;
  338. border-radius: 50rpx 50rpx 50rpx 50rpx;
  339. border: 2rpx solid #FF8C00;
  340. font-size: 30rpx;
  341. color: #FF8C00;
  342. line-height: 60rpx;
  343. text-align: center;
  344. margin: 0 30rpx 0 10rpx;
  345. }
  346. >view:nth-of-type(3) {
  347. font-size: 30rpx;
  348. color: #333333;
  349. line-height: 42rpx;
  350. text-align: left;
  351. overflow: hidden;
  352. text-overflow: ellipsis;
  353. white-space: nowrap;
  354. }
  355. }
  356. .lab-info-b {
  357. height: 80rpx;
  358. padding: 0 30rpx;
  359. box-sizing: border-box;
  360. display: flex;
  361. justify-content: flex-start;
  362. align-items: center;
  363. >img {
  364. width: 34rpx;
  365. height: 34rpx;
  366. margin-right: 12rpx;
  367. }
  368. font-size: 30rpx;
  369. color: #333333;
  370. line-height: 42rpx;
  371. text-align: left;
  372. }
  373. }
  374. .liability-unit {
  375. width: 750rpx;
  376. height: 80rpx;
  377. background: #FFFFFF;
  378. border-bottom: 1rpx solid #E0E0E0;
  379. padding: 0 30rpx;
  380. box-sizing: border-box;
  381. display: flex;
  382. justify-content: space-between;
  383. margin-top: 14rpx;
  384. >view:nth-of-type(1) {
  385. font-size: 30rpx;
  386. color: #333333;
  387. line-height: 80rpx;
  388. text-align: left;
  389. }
  390. >view:nth-of-type(2) {
  391. font-size: 30rpx;
  392. color: #666666;
  393. line-height: 80rpx;
  394. text-align: left;
  395. }
  396. }
  397. .small-title {
  398. width: 750rpx;
  399. height: 80rpx;
  400. background: #FFFFFF;
  401. border-bottom: 1rpx solid #E0E0E0;
  402. padding: 0 30rpx;
  403. box-sizing: border-box;
  404. display: flex;
  405. justify-content: space-between;
  406. align-items: center;
  407. >view {
  408. font-size: 30rpx;
  409. color: #333333;
  410. line-height: 80rpx;
  411. text-align: left;
  412. }
  413. >img {
  414. width: 24rpx;
  415. height: 12rpx;
  416. }
  417. }
  418. .sub-head {
  419. width: 750rpx;
  420. height: 80rpx;
  421. background: #fff;
  422. padding: 0 30rpx;
  423. box-sizing: border-box;
  424. display: flex;
  425. justify-content: space-between;
  426. align-items: center;
  427. border-bottom: 1rpx solid #E0E0E0;
  428. >view:nth-of-type(1) {
  429. font-family: PingFang SC;
  430. font-weight: 500;
  431. font-size: 30rpx;
  432. color: #666666;
  433. line-height: 30rpx;
  434. }
  435. >view:nth-of-type(2) {
  436. display: flex;
  437. justify-content: flex-end;
  438. align-items: center;
  439. >img {
  440. width: 34rpx;
  441. height: 34rpx;
  442. margin-right: 14rpx;
  443. }
  444. >view {
  445. font-family: PingFang SC;
  446. font-weight: 500;
  447. font-size: 30rpx;
  448. color: #0183FA;
  449. line-height: 30rpx;
  450. }
  451. }
  452. }
  453. .sub-head:last-child {
  454. border-bottom: none;
  455. }
  456. .small-title-new {
  457. width: 750rpx;
  458. height: 80rpx;
  459. background: #FFFFFF;
  460. border-bottom: 1rpx solid #E0E0E0;
  461. padding: 0 30rpx;
  462. box-sizing: border-box;
  463. display: flex;
  464. justify-content: space-between;
  465. align-items: center;
  466. >view {
  467. font-size: 30rpx;
  468. color: #333333;
  469. line-height: 80rpx;
  470. text-align: left;
  471. }
  472. >img {
  473. width: 24rpx;
  474. height: 12rpx;
  475. }
  476. }
  477. .classify {
  478. .small-items-new {
  479. padding-left: 20rpx;
  480. box-sizing: border-box;
  481. background: #fff;
  482. display: flex;
  483. justify-content: flex-start;
  484. padding: 30rpx;
  485. box-sizing: border-box;
  486. border-bottom: 1rpx solid #E0E0E0;
  487. >view:nth-of-type(1) {
  488. color: #999999;
  489. font-weight: 500;
  490. font-size: 28rpx;
  491. margin-right: 12rpx;
  492. line-height: 34rpx;
  493. }
  494. >view:nth-of-type(2) {
  495. display: block;
  496. font-family: PingFang SC;
  497. font-weight: 500;
  498. font-size: 28rpx;
  499. line-height: 34rpx;
  500. color: #999999;
  501. }
  502. }
  503. .logotype-img-new {
  504. padding: 26rpx 0 34rpx 0;
  505. box-sizing: border-box;
  506. background: #fff;
  507. >img {
  508. display: inline-block;
  509. width: 86rpx;
  510. height: 114rpx;
  511. margin-left: 30rpx;
  512. margin-bottom: 20rpx;
  513. }
  514. }
  515. .small-items {
  516. padding-left: 20rpx;
  517. box-sizing: border-box;
  518. background: #fff;
  519. display: flex;
  520. justify-content: flex-start;
  521. padding: 20rpx;
  522. box-sizing: border-box;
  523. >view:nth-of-type(1) {
  524. color: #999999;
  525. font-weight: 500;
  526. font-size: 28rpx;
  527. margin-right: 12rpx;
  528. line-height: 34rpx;
  529. }
  530. >view:nth-of-type(2) {
  531. display: block;
  532. font-family: PingFang SC;
  533. font-weight: 500;
  534. font-size: 28rpx;
  535. line-height: 34rpx;
  536. color: #999999;
  537. }
  538. }
  539. .logotype {
  540. width: 750rpx;
  541. height: 100rpx;
  542. font-family: PingFang SC;
  543. font-weight: 500;
  544. font-size: 32rpx;
  545. color: #333333;
  546. line-height: 100rpx;
  547. padding-left: 20rpx;
  548. box-sizing: border-box;
  549. background: #0183FA;
  550. color: #fff;
  551. }
  552. .logotype-img {
  553. padding: 26rpx 0 34rpx 0;
  554. box-sizing: border-box;
  555. background: #fff;
  556. >img {
  557. display: inline-block;
  558. width: 86rpx;
  559. height: 114rpx;
  560. margin-left: 30rpx;
  561. margin-bottom: 20rpx;
  562. }
  563. }
  564. }
  565. }
  566. .position-button-box {
  567. position: absolute;
  568. bottom: 25rpx;
  569. left: 60rpx;
  570. width: 640rpx;
  571. height: 100rpx;
  572. display: flex;
  573. color: #fff;
  574. overflow: hidden;
  575. view:nth-child(2) {
  576. border-top-left-radius: 10rpx;
  577. border-bottom-left-radius: 10rpx;
  578. }
  579. view:nth-last-child(2) {
  580. border-top-right-radius: 10rpx;
  581. border-bottom-right-radius: 10rpx;
  582. }
  583. .position-button-p-null {
  584. flex: 1;
  585. }
  586. .position-button-p-1 {
  587. width: 160rpx;
  588. line-height: 100rpx;
  589. font-size: 30rpx;
  590. text-align: center;
  591. background-color: #0183FA;
  592. }
  593. .position-button-p-2 {
  594. width: 160rpx;
  595. line-height: 100rpx;
  596. font-size: 30rpx;
  597. text-align: center;
  598. background-color: #16B531;
  599. }
  600. .position-button-p-3 {
  601. width: 160rpx;
  602. line-height: 100rpx;
  603. font-size: 30rpx;
  604. text-align: center;
  605. background-color: #00DEDE;
  606. }
  607. .position-button-p-4 {
  608. width: 160rpx;
  609. line-height: 100rpx;
  610. font-size: 30rpx;
  611. text-align: center;
  612. background-color: #FF8C00;
  613. }
  614. }
  615. }
  616. </style>