Browse Source

增加了添加录入人脸凭证

master
xiaohei 1 year ago
parent
commit
846bf051a2
2 changed files with 52 additions and 14 deletions
  1. +12
    -4
      dist/static/config.js
  2. +40
    -10
      src/views/userManagement.vue

+ 12
- 4
dist/static/config.js View File

@ -21,13 +21,21 @@ export default {
code:4, code:4,
desc:"Z电信" desc:"Z电信"
}, },
// {
// code:5,
// desc:"移动透传"
// },
// {
// code:6,
// desc:"wifi"
// },
{ {
code:5,
desc:"移动透传"
code:6,
desc:"Z移动透传"
}, },
{ {
code:6,
desc:"wifi"
code:5,
desc:"Zwifi"
}, },
{ {
code:7, code:7,


+ 40
- 10
src/views/userManagement.vue View File

@ -445,7 +445,8 @@
</el-form-item> </el-form-item>
<el-form-item label="上传照片" v-if="documentType == 10"> <el-form-item label="上传照片" v-if="documentType == 10">
<div v-if="documentType == 10"> <div v-if="documentType == 10">
<el-upload action="#" list-type="picture-card" size="middle" :auto-upload="false"
<Cropper @change="getFaceData($event)"></Cropper>
<!-- <el-upload action="#" list-type="picture-card" size="middle" :auto-upload="false"
:modal-append-to-body="false"> :modal-append-to-body="false">
<i slot="default" class="el-icon-plus"></i> <i slot="default" class="el-icon-plus"></i>
<div slot="file" slot-scope="{ file }"> <div slot="file" slot-scope="{ file }">
@ -465,7 +466,7 @@
</el-upload> </el-upload>
<el-dialog :visible.sync="dialogVisible" :modal-append-to-body="false"> <el-dialog :visible.sync="dialogVisible" :modal-append-to-body="false">
<img width="100%" :src="dialogImageUrl" alt="" /> <img width="100%" :src="dialogImageUrl" alt="" />
</el-dialog>
</el-dialog> -->
</div> </div>
</el-form-item> </el-form-item>
<el-form-item label="指纹" v-if="documentType == 11"> <el-form-item label="指纹" v-if="documentType == 11">
@ -750,6 +751,7 @@ import zw from "./zw.vue"
import getFinger from "./getFinger.vue" import getFinger from "./getFinger.vue"
import md5 from 'js-md5' import md5 from 'js-md5'
import ICINLocker from "../utils/equipment.js" import ICINLocker from "../utils/equipment.js"
import Cropper from "../components/cropperJs/index.vue";
import { import {
timestampToTime, timestampToTime,
dec2hex, dec2hex,
@ -1107,7 +1109,8 @@ export default {
freeUserTitle: '冻结用户', freeUserTitle: '冻结用户',
userTypeList: [], userTypeList: [],
maxDateTime: '', maxDateTime: '',
minDateTime: ''
minDateTime: '',
faceData: ''
}; };
}, },
computed: { computed: {
@ -1140,7 +1143,8 @@ export default {
personLi, personLi,
zw, getFinger, zw, getFinger,
contrast, contrast,
NumberGrow
NumberGrow,
Cropper
}, },
mounted() { mounted() {
// //
@ -1173,6 +1177,9 @@ export default {
this.$store.commit("increment", 1); this.$store.commit("increment", 1);
}, },
methods: { methods: {
getFaceData(val){
this.faceData = val.split(',')[1]
},
// //
getLeasesList() { getLeasesList() {
let data = { let data = {
@ -4449,8 +4456,28 @@ export default {
return false return false
} }
if (documentType == 10) { if (documentType == 10) {
this.$message.error("人脸暂未开放");
return
if (pzname == '') {
pzname = '人脸' + sort
}
let str = {
username: this.voucher.username,
pzname: pzname,
userTelephone: this.drawerRow.info.userTelephone,
userPassword: this.drawerRow.info.userPassword,
faceData: this.faceData,
password: "",
passwordStartTime: moment(this.value2[0]).format('YYYYMMDDHHmmss'),
passwordEndTime: moment(this.value2[1]).format('YYYYMMDDHHmmss'),
order: 6220
}
let data = {
cardId: this.drawerRow.id,
content: JSON.stringify(str),
type: documentType,
startTime: parseInt( moment(this.value2[0]).valueOf() / 1000),
endTime: parseInt(moment(this.value2[1]).valueOf() / 1000),
};
return false
} else if (documentType == 11) { } else if (documentType == 11) {
var fingerprint = localStorage.getItem("fingerprint"); var fingerprint = localStorage.getItem("fingerprint");
var indexofstr = fingerprint.indexOf(',') var indexofstr = fingerprint.indexOf(',')
@ -4578,7 +4605,6 @@ export default {
is: false, is: false,
}; };
} }
var data = { var data = {
cardId: this.drawerRow.id, cardId: this.drawerRow.id,
content: JSON.stringify(str), content: JSON.stringify(str),
@ -4587,9 +4613,13 @@ export default {
endTime: moment(this.value2[1]).valueOf() / 1000 endTime: moment(this.value2[1]).valueOf() / 1000
}; };
httpPost(data, this.$api.addCertificates).then((res) => { httpPost(data, this.$api.addCertificates).then((res) => {
this.$message.success('添加成功')
this.roomstatus1 = true;
this.getcertificate();
if(res.success){
this.$message.success('添加成功')
this.roomstatus1 = true;
this.getcertificate();
}else{
this.$message.error('添加失败')
}
}); });
}, },
// //


Loading…
Cancel
Save