|
@@ -1,10 +1,11 @@
|
|
|
<!-- 权限申请新增 -->
|
|
<!-- 权限申请新增 -->
|
|
|
<template>
|
|
<template>
|
|
|
<view class="permissionApplyAddPage">
|
|
<view class="permissionApplyAddPage">
|
|
|
- <view class="check-big-box">
|
|
|
|
|
|
|
+ <view class="check-big-box" v-if="!dialogRulesType">
|
|
|
<view class="check-text-p">*</view>
|
|
<view class="check-text-p">*</view>
|
|
|
<view class="check-title-p">所需权限</view>
|
|
<view class="check-title-p">所需权限</view>
|
|
|
<view class="check-box" @click="checkButton(item)"
|
|
<view class="check-box" @click="checkButton(item)"
|
|
|
|
|
+ v-if="!item.checkSwitch"
|
|
|
v-for="(item,index) in permConfigList" :key="index">
|
|
v-for="(item,index) in permConfigList" :key="index">
|
|
|
<img v-if="!item.checkType" class="left-box" :src="imagesUrl('commonality/icon_12.png')">
|
|
<img v-if="!item.checkType" class="left-box" :src="imagesUrl('commonality/icon_12.png')">
|
|
|
<img v-if="item.checkType" class="left-box" :src="imagesUrl('commonality/icon_13.png')">
|
|
<img v-if="item.checkType" class="left-box" :src="imagesUrl('commonality/icon_13.png')">
|
|
@@ -33,7 +34,8 @@
|
|
|
<view class="text-color-p" v-if="subject.subName">{{subject.buildName}} - {{subject.floorName}} - {{subject.roomNum}}</view>
|
|
<view class="text-color-p" v-if="subject.subName">{{subject.buildName}} - {{subject.floorName}} - {{subject.roomNum}}</view>
|
|
|
<view class="text-color-p" v-if="subject.subName">实验室负责人:{{subject.adminName}}</view>
|
|
<view class="text-color-p" v-if="subject.subName">实验室负责人:{{subject.adminName}}</view>
|
|
|
</view>
|
|
</view>
|
|
|
- <view class="submit-button-p" style="margin-top:60rpx;" @click="submitButton()">立 即 申 请</view>
|
|
|
|
|
|
|
+ <view class="submit-button-p" style="margin-top:60rpx;" v-if="!dialogRulesType" @click="submitButton()">立 即 申 请</view>
|
|
|
|
|
+ <view class="submit-button-p-2" style="margin-top:60rpx;" v-if="dialogRulesType">您已申请了该实验室所有权限</view>
|
|
|
<!-- 实验室选择页面 -->
|
|
<!-- 实验室选择页面 -->
|
|
|
<view class="pageTwo" v-if="pageType == 2">
|
|
<view class="pageTwo" v-if="pageType == 2">
|
|
|
<view class="pageTwo-input-box">
|
|
<view class="pageTwo-input-box">
|
|
@@ -61,6 +63,7 @@
|
|
|
laboratorySubRelInfoGetRelList,
|
|
laboratorySubRelInfoGetRelList,
|
|
|
} from '@/api/index.js'
|
|
} from '@/api/index.js'
|
|
|
import {
|
|
import {
|
|
|
|
|
+ hwmsAppRegisterApprovalFindBySubIdAndUserId,
|
|
|
hwmsPermConfigList,
|
|
hwmsPermConfigList,
|
|
|
hwmsAppRegisterApprovalAdd,
|
|
hwmsAppRegisterApprovalAdd,
|
|
|
} from '@/pages_hazardousWasteRecycling/api/index.js'
|
|
} from '@/pages_hazardousWasteRecycling/api/index.js'
|
|
@@ -80,6 +83,7 @@
|
|
|
checkType2:true
|
|
checkType2:true
|
|
|
},
|
|
},
|
|
|
permConfigList:[],
|
|
permConfigList:[],
|
|
|
|
|
+ dialogRulesType:false,
|
|
|
}
|
|
}
|
|
|
},
|
|
},
|
|
|
onLoad(option) {
|
|
onLoad(option) {
|
|
@@ -172,6 +176,7 @@
|
|
|
if (data.code == 200) {
|
|
if (data.code == 200) {
|
|
|
for(let i=0;i<data.data.length;i++){
|
|
for(let i=0;i<data.data.length;i++){
|
|
|
data.data[i].checkType = true;
|
|
data.data[i].checkType = true;
|
|
|
|
|
+ data.data[i].checkSwitch = false;
|
|
|
}
|
|
}
|
|
|
this.$set(this,'permConfigList',data.data);
|
|
this.$set(this,'permConfigList',data.data);
|
|
|
}
|
|
}
|
|
@@ -209,8 +214,66 @@
|
|
|
},
|
|
},
|
|
|
//实验室选择
|
|
//实验室选择
|
|
|
checkClick(item) {
|
|
checkClick(item) {
|
|
|
- this.$set(this, "subject", item);
|
|
|
|
|
- this.inputClick(1);
|
|
|
|
|
|
|
+ this.hwmsAppRegisterApprovalFindBySubIdAndUserId(item);
|
|
|
|
|
+ },
|
|
|
|
|
+ //查询实验室与人员是否有报备权限
|
|
|
|
|
+ async hwmsAppRegisterApprovalFindBySubIdAndUserId(item){
|
|
|
|
|
+ let self = this;
|
|
|
|
|
+ let obj = {
|
|
|
|
|
+ subId:item.subId,
|
|
|
|
|
+ userId:uni.getStorageSync('userId'),
|
|
|
|
|
+ }
|
|
|
|
|
+ const {
|
|
|
|
|
+ data
|
|
|
|
|
+ } = await hwmsAppRegisterApprovalFindBySubIdAndUserId(obj)
|
|
|
|
|
+ if (data.code == 200) {
|
|
|
|
|
+ if(data.data[0]){
|
|
|
|
|
+ let dataList = [];
|
|
|
|
|
+ for(let i=0;i<data.data.length;i++){
|
|
|
|
|
+ let permId = data.data[i].permId.split(',');
|
|
|
|
|
+ dataList = dataList.concat(permId)
|
|
|
|
|
+ }
|
|
|
|
|
+ for(let i=0;i<dataList.length;i++){
|
|
|
|
|
+ for(let o=0;o<self.permConfigList.length;o++){
|
|
|
|
|
+ if(dataList[i]==self.permConfigList[o].id){
|
|
|
|
|
+ self.permConfigList[o].checkSwitch = true
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
|
|
+ let newList = [];
|
|
|
|
|
+ for(let o=0;o<self.permConfigList.length;o++){
|
|
|
|
|
+ if(!self.permConfigList[o].checkSwitch){
|
|
|
|
|
+ newList.push(self.permConfigList[o].id)
|
|
|
|
|
+ self.permConfigList[o].checkType = true;
|
|
|
|
|
+ }else{
|
|
|
|
|
+ self.permConfigList[o].checkType = false;
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
|
|
+ if(newList[0]){
|
|
|
|
|
+ this.$set(this,'dialogRulesType',false);
|
|
|
|
|
+ }else{
|
|
|
|
|
+ this.$set(this,'dialogRulesType',true);
|
|
|
|
|
+ }
|
|
|
|
|
+ }else{
|
|
|
|
|
+ for(let i = 0;i<self.permConfigList.length;i++){
|
|
|
|
|
+ self.permConfigList[i].checkSwitch = false;
|
|
|
|
|
+ }
|
|
|
|
|
+ this.$set(this,'dialogRulesType',false);
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+
|
|
|
|
|
+
|
|
|
|
|
+
|
|
|
|
|
+
|
|
|
|
|
+
|
|
|
|
|
+
|
|
|
|
|
+
|
|
|
|
|
+
|
|
|
|
|
+
|
|
|
|
|
+
|
|
|
|
|
+ this.$set(this, "subject", item);
|
|
|
|
|
+ this.inputClick(1);
|
|
|
|
|
+ }
|
|
|
},
|
|
},
|
|
|
},
|
|
},
|
|
|
}
|
|
}
|
|
@@ -287,6 +350,17 @@
|
|
|
margin:20rpx 175rpx;
|
|
margin:20rpx 175rpx;
|
|
|
border-radius:10rpx;
|
|
border-radius:10rpx;
|
|
|
}
|
|
}
|
|
|
|
|
+ .submit-button-p-2{
|
|
|
|
|
+ background-color:#999;
|
|
|
|
|
+ color:#fff;
|
|
|
|
|
+ width:500rpx;
|
|
|
|
|
+ height:80rpx;
|
|
|
|
|
+ line-height:80rpx;
|
|
|
|
|
+ text-align: center;
|
|
|
|
|
+ font-size:30rpx;
|
|
|
|
|
+ margin:20rpx 125rpx;
|
|
|
|
|
+ border-radius:10rpx;
|
|
|
|
|
+ }
|
|
|
|
|
|
|
|
.pageTwo {
|
|
.pageTwo {
|
|
|
flex: 1;
|
|
flex: 1;
|