heyang 2 years ago
parent
commit
b716f299bf

+ 78 - 10
src/views/comprehensive/laboratoryManagement/accessAuthorization/lookImpower.vue

@@ -7,8 +7,8 @@
     </div>
     <div class="supplier-page">
       <advanced-search :searchData="searchData"></advanced-search>
-        <el-table  v-loading="loading" ref="multipleTable"  border tooltip-effect="dark" :row-key="getRowKeys" :data="tableData"
-                  highlight-current-row @selection-change="handleSelectionChange">
+        <el-table  v-loading="loading"   border tooltip-effect="dark" :row-key="getRowKeys" :data="tableData"
+                  highlight-current-row @selection-change="handleSelectionChange2">
           <el-table-column type="selection"  width="55" :reserve-selection="true" align="center"></el-table-column>
         <el-table-column label="所属单位" align="left" prop="deptName"/>
         <el-table-column label="姓名" align="left" prop="nickName"></el-table-column>
@@ -21,6 +21,9 @@
               </el-tooltip>
             </span>
           </template>
+          <template slot-scope="scope">
+              <span v-for="item in scope.row.verifyList">{{item.name}}</span>
+          </template>
         </el-table-column>
         <el-table-column label="类别" align="left" prop="userType"></el-table-column>
         <el-table-column label="授权时间" align="left" prop="verifyTime"></el-table-column>
@@ -39,14 +42,11 @@
         </el-table-column>
         <el-table-column label="操作" align="left" class-name="small-padding fixed-width" width="220">
           <template slot-scope="scope">
-            <div class="button-box">
-              <p class="table-min-button"
-                 v-if="(scope.row.userType=='学生' && !admittance) || (scope.row.userType=='教师' && !whiteList)"
-                 @click="handleClick('',scope.row,'delete')"
-              >删除</p>
-              <p class="table-min-button"  style="color: #333;cursor: text" @click="handleClick('',scope.row,'again')">手动<i style="color: #0045AF;cursor: pointer;font-style: normal;text-decoration:underline">重试</i></p>
-              <p class="table-min-button"  style="color: #333;cursor: text" @click="handleClick('',scope.row,'again')"  v-if="scope.row.userType=='学生' && admittance">安全准入<i style="color: #0045AF;cursor: pointer;font-style: normal;text-decoration:underline">重试</i></p>
-              <p class="table-min-button"  style="color: #333;cursor: text" @click="handleClick('',scope.row,'again')" v-if="scope.row.userType=='教师' && whiteList">白名单<i style="color: #0045AF;cursor: pointer;font-style: normal;text-decoration:underline">重试</i></p>
+            <div class="button-box" style="display: flex;justify-content: flex-start;">
+              <p class="table-min-button"  style="color: #333;cursor: text" @click="handleClick('',scope.row,'again')">手动<i style="color: #0183FA;cursor: pointer;font-style: normal;text-decoration:underline">重试</i></p>
+              <p class="table-min-button"  style="color: #333;cursor: text" @click="handleClick('',scope.row,'again')"  v-if="scope.row.userType=='学生' && admittance">安全准入<i style="color: #0183FA;cursor: pointer;font-style: normal;text-decoration:underline">重试</i></p>
+              <p class="table-min-button"  style="color: #333;cursor: text" @click="handleClick('',scope.row,'again')" v-if="scope.row.userType=='教师' && whiteList">白名单<i style="color: #0183FA;cursor: pointer;font-style: normal;text-decoration:underline">重试</i></p>
+              <p class="table-min-button" v-if="(scope.row.userType=='学生' && !admittance) || (scope.row.userType=='教师' && !whiteList)"@click="handleClick('',scope.row,'delete')">删除</p>
             </div>
           </template>
         </el-table-column>
@@ -234,6 +234,7 @@ export default {
           return time.getTime() < Date.now();//如果没有后面的-8.64e7就是不可以选择今天的
         }
       },
+      impowerList:[],//授权列表选中
       admittance:false,//智能门禁有没有勾选安全准入
       whiteList:false,//智能门禁有没有勾选白名单
       searchData:{
@@ -388,6 +389,13 @@ export default {
         this.labWhiteJoinSubList=val;
 
       },
+     //已授权列表
+      handleSelectionChange2(val){
+        let _this=this;
+        this.impowerList=[];
+        this.impowerList=val;
+
+      },
 
       handleClick(index,row,doType){
         let _this=this;
@@ -493,6 +501,11 @@ export default {
           _this.userType=2;
           this.getUserList();
         }else if(type=='batchAgain'){
+          if(_this.impowerList.length<=0){
+            _this.msgError("请选择需要授权的数据!");
+          }else{
+
+          }
 
         }
       },
@@ -502,6 +515,45 @@ export default {
           let res=response.rows;
           _this.tableData=res;
           _this.total=response.total;
+          //先判断是或还是+,如果是或,判断有哪几种,并且判断每种显示红色还是绿色,如果是加,判断是否每个都是true,如果有一个不是那就是红色,入股都是那是绿色
+          let verifyList=[];
+          let isVerify=true;
+          _this.tableData.forEach(function(item) {
+            if(item.verifyMode.indexOf('或')!=-1){//或
+
+              if(item.verifyMode.search('密码')!=-1){
+                verifyList.push({verifyStatus:item.state,name:'密码'})
+              }
+              if(item.verifyMode.search('人脸')!=-1){
+                verifyList.push({verifyStatus:item.ifFace,name:'人脸'})
+              }
+              if(item.verifyMode.search('刷卡')!=-1){
+                verifyList.push({verifyStatus:item.ifCard,name:'刷卡'})
+              }
+              if(item.verifyMode.search('指纹')!=-1){
+                verifyList.push({verifyStatus:item.ifFinger,name:'指纹'})
+              }
+              item.verifyList=verifyList;
+              verifyList=[];
+
+            }else{//+
+              if(item.verifyMode.search('密码')!=-1 && !item.state){
+                 isVerify=false;
+              }
+              if(item.verifyMode.search('人脸')!=-1 && !item.ifFace){
+                isVerify=false;
+              }
+              if(item.verifyMode.search('刷卡')!=-1 && !item.ifCard){
+                isVerify=false;
+              }
+              if(item.verifyMode.search('指纹')!=-1 && !item.ifFinger){
+                isVerify=false;
+              }
+              verifyList.push({verifyStatus:isVerify,name:item.verifyMode})
+              item.verifyList=verifyList;
+              verifyList=[];
+            }
+          })
         });
       },
     //失效时间修改后提交
@@ -574,6 +626,7 @@ export default {
   flex:1;
   display: flex;
   flex-direction: column;
+
   /*顶部*/
   .supplier-title{
     display: flex;
@@ -680,5 +733,20 @@ export default {
       margin-bottom: 0!important;
     }
   }
+  /*验证方式*/
+  .verify-green{
+    background: #67C23A;
+    color: #ffffff;
+    padding: 2px 6px;
+    box-sizing: border-box;
+    margin-right: 10px;
+  }
+  .verify-red{
+    background: #F56C6C;
+    color: #ffffff;
+    padding: 2px 6px;
+    box-sizing: border-box;
+    margin-right: 10px;
+  }
 }
 </style>