Browse Source

版本3.8.0 2023-12-29 ljd

1、增加了判断租户info字段的类型判断,防止后续获取数据时类型错误导致获取不到数据
master
xiaohei 1 year ago
parent
commit
9264c01cb5
1 changed files with 81 additions and 30 deletions
  1. +81
    -30
      src/views/userManagement.vue

+ 81
- 30
src/views/userManagement.vue View File

@ -1205,10 +1205,16 @@ export default {
limitedTimePassword(index, row) {
const startTime = moment(new Date().getTime()).format("YYYY-MM-DD HH:mm:ss")
const endTime = moment(new Date().getTime() + 4 * 60 * 1000).format("YYYY-MM-DD HH:mm:ss")
var info = ''
if(typeof (this.drawerRow.info) == 'object'){
info = this.drawerRow.info
}else if(typeof (this.drawerRow.info) == 'string'){
info = JSON.parse(this.drawerRow.info)
}
let data3 = {
code: "/zg/offlinepassword/limit",
data: {
userName: this.drawerRow.info.userId,
userName: info.userId,
lockId: row.deviceNum,
startTime: startTime,
endTime: endTime
@ -1236,10 +1242,16 @@ export default {
timingPassword(index, row) {
const startTime = moment(new Date().getTime()).format("YYYY-MM-DD HH:mm:ss")
const endTime = moment(new Date().getTime() + 24 * 60 * 60 * 1000).format("YYYY-MM-DD HH:mm:ss")
var info = ''
if(typeof (this.drawerRow.info) == 'object'){
info = this.drawerRow.info
}else if(typeof (this.drawerRow.info) == 'string'){
info = JSON.parse(this.drawerRow.info)
}
let data3 = {
code: "/zg/offlinepassword/correctTime",
data: {
userName: this.drawerRow.info.userId,
userName: info.userId,
lockId: row.deviceNum,
},
};
@ -1265,10 +1277,16 @@ export default {
clearAllPassWord(index, row) {
const startTime = moment(new Date().getTime()).format("YYYY-MM-DD HH:mm:ss")
const endTime = moment(new Date().getTime() + 24 * 60 * 60 * 1000).format("YYYY-MM-DD HH:mm:ss")
var info = ''
if(typeof (this.drawerRow.info) == 'object'){
info = this.drawerRow.info
}else if(typeof (this.drawerRow.info) == 'string'){
info = JSON.parse(this.drawerRow.info)
}
let data3 = {
code: "/zg/offlinepassword/clear",
data: {
userName: this.drawerRow.info.userId,
userName: info.userId,
lockId: row.deviceNum,
startTime: startTime,
// endTime:endTime,
@ -1297,10 +1315,16 @@ export default {
getLimitMethods(index, row) {
const startTime = moment(new Date().getTime()).format("YYYY-MM-DD HH:mm:ss")
const endTime = moment(new Date().getTime() + 24 * 60 * 60 * 1000).format("YYYY-MM-DD HH:mm:ss")
var info = ''
if(typeof (this.drawerRow.info) == 'object'){
info = this.drawerRow.info
}else if(typeof (this.drawerRow.info) == 'string'){
info = JSON.parse(this.drawerRow.info)
}
let data3 = {
code: "/zg/offlinepassword/forever",
data: {
userName: this.drawerRow.info.userId,
userName: info.userId,
lockId: row.deviceNum,
startTime: startTime,
// endTime:endTime,
@ -3105,6 +3129,12 @@ export default {
//
continuationManagementSave() {
console.log(this.roomtable, this.drawerRow)
var info = ''
if(typeof (this.drawerRow.info) == 'object'){
info = this.drawerRow.info
}else if(typeof (this.drawerRow.info) == 'string'){
info = JSON.parse(this.drawerRow.info)
}
this.$confirm("是否续住", "提示", {
type: "warning",
}).then(() => {
@ -3123,8 +3153,8 @@ export default {
var roomName = this.zNodes.filter(item => li.roomId === item.id)
if (resultArr) {
if (resultArr.manufactureId == 101) {
var userTelephone = this.drawerRow.info.userTelephone;
var userPassword = this.drawerRow.info.userPassword;
var userTelephone = info.userTelephone;
var userPassword = info.userPassword;
resultArr.roomName = roomName[0].name
var data = {
deviceNum: resultArr.deviceNum,
@ -3258,7 +3288,13 @@ export default {
sendVoucher() {
var SelectedListbind = this.SelectedList
var roomAbout = this.$store.state.roomAbout
var infostr = this.drawerRow.info;
var infostr = ''
if(typeof (this.drawerRow.info) == 'object'){
infostr = this.drawerRow.info
}else if(typeof (this.drawerRow.info) == 'string'){
infostr = JSON.parse(this.drawerRow.info)
}
// var infostr = this.drawerRow.info;
var fjid = [];
if (this.value2[0] == '' || this.value2[1] == '') {
this.$message.error("请选择开始结束时间")
@ -3276,6 +3312,7 @@ export default {
var room = roomAbout.filter(item => item.roomId == resultArr.roomId)[0]
resultArr.roomName = room.roomName
console.log("3278", this.multipleSelection2)
// return
this.putCarfidzg(resultArr, this.multipleSelection2);
} else if (resultArr.manufactureId == 101) {
var room = roomAbout.filter(item => item.roomId == resultArr.roomId)[0]
@ -3711,6 +3748,12 @@ export default {
var endTime = new Date(this.value2[1]).getTime() / 1000
var passwordStartTime = new Date(this.value2[0]).getTime() / 1000
var passwordEndTime = new Date(this.value2[1]).getTime() / 1000
var info = ''
if(typeof (this.drawerRow.info) == 'object'){
info = this.drawerRow.info
}else if(typeof (this.drawerRow.info) == 'string'){
info = JSON.parse(this.drawerRow.info)
}
// var passwordStartTime = JSON.stringify(row.startTime)
// var passwordEndTime = JSON.stringify(row.endTime)
// var sort=this.getTypeSort(this.roomtable1,row.type)
@ -3751,8 +3794,8 @@ export default {
lockerId: resultArr.deviceNum,
imei: resultArr.imei,
order: 6216,
lockerUserId: this.drawerRow.info.userPassword,
keyId: this.drawerRow.info.userPassword,
lockerUserId: info.userPassword,
keyId: info.userPassword,
fingerType: 0,
file: fingerprint1,
cardName: row.name + '-' + (pzname ? pzname : ''),
@ -3760,6 +3803,7 @@ export default {
startTime: passwordStartTime,
endTime: passwordEndTime
};
console.log("3764",data3)
ICINLocker.addFingerPrints(data3.lockerId, data3.imei, data3.lockerUserId, data3.fingerType, data3
.file, data3.startTime, data3.endTime, data3.cardName, data3.roomName, (callback) => {
if (callback.success) {
@ -4867,6 +4911,12 @@ export default {
let str = {};
let cardName = this.drawerRow.name,
pzname = '';
var info = ""
if(typeof(this.drawerRow.info) == 'object'){
info = this.drawerRow.info
}else if(typeof(this.drawerRow.info) == 'string'){
info = JSON.parse(this.drawerRow.info)
}
if (documentType == '请选择') {
this.$message.error("请选择凭证类型")
return false;
@ -4886,14 +4936,14 @@ export default {
if (pzname == '') {
pzname = '人脸' + sort
}
let str = {
str = {
username: this.voucher.username,
pzname: pzname,
userTelephone: this.drawerRow.info.userTelephone,
userPassword: this.drawerRow.info.userPassword,
userTelephone: info.userTelephone,
userPassword: info.userPassword,
faceData: this.faceData,
keyId: this.drawerRow.info.keyId,
userId: this.drawerRow.info.userId,
keyId: info.keyId,
userId: info.userId,
password: "",
passwordStartTime: moment(this.value2[0]).format('YYYYMMDDHHmmss'),
passwordEndTime: moment(this.value2[1]).format('YYYYMMDDHHmmss'),
@ -4913,10 +4963,10 @@ export default {
str = {
username: this.voucher.username,
pzname: pzname,
userTelephone: this.drawerRow.info.userTelephone,
userPassword: this.drawerRow.info.userPassword,
keyId: this.drawerRow.info.keyId,
userId: this.drawerRow.info.userId,
userTelephone: info.userTelephone,
userPassword: info.userPassword,
keyId: info.keyId,
userId: info.userId,
fingerprintAlias: this.voucher.fingerprintAlias,
password: "",
passwordStartTime: moment(this.value2[0]).format('YYYYMMDDHHmmss'),
@ -4941,10 +4991,10 @@ export default {
str = {
username: this.voucher.username,
pzname: pzname,
userTelephone: this.drawerRow.info.userTelephone,
userPassword: this.drawerRow.info.userPassword,
keyId: this.drawerRow.info.keyId,
userId: this.drawerRow.info.userId,
userTelephone: info.userTelephone,
userPassword: info.userPassword,
keyId: info.keyId,
userId: info.userId,
operateMode: 13,
order: 6213,
password: arr2.toUpperCase(), //this.voucher.idcard,
@ -4977,10 +5027,10 @@ export default {
pzname: pzname,
operateMode: 10,
order: 6210,
userTelephone: this.drawerRow.info.userTelephone,
userPassword: this.drawerRow.info.userPassword,
keyId: this.drawerRow.info.keyId,
userId: this.drawerRow.info.userId,
userTelephone: info.userTelephone,
userPassword: info.userPassword,
keyId: info.keyId,
userId: info.userId,
password: nfc.toUpperCase(), //this.voucher.nfc,
passwordStartTime: moment(this.value2[0]).format('YYYYMMDDHHmmss'),
passwordEndTime: moment(this.value2[1]).format('YYYYMMDDHHmmss'),
@ -5002,10 +5052,10 @@ export default {
pzname: pzname,
// imei: this.deviceList[0].imei,
password: this.voucher.password,
userTelephone: this.drawerRow.info.userTelephone,
userPassword: this.drawerRow.info.userPassword,
keyId: this.drawerRow.info.keyId,
userId: this.drawerRow.info.userId,
userTelephone: info.userTelephone,
userPassword: info.userPassword,
keyId: info.keyId,
userId: info.userId,
operateMode: 7,
order: 6207,
passwordStartTime: moment(this.value2[0]).format('YYYYMMDDHHmmss'),
@ -5020,6 +5070,7 @@ export default {
startTime: moment(this.value2[0]).valueOf() / 1000,
endTime: moment(this.value2[1]).valueOf() / 1000
};
console.log("5025",str,data)
httpPost(data, this.$api.addCertificates).then((res) => {
if (res.success) {
this.$message.success('添加成功')


Loading…
Cancel
Save