123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218 |
- <template>
- <view class="shade" v-if="pageType == 1">
- <view class="null-box" @click="dialogClose()"></view>
- <view class="shade_n">
- <view class="title">
- <view>请选择实验室</view>
- </view>
- <view class="batch">
- <view class="batch-li" @click="batchClick(item)" v-for="(item,index) in batchList">
- <view class="batch-li-l">
- <text>{{item.planTitle}}-{{item.checkName}}</text>
- <text>{{item.subName}}{{item.roomNum?'('+item.roomNum+')':''}}</text>
- </view>
- <view class="batch-li-r">
- <img :src="imagesUrl('commonality/icon_wd_gd@1x.png')">
- </view>
- </view>
- </view>
- </view>
- </view>
- </template>
- <script>
- import {
- securityAppCheckManageList,
- securityAppCheckSetOptionList,
- securityAppCheckPlanScanCode,
- } from '@/pages_safetyCheck/api/index.js'
- import {
- config
- } from '@/api/request/config.js'
- export default {
- name: "iotControl",
- props: {
- subjectData: {},
- },
- data() {
- return {
- pageType:0,
- newData:{},
- batchList: [],
- checkCategory: null,
- }
- },
- created() {
-
- },
- mounted() {
- if(uni.getStorageSync('identityData')){
- if(uni.getStorageSync('identityData').type=='collegeAdmin'){
- this.checkCategory=2
- }else if(uni.getStorageSync('identityData').type=='schoolAdmin'){
- this.checkCategory=1
- }
- }
- this.$set(this, 'newData', this.subjectData);
- this.securityAppCheckPlanScanCode();
- },
- methods: {
- dialogClose() {
- this.$parent.goPage('securityCheck',false);
- },
- batchClick(row) {
- let infoData = row;
- infoData.pageType = 0;
- uni.navigateTo({
- url: '/pages_safetyCheck/views/itemsManage/hiddenDangerItems?infoData=' + encodeURIComponent(
- JSON.stringify(infoData))
- });
- },
- //查询计划
- async securityAppCheckPlanScanCode() {
- console.log('planSetId',this.newData)
- let obj = {
- subId:this.newData.subId,
- checkCategory:this.checkCategory,
- };
- if(this.newData.planSetId){
- obj.planSetId = this.newData.planSetId;
- }
- const {
- data
- } = await securityAppCheckPlanScanCode(obj);
- if (data.code == 200) {
- if(data.data[0]){
- if(data.data[1]){
- //多个
- this.$set(this,'batchList',data.data);
- this.$set(this,'pageType',1);
- }else{
- //单个
- let infoData = data.data[0];
- infoData.pageType = 0;
- uni.navigateTo({
- url: '/pages_safetyCheck/views/itemsManage/hiddenDangerItems?infoData=' + encodeURIComponent(
- JSON.stringify(infoData))
- });
- }
- }else{
- //没有
- uni.showToast({
- title: '该实验室暂无检查计划!',
- icon: "none",
- mask: true,
- duration: 2000
- });
- this.dialogClose();
- }
- }
- },
- },
- onHide() {
-
- },
- beforeDestroy() {
-
- },
- }
- </script>
- <style lang="stylus" scoped>
- .shade {
- height: 100%;
- width: 100%;
- position: fixed;
- display: flex;
- flex-direction: column;
- z-index: 200;
- background: rgba(0, 0, 0, 0.2);
- top: 0;
-
- .null-box {
- flex: 1;
- }
-
- .shade_n {
- position: absolute;
- bottom: 0;
- left: 0;
- width: 750rpx;
- height: 466rpx;
- background: #FFFFFF;
- border-radius: 20rpx 20rpx 0rpx 0rpx;
- overflow-y: auto;
-
- .title {
- display: flex;
- justify-content: space-between;
- align-items: center;
- padding: 0 50rpx 0 284rpx;
- box-sizing: border-box;
- border-bottom: 1rpx solid #E0E0E0;
-
- >view {
- font-size: 30rpx;
- color: #3D3D3D;
- line-height: 90rpx;
- text-align: left;
- }
-
- >img {
- width: 24rpx;
- height: 12rpx;
- }
- }
-
- .batch {
- padding: 0 30rpx;
- box-sizing: border-box;
-
- .batch-li {
- display: flex;
- justify-content: space-between;
- align-items: center;
- border-bottom: 1rpx solid #E0E0E0;
- padding: 20rpx 0 16rpx 0rpx;
- box-sizing: border-box;
-
- .batch-li-l {
- >text:nth-of-type(1) {
- display: block;
- font-size: 30rpx;
- color: #333333;
- line-height: 42rpx;
- text-align: left;
- }
-
- >text:nth-of-type(2) {
- display: block;
- font-size: 28rpx;
- color: #666666;
- line-height: 39rpx;
- text-align: left;
- margin-top: 6rpx;
- }
- }
-
- .batch-li-r {
- font-size: 28rpx;
- color: #666666;
- line-height: 39rpx;
- text-align: left;
- display: flex;
- justify-content: flex-start;
- align-items: center;
-
- >img {
- width: 24rpx;
- height: 24rpx;
- margin-left: 9rpx;
- }
- }
- }
- }
- }
- }
- </style>
|