heyang пре 2 година
родитељ
комит
5760f71f24

+ 8 - 0
src/api/laboratory/subject.js

@@ -392,6 +392,14 @@ export function editImpowerHaikang(data) {
     data: data
     data: data
   })
   })
 }
 }
+//新增用户授权
+export function retryImpowerHaikang(data) {
+  return request({
+    url: '/laboratory/haikang/user/retryAccredit',
+    method: 'post',
+    data: data
+  })
+}
 // 删除用户授权
 // 删除用户授权
 export function delUserHaikang(id) {
 export function delUserHaikang(id) {
   return request({
   return request({

+ 81 - 29
src/views/comprehensive/laboratoryManagement/accessAuthorization/lookImpower.vue

@@ -22,7 +22,7 @@
             </span>
             </span>
           </template>
           </template>
           <template slot-scope="scope">
           <template slot-scope="scope">
-              <span v-for="item in scope.row.verifyList">{{item.name}}</span>
+              <span  v-for="item in scope.row.verifyList" :class="item.verifyStatus?'verify-green':'verify-red'">{{item.name}}</span>
           </template>
           </template>
         </el-table-column>
         </el-table-column>
         <el-table-column label="类别" align="left" prop="userType"></el-table-column>
         <el-table-column label="类别" align="left" prop="userType"></el-table-column>
@@ -43,9 +43,9 @@
         <el-table-column label="操作" align="left" class-name="small-padding fixed-width" width="220">
         <el-table-column label="操作" align="left" class-name="small-padding fixed-width" width="220">
           <template slot-scope="scope">
           <template slot-scope="scope">
             <div class="button-box" style="display: flex;justify-content: flex-start;">
             <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)" style="color: #333;cursor: text" @click="handleClick('',scope.row,'again')">手动<i style="color: #0183FA;cursor: pointer;font-style: normal;text-decoration:underline" @click="handleClick('',scope.row,'retry')" v-if="!scope.row.isretry">重试</i></p>
+              <p class="table-min-button" v-if="scope.row.userType=='学生' && admittance"  style="color: #333;cursor: text" @click="handleClick('',scope.row,'again')"  >安全准入<i style="color: #0183FA;cursor: pointer;font-style: normal;text-decoration:underline" @click="handleClick('',scope.row,'retry')" v-if="!scope.row.isretry">重试</i></p>
+              <p class="table-min-button" v-if="scope.row.userType=='教师' && whiteList" style="color: #333;cursor: text" @click="handleClick('',scope.row,'again')" >白名单<i style="color: #0183FA;cursor: pointer;font-style: normal;text-decoration:underline" @click="handleClick('',scope.row,'retry')" v-if="!scope.row.isretry">重试</i></p>
               <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" v-if="(scope.row.userType=='学生' && !admittance) || (scope.row.userType=='教师' && !whiteList)"@click="handleClick('',scope.row,'delete')">删除</p>
             </div>
             </div>
           </template>
           </template>
@@ -179,7 +179,7 @@ import {
   delUserHaikang,
   delUserHaikang,
   editImpowerHaikang,
   editImpowerHaikang,
   getHaikangQueryTypes,
   getHaikangQueryTypes,
-  getHaikangUserList
+  getHaikangUserList, retryImpowerHaikang
 } from '@/api/laboratory/subject'
 } from '@/api/laboratory/subject'
 
 
 export default {
 export default {
@@ -242,7 +242,7 @@ export default {
           {
           {
             name:"新增教职工授权",//按钮名称 只有再状态 1 时需要
             name:"新增教职工授权",//按钮名称 只有再状态 1 时需要
             type:"1", //按钮类型 1.按钮 2.导入 3.导出
             type:"1", //按钮类型 1.按钮 2.导入 3.导出
-            parameter:"addStudent",//按钮字符用于返回方法时的判断
+            parameter:"addTeacher",//按钮字符用于返回方法时的判断
             hasPermi:[''] // 权限字段 如果没有则传空字符 hasPermi:"",
             hasPermi:[''] // 权限字段 如果没有则传空字符 hasPermi:"",
           },
           },
           {
           {
@@ -321,8 +321,6 @@ export default {
           this.dialogTable.splice(1,0);
           this.dialogTable.splice(1,0);
 
 
       },
       },
-
-
     //获取当前日期
     //获取当前日期
       getdate() {
       getdate() {
         const dates = new Date()
         const dates = new Date()
@@ -415,6 +413,10 @@ export default {
             _this.getList();
             _this.getList();
 
 
           }).catch(() => {});
           }).catch(() => {});
+        }else if(doType=='retry'){
+          let arr=[];
+          arr.push({'id':row.id})
+          _this.retryImpowerHaikang(arr)
         }
         }
       },
       },
       //获取学院列表
       //获取学院列表
@@ -504,7 +506,11 @@ export default {
           if(_this.impowerList.length<=0){
           if(_this.impowerList.length<=0){
             _this.msgError("请选择需要授权的数据!");
             _this.msgError("请选择需要授权的数据!");
           }else{
           }else{
-
+            let arr=[];
+            this.impowerList.forEach(function(item){
+              arr.push({'id':item.id})
+            })
+            _this.retryImpowerHaikang(arr)
           }
           }
 
 
         }
         }
@@ -518,45 +524,65 @@ export default {
           //先判断是或还是+,如果是或,判断有哪几种,并且判断每种显示红色还是绿色,如果是加,判断是否每个都是true,如果有一个不是那就是红色,入股都是那是绿色
           //先判断是或还是+,如果是或,判断有哪几种,并且判断每种显示红色还是绿色,如果是加,判断是否每个都是true,如果有一个不是那就是红色,入股都是那是绿色
           let verifyList=[];
           let verifyList=[];
           let isVerify=true;
           let isVerify=true;
+          let isretry=true;//判断是否需要显示重试按钮
           _this.tableData.forEach(function(item) {
           _this.tableData.forEach(function(item) {
             if(item.verifyMode.indexOf('或')!=-1){//或
             if(item.verifyMode.indexOf('或')!=-1){//或
 
 
               if(item.verifyMode.search('密码')!=-1){
               if(item.verifyMode.search('密码')!=-1){
                 verifyList.push({verifyStatus:item.state,name:'密码'})
                 verifyList.push({verifyStatus:item.state,name:'密码'})
+                if(!item.state){
+                  isretry=false
+                }
               }
               }
               if(item.verifyMode.search('人脸')!=-1){
               if(item.verifyMode.search('人脸')!=-1){
                 verifyList.push({verifyStatus:item.ifFace,name:'人脸'})
                 verifyList.push({verifyStatus:item.ifFace,name:'人脸'})
+                if(!item.ifFace){
+                  isretry=false
+                }
               }
               }
               if(item.verifyMode.search('刷卡')!=-1){
               if(item.verifyMode.search('刷卡')!=-1){
                 verifyList.push({verifyStatus:item.ifCard,name:'刷卡'})
                 verifyList.push({verifyStatus:item.ifCard,name:'刷卡'})
+                if(!item.ifCard){
+                  isretry=false
+                }
               }
               }
               if(item.verifyMode.search('指纹')!=-1){
               if(item.verifyMode.search('指纹')!=-1){
                 verifyList.push({verifyStatus:item.ifFinger,name:'指纹'})
                 verifyList.push({verifyStatus:item.ifFinger,name:'指纹'})
+                if(!item.ifFinger){
+                  isretry=false
+                }
               }
               }
               item.verifyList=verifyList;
               item.verifyList=verifyList;
+              item.isretry=isretry;
               verifyList=[];
               verifyList=[];
 
 
             }else{//+
             }else{//+
               if(item.verifyMode.search('密码')!=-1 && !item.state){
               if(item.verifyMode.search('密码')!=-1 && !item.state){
                  isVerify=false;
                  isVerify=false;
+                 isretry=false;
               }
               }
               if(item.verifyMode.search('人脸')!=-1 && !item.ifFace){
               if(item.verifyMode.search('人脸')!=-1 && !item.ifFace){
                 isVerify=false;
                 isVerify=false;
+                isretry=false;
               }
               }
               if(item.verifyMode.search('刷卡')!=-1 && !item.ifCard){
               if(item.verifyMode.search('刷卡')!=-1 && !item.ifCard){
                 isVerify=false;
                 isVerify=false;
+                isretry=false;
               }
               }
               if(item.verifyMode.search('指纹')!=-1 && !item.ifFinger){
               if(item.verifyMode.search('指纹')!=-1 && !item.ifFinger){
                 isVerify=false;
                 isVerify=false;
+                isretry=false;
               }
               }
               verifyList.push({verifyStatus:isVerify,name:item.verifyMode})
               verifyList.push({verifyStatus:isVerify,name:item.verifyMode})
               item.verifyList=verifyList;
               item.verifyList=verifyList;
+              item.isretry=isretry;
               verifyList=[];
               verifyList=[];
             }
             }
           })
           })
+          console.log(_this.tableData)
         });
         });
       },
       },
-    //失效时间修改后提交
+      //失效时间修改后提交
       loseTimeSubmitForm(){
       loseTimeSubmitForm(){
         let _this=this;
         let _this=this;
         let arr=[];
         let arr=[];
@@ -573,6 +599,30 @@ export default {
           });
           });
         },100)
         },100)
       },
       },
+      //重试
+      retryImpowerHaikang(arr){
+        let _this=this;
+        _this.form.detailList=arr;
+        retryImpowerHaikang(_this.form).then(response => {
+          if(response.code==200){
+            _this.msgSuccess("重试成功");
+            _this.dialogVisible=false;
+            _this.getList();
+          }else if(response.code==205){
+            _this.$confirm(response.msg, "警告", {
+              confirmButtonText: "确定",
+              cancelButtonText: "取消",
+              type: "warning"
+            }).then(function() {
+              _this.dialogVisible=false;
+              _this.getList();
+            }).then(() => {
+              _this.dialogVisible=false;
+              _this.getList();
+            }).catch(() => {});
+          }
+        });
+      },
       /* 新增授权*/
       /* 新增授权*/
       submitForm(){
       submitForm(){
         let _this=this;
         let _this=this;
@@ -588,17 +638,25 @@ export default {
             })
             })
           }
           }
           _this.form.detailList=arr;
           _this.form.detailList=arr;
-          setTimeout(function () {
-            AddImpowerHaikang(_this.form).then(response => {
-              if(response.code==200){
-                setTimeout(function () {
-                  _this.msgSuccess("新增成功");
-                  _this.dialogVisible=false;
-                  _this.getList();
-                },1000)
-              }
-            });
-          },100)
+          AddImpowerHaikang(_this.form).then(response => {
+            if(response.code==200){
+              _this.msgSuccess("新增成功");
+              _this.dialogVisible=false;
+              _this.getList();
+            }else if(response.code==205){
+              _this.$confirm(response.msg, "警告", {
+                confirmButtonText: "确定",
+                cancelButtonText: "取消",
+                type: "warning"
+              }).then(function() {
+                _this.dialogVisible=false;
+                _this.getList();
+              }).then(() => {
+                _this.dialogVisible=false;
+                _this.getList();
+              }).catch(() => {});
+            }
+          });
         }else{
         }else{
           this.msgError("请先选择人员!");
           this.msgError("请先选择人员!");
         }
         }
@@ -735,17 +793,11 @@ export default {
   }
   }
   /*验证方式*/
   /*验证方式*/
   .verify-green{
   .verify-green{
-    background: #67C23A;
-    color: #ffffff;
-    padding: 2px 6px;
-    box-sizing: border-box;
+    color: #46D417;
     margin-right: 10px;
     margin-right: 10px;
   }
   }
   .verify-red{
   .verify-red{
-    background: #F56C6C;
-    color: #ffffff;
-    padding: 2px 6px;
-    box-sizing: border-box;
+    color: #FF0000;
     margin-right: 10px;
     margin-right: 10px;
   }
   }
 }
 }