|
@@ -33,14 +33,14 @@
|
|
|
<a-col :span="24">
|
|
<a-col :span="24">
|
|
|
<a-form-model-item label="新房间" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="">
|
|
<a-form-model-item label="新房间" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="">
|
|
|
<template v-if="selectData.length>0">
|
|
<template v-if="selectData.length>0">
|
|
|
- {{newRoom && newRoom.roomInfo.name}}
|
|
|
|
|
|
|
+ {{newRoom && newRoom.name}}
|
|
|
</template> <a href="#" @click="selectVisible = true">选择</a>
|
|
</template> <a href="#" @click="selectVisible = true">选择</a>
|
|
|
</a-form-model-item>
|
|
</a-form-model-item>
|
|
|
</a-col>
|
|
</a-col>
|
|
|
<a-col :span="24">
|
|
<a-col :span="24">
|
|
|
<a-form-model-item label="房价" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="">
|
|
<a-form-model-item label="房价" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="">
|
|
|
<!-- <a-input-number :min="0" v-model="dayNum" placeholder="请输入续住天数" style="width: 40%" @change="dayChange" /> -->
|
|
<!-- <a-input-number :min="0" v-model="dayNum" placeholder="请输入续住天数" style="width: 40%" @change="dayChange" /> -->
|
|
|
- <template v-if="newRoom && newRoom.roomInfo">
|
|
|
|
|
|
|
+ <template v-if="newRoom">
|
|
|
{{ timeData.reduce((pre,cur)=> pre+cur.price*1,0) }}
|
|
{{ timeData.reduce((pre,cur)=> pre+cur.price*1,0) }}
|
|
|
<a-popover placement="right">
|
|
<a-popover placement="right">
|
|
|
<template slot="content">
|
|
<template slot="content">
|
|
@@ -100,8 +100,8 @@
|
|
|
</a-col>
|
|
</a-col>
|
|
|
<a-col :span="24" v-if="dataList.length>0">
|
|
<a-col :span="24" v-if="dataList.length>0">
|
|
|
<div style="display:flex;flex-wrap:wrap;height:400px;overflow: auto;">
|
|
<div style="display:flex;flex-wrap:wrap;height:400px;overflow: auto;">
|
|
|
- <div v-for="(item,index) in dataList" :key="index" @click="selectRoom(item, index)" :class="{'active':index==link}" style="border:1px solid #ccc;padding: 5px 20px;margin-right:10px;margin-top:10px;border-radius:5px;">
|
|
|
|
|
- {{ item.roomInfo && item.roomInfo.name}}
|
|
|
|
|
|
|
+ <div v-for="(item,index) in dataList" :key="index" @click="selectRoom(item, index)" :class="{'active':index==link}" style="border:1px solid #ccc;padding: 5px 20px;margin-right:10px;margin-top:10px;border-radius:5px;height:30px">
|
|
|
|
|
+ {{ item && item.name}}
|
|
|
</div>
|
|
</div>
|
|
|
</div>
|
|
</div>
|
|
|
</a-col>
|
|
</a-col>
|
|
@@ -265,17 +265,16 @@ export default {
|
|
|
this.roomStatusList = list;
|
|
this.roomStatusList = list;
|
|
|
}
|
|
}
|
|
|
});
|
|
});
|
|
|
- this.loadData();
|
|
|
|
|
},
|
|
},
|
|
|
methods: {
|
|
methods: {
|
|
|
changeSelct() {
|
|
changeSelct() {
|
|
|
- if (this.selectData[0].roomInfo.id == this.model.roomInfo.id) {
|
|
|
|
|
|
|
+ if (this.selectData[0].id == this.model.id) {
|
|
|
this.$message.warning("不能选择相同的房间");
|
|
this.$message.warning("不能选择相同的房间");
|
|
|
return
|
|
return
|
|
|
}
|
|
}
|
|
|
this.newRoom = this.selectData[0]
|
|
this.newRoom = this.selectData[0]
|
|
|
- this.timeData.forEach(ele=>{
|
|
|
|
|
- ele.price = this.newRoom.layout.marketPrice
|
|
|
|
|
|
|
+ this.timeData.forEach(ele => {
|
|
|
|
|
+ ele.price = this.newRoom.marketPrice
|
|
|
})
|
|
})
|
|
|
this.selectVisible = false;
|
|
this.selectVisible = false;
|
|
|
},
|
|
},
|
|
@@ -361,26 +360,26 @@ export default {
|
|
|
var list = this.oldRoomList;
|
|
var list = this.oldRoomList;
|
|
|
if (this.checkedCesRoomLayoutList.length > 0) {
|
|
if (this.checkedCesRoomLayoutList.length > 0) {
|
|
|
list = this.oldRoomList.reduce((acc, curr) => {
|
|
list = this.oldRoomList.reduce((acc, curr) => {
|
|
|
- const rooms = curr.rooms.filter((room) =>
|
|
|
|
|
- this.checkedCesRoomLayoutList.includes(room.layout.id)
|
|
|
|
|
|
|
+ const floorRooms = curr.floorRooms.filter((room) =>
|
|
|
|
|
+ this.checkedCesRoomLayoutList.includes(room.layoutId)
|
|
|
);
|
|
);
|
|
|
acc.push({
|
|
acc.push({
|
|
|
...curr,
|
|
...curr,
|
|
|
- rooms
|
|
|
|
|
|
|
+ floorRooms
|
|
|
});
|
|
});
|
|
|
return acc;
|
|
return acc;
|
|
|
}, []);
|
|
}, []);
|
|
|
}
|
|
}
|
|
|
if (this.checkedRoomStatusList.length > 0) {
|
|
if (this.checkedRoomStatusList.length > 0) {
|
|
|
list = list.reduce((acc, curr) => {
|
|
list = list.reduce((acc, curr) => {
|
|
|
- const rooms = curr.rooms.filter((room) =>
|
|
|
|
|
|
|
+ const floorRooms = curr.floorRooms.filter((room) =>
|
|
|
this.checkedRoomStatusList.includes(
|
|
this.checkedRoomStatusList.includes(
|
|
|
- room.roomInfo.roomStatus.toString()
|
|
|
|
|
|
|
+ room.roomStatus.toString()
|
|
|
)
|
|
)
|
|
|
);
|
|
);
|
|
|
acc.push({
|
|
acc.push({
|
|
|
...curr,
|
|
...curr,
|
|
|
- rooms
|
|
|
|
|
|
|
+ floorRooms
|
|
|
});
|
|
});
|
|
|
return acc;
|
|
return acc;
|
|
|
}, []);
|
|
}, []);
|
|
@@ -389,9 +388,9 @@ export default {
|
|
|
this.roomList = list;
|
|
this.roomList = list;
|
|
|
let arr = [];
|
|
let arr = [];
|
|
|
this.roomList.forEach(ele => {
|
|
this.roomList.forEach(ele => {
|
|
|
- ele.rooms.forEach(item => {
|
|
|
|
|
|
|
+ ele.floorRooms.forEach(item => {
|
|
|
if (item) {
|
|
if (item) {
|
|
|
- if (arr.some(i => i.roomInfo.id == item.roomInfo.id)) {} else {
|
|
|
|
|
|
|
+ if (arr.some(i => i.id == item.id)) {} else {
|
|
|
arr.push(item)
|
|
arr.push(item)
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
@@ -403,13 +402,26 @@ export default {
|
|
|
loadData() {
|
|
loadData() {
|
|
|
// this.checkInBtnDis = false;
|
|
// this.checkInBtnDis = false;
|
|
|
// this.scheduleBtnDis = false;
|
|
// this.scheduleBtnDis = false;
|
|
|
- getAction("/rooms/cesRooms/realtime-rooms", {}).then((res) => {
|
|
|
|
|
|
|
+ // getAction("/rooms/cesRooms/realtime-rooms", {}).then((res) => {
|
|
|
|
|
+ // if (res.success) {
|
|
|
|
|
+ // res.result.forEach((row) => {
|
|
|
|
|
+ // this.$set(row, "collapse", 1);
|
|
|
|
|
+ // });
|
|
|
|
|
+ // this.roomList = res.result;
|
|
|
|
|
+ // this.oldRoomList = JSON.parse(JSON.stringify(res.result));
|
|
|
|
|
+ // this.checkChange()
|
|
|
|
|
+ // }
|
|
|
|
|
+ // });
|
|
|
|
|
+ getAction("/rooms/cesRooms/can-user-rooms", {
|
|
|
|
|
+ startOf: this.model.livingData.livingOrder.arrivalTime,
|
|
|
|
|
+ endOf: this.model.livingData.livingOrder.dueOutTime,
|
|
|
|
|
+ bookingType: 1,
|
|
|
|
|
+ hourRoomRuleId: '',
|
|
|
|
|
+ cancelLayout: true,
|
|
|
|
|
+ }).then((res) => {
|
|
|
if (res.success) {
|
|
if (res.success) {
|
|
|
- res.result.forEach((row) => {
|
|
|
|
|
- this.$set(row, "collapse", 1);
|
|
|
|
|
- });
|
|
|
|
|
- this.roomList = res.result;
|
|
|
|
|
- this.oldRoomList = JSON.parse(JSON.stringify(res.result));
|
|
|
|
|
|
|
+ this.roomList = res.result[0].buildingRooms;
|
|
|
|
|
+ this.oldRoomList = JSON.parse(JSON.stringify(res.result[0].buildingRooms));
|
|
|
this.checkChange()
|
|
this.checkChange()
|
|
|
}
|
|
}
|
|
|
});
|
|
});
|
|
@@ -419,6 +431,7 @@ export default {
|
|
|
},
|
|
},
|
|
|
edit(record) {
|
|
edit(record) {
|
|
|
this.model = Object.assign({}, record);
|
|
this.model = Object.assign({}, record);
|
|
|
|
|
+ this.loadData();
|
|
|
// this.model.startValue = record.livingData.livingOrder.dueOutTime
|
|
// this.model.startValue = record.livingData.livingOrder.dueOutTime
|
|
|
let arr = []
|
|
let arr = []
|
|
|
arr.length = this.daysBetween(record.livingData.livingOrder.dueOutTime, record.livingData.livingOrder.arrivalTime)
|
|
arr.length = this.daysBetween(record.livingData.livingOrder.dueOutTime, record.livingData.livingOrder.arrivalTime)
|
|
@@ -426,7 +439,7 @@ export default {
|
|
|
arr[i] = {
|
|
arr[i] = {
|
|
|
day: this.addDate(record.livingData.livingOrder.arrivalTime, i),
|
|
day: this.addDate(record.livingData.livingOrder.arrivalTime, i),
|
|
|
// price: this.model.layout.marketPrice,
|
|
// price: this.model.layout.marketPrice,
|
|
|
- price:0
|
|
|
|
|
|
|
+ price: 0
|
|
|
};
|
|
};
|
|
|
}
|
|
}
|
|
|
console.log(arr);
|
|
console.log(arr);
|
|
@@ -438,6 +451,10 @@ export default {
|
|
|
// 触发表单验证
|
|
// 触发表单验证
|
|
|
this.$refs.form.validate((valid) => {
|
|
this.$refs.form.validate((valid) => {
|
|
|
if (valid) {
|
|
if (valid) {
|
|
|
|
|
+ if (!this.newRoom) {
|
|
|
|
|
+ this.$message.warning("请选择新房间");
|
|
|
|
|
+ return
|
|
|
|
|
+ }
|
|
|
that.confirmLoading = true;
|
|
that.confirmLoading = true;
|
|
|
let httpurl = "";
|
|
let httpurl = "";
|
|
|
let method = "";
|
|
let method = "";
|
|
@@ -448,19 +465,15 @@ export default {
|
|
|
// httpurl += this.url.edit;
|
|
// httpurl += this.url.edit;
|
|
|
// method = "put";
|
|
// method = "put";
|
|
|
// }
|
|
// }
|
|
|
- if (!this.newRoom || !this.newRoom.roomInfo) {
|
|
|
|
|
- this.$message.warning("请选择新房间");
|
|
|
|
|
- return
|
|
|
|
|
- }
|
|
|
|
|
let prices = this.timeData.map(item => {
|
|
let prices = this.timeData.map(item => {
|
|
|
return {
|
|
return {
|
|
|
dayTime: item.day,
|
|
dayTime: item.day,
|
|
|
price: item.price,
|
|
price: item.price,
|
|
|
- roomId: this.newRoom.roomInfo.id
|
|
|
|
|
|
|
+ roomId: this.newRoom.id
|
|
|
}
|
|
}
|
|
|
})
|
|
})
|
|
|
// return
|
|
// return
|
|
|
- httpAction(`/business/busRoomBookingOrders/change-living-room?livingOrderId=${this.model.roomInfo.livingOrderId}&changeRoomId=${this.newRoom.roomInfo.id}`, prices, 'post')
|
|
|
|
|
|
|
+ httpAction(`/business/busRoomBookingOrders/change-living-room?livingOrderId=${this.model.roomInfo.livingOrderId}&changeRoomId=${this.newRoom.id}`, prices, 'post')
|
|
|
.then((res) => {
|
|
.then((res) => {
|
|
|
if (res.success) {
|
|
if (res.success) {
|
|
|
that.$message.success(res.message);
|
|
that.$message.success(res.message);
|