safetyCardScan.vue 16 KB

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