diff --git a/src/views/DeviceFeedbackLog.vue b/src/views/DeviceFeedbackLog.vue index 97bf624..d72ff39 100644 --- a/src/views/DeviceFeedbackLog.vue +++ b/src/views/DeviceFeedbackLog.vue @@ -137,7 +137,10 @@ }, mounted() { document.addEventListener('keydown', this.keyDown) - this.getOperates(); + this.getAboutDevice() + setTimeout(() => { + this.getOperates(); + }, 500) }, methods: { //获取房源筛选列表 @@ -658,7 +661,9 @@ }) }; httpPost(data, this.$api.getDeviceItems).then((res) => { - this.AboutDevice = res.data.list + if(res.success) { + this.AboutDevice = res.data.list + } }) }, time(time = +new Date()) { @@ -683,7 +688,6 @@ orderBy: "createTime", }; httpPost(data, this.$api.getDeviceResult).then((res) => { - var AboutDevice = this.AboutDevice let datalist=utils.zlib_unzip(res.data) datalist.map((li) => { if ((li.command == 6204 || li.command == 6207 || li.command == 6210 || li @@ -693,7 +697,7 @@ li['reStatus'] = false } li.createTime = this.time(+new Date(li.createTime)); - var resultArr = AboutDevice.filter(_item => _item.imei == li.imei)[0] + var resultArr = this.AboutDevice.filter(_item => _item.imei == li.imei)[0] li['operationType'] = '' var operationType = this.DeviceFeedbackLog.filter(item => item.code == li.command)[ 0] @@ -701,6 +705,7 @@ li['operationType'] = operationType.desc } li['statusText'] = utils.statusCode(li.result) + console.log(resultArr); if (resultArr) { li.roomId = resultArr.id li.roomName = resultArr.roomName diff --git a/src/views/userManagement.vue b/src/views/userManagement.vue index d1d93d3..27d3a11 100644 --- a/src/views/userManagement.vue +++ b/src/views/userManagement.vue @@ -3090,199 +3090,6 @@ export default { 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() { let SelectedListbind = this.bindSelectedList let infostr = ''//JSON.parse(this.drawerRow.info); @@ -3311,8 +3118,6 @@ export default { console.log(resultArr, SelectedListbind, this.AboutDevice) var roomName = this.zNodes.filter(item => li === item.id) if (resultArr) { - // console.log(roomName,resultArr, this.drawerRow) - // return if (resultArr.imei) { fjid.push(str); if (resultArr.manufactureId == 201 || resultArr.manufactureId == 221) { @@ -3331,7 +3136,13 @@ export default { .lockerUserId, data.role, data.action, data.order, data.cardName, data .roomName, ( callback) => { + console.log(callback); if (callback.success) { + this.getcheckInList() + this.getAboutRoom(); + setTimeout(() => { + _this.updateRoom(); + }, 1000) var locakUserdata = { deviceNum: resultArr.deviceNum, imei: resultArr.imei, @@ -3345,9 +3156,8 @@ export default { endTime: moment(this.value2[1]).valueOf() / 1000, } utils.sendLockUser(locakUserdata, (callbackLOCK) => { - - }) + }) } else { this.$message.error(callback.msg); if (callback.code == 201016) { @@ -3357,8 +3167,8 @@ export default { this.getcheckInList() this.getAboutRoom(); setTimeout(() => { - this.updateRoom(); - }, 500); + _this.updateRoom(); + }, 1000); this.$message.success("用户门锁已存在") } else { this.$message.error("添加失败") @@ -3374,8 +3184,8 @@ export default { this.getAboutRoom(); this.getcheckInList() setTimeout(() => { - this.updateRoom(); - }, 500); + _this.updateRoom(); + }, 1000); } else { this.$message.error("添加失败") } @@ -3425,8 +3235,8 @@ export default { this.getAboutRoom(); this.getcheckInList() setTimeout(() => { - this.updateRoom(); - }, 500); + _this.updateRoom(); + }, 1000); } else { this.$message.error("添加失败") } @@ -3444,8 +3254,8 @@ export default { this.getAboutRoom(); this.getcheckInList() setTimeout(() => { - this.updateRoom(); - }, 500); + _this.updateRoom(); + }, 1000); } else { this.$message.error("添加失败") } @@ -3461,8 +3271,8 @@ export default { this.getAboutRoom(); this.getcheckInList() setTimeout(() => { - this.updateRoom(); - }, 500); + _this.updateRoom(); + }, 1000); } else { this.$message.error("添加失败") } @@ -3478,8 +3288,8 @@ export default { this.getAboutRoom(); this.getcheckInList() setTimeout(() => { - this.updateRoom(); - }, 500); + _this.updateRoom(); + }, 1000); } else { this.$message.error("添加失败") } @@ -4156,6 +3966,7 @@ export default { } roomtable.push(li); }); + console.log(roomScreen); this.roomScreen = roomScreen this.SelectedList = SelectedList; this.selectkeyadd = SelectedList; @@ -4205,6 +4016,7 @@ export default { ids: [this.drawerRow.id] } httpPost(data, this.$api.getTenant).then(res => { + console.log(res); if (res.code == 200) { this.checkInListing = res.data } else { @@ -4370,6 +4182,7 @@ export default { }, // 筛选和这个人员有关的房源 screenRoom(id) { + console.log("调用"); var roomAbout = this.$store.state.roomAbout; var SelectedList = [], roomtable = [], roomScreen = [];