Browse Source

1009

master
xiaoheiiskinder 1 year ago
parent
commit
b0d6596ecc
2 changed files with 31 additions and 213 deletions
  1. +9
    -4
      src/views/DeviceFeedbackLog.vue
  2. +22
    -209
      src/views/userManagement.vue

+ 9
- 4
src/views/DeviceFeedbackLog.vue View File

@ -137,7 +137,10 @@
}, },
mounted() { mounted() {
document.addEventListener('keydown', this.keyDown) document.addEventListener('keydown', this.keyDown)
this.getOperates();
this.getAboutDevice()
setTimeout(() => {
this.getOperates();
}, 500)
}, },
methods: { methods: {
// //
@ -658,7 +661,9 @@
}) })
}; };
httpPost(data, this.$api.getDeviceItems).then((res) => { httpPost(data, this.$api.getDeviceItems).then((res) => {
this.AboutDevice = res.data.list
if(res.success) {
this.AboutDevice = res.data.list
}
}) })
}, },
time(time = +new Date()) { time(time = +new Date()) {
@ -683,7 +688,6 @@
orderBy: "createTime", orderBy: "createTime",
}; };
httpPost(data, this.$api.getDeviceResult).then((res) => { httpPost(data, this.$api.getDeviceResult).then((res) => {
var AboutDevice = this.AboutDevice
let datalist=utils.zlib_unzip(res.data) let datalist=utils.zlib_unzip(res.data)
datalist.map((li) => { datalist.map((li) => {
if ((li.command == 6204 || li.command == 6207 || li.command == 6210 || li if ((li.command == 6204 || li.command == 6207 || li.command == 6210 || li
@ -693,7 +697,7 @@
li['reStatus'] = false li['reStatus'] = false
} }
li.createTime = this.time(+new Date(li.createTime)); 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'] = '' li['operationType'] = ''
var operationType = this.DeviceFeedbackLog.filter(item => item.code == li.command)[ var operationType = this.DeviceFeedbackLog.filter(item => item.code == li.command)[
0] 0]
@ -701,6 +705,7 @@
li['operationType'] = operationType.desc li['operationType'] = operationType.desc
} }
li['statusText'] = utils.statusCode(li.result) li['statusText'] = utils.statusCode(li.result)
console.log(resultArr);
if (resultArr) { if (resultArr) {
li.roomId = resultArr.id li.roomId = resultArr.id
li.roomName = resultArr.roomName li.roomName = resultArr.roomName


+ 22
- 209
src/views/userManagement.vue View File

@ -3090,199 +3090,6 @@ 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() {
let SelectedListbind = this.bindSelectedList let SelectedListbind = this.bindSelectedList
let infostr = ''//JSON.parse(this.drawerRow.info); let infostr = ''//JSON.parse(this.drawerRow.info);
@ -3311,8 +3118,6 @@ export default {
console.log(resultArr, SelectedListbind, this.AboutDevice) 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)
// return
if (resultArr.imei) { if (resultArr.imei) {
fjid.push(str); fjid.push(str);
if (resultArr.manufactureId == 201 || resultArr.manufactureId == 221) { if (resultArr.manufactureId == 201 || resultArr.manufactureId == 221) {
@ -3331,7 +3136,13 @@ export default {
.lockerUserId, data.role, data.action, data.order, data.cardName, data .lockerUserId, data.role, data.action, data.order, data.cardName, data
.roomName, ( .roomName, (
callback) => { callback) => {
console.log(callback);
if (callback.success) { if (callback.success) {
this.getcheckInList()
this.getAboutRoom();
setTimeout(() => {
_this.updateRoom();
}, 1000)
var locakUserdata = { var locakUserdata = {
deviceNum: resultArr.deviceNum, deviceNum: resultArr.deviceNum,
imei: resultArr.imei, imei: resultArr.imei,
@ -3345,9 +3156,8 @@ 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 {
this.$message.error(callback.msg); this.$message.error(callback.msg);
if (callback.code == 201016) { if (callback.code == 201016) {
@ -3357,8 +3167,8 @@ export default {
this.getcheckInList() this.getcheckInList()
this.getAboutRoom(); this.getAboutRoom();
setTimeout(() => { setTimeout(() => {
this.updateRoom();
}, 500);
_this.updateRoom();
}, 1000);
this.$message.success("用户门锁已存在") this.$message.success("用户门锁已存在")
} else { } else {
this.$message.error("添加失败") this.$message.error("添加失败")
@ -3374,8 +3184,8 @@ export default {
this.getAboutRoom(); this.getAboutRoom();
this.getcheckInList() this.getcheckInList()
setTimeout(() => { setTimeout(() => {
this.updateRoom();
}, 500);
_this.updateRoom();
}, 1000);
} else { } else {
this.$message.error("添加失败") this.$message.error("添加失败")
} }
@ -3425,8 +3235,8 @@ export default {
this.getAboutRoom(); this.getAboutRoom();
this.getcheckInList() this.getcheckInList()
setTimeout(() => { setTimeout(() => {
this.updateRoom();
}, 500);
_this.updateRoom();
}, 1000);
} else { } else {
this.$message.error("添加失败") this.$message.error("添加失败")
} }
@ -3444,8 +3254,8 @@ export default {
this.getAboutRoom(); this.getAboutRoom();
this.getcheckInList() this.getcheckInList()
setTimeout(() => { setTimeout(() => {
this.updateRoom();
}, 500);
_this.updateRoom();
}, 1000);
} else { } else {
this.$message.error("添加失败") this.$message.error("添加失败")
} }
@ -3461,8 +3271,8 @@ export default {
this.getAboutRoom(); this.getAboutRoom();
this.getcheckInList() this.getcheckInList()
setTimeout(() => { setTimeout(() => {
this.updateRoom();
}, 500);
_this.updateRoom();
}, 1000);
} else { } else {
this.$message.error("添加失败") this.$message.error("添加失败")
} }
@ -3478,8 +3288,8 @@ export default {
this.getAboutRoom(); this.getAboutRoom();
this.getcheckInList() this.getcheckInList()
setTimeout(() => { setTimeout(() => {
this.updateRoom();
}, 500);
_this.updateRoom();
}, 1000);
} else { } else {
this.$message.error("添加失败") this.$message.error("添加失败")
} }
@ -4156,6 +3966,7 @@ export default {
} }
roomtable.push(li); roomtable.push(li);
}); });
console.log(roomScreen);
this.roomScreen = roomScreen this.roomScreen = roomScreen
this.SelectedList = SelectedList; this.SelectedList = SelectedList;
this.selectkeyadd = SelectedList; this.selectkeyadd = SelectedList;
@ -4205,6 +4016,7 @@ export default {
ids: [this.drawerRow.id] ids: [this.drawerRow.id]
} }
httpPost(data, this.$api.getTenant).then(res => { httpPost(data, this.$api.getTenant).then(res => {
console.log(res);
if (res.code == 200) { if (res.code == 200) {
this.checkInListing = res.data this.checkInListing = res.data
} else { } else {
@ -4370,6 +4182,7 @@ export default {
}, },
// //
screenRoom(id) { screenRoom(id) {
console.log("调用");
var roomAbout = this.$store.state.roomAbout; var roomAbout = this.$store.state.roomAbout;
var SelectedList = [], var SelectedList = [],
roomtable = [], roomScreen = []; roomtable = [], roomScreen = [];


Loading…
Cancel
Save