safetyCardScan.vue 33 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274
  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="imagesUrl('commonality/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. <img class="lab-info-l" :src="imagesUrl('commonality/icon_aqjc_shiyanshi.png')">
  24. <view class="lab-info-c">
  25. <view class="lab-info-c-t">
  26. <view class="lab-info-c-t-l">{{newData.subName}}</view>
  27. <view class="lab-info-c-t-r" v-if="newData.levelName&&newData.typeName"
  28. :style="'border:1rpx solid '+newData.levelColor+';background:'+newData.levelColorTow+';'">
  29. <text
  30. :style="'border-right:1rpx solid '+newData.levelColor+';color:'+newData.levelColor+';'">{{newData.levelName?newData.levelName:''}}</text>
  31. <text
  32. :style="'color:'+newData.levelColor+';'">{{newData.typeName?newData.typeName:''}}</text>
  33. </view>
  34. </view>
  35. <view class="lab-info-c-b">
  36. {{newData.roomNum?newData.roomNum:'-'}}房间&{{newData.buildName}}
  37. </view>
  38. </view>
  39. <view class="lab-info-r">{{newData.subArea}}㎡</view>
  40. </view>
  41. <view class="liability-unit">
  42. <view>学院单位</view>
  43. <view>{{newData.deptName}}</view>
  44. </view>
  45. <view class="small-title-new" @click="unfoldPackUp('subAdminShowType')">
  46. <view>实验室负责人</view>
  47. <uni-icons :type="newData.subAdminShowType?'up':'down'" size="12" color='#A2A2A2'></uni-icons>
  48. </view>
  49. <view class="sub-head" v-if="newData.subAdminShowType">
  50. <view>{{newData.adminName}}</view>
  51. <view @click="callPhone(newData.adminPhone)">
  52. <img :src="imagesUrl('manage/icon_aqxxp_dh.png')">
  53. <view>{{newData.adminPhone}}</view>
  54. </view>
  55. </view>
  56. <view class="small-title-new" @click="unfoldPackUp('safetyLiaisonShowType')">
  57. <view>安全联络员</view>
  58. <uni-icons :type="newData.safetyLiaisonShowType?'up':'down'" size="12" color='#A2A2A2'></uni-icons>
  59. </view>
  60. <view class="sub-head" v-if="newData.safetyLiaisonShowType&&newData.safetyLiaisonName">
  61. <view>{{newData.safetyLiaisonName}}</view>
  62. <view @click="callPhone(newData.safetyLiaisonPhone)">
  63. <img :src="imagesUrl('manage/icon_aqxxp_dh.png')">
  64. <view>{{newData.safetyLiaisonPhone}}</view>
  65. </view>
  66. </view>
  67. <view class="small-title-new" @click="unfoldPackUp('subAdminUserShowType')">
  68. <view>管理员</view>
  69. <uni-icons :type="newData.subAdminUserShowType?'up':'down'" size="12" color='#A2A2A2'></uni-icons>
  70. </view>
  71. <view style="border-bottom: 1rpx solid #E0E0E0;" v-if="newData.subAdminUserShowType">
  72. <view class="sub-head" v-for="(item,index) in newData.adminUserList" :key="index">
  73. <view>{{item.adminUserName}}</view>
  74. <view @click="callPhone(item.adminUserPhone)">
  75. <img :src="imagesUrl('manage/icon_aqxxp_dh.png')" v-if="item.adminUserPhone">
  76. <view>{{item.adminUserPhone?item.adminUserPhone:'--'}}</view>
  77. </view>
  78. </view>
  79. </view>
  80. <view class="small-title-new" @click="unfoldPackUp('adminShowType')">
  81. <view>安全员</view>
  82. <uni-icons :type="newData.adminShowType?'up':'down'" size="12" color='#A2A2A2'></uni-icons>
  83. </view>
  84. <view v-if="newData.adminShowType">
  85. <view class="sub-head" v-for="(item,index) in newData.safeUserList" :key="index">
  86. <view>{{item.safeUserName}}</view>
  87. <view @click="callPhone(item.safeUserPhone)">
  88. <img :src="imagesUrl('manage/icon_aqxxp_dh.png')" v-if="item.safeUserPhone">
  89. <view>{{item.safeUserPhone?item.safeUserPhone:'--'}}</view>
  90. </view>
  91. </view>
  92. </view>
  93. <view class="classify" v-for="(item,index) in newData.labInfoBrandModels" :key="index">
  94. <view v-if="item.privateList.length>0" class="small-title-new" @click="unfoldPackUp('list',index)">
  95. <view>{{item.brandName}}</view>
  96. <uni-icons :type="item.showType?'up':'down'" size="12" color='#A2A2A2'></uni-icons>
  97. </view>
  98. <view v-if="item.privateList.length>0 && item.brandType==1 && !item.isSpecial&&item.showType">
  99. <view class="small-items-new" v-for="(item2,index2) in item.privateList" :key="index2">
  100. <view>{{index2+1}}. </view>
  101. <view>{{item2.infoContent}}</view>
  102. </view>
  103. </view>
  104. <view v-if="item.privateList.length>0 && item.brandType==1 && item.isSpecial&&item.showType">
  105. <view class="small-items-new" v-for="(item2,index2) in item.privateList" :key="index2">
  106. <view></view>
  107. <view>{{item2.infoContent}}</view>
  108. </view>
  109. </view>
  110. <view v-if="item.privateList.length>0 && item.brandType==2&&item.showType">
  111. <view class="logotype-img-new">
  112. <img v-for="(item3,index3) in item.privateList" :key="index3" :src="baseUrl+item3.infoContent">
  113. </view>
  114. </view>
  115. </view>
  116. </view>
  117. <view class="position-button-box" :class="signInType==0?'button-box-1':'button-box-2'" v-if="pageType == 0">
  118. <img class="position-button-p-1" v-if="signInType == 1" @click="laboratoryLabHkPassOutSignIn()"
  119. :src="imagesUrl('safetyCheck/icon_sys_qd@1x.png')">
  120. <img class="position-button-p-1" v-if="signInType == 2" @click="laboratoryLabHkPassOutSignOut()"
  121. :src="imagesUrl('safetyCheck/icon_sys_qt@1x.png')">
  122. <img class="position-button-p-1" @click="goPage('securityCheck',true)"
  123. :src="imagesUrl('safetyCheck/icon_aqjc_anquanjiancha.png')">
  124. <img class="position-button-p-2" @click="goPage('snapshot','')"
  125. :src="imagesUrl('safetyCheck/icon_aqjc_suishoupai.png')">
  126. </view>
  127. <!-- 物联控制 -->
  128. <iotControl ref="iotControl" v-if="pageType == 1" :subjectData="subjectData"></iotControl>
  129. <!-- 进出记录 -->
  130. <accessRecord v-if="pageType == 2" :subjectData="subjectData"></accessRecord>
  131. <!-- 语音广播弹窗 -->
  132. <voiceBroadcast v-if="broadcastPage" :subjectData="subjectData"></voiceBroadcast>
  133. <!-- 空调弹窗 -->
  134. <airConditioning v-if="conditioningPage" :airConditioningData="airConditioningData"></airConditioning>
  135. <view class="shade-box" v-if="securityCheck">
  136. <view class="null-box" @click="goPage('securityCheck',false)"></view>
  137. <view class="shade_n">
  138. <view class="title">
  139. <view>请选择实验室</view>
  140. </view>
  141. <view class="batch">
  142. <view class="batch-li" @click="batchClickTow(item)" v-for="(item,index) in securityCheckList">
  143. <view class="batch-li-l">
  144. <text>{{item.planTitle}}-{{item.checkName}}</text>
  145. <text>{{item.subName}}{{item.roomNum?'('+item.roomNum+')':''}}</text>
  146. </view>
  147. <view class="batch-li-r">
  148. <img :src="imagesUrl('commonality/icon_wd_gd@1x.png')">
  149. </view>
  150. </view>
  151. </view>
  152. </view>
  153. </view>
  154. <view class="shade-sign-in-max-box" v-if="signInShowType">
  155. <!-- 签到 -->
  156. <view class="shade-sign-in-min-box-1" v-if="signInDataType == 1">
  157. <view class="shade-sign-in-title-p">{{signInData.title}}</view>
  158. <view class="shade-sign-in-img-text-box">
  159. <view class="shade-sign-in-img-text-min-box">
  160. <img :src="imagesUrl('safetyCheck/icon_qdcg_qdr@1x.png')">
  161. <view>签到人:</view>
  162. </view>
  163. <view class="shade-sign-in-img-text-p">{{signInData.userName}}{{signInData.userAccount?'('+signInData.userAccount+')':''}}</view>
  164. </view>
  165. <view class="shade-sign-in-img-text-box">
  166. <view class="shade-sign-in-img-text-min-box">
  167. <img :src="imagesUrl('safetyCheck/icon_qdcg_qddd@1x.png')">
  168. <view>签到地点:</view>
  169. </view>
  170. <view class="shade-sign-in-img-text-p">{{signInData.subName}}</view>
  171. <view class="shade-sign-in-img-text-p" style="margin-top:15rpx;">{{signInData.address}}</view>
  172. </view>
  173. <view class="shade-sign-in-img-text-box">
  174. <view class="shade-sign-in-img-text-min-box">
  175. <img :src="imagesUrl('safetyCheck/icon_qdcg_qdsj@1x.png')">
  176. <view>签到时间:</view>
  177. </view>
  178. <view class="shade-sign-in-img-text-p">{{signInData.signIn}}</view>
  179. </view>
  180. <view class="off-button-p" @click="offButton()">关闭({{timeNum}})</view>
  181. </view>
  182. <!-- 签退 -->
  183. <view class="shade-sign-in-min-box-2" v-if="signInDataType == 2">
  184. <view class="shade-sign-in-title-p">{{signInData.title}}</view>
  185. <view class="shade-sign-in-img-text-box">
  186. <view class="shade-sign-in-img-text-min-box">
  187. <img :src="imagesUrl('safetyCheck/icon_qdcg_qdsj@1x.png')">
  188. <view>签退时间:</view>
  189. </view>
  190. <view class="shade-sign-in-img-text-p">{{signInData.signOut}}</view>
  191. </view>
  192. <view class="shade-sign-in-img-text-box">
  193. <view class="shade-sign-in-img-text-min-box">
  194. <img :src="imagesUrl('safetyCheck/icon_qtcg_tlsj@1x.png')">
  195. <view>本次停留时间</view>
  196. </view>
  197. <view class="shade-sign-in-img-text-p">{{signInData.residenceTime}}</view>
  198. </view>
  199. <view class="shade-sign-in-text-box">
  200. <view class="shade-sign-in-text-p-1">签到信息:</view>
  201. <view class="shade-sign-in-text-p-2">签到人:</view>
  202. <view class="shade-sign-in-text-p-2" style="margin-top:12rpx;">{{signInData.userName}}{{signInData.userAccount?'('+signInData.userAccount+')':''}}</view>
  203. <view class="shade-sign-in-text-p-2">签到地点:</view>
  204. <view class="shade-sign-in-text-p-2" style="margin-top:12rpx;">{{signInData.subName}}</view>
  205. <view class="shade-sign-in-text-p-2" style="margin-top:12rpx;">{{signInData.address}}</view>
  206. <view class="shade-sign-in-text-p-2">签到时间:</view>
  207. <view class="shade-sign-in-text-p-2" style="margin-top:12rpx;">{{signInData.signIn}}</view>
  208. </view>
  209. <view class="off-button-p" @click="offButton()">关闭({{timeNum}})</view>
  210. </view>
  211. </view>
  212. </view>
  213. </template>
  214. <script>
  215. import {
  216. parseTime
  217. } from '@/component/public.js'
  218. import {
  219. pageRestrictVerify
  220. } from '@/utils/index'
  221. import {
  222. iotControl
  223. } from '@/pages_manage/views/laboratory/iotControl.vue'
  224. import {
  225. accessRecord
  226. } from '@/pages_manage/views/laboratory/accessRecord.vue'
  227. import {
  228. voiceBroadcast
  229. } from '@/pages_manage/views/laboratory/voiceBroadcast.vue'
  230. import {
  231. airConditioning
  232. } from '@/pages_manage/views/laboratory/airConditioning.vue'
  233. import {
  234. config
  235. } from '@/api/request/config.js'
  236. import {
  237. } from '@/pages/api/index.js'
  238. import {
  239. securityAppCheckPlanScanCode,
  240. } from '@/pages_safetyCheck/api/index.js'
  241. import {
  242. laboratoryLabHkPassOutIsEnableSign,
  243. laboratoryLabHkPassOutIsSign,
  244. laboratoryLabHkPassOutSignIn,
  245. laboratoryLabHkPassOutSignOut,
  246. } from '@/pages_manage/api/index.js'
  247. export default {
  248. name: "safetyCardScan",
  249. components: {
  250. iotControl,
  251. accessRecord,
  252. voiceBroadcast,
  253. airConditioning,
  254. },
  255. data() {
  256. return {
  257. baseUrl: config.base_url,
  258. pageType: 1,
  259. tabText: [{
  260. name: '安全信息牌',
  261. img: this.imagesUrl('safetyCheck/icon_sys_aqxxp@1x.png'),
  262. },
  263. {
  264. name: '监测控制',
  265. img: this.imagesUrl('safetyCheck/icon_sys_jckz@1x.png'),
  266. },
  267. {
  268. name: '进出记录',
  269. img: this.imagesUrl('safetyCheck/icon_sys_jcjl@1x.png'),
  270. },
  271. ],
  272. pageType: 0,
  273. newData: {
  274. adminName: '',
  275. adminPhone: '',
  276. safeUserList: [],
  277. adminUserList: [],
  278. labInfoBrandModels: [],
  279. },
  280. subjectData: null,
  281. identityData: uni.getStorageSync('identityData'),
  282. //语音广播弹窗
  283. broadcastPage: false,
  284. //空调弹窗
  285. conditioningPage: false,
  286. // 空调弹窗
  287. airConditioningData: null,
  288. securityCheck: false,
  289. securityCheckList:[],
  290. form: {},
  291. //签到按钮状态
  292. signInType:0,
  293. signInShowType:false,
  294. signInDataType:0,
  295. signInData:{
  296. title:'签到成功',
  297. userName:'姓名',
  298. userAccount:'学号',
  299. subName:'实验室名称',
  300. address:'楼栋-楼层-房间号',
  301. signIn:'2025-09-20 15:15:15',
  302. signOut:'2025-09-20 15:15:15',
  303. residenceTime:'20-20-20-20',
  304. },
  305. timeNum:0,
  306. timeData:null,
  307. }
  308. },
  309. // 父页面
  310. onReachBottom() {
  311. uni.$emit('onReachBottom') // 设置监听事件
  312. },
  313. onPullDownRefresh() {
  314. uni.$emit('onPullDownRefresh') // 设置监听事件
  315. },
  316. onLoad(option) {
  317. let newData = JSON.parse(decodeURIComponent(option.infoData));
  318. newData.subAdminShowType = true;
  319. newData.safetyLiaisonShowType = true;
  320. newData.subAdminUserShowType = true;
  321. newData.adminShowType = true;
  322. if (newData.labInfoBrandModels) {
  323. for (let i = 0; i < newData.labInfoBrandModels.length; i++) {
  324. newData.labInfoBrandModels[i].showType = true;
  325. }
  326. }
  327. if (newData.levelColor) {
  328. newData.levelColorTow = this.hexToRgb(newData.levelColor, 0.2)
  329. }
  330. this.$nextTick(() => {
  331. this.$set(this, 'newData', newData);
  332. this.$set(this, 'subjectData', newData);
  333. this.$set(this, 'pageType', 0);
  334. this.laboratoryLabHkPassOutIsEnableSign();
  335. })
  336. },
  337. onShow() {
  338. this.$set(this, 'securityCheck', false)
  339. },
  340. mounted() {
  341. },
  342. methods: {
  343. //十六进制颜色值和RGB格式转换
  344. hexToRgb(hex, opacity = 1) {
  345. // 去除#号
  346. var color = hex.replace("#", "");
  347. // 分割成红、绿、蓝三部分的16进制字符串
  348. var red = parseInt(color.substring(0, 2), 16);
  349. var green = parseInt(color.substring(2, 4), 16);
  350. var blue = parseInt(color.substring(4, 6), 16);
  351. return `RGB(${red}, ${green}, ${blue},${opacity})`;
  352. },
  353. //拨打电话
  354. callPhone(tel) {
  355. if(tel){
  356. uni.makePhoneCall({
  357. phoneNumber: tel
  358. })
  359. }
  360. },
  361. goVideoPage() {
  362. console.log('视频')
  363. let obj = {
  364. type: 4,
  365. subId: this.newData.subId
  366. }
  367. uni.navigateTo({
  368. url: '/pages_manage/views/laboratory/videoPlayer?item=' + encodeURIComponent(JSON.stringify(
  369. obj))
  370. });
  371. },
  372. getIotControlData() {
  373. this.$refs['iotControl'].iotAppHardwareFindByType();
  374. },
  375. buttonClick(type, row) {
  376. let self = this;
  377. if (type == 'subDetail') {
  378. //实验室详情
  379. } else if (type == 'broadcastOpen') {
  380. //语音弹窗开启
  381. this.$set(this, 'broadcastPage', true);
  382. } else if (type == 'broadcastClose') {
  383. //语音弹窗关闭
  384. this.$set(this, 'broadcastPage', false);
  385. } else if (type == 'conditioningOpen') {
  386. //空调弹窗开启
  387. this.$set(this, 'airConditioningData', row);
  388. this.$set(this, 'conditioningPage', true);
  389. } else if (type == 'conditioningClose') {
  390. //空调弹窗关闭
  391. this.$set(this, 'conditioningPage', false);
  392. } else if (type == 'back') {
  393. this.$set(this, 'pageType', 2);
  394. }
  395. },
  396. //展开/收起操作
  397. unfoldPackUp(type, index) {
  398. if (type == 'subAdminShowType') {
  399. this.$set(this.newData, 'subAdminShowType', !this.newData.subAdminShowType);
  400. }else if (type == 'safetyLiaisonShowType') {
  401. this.$set(this.newData, 'safetyLiaisonShowType', !this.newData.safetyLiaisonShowType);
  402. } else if (type == 'subAdminUserShowType') {
  403. this.$set(this.newData, 'subAdminUserShowType', !this.newData.subAdminUserShowType);
  404. } else if (type == 'adminShowType') {
  405. this.$set(this.newData, 'adminShowType', !this.newData.adminShowType);
  406. } else if (type == 'list') {
  407. this.$set(this.newData.labInfoBrandModels[index], 'showType', !this.newData.labInfoBrandModels[index]
  408. .showType);
  409. }
  410. },
  411. //顶部tab点击
  412. tabClick(index) {
  413. if (this.pageType != index) {
  414. this.$set(this, 'pageType', index);
  415. }
  416. },
  417. goPage(type, status) {
  418. if (!pageRestrictVerify(type)) {
  419. uni.showToast({
  420. title: '没有相关权限,请联系管理员',
  421. icon: "none",
  422. mask: true,
  423. duration: 2000
  424. });
  425. return
  426. } else if (type == 'securityCheck') {
  427. if(status){
  428. this.securityAppCheckPlanScanCode(this.newData.subId,);
  429. }else{
  430. this.$set(this,'securityCheck',false);
  431. }
  432. } else if (type == 'snapshot') {
  433. console.log(111)
  434. console.log(this.newData)
  435. this.$set(this.form, "subId", this.newData.subId)
  436. this.$set(this.form, "subName", this.newData.subName)
  437. this.$set(this.form, "subRoom", this.newData.roomNum)
  438. this.$set(this.form, "deptId", this.newData.deptId)
  439. this.$set(this.form, "deptName", this.newData.deptName)
  440. this.$set(this.form, "buildId", this.newData.buildId)
  441. this.$set(this.form, "buildName", this.newData.buildName)
  442. this.$set(this.form, "floorId", this.newData.floorId)
  443. this.$set(this.form, "floorName", this.newData.floorName)
  444. this.$set(this.form, "typeId", this.newData.typeId)
  445. this.$set(this.form, "classTypeNames", this.newData.typeName)
  446. this.$set(this.form, "levelId", this.newData.levelId)
  447. this.$set(this.form, "classLevelName", this.newData.levelName)
  448. uni.navigateTo({
  449. url: '/pages_safetyCheck/views/snapshotManage/snapshotList?form=' +
  450. encodeURIComponent(JSON.stringify(this.form))
  451. });
  452. }
  453. },
  454. //查询计划
  455. async securityAppCheckPlanScanCode(subId,planSetId) {
  456. let self = this;
  457. let checkCategory = null;
  458. if(uni.getStorageSync('identityData')){
  459. if(uni.getStorageSync('identityData').type=='collegeAdmin'){
  460. checkCategory=2
  461. }else if(uni.getStorageSync('identityData').type=='schoolAdmin'){
  462. checkCategory=1
  463. }
  464. }
  465. let obj = {
  466. subId:subId,
  467. checkCategory:checkCategory,
  468. };
  469. if(planSetId){
  470. obj.planSetId = planSetId;
  471. }
  472. const {
  473. data
  474. } = await securityAppCheckPlanScanCode(obj);
  475. if (data.code == 200) {
  476. if(data.data[0]){
  477. if(data.data[1]){
  478. //多个
  479. self.$set(self,'securityCheckList',data.data);
  480. self.$set(self,'securityCheck',true);
  481. }else{
  482. //单个
  483. let infoData = data.data[0];
  484. infoData.pageType = 0;
  485. uni.navigateTo({
  486. url: '/pages_safetyCheck/views/itemsManage/hiddenDangerItems?infoData=' + encodeURIComponent(
  487. JSON.stringify(infoData))
  488. });
  489. }
  490. }else{
  491. //没有
  492. uni.showToast({
  493. title: '该实验室暂无检查计划!',
  494. icon: "none",
  495. mask: true,
  496. duration: 2000
  497. });
  498. }
  499. }
  500. },
  501. //是否可以门禁签到
  502. async laboratoryLabHkPassOutIsEnableSign(subId,planSetId) {
  503. let self = this;
  504. let obj = {
  505. subId:this.newData.subId
  506. };
  507. const {
  508. data
  509. } = await laboratoryLabHkPassOutIsEnableSign(obj);
  510. if (data.code == 200) {
  511. if(data.data){
  512. this.laboratoryLabHkPassOutIsSign();
  513. }
  514. }
  515. },
  516. //是否已经签到
  517. async laboratoryLabHkPassOutIsSign(subId,planSetId) {
  518. let self = this;
  519. let obj = {
  520. subId:this.newData.subId
  521. };
  522. const {
  523. data
  524. } = await laboratoryLabHkPassOutIsSign(obj);
  525. if (data.code == 200) {
  526. if(data.data){
  527. this.$set(this,'signInType',2);
  528. }else{
  529. this.$set(this,'signInType',1);
  530. }
  531. }
  532. },
  533. //门禁签到
  534. async laboratoryLabHkPassOutSignIn(subId,planSetId) {
  535. let self = this;
  536. let obj = {
  537. subId:this.newData.subId
  538. };
  539. const {
  540. data
  541. } = await laboratoryLabHkPassOutSignIn(obj);
  542. if (data.code == 200) {
  543. let obj = data.data;
  544. obj.title = '签到成功';
  545. obj.address = this.newData.buildName +'-'+this.newData.floorName +'-'+this.newData.roomNum;
  546. obj.signIn = parseTime(obj.signIn, "{y}-{m}-{d} {h}:{i}:{s}");
  547. this.$set(this,'signInData',obj);
  548. this.$set(this,'signInDataType',1);
  549. this.$set(this,'signInShowType',true);
  550. this.timerFunction();
  551. this.laboratoryLabHkPassOutIsSign();
  552. }
  553. },
  554. //门禁签退
  555. async laboratoryLabHkPassOutSignOut(subId,planSetId) {
  556. let self = this;
  557. let obj = {
  558. subId:this.newData.subId
  559. };
  560. const {
  561. data
  562. } = await laboratoryLabHkPassOutSignOut(obj);
  563. if (data.code == 200) {
  564. let obj = data.data;
  565. obj.title = '签退成功';
  566. obj.address = this.newData.buildName +'-'+this.newData.floorName +'-'+this.newData.roomNum;
  567. obj.signIn = parseTime(obj.signIn, "{y}-{m}-{d} {h}:{i}:{s}");
  568. obj.signOut = parseTime(obj.signOut, "{y}-{m}-{d} {h}:{i}:{s}");
  569. this.$set(this,'signInData',obj);
  570. this.$set(this,'signInDataType',2);
  571. this.$set(this,'signInShowType',true);
  572. this.timerFunction();
  573. this.laboratoryLabHkPassOutIsSign();
  574. }
  575. },
  576. timerFunction(){
  577. let self = this;
  578. this.$set(this,'timeNum',10);
  579. this.timeData = setInterval(refreshCount, 1000);
  580. function refreshCount() {
  581. if(self.timeNum>0){
  582. self.$set(self,'timeNum',self.timeNum - 1);
  583. }else{
  584. self.$set(self,'signInShowType',false);
  585. clearInterval(self.timeData);
  586. }
  587. }
  588. },
  589. offButton(){
  590. clearInterval(this.timeData);
  591. this.$set(this,'signInShowType',false);
  592. },
  593. batchClickTow(row) {
  594. let infoData = row;
  595. infoData.pageType = 0;
  596. uni.navigateTo({
  597. url: '/pages_safetyCheck/views/itemsManage/hiddenDangerItems?infoData=' + encodeURIComponent(
  598. JSON.stringify(infoData))
  599. });
  600. },
  601. }
  602. }
  603. </script>
  604. <style lang="stylus" scoped>
  605. @import '@/api/request/imagesUrl.styl';
  606. .safetyCardScan {
  607. height: 100%;
  608. #fontColor-A {
  609. color: #00DEDE;
  610. }
  611. #fontColor-B {
  612. color: #FF8C00;
  613. }
  614. #fontColor-C {
  615. color: #0083FD;
  616. }
  617. .header {
  618. height: 192rpx;
  619. width: 100%;
  620. // position: fixed;
  621. // top: 0rpx;
  622. // z-index: 100;
  623. background: #fff;
  624. .tabTitle {
  625. width: 750rpx;
  626. height: 188rpx;
  627. display flex;
  628. justify-content: flex-start;
  629. align-items: center;
  630. border-bottom: 4rpx solid #F5F5F5;
  631. .tabTitle_li {
  632. height: 188rpx;
  633. flex: 1;
  634. position: relative;
  635. text-align center;
  636. .tabTitle_text {
  637. display: flex;
  638. justify-content: center;
  639. flex-direction: column;
  640. align-items: center;
  641. >img {
  642. width: 80rpx;
  643. height: 80rpx;
  644. margin-top: 20rpx;
  645. }
  646. >view:nth-of-type(1) {
  647. font-size: 30rpx;
  648. color: #333333;
  649. line-height: 42rpx;
  650. text-align: left;
  651. margin-top: 10rpx;
  652. }
  653. >view:nth-of-type(2) {
  654. font-size: 24rpx;
  655. color: #666666;
  656. line-height: 34rpx;
  657. text-align: left;
  658. }
  659. position: relative;
  660. &.on {}
  661. }
  662. .line {
  663. width: 2rpx;
  664. height: 40rpx;
  665. background: #D8D8D8;
  666. position: absolute;
  667. top: 40%;
  668. }
  669. .tabTitle_across {
  670. /* width: 50rpx;
  671. height: 4rpx;
  672. background: #0183FA;
  673. border-radius: 2rpx; */
  674. margin-left: 38%;
  675. margin-top: 12rpx;
  676. display none;
  677. >img {
  678. width: 40rpx;
  679. height: 26rpx;
  680. }
  681. &.on {
  682. display block;
  683. }
  684. }
  685. }
  686. }
  687. }
  688. /* 安全信息牌 */
  689. .safetyCard {
  690. padding-bottom: 150rpx;
  691. .lab-info {
  692. background: #FFFFFF;
  693. display: flex;
  694. justify-content: space-between;
  695. .lab-info-l {
  696. width: 80rpx;
  697. height: 80rpx;
  698. background: #0183FA;
  699. border-radius: 10rpx 10rpx 10rpx 10rpx;
  700. margin-left: 30rpx;
  701. margin-top: 30rpx;
  702. }
  703. .lab-info-c {
  704. width: 500rpx;
  705. margin: 24rpx 30rpx 0 20rpx;
  706. .lab-info-c-t {
  707. display: flex;
  708. justify-content: space-between;
  709. .lab-info-c-t-l {
  710. font-size: 30rpx;
  711. color: #333333;
  712. line-height: 42rpx;
  713. text-align: left;
  714. overflow: hidden;
  715. text-overflow: ellipsis;
  716. white-space: nowrap;
  717. }
  718. .lab-info-c-t-r {
  719. display: flex;
  720. justify-content: flex-start;
  721. background: rgba(255, 0, 0, 0.2);
  722. border-radius: 10rpx 10rpx 10rpx 10rpx;
  723. border: 2rpx solid #FF0000;
  724. width: 200rpx;
  725. height: 40rpx;
  726. margin-left: 10rpx;
  727. >text {
  728. display: inline-block;
  729. flex: 1;
  730. text-align: center;
  731. font-size: 24rpx;
  732. color: #FF0000;
  733. line-height: 40rpx;
  734. text-align: center;
  735. overflow: hidden;
  736. text-overflow: ellipsis;
  737. white-space: nowrap;
  738. }
  739. >text:nth-of-type(1) {
  740. border-right: 2rpx solid #FF0000;
  741. }
  742. >text:nth-of-type(2) {}
  743. }
  744. }
  745. .lab-info-c-b {
  746. font-size: 30rpx;
  747. color: #666666;
  748. line-height: 42rpx;
  749. text-align: left;
  750. margin-top: 10rpx;
  751. overflow: hidden;
  752. text-overflow: ellipsis;
  753. white-space: nowrap;
  754. }
  755. }
  756. .lab-info-r {
  757. width: 100rpx;
  758. height: 150rpx;
  759. background: rgba(1, 131, 250, 0.2);
  760. border-radius: 0rpx 0rpx 0rpx 0rpx;
  761. font-size: 28rpx;
  762. color: #0183FA;
  763. line-height: 150rpx;
  764. text-align: center;
  765. }
  766. }
  767. .liability-unit {
  768. width: 750rpx;
  769. height: 80rpx;
  770. background: #FFFFFF;
  771. border-bottom: 1rpx solid #E0E0E0;
  772. padding: 0 30rpx;
  773. box-sizing: border-box;
  774. display: flex;
  775. justify-content: space-between;
  776. margin-top: 14rpx;
  777. >view:nth-of-type(1) {
  778. font-size: 30rpx;
  779. color: #333333;
  780. line-height: 80rpx;
  781. text-align: left;
  782. }
  783. >view:nth-of-type(2) {
  784. font-size: 30rpx;
  785. color: #666666;
  786. line-height: 80rpx;
  787. text-align: left;
  788. }
  789. }
  790. .small-title {
  791. width: 750rpx;
  792. height: 80rpx;
  793. background: #FFFFFF;
  794. border-bottom: 1rpx solid #E0E0E0;
  795. padding: 0 30rpx;
  796. box-sizing: border-box;
  797. display: flex;
  798. justify-content: space-between;
  799. align-items: center;
  800. >view {
  801. font-size: 30rpx;
  802. color: #333333;
  803. line-height: 80rpx;
  804. text-align: left;
  805. }
  806. >img {
  807. width: 24rpx;
  808. height: 12rpx;
  809. }
  810. }
  811. .sub-head {
  812. width: 750rpx;
  813. height: 80rpx;
  814. background: #fff;
  815. padding: 0 30rpx;
  816. box-sizing: border-box;
  817. display: flex;
  818. justify-content: space-between;
  819. align-items: center;
  820. border-bottom: 1rpx solid #E0E0E0;
  821. >view:nth-of-type(1) {
  822. font-family: PingFang SC;
  823. font-weight: 500;
  824. font-size: 30rpx;
  825. color: #666666;
  826. line-height: 30rpx;
  827. }
  828. >view:nth-of-type(2) {
  829. display: flex;
  830. justify-content: flex-end;
  831. align-items: center;
  832. >img {
  833. width: 34rpx;
  834. height: 34rpx;
  835. margin-right: 14rpx;
  836. }
  837. >view {
  838. font-family: PingFang SC;
  839. font-weight: 500;
  840. font-size: 30rpx;
  841. color: #0183FA;
  842. line-height: 30rpx;
  843. }
  844. }
  845. }
  846. .sub-head:last-child {
  847. border-bottom: none;
  848. }
  849. .small-title-new {
  850. width: 750rpx;
  851. height: 80rpx;
  852. background: #FFFFFF;
  853. border-bottom: 1rpx solid #E0E0E0;
  854. padding: 0 30rpx;
  855. box-sizing: border-box;
  856. display: flex;
  857. justify-content: space-between;
  858. align-items: center;
  859. >view {
  860. font-size: 30rpx;
  861. color: #333333;
  862. line-height: 80rpx;
  863. text-align: left;
  864. }
  865. >img {
  866. width: 24rpx;
  867. height: 12rpx;
  868. }
  869. }
  870. .classify {
  871. .small-items-new {
  872. padding-left: 20rpx;
  873. box-sizing: border-box;
  874. background: #fff;
  875. display: flex;
  876. justify-content: flex-start;
  877. padding: 30rpx;
  878. box-sizing: border-box;
  879. border-bottom: 1rpx solid #E0E0E0;
  880. >view:nth-of-type(1) {
  881. color: #999999;
  882. font-weight: 500;
  883. font-size: 28rpx;
  884. margin-right: 12rpx;
  885. line-height: 34rpx;
  886. }
  887. >view:nth-of-type(2) {
  888. display: block;
  889. font-family: PingFang SC;
  890. font-weight: 500;
  891. font-size: 28rpx;
  892. line-height: 34rpx;
  893. color: #999999;
  894. }
  895. }
  896. .logotype-img-new {
  897. padding: 26rpx 0 34rpx 0;
  898. box-sizing: border-box;
  899. background: #fff;
  900. >img {
  901. display: inline-block;
  902. width: 86rpx;
  903. height: 114rpx;
  904. margin-left: 30rpx;
  905. margin-bottom: 20rpx;
  906. }
  907. }
  908. .small-items {
  909. padding-left: 20rpx;
  910. box-sizing: border-box;
  911. background: #fff;
  912. display: flex;
  913. justify-content: flex-start;
  914. padding: 20rpx;
  915. box-sizing: border-box;
  916. >view:nth-of-type(1) {
  917. color: #999999;
  918. font-weight: 500;
  919. font-size: 28rpx;
  920. margin-right: 12rpx;
  921. line-height: 34rpx;
  922. }
  923. >view:nth-of-type(2) {
  924. display: block;
  925. font-family: PingFang SC;
  926. font-weight: 500;
  927. font-size: 28rpx;
  928. line-height: 34rpx;
  929. color: #999999;
  930. }
  931. }
  932. .logotype {
  933. width: 750rpx;
  934. height: 100rpx;
  935. font-family: PingFang SC;
  936. font-weight: 500;
  937. font-size: 32rpx;
  938. color: #333333;
  939. line-height: 100rpx;
  940. padding-left: 20rpx;
  941. box-sizing: border-box;
  942. background: #0183FA;
  943. color: #fff;
  944. }
  945. .logotype-img {
  946. padding: 26rpx 0 34rpx 0;
  947. box-sizing: border-box;
  948. background: #fff;
  949. >img {
  950. display: inline-block;
  951. width: 86rpx;
  952. height: 114rpx;
  953. margin-left: 30rpx;
  954. margin-bottom: 20rpx;
  955. }
  956. }
  957. }
  958. }
  959. .button-box-1{
  960. img:nth-child(1){
  961. margin:0 143rpx;
  962. }
  963. }
  964. .button-box-2{
  965. img:nth-child(1){
  966. margin-left:68rpx;
  967. }
  968. img:nth-child(2){
  969. margin:0 67rpx;
  970. }
  971. img:nth-child(3){
  972. margin-right:68rpx;
  973. }
  974. }
  975. .position-button-box {
  976. position: fixed;
  977. bottom: 40rpx;
  978. display: flex;
  979. justify-content: center;
  980. >img {
  981. width: 160rpx;
  982. height: 160rpx;
  983. }
  984. }
  985. .shade-box {
  986. height: 100%;
  987. width: 100%;
  988. position: fixed;
  989. display: flex;
  990. flex-direction: column;
  991. z-index: 200;
  992. background: rgba(0, 0, 0, 0.2);
  993. top: 0;
  994. .null-box {
  995. flex: 1;
  996. }
  997. .shade_n {
  998. position: absolute;
  999. bottom: 0;
  1000. left: 0;
  1001. width: 750rpx;
  1002. height: 466rpx;
  1003. background: #FFFFFF;
  1004. border-radius: 20rpx 20rpx 0rpx 0rpx;
  1005. overflow-y: auto;
  1006. .title {
  1007. display: flex;
  1008. justify-content: space-between;
  1009. align-items: center;
  1010. padding: 0 50rpx 0 284rpx;
  1011. box-sizing: border-box;
  1012. border-bottom: 1rpx solid #E0E0E0;
  1013. >view {
  1014. font-size: 30rpx;
  1015. color: #3D3D3D;
  1016. line-height: 90rpx;
  1017. text-align: left;
  1018. }
  1019. >img {
  1020. width: 24rpx;
  1021. height: 12rpx;
  1022. }
  1023. }
  1024. .batch {
  1025. padding: 0 30rpx;
  1026. box-sizing: border-box;
  1027. .batch-li {
  1028. display: flex;
  1029. justify-content: space-between;
  1030. align-items: center;
  1031. border-bottom: 1rpx solid #E0E0E0;
  1032. padding: 20rpx 0 16rpx 0rpx;
  1033. box-sizing: border-box;
  1034. .batch-li-l {
  1035. >text:nth-of-type(1) {
  1036. display: block;
  1037. font-size: 30rpx;
  1038. color: #333333;
  1039. line-height: 42rpx;
  1040. text-align: left;
  1041. }
  1042. >text:nth-of-type(2) {
  1043. display: block;
  1044. font-size: 28rpx;
  1045. color: #666666;
  1046. line-height: 39rpx;
  1047. text-align: left;
  1048. margin-top: 6rpx;
  1049. }
  1050. }
  1051. .batch-li-r {
  1052. font-size: 28rpx;
  1053. color: #666666;
  1054. line-height: 39rpx;
  1055. text-align: left;
  1056. display: flex;
  1057. justify-content: flex-start;
  1058. align-items: center;
  1059. >img {
  1060. width: 24rpx;
  1061. height: 24rpx;
  1062. margin-left: 9rpx;
  1063. }
  1064. }
  1065. }
  1066. }
  1067. }
  1068. }
  1069. .shade-sign-in-max-box{
  1070. height: 100%;
  1071. width: 100%;
  1072. position: fixed;
  1073. display: flex;
  1074. flex-direction: column;
  1075. z-index: 200;
  1076. background: rgba(0, 0, 0, 0.2);
  1077. top: 0;
  1078. .shade-sign-in-min-box-1{
  1079. width:600rpx;
  1080. height:660rpx;
  1081. position: absolute;
  1082. top:50%;
  1083. left:50%;
  1084. margin-top:-442rpx;
  1085. margin-left:-300rpx;
  1086. background-color: #fff;
  1087. border-radius: 20rpx;
  1088. overflow: hidden
  1089. .shade-sign-in-title-p{
  1090. background: url($imagesUrl+'safetyCheck/img_qdcg@1x.png') no-repeat;
  1091. background-size:100%;
  1092. background-repeat: no-repeat;
  1093. }
  1094. }
  1095. .shade-sign-in-min-box-2{
  1096. width:600rpx;
  1097. height:920rpx;
  1098. position: absolute;
  1099. top:50%;
  1100. left:50%;
  1101. margin-top:-554rpx;
  1102. margin-left:-300rpx;
  1103. background-color: #fff;
  1104. border-radius: 20rpx;
  1105. overflow: hidden
  1106. .shade-sign-in-title-p{
  1107. background: url($imagesUrl+'safetyCheck/img_qtcg@1x.png') no-repeat;
  1108. background-size:100%;
  1109. background-repeat: no-repeat;
  1110. }
  1111. }
  1112. .shade-sign-in-title-p{
  1113. width: 600rpx;
  1114. height: 100rpx;
  1115. font-size:36rpx;
  1116. color:#fff;
  1117. text-align: center;
  1118. line-height:100rpx;
  1119. }
  1120. .shade-sign-in-img-text-box{
  1121. margin-left:49rpx;
  1122. margin-top:38rpx;
  1123. .shade-sign-in-img-text-min-box{
  1124. display: flex;
  1125. img{
  1126. width: 36rpx;
  1127. height: 36rpx;
  1128. margin-right:12rpx;
  1129. }
  1130. view{
  1131. height: 36rpx;
  1132. font-weight: normal;
  1133. font-size: 30rpx;
  1134. color: #666666;
  1135. line-height: 36rpx;
  1136. text-align: left;
  1137. font-style: normal;
  1138. text-transform: none;
  1139. }
  1140. }
  1141. .shade-sign-in-img-text-p{
  1142. margin-top:25rpx;
  1143. height: 36rpx;
  1144. font-weight: normal;
  1145. font-size: 30rpx;
  1146. color: #333333;
  1147. line-height: 36rpx;
  1148. text-align: left;
  1149. font-style: normal;
  1150. text-transform: none;
  1151. }
  1152. }
  1153. .shade-sign-in-text-box{
  1154. margin:0 40rpx;
  1155. width:520rpx;
  1156. height:420rpx;
  1157. background: #F5F5F5;
  1158. border-radius: 20rpx 20rpx 20rpx 20rpx;
  1159. overflow: hidden;
  1160. margin-top:30rpx;
  1161. .shade-sign-in-text-p-1{
  1162. margin-left:46rpx;
  1163. margin-top:25rpx;
  1164. height: 30rpx;
  1165. font-weight: normal;
  1166. font-size: 30rpx;
  1167. color: #666666;
  1168. line-height: 30rpx;
  1169. text-align: left;
  1170. font-style: normal;
  1171. text-transform: none;
  1172. }
  1173. .shade-sign-in-text-p-2{
  1174. margin-left:46rpx;
  1175. margin-top:27rpx;
  1176. height: 30rpx;
  1177. font-weight: normal;
  1178. font-size: 26rpx;
  1179. color: #666666;
  1180. line-height: 30rpx;
  1181. text-align: left;
  1182. font-style: normal;
  1183. text-transform: none;
  1184. }
  1185. }
  1186. .off-button-p{
  1187. width:600rpx;
  1188. height:100rpx;
  1189. line-height:100rpx;
  1190. font-size:30rpx;
  1191. color: #0183FA;
  1192. text-align: center;
  1193. }
  1194. }
  1195. }
  1196. </style>