|
@ -2627,7 +2627,6 @@ export default { |
|
|
getalllist() { |
|
|
getalllist() { |
|
|
var data = {}; |
|
|
var data = {}; |
|
|
httpGet(data, this.$api.getSiteList).then((res) => { |
|
|
httpGet(data, this.$api.getSiteList).then((res) => { |
|
|
|
|
|
|
|
|
this.zNodes = JSON.parse(JSON.stringify(res.data.list.list)); |
|
|
this.zNodes = JSON.parse(JSON.stringify(res.data.list.list)); |
|
|
var zNodes = JSON.parse(JSON.stringify(res.data.list.list)); |
|
|
var zNodes = JSON.parse(JSON.stringify(res.data.list.list)); |
|
|
var array = utils.uniqueArray(zNodes, "id"); |
|
|
var array = utils.uniqueArray(zNodes, "id"); |
|
@ -3082,9 +3081,207 @@ export default { |
|
|
this.SelectedListVoucher = selectRow |
|
|
this.SelectedListVoucher = selectRow |
|
|
}, |
|
|
}, |
|
|
// 绑定房间 |
|
|
// 绑定房间 |
|
|
|
|
|
// bindsave() { |
|
|
|
|
|
// var SelectedListbind = this.bindSelectedList |
|
|
|
|
|
// var infostr = JSON.parse(this.drawerRow.info); |
|
|
|
|
|
// var fjid = []; |
|
|
|
|
|
// var _this = this |
|
|
|
|
|
// if (this.value2[0] == '' || this.value2[1] == '') { |
|
|
|
|
|
// this.$message.error("请选择开始结束时间") |
|
|
|
|
|
// return false; |
|
|
|
|
|
// } |
|
|
|
|
|
// if (SelectedListbind.length != 0) { |
|
|
|
|
|
// SelectedListbind.forEach((li) => { |
|
|
|
|
|
// var str = { |
|
|
|
|
|
// cardId: this.drawerRow.id, |
|
|
|
|
|
// siteId: li, |
|
|
|
|
|
// startTime: this.value2[0], |
|
|
|
|
|
// endTime: this.value2[1] |
|
|
|
|
|
// }; |
|
|
|
|
|
// var resultArr = this.AboutDevice.filter( |
|
|
|
|
|
// (_item) => _item.roomId == li |
|
|
|
|
|
// )[0]; |
|
|
|
|
|
// var roomName = this.zNodes.filter(item => li === item.id) |
|
|
|
|
|
// if (resultArr) { |
|
|
|
|
|
// // console.log(roomName,resultArr, this.drawerRow) |
|
|
|
|
|
// // return |
|
|
|
|
|
// if (resultArr.imei) { |
|
|
|
|
|
// fjid = [str]; |
|
|
|
|
|
// if (resultArr.manufactureId == 201 || resultArr.manufactureId == 221) { |
|
|
|
|
|
// var data = { |
|
|
|
|
|
// lockerId: resultArr.deviceNum, |
|
|
|
|
|
// imei: resultArr.imei, |
|
|
|
|
|
// lockerUserId: infostr.userPassword, |
|
|
|
|
|
// keyId: infostr.userPassword, |
|
|
|
|
|
// role: 0, |
|
|
|
|
|
// action: 1, |
|
|
|
|
|
// order: 6226, |
|
|
|
|
|
// cardName: this.drawerRow.name, |
|
|
|
|
|
// roomName: roomName[0].name |
|
|
|
|
|
// }; |
|
|
|
|
|
// ICINLocker.addUserToLock(data.lockerId, data.imei, data |
|
|
|
|
|
// .lockerUserId, data.role, data.action, data.order, data.cardName, data |
|
|
|
|
|
// .roomName, ( |
|
|
|
|
|
// callback) => { |
|
|
|
|
|
// if (callback.success) { |
|
|
|
|
|
// var locakUserdata = { |
|
|
|
|
|
// deviceNum: resultArr.deviceNum, |
|
|
|
|
|
// imei: resultArr.imei, |
|
|
|
|
|
// cardId: this.drawerRow.id, |
|
|
|
|
|
// content: JSON.stringify( |
|
|
|
|
|
// data |
|
|
|
|
|
// ), //operateMode:NFC-10、把人员添加到凭证-1 |
|
|
|
|
|
// type: 26, |
|
|
|
|
|
// serial: callback.data.serialNumber, |
|
|
|
|
|
// startTime: moment(this.value2[0]).valueOf() / 1000, |
|
|
|
|
|
// endTime: moment(this.value2[1]).valueOf() / 1000, |
|
|
|
|
|
// } |
|
|
|
|
|
// utils.sendLockUser(locakUserdata, (callbackLOCK) => { |
|
|
|
|
|
|
|
|
|
|
|
// }) |
|
|
|
|
|
|
|
|
|
|
|
// } else { |
|
|
|
|
|
// this.$message.error(callback.msg); |
|
|
|
|
|
// if (callback.code == 201016) { |
|
|
|
|
|
// httpPost(fjid, this.$api.bindCard).then((res) => { |
|
|
|
|
|
// if (res.success) { |
|
|
|
|
|
// this.bindRoomStatus = false |
|
|
|
|
|
// this.getcheckInList() |
|
|
|
|
|
// this.getAboutRoom(); |
|
|
|
|
|
// setTimeout(() => { |
|
|
|
|
|
// this.updateRoom(); |
|
|
|
|
|
// }, 500); |
|
|
|
|
|
// this.$message.success("用户门锁已存在") |
|
|
|
|
|
// } else { |
|
|
|
|
|
// this.$message.error("添加失败") |
|
|
|
|
|
// } |
|
|
|
|
|
// }); |
|
|
|
|
|
// } |
|
|
|
|
|
// } |
|
|
|
|
|
// }) |
|
|
|
|
|
// httpPost(fjid, this.$api.bindCard).then((res) => { |
|
|
|
|
|
// if (res.success) { |
|
|
|
|
|
// this.bindRoomStatus = false |
|
|
|
|
|
// this.getAboutRoom(); |
|
|
|
|
|
// this.getcheckInList() |
|
|
|
|
|
// setTimeout(() => { |
|
|
|
|
|
// this.updateRoom(); |
|
|
|
|
|
// }, 500); |
|
|
|
|
|
// } else { |
|
|
|
|
|
// this.$message.error("添加失败") |
|
|
|
|
|
// } |
|
|
|
|
|
// }); |
|
|
|
|
|
// } else if (resultArr.manufactureId == 101) { |
|
|
|
|
|
// var userstr = { |
|
|
|
|
|
// imei: resultArr.imei, |
|
|
|
|
|
// deviceNum: resultArr.deviceNum, |
|
|
|
|
|
// userTelephone: infostr.userTelephone, |
|
|
|
|
|
// userPassword: infostr.userPassword, |
|
|
|
|
|
// password: infostr.userPassword, |
|
|
|
|
|
// operateMode: 26, |
|
|
|
|
|
// order: 6226, |
|
|
|
|
|
// passwordStartTime: this.moment(this.value2[0]).format( |
|
|
|
|
|
// "YYYYMMDDHHmmss"), |
|
|
|
|
|
// passwordEndTime: this.moment(this.value2[1]).format("YYYYMMDDHHmmss"), |
|
|
|
|
|
// is: false, |
|
|
|
|
|
// cardName: this.drawerRow.name, |
|
|
|
|
|
// roomName: roomName[0].name |
|
|
|
|
|
// }; |
|
|
|
|
|
// ICINLocker.LDAddUser(userstr.deviceNum, userstr.imei, userstr.userTelephone, |
|
|
|
|
|
// userstr.userPassword, userstr.password, userstr.passwordStartTime, |
|
|
|
|
|
// userstr.passwordEndTime, userstr.operateMode, userstr.order, userstr |
|
|
|
|
|
// .cardName, userstr.roomName, false, (callback) => { |
|
|
|
|
|
// if (callback.success) { |
|
|
|
|
|
// console.log(_this.value2) |
|
|
|
|
|
// var locakUserdata = { |
|
|
|
|
|
// deviceNum: resultArr.deviceNum, |
|
|
|
|
|
// imei: resultArr.imei, |
|
|
|
|
|
// cardId: this.drawerRow.id, |
|
|
|
|
|
// content: JSON.stringify( |
|
|
|
|
|
// userstr |
|
|
|
|
|
// ), //operateMode:NFC-10、把人员添加到凭证-1 |
|
|
|
|
|
// type: 26, |
|
|
|
|
|
// serial: callback.data.serialNumber, |
|
|
|
|
|
// startTime: moment(_this.value2[0]).valueOf() / 1000, |
|
|
|
|
|
// endTime: moment(_this.value2[1]).valueOf() / 1000, |
|
|
|
|
|
// } |
|
|
|
|
|
// utils.sendLockUser(locakUserdata, (callbackLOCK) => { |
|
|
|
|
|
|
|
|
|
|
|
// }) |
|
|
|
|
|
// httpPost(fjid, this.$api.bindCard).then((res) => { |
|
|
|
|
|
// if (res.success) { |
|
|
|
|
|
// this.bindRoomStatus = false |
|
|
|
|
|
// this.getAboutRoom(); |
|
|
|
|
|
// this.getcheckInList() |
|
|
|
|
|
// setTimeout(() => { |
|
|
|
|
|
// this.updateRoom(); |
|
|
|
|
|
// }, 500); |
|
|
|
|
|
// } else { |
|
|
|
|
|
// this.$message.error("添加失败") |
|
|
|
|
|
// } |
|
|
|
|
|
// }); |
|
|
|
|
|
// } else { |
|
|
|
|
|
// this.$message.error(callback.msg); |
|
|
|
|
|
// } |
|
|
|
|
|
// }) |
|
|
|
|
|
// } else if (resultArr.manufactureId == 1201) { |
|
|
|
|
|
// httpPost(fjid, this.$api.bindCard).then((res) => { |
|
|
|
|
|
// if (res.success) { |
|
|
|
|
|
// this.bindRoomStatus = false |
|
|
|
|
|
// this.getAboutRoom(); |
|
|
|
|
|
// this.getcheckInList() |
|
|
|
|
|
// setTimeout(() => { |
|
|
|
|
|
// this.updateRoom(); |
|
|
|
|
|
// }, 500); |
|
|
|
|
|
// } else { |
|
|
|
|
|
// this.$message.error("添加失败") |
|
|
|
|
|
// } |
|
|
|
|
|
// }); |
|
|
|
|
|
// } |
|
|
|
|
|
// } else { |
|
|
|
|
|
// fjid.push(str); |
|
|
|
|
|
// httpPost(fjid, this.$api.bindCard).then((res) => { |
|
|
|
|
|
// if (res.success) { |
|
|
|
|
|
// this.bindRoomStatus = false |
|
|
|
|
|
// this.getAboutRoom(); |
|
|
|
|
|
// this.getcheckInList() |
|
|
|
|
|
// setTimeout(() => { |
|
|
|
|
|
// this.updateRoom(); |
|
|
|
|
|
// }, 500); |
|
|
|
|
|
// } else { |
|
|
|
|
|
// this.$message.error("添加失败") |
|
|
|
|
|
// } |
|
|
|
|
|
// }); |
|
|
|
|
|
// } |
|
|
|
|
|
// } else { |
|
|
|
|
|
// fjid.push(str); |
|
|
|
|
|
// httpPost(fjid, this.$api.bindCard).then((res) => { |
|
|
|
|
|
// if (res.success) { |
|
|
|
|
|
// this.bindRoomStatus = false |
|
|
|
|
|
// this.getAboutRoom(); |
|
|
|
|
|
// this.getcheckInList() |
|
|
|
|
|
// setTimeout(() => { |
|
|
|
|
|
// this.updateRoom(); |
|
|
|
|
|
// }, 500); |
|
|
|
|
|
// } else { |
|
|
|
|
|
// this.$message.error("添加失败") |
|
|
|
|
|
// } |
|
|
|
|
|
// }); |
|
|
|
|
|
// this.$message.error("该房间未绑定门锁") |
|
|
|
|
|
// } |
|
|
|
|
|
// }); |
|
|
|
|
|
// } else { |
|
|
|
|
|
// this.$message.error("请选择要添加的房间") |
|
|
|
|
|
// } |
|
|
|
|
|
// }, |
|
|
bindsave() { |
|
|
bindsave() { |
|
|
var SelectedListbind = this.bindSelectedList |
|
|
|
|
|
var infostr = JSON.parse(this.drawerRow.info); |
|
|
|
|
|
|
|
|
let SelectedListbind = this.bindSelectedList |
|
|
|
|
|
let infostr = ''//JSON.parse(this.drawerRow.info); |
|
|
|
|
|
if (typeof (this.drawerRow.info) == 'object') { |
|
|
|
|
|
infostr = this.drawerRow.info |
|
|
|
|
|
} else if (typeof (this.drawerRow.info) == 'string') { |
|
|
|
|
|
infostr = JSON.parse(this.drawerRow.info) |
|
|
|
|
|
} |
|
|
var fjid = []; |
|
|
var fjid = []; |
|
|
var _this = this |
|
|
var _this = this |
|
|
if (this.value2[0] == '' || this.value2[1] == '') { |
|
|
if (this.value2[0] == '' || this.value2[1] == '') { |
|
@ -3092,7 +3289,7 @@ export default { |
|
|
return false; |
|
|
return false; |
|
|
} |
|
|
} |
|
|
if (SelectedListbind.length != 0) { |
|
|
if (SelectedListbind.length != 0) { |
|
|
SelectedListbind.forEach((li) => { |
|
|
|
|
|
|
|
|
SelectedListbind.forEach((li, index) => { |
|
|
var str = { |
|
|
var str = { |
|
|
cardId: this.drawerRow.id, |
|
|
cardId: this.drawerRow.id, |
|
|
siteId: li, |
|
|
siteId: li, |
|
@ -3102,12 +3299,13 @@ export default { |
|
|
var resultArr = this.AboutDevice.filter( |
|
|
var resultArr = this.AboutDevice.filter( |
|
|
(_item) => _item.roomId == li |
|
|
(_item) => _item.roomId == li |
|
|
)[0]; |
|
|
)[0]; |
|
|
|
|
|
console.log(resultArr, SelectedListbind, this.AboutDevice) |
|
|
var roomName = this.zNodes.filter(item => li === item.id) |
|
|
var roomName = this.zNodes.filter(item => li === item.id) |
|
|
if (resultArr) { |
|
|
if (resultArr) { |
|
|
// console.log(roomName,resultArr, this.drawerRow) |
|
|
// console.log(roomName,resultArr, this.drawerRow) |
|
|
// return |
|
|
// return |
|
|
if (resultArr.imei) { |
|
|
if (resultArr.imei) { |
|
|
fjid = [str]; |
|
|
|
|
|
|
|
|
fjid.push(str); |
|
|
if (resultArr.manufactureId == 201 || resultArr.manufactureId == 221) { |
|
|
if (resultArr.manufactureId == 201 || resultArr.manufactureId == 221) { |
|
|
var data = { |
|
|
var data = { |
|
|
lockerId: resultArr.deviceNum, |
|
|
lockerId: resultArr.deviceNum, |
|
@ -3138,7 +3336,7 @@ export default { |
|
|
endTime: moment(this.value2[1]).valueOf() / 1000, |
|
|
endTime: moment(this.value2[1]).valueOf() / 1000, |
|
|
} |
|
|
} |
|
|
utils.sendLockUser(locakUserdata, (callbackLOCK) => { |
|
|
utils.sendLockUser(locakUserdata, (callbackLOCK) => { |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
}) |
|
|
}) |
|
|
|
|
|
|
|
|
} else { |
|
|
} else { |
|
@ -3160,18 +3358,20 @@ export default { |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
}) |
|
|
}) |
|
|
httpPost(fjid, this.$api.bindCard).then((res) => { |
|
|
|
|
|
if (res.success) { |
|
|
|
|
|
this.bindRoomStatus = false |
|
|
|
|
|
this.getAboutRoom(); |
|
|
|
|
|
this.getcheckInList() |
|
|
|
|
|
setTimeout(() => { |
|
|
|
|
|
this.updateRoom(); |
|
|
|
|
|
}, 500); |
|
|
|
|
|
} else { |
|
|
|
|
|
this.$message.error("添加失败") |
|
|
|
|
|
} |
|
|
|
|
|
}); |
|
|
|
|
|
|
|
|
if ((SelectedListbind.length - 1) === index) { |
|
|
|
|
|
httpPost(fjid, this.$api.bindCard).then((res) => { |
|
|
|
|
|
if (res.success) { |
|
|
|
|
|
this.bindRoomStatus = false |
|
|
|
|
|
this.getAboutRoom(); |
|
|
|
|
|
this.getcheckInList() |
|
|
|
|
|
setTimeout(() => { |
|
|
|
|
|
this.updateRoom(); |
|
|
|
|
|
}, 500); |
|
|
|
|
|
} else { |
|
|
|
|
|
this.$message.error("添加失败") |
|
|
|
|
|
} |
|
|
|
|
|
}); |
|
|
|
|
|
} |
|
|
} else if (resultArr.manufactureId == 101) { |
|
|
} else if (resultArr.manufactureId == 101) { |
|
|
var userstr = { |
|
|
var userstr = { |
|
|
imei: resultArr.imei, |
|
|
imei: resultArr.imei, |
|
@ -3209,23 +3409,43 @@ export default { |
|
|
utils.sendLockUser(locakUserdata, (callbackLOCK) => { |
|
|
utils.sendLockUser(locakUserdata, (callbackLOCK) => { |
|
|
|
|
|
|
|
|
}) |
|
|
}) |
|
|
httpPost(fjid, this.$api.bindCard).then((res) => { |
|
|
|
|
|
if (res.success) { |
|
|
|
|
|
this.bindRoomStatus = false |
|
|
|
|
|
this.getAboutRoom(); |
|
|
|
|
|
this.getcheckInList() |
|
|
|
|
|
setTimeout(() => { |
|
|
|
|
|
this.updateRoom(); |
|
|
|
|
|
}, 500); |
|
|
|
|
|
} else { |
|
|
|
|
|
this.$message.error("添加失败") |
|
|
|
|
|
} |
|
|
|
|
|
}); |
|
|
|
|
|
} else { |
|
|
|
|
|
this.$message.error(callback.msg); |
|
|
|
|
|
|
|
|
if ((SelectedListbind.length - 1) === index) { |
|
|
|
|
|
httpPost(fjid, this.$api.bindCard).then((res) => { |
|
|
|
|
|
if (res.success) { |
|
|
|
|
|
this.bindRoomStatus = false |
|
|
|
|
|
this.getAboutRoom(); |
|
|
|
|
|
this.getcheckInList() |
|
|
|
|
|
setTimeout(() => { |
|
|
|
|
|
this.updateRoom(); |
|
|
|
|
|
}, 500); |
|
|
|
|
|
} else { |
|
|
|
|
|
this.$message.error("添加失败") |
|
|
|
|
|
} |
|
|
|
|
|
}); |
|
|
|
|
|
} else { |
|
|
|
|
|
this.$message.error(callback.msg); |
|
|
|
|
|
} |
|
|
} |
|
|
} |
|
|
}) |
|
|
}) |
|
|
} else if (resultArr.manufactureId == 1201) { |
|
|
} else if (resultArr.manufactureId == 1201) { |
|
|
|
|
|
if ((SelectedListbind.length - 1) === index) { |
|
|
|
|
|
httpPost(fjid, this.$api.bindCard).then((res) => { |
|
|
|
|
|
if (res.success) { |
|
|
|
|
|
this.bindRoomStatus = false |
|
|
|
|
|
this.getAboutRoom(); |
|
|
|
|
|
this.getcheckInList() |
|
|
|
|
|
setTimeout(() => { |
|
|
|
|
|
this.updateRoom(); |
|
|
|
|
|
}, 500); |
|
|
|
|
|
} else { |
|
|
|
|
|
this.$message.error("添加失败") |
|
|
|
|
|
} |
|
|
|
|
|
}); |
|
|
|
|
|
} |
|
|
|
|
|
} |
|
|
|
|
|
} else { |
|
|
|
|
|
fjid.push(str); |
|
|
|
|
|
if ((SelectedListbind.length - 1) === index) { |
|
|
httpPost(fjid, this.$api.bindCard).then((res) => { |
|
|
httpPost(fjid, this.$api.bindCard).then((res) => { |
|
|
if (res.success) { |
|
|
if (res.success) { |
|
|
this.bindRoomStatus = false |
|
|
this.bindRoomStatus = false |
|
@ -3239,8 +3459,10 @@ export default { |
|
|
} |
|
|
} |
|
|
}); |
|
|
}); |
|
|
} |
|
|
} |
|
|
} else { |
|
|
|
|
|
fjid.push(str); |
|
|
|
|
|
|
|
|
} |
|
|
|
|
|
} else { |
|
|
|
|
|
fjid.push(str); |
|
|
|
|
|
if ((SelectedListbind.length - 1) === index) { |
|
|
httpPost(fjid, this.$api.bindCard).then((res) => { |
|
|
httpPost(fjid, this.$api.bindCard).then((res) => { |
|
|
if (res.success) { |
|
|
if (res.success) { |
|
|
this.bindRoomStatus = false |
|
|
this.bindRoomStatus = false |
|
@ -3254,20 +3476,6 @@ export default { |
|
|
} |
|
|
} |
|
|
}); |
|
|
}); |
|
|
} |
|
|
} |
|
|
} else { |
|
|
|
|
|
fjid.push(str); |
|
|
|
|
|
httpPost(fjid, this.$api.bindCard).then((res) => { |
|
|
|
|
|
if (res.success) { |
|
|
|
|
|
this.bindRoomStatus = false |
|
|
|
|
|
this.getAboutRoom(); |
|
|
|
|
|
this.getcheckInList() |
|
|
|
|
|
setTimeout(() => { |
|
|
|
|
|
this.updateRoom(); |
|
|
|
|
|
}, 500); |
|
|
|
|
|
} else { |
|
|
|
|
|
this.$message.error("添加失败") |
|
|
|
|
|
} |
|
|
|
|
|
}); |
|
|
|
|
|
this.$message.error("该房间未绑定门锁") |
|
|
this.$message.error("该房间未绑定门锁") |
|
|
} |
|
|
} |
|
|
}); |
|
|
}); |
|
|