Browse Source

版本3.7 2023-11-22 ljd

1、凭证增加了WiFi人脸锁的人脸凭证录入和删除功能
master
xiaohei 1 year ago
parent
commit
bcac00b2e2
1 changed files with 178 additions and 24 deletions
  1. +178
    -24
      src/views/userManagement.vue

+ 178
- 24
src/views/userManagement.vue View File

@ -385,8 +385,8 @@
<el-button type="text" @click="modifyCrai(scope.$index, scope.row)">修改凭证</el-button>
<el-button type="text" @click="viewDistributionRecord(scope.$index, scope.row)">查看下发记录
</el-button>
<el-button type="text" class="red" @click="deletefun1(scope.$index, scope.row)">删除
</el-button>
<!-- <el-button type="text" class="red" @click="deletefun1(scope.$index, scope.row)">删除
</el-button> -->
<el-button type="text" class="red" v-if="userInfo.type == 0"
@click="deleteCertificatesMethod(scope.$index, scope.row)">删除平台记录
</el-button>
@ -2092,9 +2092,89 @@ export default {
that.$message.error("删除失败!")
}
});
} else if (res.data.list[0].manufactureId == 1201) {
} else if (res.data.list[0].manufactureId == 1201 || res.data.list[0].manufactureId == 1241) {
if (row.type == 1) {
this.getfiId1(row, function (data) {
if (data.length > 0) {
let datastr={
code: "lwj/fpOperate",
data: {
lockerId:row.deviceNum,
lockerUserId:JSON.parse(row.content).userPassword,
action:2,
fpData:null,
startTime:row.startTime,
endTime:row.endTime,
operateMode: 18,
order: 6218,
cardName:cardName,
roomName: JSON.parse(row.content).roomName,
fpIndex: JSON.parse(row.content).index
}
}
httpPost(datastr,this.$api.sendCommand).then(res2=>{
if(res2.success){
let content = JSON.parse(row.content)
content.operateMode = 18
content.order = 6218
let updatedata = {
id: row.id,
status: 0,
content: JSON.stringify(content),
serial: res2.data.serialNumber,
};
httpPost(updatedata, that.$api.updateCertificates).then((res3) => {
console.log(res3);
});
that.$message.success('删除成功');
that.obtainVoucherIssuanceRecord();
}else{
that.$message.error('删除失败');
}
})
}else {
that.$message.error('暂无发现对应指纹序号');
}
})
} else if(row.type == 2) {
} else if(row.type == 3) {
let data={
code: "lwj/cardOperate",
data: {
lockerId:row.deviceNum,
lockerUserId:JSON.parse(row.content).userPassword,
action:2,
cardNo: JSON.parse(row.content).password,
startTime:row.startTime,
endTime: row.endTime,
operateMode: 12,
order: 6212,
cardName: cardName,
roomName: res.data.list[0].roomName
}
}
httpPost(data,this.$api.sendCommand).then(res=>{
if (res.success) {
let content = JSON.parse(row.content)
content.operateMode = 12
content.order = 6212
let updatedata = {
id: row.id,
status: 0,
content: JSON.stringify(content),
serial: res.data.serialNumber,
};
httpPost(updatedata, that.$api.updateCertificates).then((res) => {
console.log(res);
});
that.$message.success('删除成功');
that.obtainVoucherIssuanceRecord();
} else {
this.$message.error(res.msg)
}
})
} else if (row.type == 4) {
let data = {
code: "lwj/passwordOperate",
@ -2115,6 +2195,7 @@ export default {
if (res.success) {
let content = JSON.parse(row.content)
content.operateMode = 9
content.order = 6209
let updatedata = {
id: row.id,
status: 0,
@ -2128,6 +2209,43 @@ export default {
this.$message.error(res.msg)
}
})
} else if (row.type == 0) {
let data = {
code: "lwj/faceOperate",
data: {
faceIndex: JSON.parse(row.content).index,
action: 2,
endTime: row.endTime,
faceData: JSON.parse(row.content).faceData,
lockerId: deviceinfo.deviceNum,
lockerUserId: JSON.parse(row.content).userPassword,
startTime: row.startTime,
operateMode: 22,
order: 6222
}
}
httpPost(data, this.$api.sendCommand).then(res1 => {
console.log(res1);
let content = JSON.parse(row.content)
content.operateMode = 22
content.order = 6222
if(res1.success){
let updatedata = {
id: row.id,
status: 0,
serial: res1.data.serialNumber,
content: JSON.stringify(content)
}
httpPost(updatedata, this.$api.updateCertificates).then(res2 => {
console.log(res2);
if(res2.success) {
this.$message.success('删除成功')
}else{
this.$message.error('删除失败')
}
})
}
})
}
}
} else {
@ -3799,6 +3917,63 @@ export default {
}
})
}
} else if(row.type == 10){
let fpId = new Date();
let faceData = JSON.parse(row.content).faceData;
var str = {
imei: resultArr.imei,
deviceNum: resultArr.deviceNum,
userTelephone: userTelephone,
userPassword: userPassword,
password: JSON.parse(row.content).password,
faceTimeId: fpId.getTime(),
operateMode: 20,
type: 0,
order: 6220,
faceData: faceData,
passwordStartTime: passwordStartTime,
passwordEndTime: passwordEndTime,
pzname: (pzname ? pzname : ''),
cardName: row.name + '-' + (pzname ? pzname : ''),
roomName: resultArr.roomName
};
let data={
code: "lwj/faceOperate",
data: {
lockerId:resultArr.deviceNum,
lockerUserId:JSON.parse(row.content).userPassword,
action:1,
faceData:faceData,
startTime:startTime,
endTime:endTime,
operateMode: 20,
order: 6220
}
}
httpPost(data,this.$api.sendCommand).then(res=>{
console.log(res);
if (res.success) {
str.index = res.data.index
var data = {
cardId: this.drawerRow.id,
deviceNum: resultArr.deviceNum,
imei: resultArr.imei,
content: JSON.stringify(str), //operateMode:NFC-10-1
type: str.type,
serial: res.data.serialNumber,
startTime: startTime,
endTime: endTime,
order: 6220
};
httpPost(data, this.$api.addCertificates).then((res) => {
this.bindRoomStatus1 = false
this.getcertificate(); //
this.$message.success('下发成功')
});
} else {
this.$message.error(res.msg)
}
})
}
},
@ -4470,14 +4645,6 @@ export default {
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) {
var fingerprint = localStorage.getItem("fingerprint");
var indexofstr = fingerprint.indexOf(',')
@ -4504,19 +4671,6 @@ export default {
order: 6216,
fingerprint: fingerprint,
};
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),
};
httpPost(data, this.$api.addCertificates).then((res) => {
this.$message.success('下发成功')
this.roomstatus1 = true;
this.getcertificate(); //
});
return false;
} else if (documentType == 12) {
var arr2 = ''
if (this.voucher.idcard.length == 16) {


Loading…
Cancel
Save