Browse Source

0926

master
xiaoheiiskinder 1 year ago
parent
commit
b162e0cc2a
3 changed files with 259 additions and 52 deletions
  1. +1
    -1
      dist/index.html
  2. +2
    -3
      src/views/boYu/byRoom.vue
  3. +256
    -48
      src/views/userManagement.vue

+ 1
- 1
dist/index.html View File

@ -1 +1 @@
<!DOCTYPE html><html><head><meta http-equiv=Content-Language><meta name=viewport content="width=device-width,initial-scale=1"><meta http-equiv=X-UA-Compatible content="IE=edge,chrome=1"><meta http-equiv=Content-Type content="text/html;charset=utf-8"><title>智慧公寓管理系统</title><link href=/static/css/app.8a55946efe7eb077cdd0f858060e8f85.css rel=stylesheet></head><body><div id=app></div><script type=text/javascript src=/static/js/manifest.c67b300ba6ba2383843d.js></script><script type=text/javascript src=/static/js/vendor.622945be597e735b1a7b.js></script><script type=text/javascript src=/static/js/app.556ad3f473288dd0de3c.js></script></body></html>
<!DOCTYPE html><html><head><meta http-equiv=Content-Language><meta name=viewport content="width=device-width,initial-scale=1"><meta http-equiv=X-UA-Compatible content="IE=edge,chrome=1"><meta http-equiv=Content-Type content="text/html;charset=utf-8"><title>智慧公寓管理系统</title><link href=/static/css/app.69e3b4021be0390386b0f534b99cd382.css rel=stylesheet></head><body><div id=app></div><script type=text/javascript src=/static/js/manifest.5d748e20c8b5af4bbaa2.js></script><script type=text/javascript src=/static/js/vendor.622945be597e735b1a7b.js></script><script type=text/javascript src=/static/js/app.ec17f243103266224701.js></script></body></html>

+ 2
- 3
src/views/boYu/byRoom.vue View File

@ -260,7 +260,6 @@ export default {
// //
async getBYRoom() { async getBYRoom() {
let content = [] let content = []
console.log(this.form)
let results = await this.getRoomList(); let results = await this.getRoomList();
this.pageTotal = results.total this.pageTotal = results.total
this.tableData = results.list this.tableData = results.list
@ -382,7 +381,7 @@ export default {
}, },
// //
checkNodeOne(e) { checkNodeOne(e) {
if (e.length < 5) {
if (e[0].length < 5) {
this.$message.error('请选择房间') this.$message.error('请选择房间')
} else { } else {
this.form.roomId = e[e.length - 1] this.form.roomId = e[e.length - 1]
@ -406,7 +405,7 @@ export default {
code: "by/addDevice", code: "by/addDevice",
data: { data: {
did: this.form.did, did: this.form.did,
roomId: this.form.roomId
roomId: this.form.roomId[0]
} }
} }
httpPost(data, this.$api.sendCommand).then(res => { httpPost(data, this.$api.sendCommand).then(res => {


+ 256
- 48
src/views/userManagement.vue View File

@ -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("该房间未绑定门锁")
} }
}); });


Loading…
Cancel
Save