safetyCardScan.vue 16 KB

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