lookImpower.vue 31 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863
  1. <!--供应商管理-->
  2. <template>
  3. <div class="supplier">
  4. <div class="supplier-title">
  5. <P>实验室名称-已授权列表 </P>
  6. <p class="button-p reset-button-one" @click="backPage">返回</p>
  7. </div>
  8. <div class="supplier-page">
  9. <advanced-search :searchData="searchData"></advanced-search>
  10. <el-table v-loading="loading" ref="multipleTable2" border tooltip-effect="dark" :row-key="getRowKeys2" :data="tableData"
  11. highlight-current-row @selection-change="handleSelectionChange2">
  12. <el-table-column type="selection" width="55" :reserve-selection="true" align="center"></el-table-column>
  13. <el-table-column label="所属单位" align="left" prop="deptName" show-overflow-tooltip/>
  14. <el-table-column label="姓名" align="left" prop="nickName"></el-table-column>
  15. <el-table-column align="left" prop="verifyMode">
  16. <template slot-scope="scope" slot="header">
  17. <span>验证方式
  18. <el-tooltip class="item" effect="dark" placement="top-start">
  19. <i class= 'el-icon-question' style="color:#E6A23C; margin-left:5px;font-size: 16px;'"></i>
  20. <div style="width: 200px;" slot="content">红色:表示此验证方式失败<br/>绿色表示此验证方式成功</div>
  21. </el-tooltip>
  22. </span>
  23. </template>
  24. <template slot-scope="scope">
  25. <span v-for="item in scope.row.verifyList" :class="item.verifyStatus?'verify-green':'verify-red'">{{item.name}}</span>
  26. </template>
  27. </el-table-column>
  28. <el-table-column label="授权状态" align="left" prop="isretry">
  29. <template slot-scope="scope">
  30. <span v-if="scope.row.state">成功</span>
  31. <span v-if="!scope.row.state">失败</span>
  32. </template>
  33. </el-table-column>
  34. <el-table-column label="类别" align="left" prop="userType"></el-table-column>
  35. <el-table-column label="授权时间" align="left" prop="verifyTime" show-overflow-tooltip></el-table-column>
  36. <el-table-column label="授权人" align="left" prop="verifyUser"></el-table-column>
  37. <el-table-column label="失效时间" align="left" prop="invalidTime" width="250">
  38. <template slot-scope="scope">
  39. <el-date-picker
  40. :disabled="(scope.row.userType=='学生' && admittance) || (scope.row.userType=='教师' && whiteList)"
  41. :picker-options="pickerOptions0"
  42. v-model="scope.row.invalidTime"
  43. value-format="yyyy-MM-dd"
  44. type="date"
  45. placeholder="请选择失效时间">
  46. </el-date-picker>
  47. </template>
  48. </el-table-column>
  49. <el-table-column label="操作" align="left" class-name="small-padding fixed-width" width="220">
  50. <template slot-scope="scope">
  51. <div class="table-button-box">
  52. <p class="table-button-null"></p>
  53. <p class="table-button-p" v-if="(scope.row.userType=='学生' && !admittance && !scope.row.isretry) || (scope.row.userType=='教师' && !whiteList) && !scope.row.isretry" @click="handleClick('',scope.row,'again')">手动<i style="color: #0183FA;cursor: pointer;font-style: normal;text-decoration:underline" @click="handleClick('',scope.row,'retry')">重试</i></p>
  54. <p class="table-button-p" v-if="scope.row.userType=='学生' && admittance" @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>
  55. <p class="table-button-p" v-if="scope.row.userType=='教师' && whiteList" @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>
  56. <p class="table-button-p" v-if="(scope.row.userType=='学生' && !admittance) || (scope.row.userType=='教师' && !whiteList)"@click="handleClick('',scope.row,'delete')">删除</p>
  57. <p class="table-button-null"></p>
  58. </div>
  59. </template>
  60. </el-table-column>
  61. </el-table>
  62. <div style="display: flex;height:32px;margin-top:15px;">
  63. <div style="flex:5;">
  64. <pagination :page-sizes="[20, 30, 40, 50]"
  65. v-show="total>0"
  66. :total="total"
  67. style="margin:0;"
  68. :page.sync="queryParams.pageNum"
  69. :limit.sync="queryParams.pageSize"
  70. @pagination="getList"
  71. />
  72. </div>
  73. </div>
  74. <div style="text-align: center;">
  75. <el-button class="color_ff back_one" style="width: 300px;" @click="loseTimeSubmitForm()">确定</el-button>
  76. </div>
  77. </div>
  78. <!--关联实验室弹框-->
  79. <el-dialog :title=dialogTitle @close="handleClose" :visible.sync="dialogVisible" width="80%">
  80. <el-form :model="dialogForm" ref="dialogForm" :inline="true" label-width="140px">
  81. <el-form-item label="关键字" prop="name" >
  82. <el-input
  83. v-model="dialogForm.searchValue"
  84. placeholder="请输入名称/联系方式"
  85. clearable
  86. size="small"
  87. />
  88. </el-form-item>
  89. <el-form-item label="所属单位" prop="deptId" label-width="80px">
  90. <el-select v-model="dialogForm.deptId" clearable placeholder="请选择学院">
  91. <el-option
  92. v-for="item in collegeOptions"
  93. :key="item.deptId"
  94. :label="item.deptName"
  95. :value="item.deptId">
  96. </el-option>
  97. </el-select>
  98. </el-form-item>
  99. <el-form-item>
  100. <p class="inquire-button-one" style="margin-left:20px;" @click="onSearch">查询</p>
  101. <p class="reset-button-one" style="margin-left:20px;" @click="resetForm">重置</p>
  102. </el-form-item>
  103. </el-form>
  104. <div class="btn_list">
  105. <i class="el-icon-warning"></i>
  106. <i>已选择 {{labWhiteJoinSubList.length}} 项目</i>
  107. <i @click="toggleSelection(dialogTable)">全选本页</i>
  108. <i></i>
  109. <i @click="toggleSelection()">清除选项</i>
  110. </div>
  111. <el-table ref="multipleTable" border tooltip-effect="dark" :row-key="getRowKeys" :data="dialogTable"
  112. highlight-current-row @selection-change="handleSelectionChange" style="cursor: pointer;height:500px;">
  113. <el-table-column type="selection" width="55" :reserve-selection="true" align="center"></el-table-column>
  114. <el-table-column label="所属单位" align="left" prop="deptName"/>
  115. <el-table-column label="姓名" align="left" prop="nickName" />
  116. <el-table-column label="导师" align="left" prop="tutorUserName" v-if="userType==1"/>
  117. <el-table-column label="专业" align="left" prop="major" v-if="userType==1"/>
  118. <el-table-column label="身份" align="left" prop="positionName" v-if="userType==2"/>
  119. <el-table-column label="验证方式" align="left" prop="verifyMode">
  120. <template slot-scope="scope">
  121. <el-select v-model="scope.row.verifyMode" @change="verifyModeFun(scope.row)" clearable >
  122. <el-option
  123. v-for="item in verifyWayList"
  124. :key="item.key"
  125. :label="item.value"
  126. :value="item.key">
  127. </el-option>
  128. </el-select>
  129. </template>
  130. </el-table-column>
  131. <el-table-column label="失效时间" align="left" prop="invalidTime">
  132. <template slot-scope="scope">
  133. <el-date-picker
  134. @blur="invalidTimeFun(scope.row,$event)"
  135. :picker-options="pickerOptions0"
  136. v-model="scope.row.invalidTime"
  137. value-format="yyyy-MM-dd"
  138. type="date"
  139. placeholder="请选择失效时间">
  140. </el-date-picker>
  141. </template>
  142. </el-table-column>
  143. </el-table>
  144. <pagination :page-sizes="[20, 30, 40, 50]"
  145. v-show="total>0"
  146. :total="total"
  147. :page.sync="dialogForm.pageNum"
  148. :limit.sync="dialogForm.pageSize"
  149. @pagination="getUserList"
  150. />
  151. <div class="configuration">
  152. <el-form :model="configuration" ref="queryForm" :inline="true" v-if="unifyDeploy">
  153. <el-form-item label="验证方式:" prop="name">
  154. <el-select v-model="configuration.verifyMode" clearable >
  155. <el-option
  156. v-for="item in verifyWayList"
  157. :key="item.key"
  158. :label="item.value"
  159. :value="item.key">
  160. </el-option>
  161. </el-select>
  162. </el-form-item>
  163. <el-form-item label="失效时间:" prop="name">
  164. <el-date-picker
  165. :picker-options="pickerOptions0"
  166. v-model="configuration.invalidTime"
  167. value-format="yyyy-MM-dd"
  168. type="date"
  169. placeholder="请选择失效时间">
  170. </el-date-picker>
  171. </el-form-item>
  172. </el-form>
  173. <p :class="unifyDeploy?'add-button-one-120':'inquire-button-one'" @click="unifyDeployFun()">{{unifyDeploy?'取消统一配置':'统一配置'}}</p>
  174. <el-button class="color_ff back_one" style="height: 42px" @click="submitForm()">确定</el-button>
  175. </div>
  176. </el-dialog>
  177. </div>
  178. </template>
  179. <script>
  180. import { listUser} from '@/api/permissionRequired'
  181. import { listDepartments } from '@/api/system/dept'
  182. import advancedSearch from "@/components/ZDcomponents/advancedSearch.vue"
  183. import {
  184. AddImpowerHaikang,
  185. delUserHaikang,
  186. editImpowerHaikang,
  187. getHaikangQueryTypes,
  188. getHaikangUserList, retryImpowerHaikang
  189. } from '@/api/laboratory/subject'
  190. export default {
  191. name: "Approval",
  192. components: {
  193. advancedSearch
  194. },
  195. props:{
  196. pageData:{},
  197. },
  198. data() {
  199. return {
  200. loading:false,
  201. // 查询参数
  202. queryParams: {
  203. pageNum: 1,
  204. pageSize:20,
  205. searchValue:'',
  206. userType:'',
  207. hardId:'',
  208. startTime:'',
  209. endTime:'',
  210. },
  211. total:0,
  212. tableData:[],
  213. dateRange:[],
  214. dialogForm:{
  215. pageNum: 1,
  216. pageSize: 20,
  217. userType: '',
  218. searchValue:'',
  219. deptId:'',
  220. },
  221. dialogTitle:'选择学生',
  222. dialogVisible:false,
  223. collegeOptions:[],//学院
  224. labWhiteJoinSubList:[],
  225. dialogTable:[],
  226. radioList:[],
  227. userType:1,//判断是学生 1 教职工2
  228. verifyWayList:[],
  229. configuration:{
  230. invalidTime:'',
  231. verifyMode:'',
  232. },
  233. unifyDeploy:false,
  234. //提交
  235. form:{},
  236. // 设置只能选择当前日期及之后的日期
  237. pickerOptions0: {
  238. disabledDate(time) {
  239. return time.getTime() < Date.now();//如果没有后面的-8.64e7就是不可以选择今天的
  240. }
  241. },
  242. impowerList:[],//授权列表选中
  243. admittance:false,//智能门禁有没有勾选安全准入
  244. whiteList:false,//智能门禁有没有勾选白名单
  245. searchData:{
  246. buttonList:[//按钮数组没有则为空
  247. {
  248. name:"批量重试",//按钮名称 只有再状态 1 时需要
  249. type:"1", //按钮类型 1.按钮 2.导入 3.导出
  250. parameter:"batchAgain",//按钮字符用于返回方法时的判断
  251. hasPermi:"", // 权限字段 如果没有则传空字符 hasPermi:"",
  252. isHasPermi:false//判断是否需要使用权限字符
  253. },
  254. ],
  255. searchList:[//搜索数组
  256. {
  257. name:"关键字",//描述名称
  258. key:"searchValue",//键名 用于返回数据
  259. value:"",//内容 用于组件内绑定数据
  260. placeholder:"请输入姓名/工号/学号",//输入提示
  261. level:"1",//1.普通搜索 2.高级搜索 普通搜索默认会在高级搜索时显示
  262. type:"1",//类型 1.input 2.select 3.TimePicker
  263. universal:'20',//通用参数 input时为最大长度 //TimePicker时可不传
  264. width:'260',//el-form-item 长度 可传可不传 不传时input/select默认180长度 TimePicker默认240长度
  265. },
  266. {
  267. name:"类别",//描述名称
  268. key:"userType",//键名 用于返回数据
  269. value:"",//内容 用于组件内绑定数据
  270. placeholder:"请选择类别",//输入提示
  271. level:"1",//1.普通搜索 2.高级搜索 普通搜索默认会在高级搜索时显示
  272. type:"2",//类型 1.input 2.select 3.TimePicker
  273. universal:[ //通用参数 select时为列表数据 //TimePicker时可不传
  274. {label:"学生",value:"22"},{label:"教师",value:"11"},
  275. ],
  276. width:'175',//el-form-item 长度 可传可不传 不传时input/select默认180长度 TimePicker默认240长度
  277. },
  278. {
  279. name:"授权时间段",//描述名称
  280. key:"dateRange",//键名 用于返回数据
  281. value:"",//内容 用于组件内绑定数据
  282. placeholder:"请选择",//输入提示
  283. level:"2",//1.普通搜索 2.高级搜索 普通搜索默认会在高级搜索时显示
  284. type:"3",//类型 1.input 2.select 3.TimePicker
  285. width:'260',//el-form-item 长度 可传可不传 不传时input/select默认180长度 TimePicker默认240长度
  286. },
  287. {
  288. name:"分类",//描述名称
  289. key:"state",//键名 用于返回数据
  290. value:"",//内容 用于组件内绑定数据
  291. placeholder:"请选择分类",//输入提示
  292. level:"2",//1.普通搜索 2.高级搜索 普通搜索默认会在高级搜索时显示
  293. type:"2",//类型 1.input 2.select 3.TimePicker
  294. universal:[ //通用参数 select时为列表数据 //TimePicker时可不传
  295. {label:"全部",value:""},{label:"授权验证成功",value:true},{label:"授权验证失败",value:false},
  296. ],
  297. width:'175',//el-form-item 长度 可传可不传 不传时input/select默认180长度 TimePicker默认240长度
  298. },
  299. ],
  300. },
  301. };
  302. },
  303. methods: {
  304. //弹出层表格里验证方式改变重新赋值
  305. verifyModeFun(d){
  306. let _this=this;
  307. this.dialogTable.forEach(function(item,index){
  308. if(item.userId==d.userId){
  309. _this.$set(_this.dialogTable,index,d)
  310. }
  311. })
  312. },
  313. //弹出层表格里失效时间改变重新赋值
  314. invalidTimeFun(item,e){
  315. this.dialogTable.splice(1,0);
  316. },
  317. //获取当前日期
  318. getdate() {
  319. const dates = new Date()
  320. dates.setMonth(dates.getMonth() + 1)
  321. var pastMonth = dates.getMonth() + 1
  322. var pastDay = dates.getDate()
  323. if (pastMonth >= 1 && pastMonth <= 9) {
  324. pastMonth = '0' + pastMonth
  325. }
  326. if (pastDay >= 0 && pastDay <= 9) {
  327. pastDay = '0' + pastDay
  328. }
  329. const endDate = dates.getFullYear() + '-' + pastMonth + '-' + pastDay
  330. return endDate
  331. },
  332. //查询
  333. onSearch() {
  334. this.dialogForm.pageNo = 1;
  335. this.getUserList();
  336. },
  337. //重置
  338. resetForm() {
  339. this.dialogForm.searchValue = '';
  340. this.dialogForm.deptId = '';
  341. this.onSearch();
  342. },
  343. //统一配置
  344. unifyDeployFun(){
  345. this.unifyDeploy=!this.unifyDeploy
  346. if(this.unifyDeploy==false){
  347. this.configuration.invalidTime='';
  348. this.configuration.verifyMode='';
  349. }
  350. },
  351. getRowKeys(row) {
  352. return row.userId; //指定row-key的一个标识
  353. },
  354. getRowKeys2(row) {
  355. return row.id; //指定row-key的一个标识
  356. },
  357. //监听关联记录弹窗关闭
  358. handleClose(){
  359. this.$refs.multipleTable.clearSelection();
  360. this.dialogForm.searchValue='';
  361. this.dialogForm.pageNum=1;
  362. this.dialogForm.deptId='';
  363. this.configuration.invalidTime='';
  364. this.configuration.verifyMode='';
  365. },
  366. //取消选中
  367. toggleSelection(rows) {
  368. let _this=this;
  369. if (rows) {
  370. rows.forEach(row => {
  371. this.$refs.multipleTable.toggleRowSelection(row,true);
  372. });
  373. } else {
  374. this.$refs.multipleTable.clearSelection();
  375. }
  376. },
  377. //选中实验室
  378. handleSelectionChange(val){
  379. let _this=this;
  380. this.labWhiteJoinSubList=[];
  381. this.labWhiteJoinSubList=val;
  382. },
  383. //已授权列表
  384. handleSelectionChange2(val){
  385. let _this=this;
  386. this.impowerList=[];
  387. this.impowerList=val;
  388. },
  389. handleClick(index,row,doType){
  390. let _this=this;
  391. if(doType=='delete'){//删除
  392. let _this=this
  393. this.$confirm('是否确认删除['+row.nickName+']门禁授权?', "警告", {
  394. confirmButtonText: "确定",
  395. cancelButtonText: "取消",
  396. type: "warning"
  397. }).then(function() {
  398. delUserHaikang(row.id).then( response => {
  399. _this.msgSuccess("删除成功");
  400. _this.getList();
  401. });
  402. }).then(() => {
  403. _this.getList();
  404. }).catch(() => {});
  405. }else if(doType=='retry'){
  406. let arr=[];
  407. arr.push({'id':row.id})
  408. _this.retryImpowerHaikang(arr)
  409. }
  410. },
  411. //获取学院列表
  412. listDepartments(){
  413. listDepartments().then(response => {
  414. this.collegeOptions = response.data;
  415. });
  416. },
  417. /** 弹框查询列表 */
  418. getUserList() {//type 1学生 2教职工
  419. let _this=this;
  420. this.loading = true;
  421. if(_this.userType==1){
  422. this.dialogForm.userType=22
  423. listUser(this.addDateRange(this.dialogForm, this.dateRange)).then(response => {
  424. this.dialogTable = response.rows;
  425. this.total = response.total;
  426. this.loading = false;
  427. this.dialogTable.forEach(function(item) {
  428. item.verifyMode='faceOrFpOrCardOrPw'
  429. item.invalidTime=_this.getdate()
  430. })
  431. }
  432. );
  433. }else if(_this.userType==2){
  434. this.dialogForm.userType=11
  435. listUser(this.addDateRange(this.dialogForm, this.dateRange)).then(response => {
  436. this.dialogTable = response.rows;
  437. this.total = response.total;
  438. this.loading = false;
  439. this.dialogTable.forEach(function(item) {
  440. item.verifyMode='faceOrFpOrCardOrPw'
  441. item.invalidTime=_this.getdate()
  442. })
  443. }
  444. );
  445. }
  446. },
  447. /** 查询门禁授权类型 */
  448. getHaikangQueryTypes(){
  449. getHaikangQueryTypes().then(response => {
  450. if(response.code==200){
  451. this.verifyWayList=response.data
  452. }
  453. });
  454. },
  455. //返回
  456. backPage(){
  457. this.$parent.handleClick('','','back');
  458. this.$parent.getList();
  459. },
  460. //父组件必要此方法用于接收参数
  461. searchClick(type,data){
  462. let _this = this;
  463. if(type == 1){ //type 1.查询
  464. this.queryParams = JSON.parse(JSON.stringify(data));
  465. if(data.dateRange){
  466. this.queryParams.startTime = data.dateRange[0];
  467. this.queryParams.endTime = data.dateRange[1];
  468. delete this.queryParams.dateRange
  469. }else{
  470. delete this.queryParams.dateRange
  471. }
  472. this.queryParams.hardId=this.pageData.hardId;
  473. this.queryParams.pageNum = 1;
  474. this.queryParams.pageSize = 20;
  475. this.getList();
  476. }else if(type == 2) { //type 1.重置
  477. this.queryParams = {
  478. pageNum: 1,
  479. pageSize: 20,
  480. hardId:this.pageData.hardId
  481. };
  482. this.getList();
  483. }else if(type=='addStudent'){
  484. _this.unifyDeploy=false;
  485. _this.dialogVisible=true;
  486. _this.dialogTitle='选择学生';
  487. _this.userType=1;
  488. this.getUserList();
  489. }else if(type=='addTeacher'){
  490. _this.unifyDeploy=false;
  491. _this.dialogVisible=true;
  492. _this.dialogTitle='选择教职工';
  493. _this.userType=2;
  494. this.getUserList();
  495. }else if(type=='batchAgain'){
  496. if(_this.impowerList.length<=0){
  497. _this.msgError("请选择需要授权的数据!");
  498. }else{
  499. let arr=[];
  500. this.impowerList.forEach(function(item){
  501. arr.push({'id':item.id})
  502. })
  503. _this.retryImpowerHaikang(arr)
  504. }
  505. }
  506. },
  507. getList(){
  508. let _this=this;
  509. getHaikangUserList(_this.queryParams).then( response => {
  510. let res=response.rows;
  511. _this.tableData=res;
  512. _this.total=response.total;
  513. //先判断是或还是+,如果是或,判断有哪几种,并且判断每种显示红色还是绿色,如果是加,判断是否每个都是true,如果有一个不是那就是红色,入股都是那是绿色
  514. _this.tableData.forEach(function(item) {
  515. let verifyList=[];
  516. let isVerify=true;//判断验证方式显示颜色
  517. let isretry=true;//判断是否需要显示重试按钮
  518. if(item.verifyMode.indexOf('或')!=-1){//或
  519. if(item.verifyMode.search('密码')!=-1){
  520. verifyList.push({verifyStatus:item.state,name:'密码'})
  521. if(!item.state){
  522. isretry=false
  523. }
  524. }
  525. if(item.verifyMode.search('人脸')!=-1){
  526. verifyList.push({verifyStatus:item.ifFace,name:'人脸'})
  527. if(!item.ifFace){
  528. isretry=false
  529. }
  530. }
  531. if(item.verifyMode.search('刷卡')!=-1){
  532. verifyList.push({verifyStatus:item.ifCard,name:'刷卡'})
  533. if(!item.ifCard){
  534. isretry=false
  535. }
  536. }
  537. if(item.verifyMode.search('指纹')!=-1){
  538. verifyList.push({verifyStatus:item.ifFinger,name:'指纹'})
  539. if(!item.ifFinger){
  540. isretry=false
  541. }
  542. }
  543. item.verifyList=verifyList;
  544. item.isretry=isretry;
  545. }else if(item.verifyMode.indexOf('+')!=-1){//+
  546. if(item.verifyMode.search('密码')!=-1){
  547. if(!item.state){
  548. isVerify=false;
  549. isretry=false;
  550. }
  551. }
  552. if(item.verifyMode.search('人脸')!=-1){
  553. if(!item.ifFace){
  554. isVerify=false;
  555. isretry=false;
  556. }
  557. }
  558. if(item.verifyMode.search('刷卡')!=-1){
  559. if(!item.ifCard){
  560. isVerify=false;
  561. isretry=false;
  562. }
  563. }
  564. if(item.verifyMode.search('指纹')!=-1){
  565. if(!item.ifFinger){
  566. isVerify=false;
  567. isretry=false;
  568. }
  569. }
  570. verifyList.push({verifyStatus:isVerify,name:item.verifyMode})
  571. item.verifyList=verifyList;
  572. item.isretry=isretry;
  573. }else{//其他单个
  574. if(item.verifyMode.search('密码')!=-1){
  575. verifyList.push({verifyStatus:item.state,name:'密码'})
  576. if(!item.state){
  577. isretry=false
  578. }
  579. }
  580. if(item.verifyMode.search('人脸')!=-1){
  581. verifyList.push({verifyStatus:item.ifFace,name:'人脸'})
  582. if(!item.ifFace){
  583. isretry=false
  584. }
  585. }
  586. if(item.verifyMode.search('刷卡')!=-1){
  587. verifyList.push({verifyStatus:item.ifCard,name:'刷卡'})
  588. if(!item.ifCard){
  589. isretry=false
  590. }
  591. }
  592. if(item.verifyMode.search('指纹')!=-1){
  593. verifyList.push({verifyStatus:item.ifFinger,name:'指纹'})
  594. if(!item.ifFinger){
  595. isretry=false
  596. }
  597. }
  598. item.verifyList=verifyList;
  599. item.isretry=isretry;
  600. }
  601. })
  602. });
  603. },
  604. //失效时间修改后提交
  605. loseTimeSubmitForm(){
  606. let _this=this;
  607. let arr=[];
  608. _this.tableData.forEach(function(item2) {
  609. arr.push({'invalidTime':item2.invalidTime,'userId':item2.userId,'verifyMode':item2.verifyMode,id:item2.id})
  610. })
  611. _this.form.detailList=arr;
  612. setTimeout(function () {
  613. editImpowerHaikang(_this.form).then(response => {
  614. if(response.code==200){
  615. _this.msgSuccess("修改成功");
  616. _this.getList();
  617. }
  618. });
  619. },100)
  620. },
  621. //重试
  622. retryImpowerHaikang(arr){
  623. let _this=this;
  624. _this.form.detailList=arr;
  625. retryImpowerHaikang(_this.form).then(response => {
  626. if(response.code==200){
  627. _this.msgSuccess("重试成功");
  628. _this.dialogVisible=false;
  629. _this.$refs.multipleTable2.clearSelection();
  630. _this.getList();
  631. }else if(response.code==205){
  632. _this.$confirm(response.msg, "警告", {
  633. confirmButtonText: "确定",
  634. cancelButtonText: "取消",
  635. type: "warning"
  636. }).then(function() {
  637. _this.dialogVisible=false;
  638. _this.getList();
  639. }).then(() => {
  640. _this.dialogVisible=false;
  641. _this.getList();
  642. }).catch(() => {});
  643. }
  644. });
  645. },
  646. /* 新增授权*/
  647. submitForm(){
  648. let _this=this;
  649. let arr=[];
  650. if(this.labWhiteJoinSubList.length>0){
  651. if(_this.configuration.invalidTime && _this.configuration.verifyMode){//统一配置
  652. this.labWhiteJoinSubList.forEach(function(item){
  653. arr.push({'invalidTime':_this.configuration.invalidTime,'userId':item.userId,'verifyMode':_this.configuration.verifyMode})
  654. })
  655. }else{
  656. this.labWhiteJoinSubList.forEach(function(item){
  657. arr.push({'invalidTime':item.invalidTime,'userId':item.userId,'verifyMode':item.verifyMode})
  658. })
  659. }
  660. _this.form.detailList=arr;
  661. AddImpowerHaikang(_this.form).then(response => {
  662. if(response.code==200){
  663. _this.msgSuccess("新增成功");
  664. _this.dialogVisible=false;
  665. _this.getList();
  666. }else if(response.code==205){
  667. _this.$confirm(response.msg, "警告", {
  668. confirmButtonText: "确定",
  669. cancelButtonText: "取消",
  670. type: "warning"
  671. }).then(function() {
  672. _this.dialogVisible=false;
  673. _this.getList();
  674. }).then(() => {
  675. _this.dialogVisible=false;
  676. _this.getList();
  677. }).catch(() => {});
  678. }
  679. });
  680. }else{
  681. this.msgError("请先选择人员!");
  682. }
  683. },
  684. },
  685. mounted() {
  686. this.queryParams.hardId=this.pageData.hardId;
  687. this.form.hardId=this.pageData.hardId;
  688. this.admittance=this.pageData.controlScope.search("1") != -1
  689. this.whiteList=this.pageData.controlScope.search("2") != -1
  690. if(!this.admittance){//安全准入-学生授权
  691. this.searchData.buttonList.unshift( {
  692. name:"新增学生授权",//按钮名称 只有再状态 1 时需要
  693. type:"1", //按钮类型 1.按钮 2.导入 3.导出
  694. parameter:"addStudent",//按钮字符用于返回方法时的判断
  695. hasPermi:"", // 权限字段 如果没有则传空字符 hasPermi:"",
  696. isHasPermi:false//判断是否需要使用权限字符
  697. })
  698. }
  699. if(!this.whiteList){//白名单-教职工授权
  700. this.searchData.buttonList.unshift({
  701. name:"新增教职工授权",//按钮名称 只有再状态 1 时需要
  702. type:"1", //按钮类型 1.按钮 2.导入 3.导出
  703. parameter:"addTeacher",//按钮字符用于返回方法时的判断
  704. hasPermi:"", // 权限字段 如果没有则传空字符 hasPermi:"",
  705. isHasPermi:false//判断是否需要使用权限字符
  706. })
  707. }
  708. this.listDepartments();
  709. this.getHaikangQueryTypes()
  710. this.getList()
  711. }
  712. };
  713. </script>
  714. <style lang="scss">
  715. .supplier{
  716. flex:1;
  717. display: flex;
  718. flex-direction: column;
  719. /*顶部*/
  720. .supplier-title{
  721. display: flex;
  722. justify-content: space-between;
  723. align-items: center;
  724. border-bottom: 1px solid #E0E0E0;
  725. height: 90px;
  726. p:nth-child(1){
  727. line-height:60px;
  728. color: #0045AF;
  729. font-size:14px;
  730. margin:0 12px 0 20px;
  731. }
  732. p:nth-child(2){
  733. margin-right:20px;
  734. }
  735. }
  736. .supplier-page{
  737. flex:1;
  738. display: flex!important;
  739. flex-direction: column;
  740. // box-shadow: 0 0 8px 2px rgba(0, 0, 0, 0.1);
  741. padding:20px 20px 20px!important;
  742. border-radius:10px;
  743. }
  744. /*弹框*/
  745. .btn_list{
  746. width: 100%;
  747. height: 40px;
  748. background: rgba(1,131,250,0.1);
  749. border-radius: 6px;
  750. display: flex;
  751. justify-content: flex-start;
  752. align-items: center;
  753. margin-bottom: 32px;
  754. >i{
  755. font-style: normal;
  756. display: inline-block;
  757. cursor: pointer;
  758. }
  759. >i:nth-of-type(1){
  760. font-size: 20px;
  761. color: #0045AF;
  762. margin: 0 16px 0 14px;
  763. }
  764. >i:nth-of-type(2){
  765. font-size: 16px;
  766. font-family: Source Han Sans CN;
  767. font-weight: bold;
  768. color: #999999;
  769. line-height: 16px;
  770. }
  771. >i:nth-of-type(3){
  772. font-size: 16px;
  773. font-family: Source Han Sans CN;
  774. font-weight: bold;
  775. color: #0045AF;
  776. line-height: 16px;
  777. margin: 0 28px 0 46px;
  778. }
  779. >i:nth-of-type(4){
  780. font-size: 16px;
  781. font-family: Source Han Sans CN;
  782. font-weight: bold;
  783. color: #0045AF;
  784. line-height: 16px;
  785. }
  786. >i:nth-of-type(5){
  787. font-size: 16px;
  788. font-family: Source Han Sans CN;
  789. font-weight: bold;
  790. color: #FFA312;
  791. line-height: 16px;
  792. margin: 0 40px 0 28px;
  793. }
  794. .bottom-button-box{
  795. display: flex;
  796. width:220px;
  797. margin: 0;
  798. p{
  799. font-size:14px;
  800. height:30px;
  801. width:100px;
  802. line-height:30px;
  803. text-align: center;
  804. border-radius:4px;
  805. }
  806. p:nth-child(1){
  807. border:1px solid #E0E0E0;
  808. margin-right:20px;
  809. }
  810. p:nth-child(2){
  811. border:1px solid #0045AF;
  812. }
  813. }
  814. }
  815. .configuration{
  816. height: 70px;
  817. display: flex;
  818. justify-content: flex-end;
  819. align-items: center;
  820. border-top: 1px solid #D8D8D8;
  821. .el-form-item{
  822. margin-bottom: 0!important;
  823. }
  824. }
  825. /*验证方式*/
  826. .verify-green{
  827. color: #46D417;
  828. margin-right: 10px;
  829. }
  830. .verify-red{
  831. color: #FF0000;
  832. margin-right: 10px;
  833. }
  834. }
  835. </style>