|
@@ -1,5 +1,5 @@
|
|
|
<template >
|
|
<template >
|
|
|
- <el-card class="box-card">
|
|
|
|
|
|
|
+ <el-card class="box-card" v-show="cardShow">
|
|
|
<div slot="header" class="clearfix">
|
|
<div slot="header" class="clearfix">
|
|
|
<div class="header-left">
|
|
<div class="header-left">
|
|
|
<span class="title">房态管理 </span>
|
|
<span class="title">房态管理 </span>
|
|
@@ -336,7 +336,7 @@
|
|
|
@change="handleCheckAllChange"
|
|
@change="handleCheckAllChange"
|
|
|
>全选</el-checkbox
|
|
>全选</el-checkbox
|
|
|
>
|
|
>
|
|
|
- <span class="all">150间</span>
|
|
|
|
|
|
|
+ <span class="all">{{ roomData.length }}间</span>
|
|
|
</div>
|
|
</div>
|
|
|
<div style="margin: 15px 0"></div>
|
|
<div style="margin: 15px 0"></div>
|
|
|
<el-checkbox-group
|
|
<el-checkbox-group
|
|
@@ -346,10 +346,10 @@
|
|
|
>
|
|
>
|
|
|
<el-checkbox
|
|
<el-checkbox
|
|
|
size="mini"
|
|
size="mini"
|
|
|
- v-for="city in cities"
|
|
|
|
|
|
|
+ v-for="(city, ind) in cities"
|
|
|
:label="city"
|
|
:label="city"
|
|
|
:key="city"
|
|
:key="city"
|
|
|
- >{{ city }} <span>50间</span></el-checkbox
|
|
|
|
|
|
|
+ >{{ city }} <span>{{ citiesNum[ind] }}间</span></el-checkbox
|
|
|
>
|
|
>
|
|
|
</el-checkbox-group>
|
|
</el-checkbox-group>
|
|
|
</div>
|
|
</div>
|
|
@@ -371,6 +371,7 @@ export default {
|
|
|
name: "Home",
|
|
name: "Home",
|
|
|
data() {
|
|
data() {
|
|
|
return {
|
|
return {
|
|
|
|
|
+ cardShow: false,
|
|
|
clickId: "",
|
|
clickId: "",
|
|
|
// 门锁管理
|
|
// 门锁管理
|
|
|
doorLock: false,
|
|
doorLock: false,
|
|
@@ -408,7 +409,11 @@ export default {
|
|
|
],
|
|
],
|
|
|
floorRoomDatas: [],
|
|
floorRoomDatas: [],
|
|
|
roomData: [],
|
|
roomData: [],
|
|
|
-
|
|
|
|
|
|
|
+ roomDatas: [],
|
|
|
|
|
+ augument: {
|
|
|
|
|
+ curPage: 1,
|
|
|
|
|
+ pageSize: 20,
|
|
|
|
|
+ }, // 当前数据为第一页
|
|
|
defaultProps: {
|
|
defaultProps: {
|
|
|
children: "children",
|
|
children: "children",
|
|
|
label: "label",
|
|
label: "label",
|
|
@@ -451,7 +456,8 @@ export default {
|
|
|
// 房态筛选数据
|
|
// 房态筛选数据
|
|
|
checkAll: false,
|
|
checkAll: false,
|
|
|
checkedCities: [],
|
|
checkedCities: [],
|
|
|
- cities: ["入住", "空闲", "锁定", "脏房", "预定"],
|
|
|
|
|
|
|
+ cities: ["空闲", "预定", "入住", "脏房", "锁定"],
|
|
|
|
|
+ citiesNum: [0, 0, 0, 0, 0],
|
|
|
isIndeterminate: false,
|
|
isIndeterminate: false,
|
|
|
};
|
|
};
|
|
|
},
|
|
},
|
|
@@ -466,13 +472,15 @@ export default {
|
|
|
"el-button--plain"
|
|
"el-button--plain"
|
|
|
)[2].children[0].innerText = ">";
|
|
)[2].children[0].innerText = ">";
|
|
|
this.roomList();
|
|
this.roomList();
|
|
|
|
|
+
|
|
|
|
|
+ alert(parseInt(3, 8));
|
|
|
},
|
|
},
|
|
|
created() {
|
|
created() {
|
|
|
// let arr = {
|
|
// let arr = {
|
|
|
- // roomNo: "2-2-1001",
|
|
|
|
|
- // build: 2,
|
|
|
|
|
- // floor: "2",
|
|
|
|
|
- // roomTypeId: 1,
|
|
|
|
|
|
|
+ // roomNo: "1-5-1007",
|
|
|
|
|
+ // build: 1,
|
|
|
|
|
+ // floor: "5",
|
|
|
|
|
+ // roomTypeId: 2,
|
|
|
// roomTypeName: "测试房",
|
|
// roomTypeName: "测试房",
|
|
|
// enableUse: "1",
|
|
// enableUse: "1",
|
|
|
// };
|
|
// };
|
|
@@ -488,51 +496,72 @@ export default {
|
|
|
},
|
|
},
|
|
|
methods: {
|
|
methods: {
|
|
|
// 数据滚动加载
|
|
// 数据滚动加载
|
|
|
- lazyLoading() {
|
|
|
|
|
- // 滚动到底部,再加载的处理事件
|
|
|
|
|
- //滚动高度
|
|
|
|
|
- let scrollTop =
|
|
|
|
|
- document.getElementsByClassName("room-floor")[0].scrollTop;
|
|
|
|
|
- // console.log(scrollTop, "scrollTop");
|
|
|
|
|
- //可视区高度
|
|
|
|
|
- let clientHeight =
|
|
|
|
|
- document.getElementsByClassName("room-floor")[0].clientHeight;
|
|
|
|
|
- // console.log(clientHeight, "clientHeight");
|
|
|
|
|
- //滚动页面的高度
|
|
|
|
|
- let scrollHeight = this.$refs.scrollBlock.scrollHeight;
|
|
|
|
|
- // console.log(scrollHeight, "scrollHeight");
|
|
|
|
|
- if (scrollTop + clientHeight >= scrollHeight) {
|
|
|
|
|
- // 滚动到底部,逻辑代码
|
|
|
|
|
- //事件处理
|
|
|
|
|
- console.log("滚动到底部,触发"); //此处可以添加数据请求
|
|
|
|
|
- // 这这里可以写一些业务逻辑,请求数据等
|
|
|
|
|
- }
|
|
|
|
|
- },
|
|
|
|
|
|
|
+ // lazyLoading() {
|
|
|
|
|
+ // // 滚动到底部,再加载的处理事件
|
|
|
|
|
+ // //滚动高度
|
|
|
|
|
+ // let scrollTop =
|
|
|
|
|
+ // document.getElementsByClassName("room-floor")[0].scrollTop;
|
|
|
|
|
+ // // console.log(scrollTop, "scrollTop");
|
|
|
|
|
+ // //可视区高度
|
|
|
|
|
+ // let clientHeight =
|
|
|
|
|
+ // document.getElementsByClassName("room-floor")[0].clientHeight;
|
|
|
|
|
+ // // console.log(clientHeight, "clientHeight");
|
|
|
|
|
+ // //滚动页面的高度
|
|
|
|
|
+ // let scrollHeight = this.$refs.scrollBlock.scrollHeight;
|
|
|
|
|
+ // // console.log(scrollHeight, "scrollHeight");
|
|
|
|
|
+ // if (scrollTop + clientHeight >= scrollHeight) {
|
|
|
|
|
+ // // 滚动到底部,逻辑代码
|
|
|
|
|
+ // //事件处理
|
|
|
|
|
+ // // let augument = {
|
|
|
|
|
+ // // curPage: 2,
|
|
|
|
|
+ // // pageSize: 25,
|
|
|
|
|
+ // // };
|
|
|
|
|
+ // // this.API.room.roomPageGroup(augument).then((res) => {
|
|
|
|
|
+ // // console.log(res);
|
|
|
|
|
+ // // });
|
|
|
|
|
+ // console.log("滚动到底部,触发"); //此处可以添加数据请求
|
|
|
|
|
+ // // 这这里可以写一些业务逻辑,请求数据等
|
|
|
|
|
+ // }
|
|
|
|
|
+ // },
|
|
|
|
|
|
|
|
- roomList() {
|
|
|
|
|
- this.API.room.roomPageGroup("pageSize=40").then((res) => {
|
|
|
|
|
|
|
+ roomList(augument) {
|
|
|
|
|
+ if (!augument) {
|
|
|
|
|
+ augument = this.augument;
|
|
|
|
|
+ }
|
|
|
|
|
+ this.API.room.roomPageGroup(augument).then((res) => {
|
|
|
this.floorRoomDatas = [];
|
|
this.floorRoomDatas = [];
|
|
|
- // console.log(res);
|
|
|
|
|
- let arr = [];
|
|
|
|
|
|
|
+ console.log(res);
|
|
|
|
|
+ console.log(res.data.list);
|
|
|
|
|
+
|
|
|
|
|
+ let arrays = [];
|
|
|
res.data.list.forEach((items) => {
|
|
res.data.list.forEach((items) => {
|
|
|
console.log(items);
|
|
console.log(items);
|
|
|
items.floors.forEach((item) => {
|
|
items.floors.forEach((item) => {
|
|
|
- console.log(item);
|
|
|
|
|
- if (item.floor == 1) {
|
|
|
|
|
- // arr.push(...items.room);
|
|
|
|
|
- console.log(item.room);
|
|
|
|
|
- }
|
|
|
|
|
|
|
+ // console.log(item);
|
|
|
|
|
+ arrays.push(item);
|
|
|
});
|
|
});
|
|
|
- this.floorRoomDatas.push(items.floors[0]);
|
|
|
|
|
});
|
|
});
|
|
|
- console.log(res.data.list);
|
|
|
|
|
|
|
+
|
|
|
|
|
+ var res = []; // 层数
|
|
|
|
|
+ var narr = []; // 每层对应的数组
|
|
|
|
|
+ for (var i = 0; i < arrays.length; i++) {
|
|
|
|
|
+ var n = res.indexOf(arrays[i].floor);
|
|
|
|
|
+ if (n == -1) {
|
|
|
|
|
+ res.push(arrays[i].floor);
|
|
|
|
|
+ narr.push({ floor: arrays[i].floor, room: [...arrays[i].room] });
|
|
|
|
|
+ } else {
|
|
|
|
|
+ narr[n].room.push(...arrays[i].room);
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
|
|
+ console.log(res, narr);
|
|
|
|
|
+ this.floorRoomDatas = narr;
|
|
|
console.log(this.floorRoomDatas);
|
|
console.log(this.floorRoomDatas);
|
|
|
this.floorRoomDatas.forEach((item) => {
|
|
this.floorRoomDatas.forEach((item) => {
|
|
|
item.room.forEach((items) => {
|
|
item.room.forEach((items) => {
|
|
|
items.roomno =
|
|
items.roomno =
|
|
|
items.roomNo.split("-")[0] +
|
|
items.roomNo.split("-")[0] +
|
|
|
"单元" +
|
|
"单元" +
|
|
|
- items.roomNo.split("-")[1] +
|
|
|
|
|
|
|
+ items.floor +
|
|
|
"层" +
|
|
"层" +
|
|
|
items.roomNo.split("-")[2] +
|
|
items.roomNo.split("-")[2] +
|
|
|
"房";
|
|
"房";
|
|
@@ -566,14 +595,19 @@ export default {
|
|
|
this.roomData.forEach((resItem) => {
|
|
this.roomData.forEach((resItem) => {
|
|
|
if (resItem.statu == 1) {
|
|
if (resItem.statu == 1) {
|
|
|
resItem.statuName = "空闲";
|
|
resItem.statuName = "空闲";
|
|
|
|
|
+ this.citiesNum[resItem.statu - 1] += 1;
|
|
|
} else if (resItem.statu == 2) {
|
|
} else if (resItem.statu == 2) {
|
|
|
resItem.statuName = "预定";
|
|
resItem.statuName = "预定";
|
|
|
|
|
+ this.citiesNum[resItem.statu - 1] += 1;
|
|
|
} else if (resItem.statu == 3) {
|
|
} else if (resItem.statu == 3) {
|
|
|
resItem.statuName = "入住";
|
|
resItem.statuName = "入住";
|
|
|
|
|
+ this.citiesNum[resItem.statu - 1] += 1;
|
|
|
} else if (resItem.statu == 4) {
|
|
} else if (resItem.statu == 4) {
|
|
|
resItem.statuName = "脏房";
|
|
resItem.statuName = "脏房";
|
|
|
|
|
+ this.citiesNum[resItem.statu - 1] += 1;
|
|
|
} else if (resItem.statu == 5) {
|
|
} else if (resItem.statu == 5) {
|
|
|
resItem.statuName = "锁定";
|
|
resItem.statuName = "锁定";
|
|
|
|
|
+ this.citiesNum[resItem.statu - 1] += 1;
|
|
|
}
|
|
}
|
|
|
});
|
|
});
|
|
|
this.data[0].children = [];
|
|
this.data[0].children = [];
|
|
@@ -601,6 +635,8 @@ export default {
|
|
|
});
|
|
});
|
|
|
// this.showTime(this.enableEndTime);
|
|
// this.showTime(this.enableEndTime);
|
|
|
console.log(this.roomData);
|
|
console.log(this.roomData);
|
|
|
|
|
+ this.roomDatas = this.roomData;
|
|
|
|
|
+ this.cardShow = true;
|
|
|
});
|
|
});
|
|
|
});
|
|
});
|
|
|
},
|
|
},
|
|
@@ -777,11 +813,13 @@ export default {
|
|
|
let roomId = item.roomId;
|
|
let roomId = item.roomId;
|
|
|
this.API.roomThirdSetting.changeElectric(roomId, operType).then((res) => {
|
|
this.API.roomThirdSetting.changeElectric(roomId, operType).then((res) => {
|
|
|
console.log(res);
|
|
console.log(res);
|
|
|
- this.$message({
|
|
|
|
|
- message: "关电成功",
|
|
|
|
|
- type: "success",
|
|
|
|
|
- });
|
|
|
|
|
- this.roomList();
|
|
|
|
|
|
|
+ if (res.success) {
|
|
|
|
|
+ this.$message({
|
|
|
|
|
+ message: "关电成功",
|
|
|
|
|
+ type: "success",
|
|
|
|
|
+ });
|
|
|
|
|
+ this.roomList();
|
|
|
|
|
+ }
|
|
|
});
|
|
});
|
|
|
},
|
|
},
|
|
|
|
|
|
|
@@ -794,6 +832,13 @@ export default {
|
|
|
},
|
|
},
|
|
|
handleCheckedCitiesChange(value) {
|
|
handleCheckedCitiesChange(value) {
|
|
|
console.log(value);
|
|
console.log(value);
|
|
|
|
|
+ let arr = this.roomDatas.filter((item) => {
|
|
|
|
|
+ for (let i in value) {
|
|
|
|
|
+ console.log(i);
|
|
|
|
|
+ return item.statuName == value[i];
|
|
|
|
|
+ }
|
|
|
|
|
+ });
|
|
|
|
|
+ console.log(arr);
|
|
|
let checkedCount = value.length;
|
|
let checkedCount = value.length;
|
|
|
this.checkAll = checkedCount === this.cities.length;
|
|
this.checkAll = checkedCount === this.cities.length;
|
|
|
this.isIndeterminate =
|
|
this.isIndeterminate =
|
|
@@ -816,6 +861,11 @@ export default {
|
|
|
.then((_) => {
|
|
.then((_) => {
|
|
|
this.API.doorLock.sendPassword(item.id).then((res) => {
|
|
this.API.doorLock.sendPassword(item.id).then((res) => {
|
|
|
console.log(res);
|
|
console.log(res);
|
|
|
|
|
+ this.$message({
|
|
|
|
|
+ message: "下发密码成功",
|
|
|
|
|
+ type: "success",
|
|
|
|
|
+ });
|
|
|
|
|
+ this.doorLock = false;
|
|
|
});
|
|
});
|
|
|
})
|
|
})
|
|
|
.catch((_) => {});
|
|
.catch((_) => {});
|