|
@@ -20,72 +20,28 @@
|
|
|
</a-select>
|
|
</a-select>
|
|
|
</a-form-model-item> -->
|
|
</a-form-model-item> -->
|
|
|
|
|
|
|
|
- <a-form-model-item
|
|
|
|
|
- label="楼栋名称"
|
|
|
|
|
- :labelCol="labelCol"
|
|
|
|
|
- :wrapperCol="wrapperCol"
|
|
|
|
|
- prop="layoutId"
|
|
|
|
|
- >
|
|
|
|
|
- <a-select
|
|
|
|
|
- show-search
|
|
|
|
|
- placeholder="请选择楼栋"
|
|
|
|
|
- v-model="buildingId"
|
|
|
|
|
- option-filter-prop="children"
|
|
|
|
|
- @change="onBuildChange"
|
|
|
|
|
- >
|
|
|
|
|
- <a-select-option v-for="item in buildingTreeData" :key="item.id" >
|
|
|
|
|
|
|
+ <a-form-model-item label="楼栋名称" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="layoutId">
|
|
|
|
|
+ <a-select show-search placeholder="请选择楼栋" v-model="buildingId" option-filter-prop="children"
|
|
|
|
|
+ @change="onBuildChange">
|
|
|
|
|
+ <a-select-option v-for="item in buildingTreeData" :key="item.id">
|
|
|
{{ item.name }}
|
|
{{ item.name }}
|
|
|
</a-select-option>
|
|
</a-select-option>
|
|
|
</a-select>
|
|
</a-select>
|
|
|
</a-form-model-item>
|
|
</a-form-model-item>
|
|
|
|
|
|
|
|
- <a-form-model-item
|
|
|
|
|
- label="层数最高"
|
|
|
|
|
- :labelCol="labelCol"
|
|
|
|
|
- :wrapperCol="wrapperCol"
|
|
|
|
|
- prop="layoutId"
|
|
|
|
|
- >
|
|
|
|
|
- <a-input-number
|
|
|
|
|
- placeholder="输入楼层数"
|
|
|
|
|
- v-model="model.floorCount"
|
|
|
|
|
- :min="1"
|
|
|
|
|
- style="width: 120px"
|
|
|
|
|
- />层
|
|
|
|
|
|
|
+ <a-form-model-item label="层数最高" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="layoutId">
|
|
|
|
|
+ <a-input-number placeholder="输入楼层数" v-model="model.floorCount" :min="1" style="width: 120px" />层
|
|
|
</a-form-model-item>
|
|
</a-form-model-item>
|
|
|
- <a-form-model-item
|
|
|
|
|
- label="每层房间数量"
|
|
|
|
|
- :labelCol="labelCol"
|
|
|
|
|
- :wrapperCol="wrapperCol"
|
|
|
|
|
- prop="layoutId"
|
|
|
|
|
- >
|
|
|
|
|
- <a-input-number
|
|
|
|
|
- placeholder="输入每层房间数"
|
|
|
|
|
- v-model="model.roomCount"
|
|
|
|
|
- :min="1"
|
|
|
|
|
- style="width: 120px"
|
|
|
|
|
- />间
|
|
|
|
|
|
|
+ <a-form-model-item label="每层房间数量" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="layoutId">
|
|
|
|
|
+ <a-input-number placeholder="输入每层房间数" v-model="model.roomCount" :min="1" style="width: 120px" />间
|
|
|
</a-form-model-item>
|
|
</a-form-model-item>
|
|
|
|
|
|
|
|
- <a-form-model-item
|
|
|
|
|
- label="设置前缀"
|
|
|
|
|
- :labelCol="labelCol"
|
|
|
|
|
- :wrapperCol="wrapperCol"
|
|
|
|
|
- prop="layoutId"
|
|
|
|
|
- >
|
|
|
|
|
|
|
+ <a-form-model-item label="设置前缀" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="layoutId">
|
|
|
<a-input placeholder="输入房号前缀" v-model="model.prefix" />
|
|
<a-input placeholder="输入房号前缀" v-model="model.prefix" />
|
|
|
</a-form-model-item>
|
|
</a-form-model-item>
|
|
|
- <a-form-model-item
|
|
|
|
|
- label="设置前缀"
|
|
|
|
|
- :labelCol="labelCol"
|
|
|
|
|
- :wrapperCol="wrapperCol"
|
|
|
|
|
- prop="layoutId"
|
|
|
|
|
- >
|
|
|
|
|
|
|
+ <a-form-model-item label="尾号排除" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="layoutId">
|
|
|
<a-checkbox v-model="model.isExpectEnd"> 尾号排除 </a-checkbox>
|
|
<a-checkbox v-model="model.isExpectEnd"> 尾号排除 </a-checkbox>
|
|
|
- <a-input
|
|
|
|
|
- :disabled="!model.isExpectEnd"
|
|
|
|
|
- placeholder="输入排除的其他尾号"
|
|
|
|
|
- v-model="tailNumber"
|
|
|
|
|
- />
|
|
|
|
|
|
|
+ <a-input :disabled="!model.isExpectEnd" placeholder="输入排除的其他尾号" v-model="tailNumber" />
|
|
|
</a-form-model-item>
|
|
</a-form-model-item>
|
|
|
<a-button type="primary" @click="genRooms"> 批量生成 </a-button>
|
|
<a-button type="primary" @click="genRooms"> 批量生成 </a-button>
|
|
|
</a-form>
|
|
</a-form>
|
|
@@ -94,52 +50,24 @@
|
|
|
<div v-if="roomTree.length > 0">
|
|
<div v-if="roomTree.length > 0">
|
|
|
<div v-for="(item, index) in roomTree" :key="index" style="width: 100%">
|
|
<div v-for="(item, index) in roomTree" :key="index" style="width: 100%">
|
|
|
<div style="font-width: 600; font-size: 20px" @click="sele(item)">
|
|
<div style="font-width: 600; font-size: 20px" @click="sele(item)">
|
|
|
- <a-input
|
|
|
|
|
- placeholder="请填写楼层名"
|
|
|
|
|
- v-model="item.name"
|
|
|
|
|
- class="floor-input"
|
|
|
|
|
- ></a-input>
|
|
|
|
|
- <a-button
|
|
|
|
|
- @click="delFloor(index)"
|
|
|
|
|
- type="danger"
|
|
|
|
|
- shape="circle"
|
|
|
|
|
- size="small"
|
|
|
|
|
- icon="minus"
|
|
|
|
|
- style="margin-left: 5px"
|
|
|
|
|
- />
|
|
|
|
|
|
|
+ <a-input placeholder="请填写楼层名" v-model="item.name" class="floor-input"></a-input>
|
|
|
|
|
+ <a-button @click="delFloor(index)" type="danger" shape="circle" size="small" icon="minus"
|
|
|
|
|
+ style="margin-left: 5px" />
|
|
|
</div>
|
|
</div>
|
|
|
<div style="color:red;" v-if="isExistNames(item.name)">名称已存在</div>
|
|
<div style="color:red;" v-if="isExistNames(item.name)">名称已存在</div>
|
|
|
- <div
|
|
|
|
|
- style="display: flex;justify-content: start;margin: 20px;flex-wrap: wrap;"
|
|
|
|
|
- >
|
|
|
|
|
- <div
|
|
|
|
|
- v-for="(room, indexs) in item.children"
|
|
|
|
|
- :key="indexs"
|
|
|
|
|
- style="width: 25%; margin-top: 10px"
|
|
|
|
|
- >
|
|
|
|
|
|
|
+ <div style="display: flex;justify-content: start;margin: 20px;flex-wrap: wrap;">
|
|
|
|
|
+ <div v-for="(room, indexs) in item.children" :key="indexs" style="width: 15%; margin-top: 10px">
|
|
|
<input v-model="room.name" style="width: 50%; margin: auto" />
|
|
<input v-model="room.name" style="width: 50%; margin: auto" />
|
|
|
-
|
|
|
|
|
- <a-button
|
|
|
|
|
- @click="delRoom(index, indexs)"
|
|
|
|
|
- type="danger"
|
|
|
|
|
- shape="circle"
|
|
|
|
|
- size="small"
|
|
|
|
|
- icon="minus"
|
|
|
|
|
- style="margin-left: 5px"
|
|
|
|
|
- />
|
|
|
|
|
- <div style="color:red;" v-if="repeatName(item.children,indexs)">房名重复</div>
|
|
|
|
|
|
|
+
|
|
|
|
|
+ <a-button @click="delRoom(index, indexs)" type="danger" shape="circle" size="small" icon="minus"
|
|
|
|
|
+ style="margin-left: 5px" />
|
|
|
|
|
+ <div style="color:red;" v-if="repeatName(item.children, indexs)">房名重复</div>
|
|
|
</div>
|
|
</div>
|
|
|
-
|
|
|
|
|
|
|
+
|
|
|
</div>
|
|
</div>
|
|
|
<div>
|
|
<div>
|
|
|
- <a-button
|
|
|
|
|
- @click="addRoom(index)"
|
|
|
|
|
- type="primary"
|
|
|
|
|
- shape="circle"
|
|
|
|
|
- size="small"
|
|
|
|
|
- icon="plus"
|
|
|
|
|
- style="margin-left: 20px; margin: 0 20px 20px"
|
|
|
|
|
- />
|
|
|
|
|
|
|
+ <a-button @click="addRoom(index)" type="primary" shape="circle" size="small" icon="plus"
|
|
|
|
|
+ style="margin-left: 20px; margin: 0 20px 20px" />
|
|
|
</div>
|
|
</div>
|
|
|
</div>
|
|
</div>
|
|
|
</div>
|
|
</div>
|
|
@@ -153,81 +81,57 @@
|
|
|
</div>
|
|
</div>
|
|
|
</div>
|
|
</div>
|
|
|
<div v-else class="room-layout-settings">
|
|
<div v-else class="room-layout-settings">
|
|
|
- <div class="layout-rooms-item" v-for="(item, layoutIndex) in layouts" :key="item.id">
|
|
|
|
|
- <div class="title-laytou">
|
|
|
|
|
- {{ item.name }}
|
|
|
|
|
-
|
|
|
|
|
|
|
+
|
|
|
|
|
+
|
|
|
|
|
+ <div style="flex:1;height: calc(100vh - 180px);overflow-y: auto;">
|
|
|
|
|
+ <div class="wait-select-title">
|
|
|
|
|
+ <div class="color-title">待配置房间</div>
|
|
|
</div>
|
|
</div>
|
|
|
- <div class="room-items">
|
|
|
|
|
- <div v-for="(element, roomIndex) in item.rooms" :key="element.id" class="layout-room-item">
|
|
|
|
|
- {{ element.name }}
|
|
|
|
|
- <a-button
|
|
|
|
|
- @click="delLayoutRoom(element, layoutIndex, roomIndex)"
|
|
|
|
|
- type="danger"
|
|
|
|
|
- shape="circle"
|
|
|
|
|
- size="small"
|
|
|
|
|
- icon="minus"
|
|
|
|
|
- style="margin-left: 5px"
|
|
|
|
|
- />
|
|
|
|
|
|
|
+ <div v-for="(item, index) in roomTree" :key="index" style="width: 100%; padding-left: 30px">
|
|
|
|
|
+ <div style="font-width: 600; font-size: 20px" @click="sele(item)">
|
|
|
|
|
+ {{ item.name }}
|
|
|
</div>
|
|
</div>
|
|
|
- </div>
|
|
|
|
|
- </div>
|
|
|
|
|
- <div class="wait-select-title">
|
|
|
|
|
- <div class="color-title">待配置房间</div>
|
|
|
|
|
- </div>
|
|
|
|
|
- <div
|
|
|
|
|
- v-for="(item, index) in roomTree"
|
|
|
|
|
- :key="index"
|
|
|
|
|
- style="width: 100%; padding-left: 30px"
|
|
|
|
|
- >
|
|
|
|
|
- <div style="font-width: 600; font-size: 20px" @click="sele(item)">
|
|
|
|
|
- {{ item.name }}
|
|
|
|
|
- </div>
|
|
|
|
|
- <div
|
|
|
|
|
- style="display: flex;justify-content: start;margin: 20px;flex-wrap: wrap;"
|
|
|
|
|
- >
|
|
|
|
|
- <div
|
|
|
|
|
- v-for="(room, indexs) in item.children"
|
|
|
|
|
- :key="indexs"
|
|
|
|
|
- class="select-room-item"
|
|
|
|
|
- :class="[room.checked ? 'checked-room' : '']"
|
|
|
|
|
- @click="room.checked = !room.checked"
|
|
|
|
|
- style="width: 80px; margin-top: 10px"
|
|
|
|
|
- >
|
|
|
|
|
- {{ room.name }}
|
|
|
|
|
|
|
+ <div style="display: flex;justify-content: start;margin: 20px;flex-wrap: wrap;">
|
|
|
|
|
+ <div v-for="(room, indexs) in item.children" :key="indexs" class="select-room-item"
|
|
|
|
|
+ :class="[room.checked ? 'checked-room' : '']" @click="room.checked = !room.checked"
|
|
|
|
|
+ style="width: 80px; margin-top: 10px">
|
|
|
|
|
+ {{ room.name }}
|
|
|
|
|
+ </div>
|
|
|
</div>
|
|
</div>
|
|
|
|
|
+
|
|
|
</div>
|
|
</div>
|
|
|
-
|
|
|
|
|
- </div>
|
|
|
|
|
- <div class="bottom-sele-btn">
|
|
|
|
|
|
|
+ <div class="bottom-sele-btn">
|
|
|
<a-popover placement="topRight" v-if="canMove.can">
|
|
<a-popover placement="topRight" v-if="canMove.can">
|
|
|
<template slot="content">
|
|
<template slot="content">
|
|
|
- <a-button
|
|
|
|
|
- type="link"
|
|
|
|
|
- v-for="(item, index) in layouts"
|
|
|
|
|
- :key="item.id"
|
|
|
|
|
- @click="moveTo(index)"
|
|
|
|
|
- >
|
|
|
|
|
|
|
+ <a-button type="link" v-for="(item, index) in layouts" :key="item.id" @click="moveTo(index)">
|
|
|
{{ item.name }}
|
|
{{ item.name }}
|
|
|
</a-button>
|
|
</a-button>
|
|
|
</template>
|
|
</template>
|
|
|
<template slot="title">
|
|
<template slot="title">
|
|
|
<span>要移动到的目标房型</span>
|
|
<span>要移动到的目标房型</span>
|
|
|
</template>
|
|
</template>
|
|
|
- <a-button :disabled="false" type="primary"
|
|
|
|
|
- >移动到房型({{ canMove.count }})</a-button
|
|
|
|
|
- >
|
|
|
|
|
|
|
+ <a-button :disabled="false" type="primary">移动到房型({{ canMove.count }})</a-button>
|
|
|
</a-popover>
|
|
</a-popover>
|
|
|
- <a-button v-else :disabled="true" type="primary"
|
|
|
|
|
- >移动到房型(0)</a-button
|
|
|
|
|
- >
|
|
|
|
|
- <a-button :disabled="saveLoading" :loading="saveLoading" @click="back" type="primary"
|
|
|
|
|
- >取消</a-button
|
|
|
|
|
- >
|
|
|
|
|
- <a-button :disabled="saveLoading" :loading="saveLoading" @click="save" type="primary"
|
|
|
|
|
- >保存并查看房间列表</a-button
|
|
|
|
|
- >
|
|
|
|
|
|
|
+ <a-button v-else :disabled="true" type="primary">移动到房型(0)</a-button>
|
|
|
|
|
+ <a-button :disabled="saveLoading" :loading="saveLoading" @click="back" type="primary">取消</a-button>
|
|
|
|
|
+ <a-button :disabled="saveLoading" :loading="saveLoading" @click="save" type="primary">保存并查看房间列表</a-button>
|
|
|
|
|
|
|
|
|
|
+ </div>
|
|
|
|
|
+ </div>
|
|
|
|
|
+ <div style="flex:1;height: calc(100vh - 180px); overflow-y: auto;">
|
|
|
|
|
+ <div class="layout-rooms-item" v-for="(item, layoutIndex) in layouts" :key="item.id">
|
|
|
|
|
+ <div class="title-laytou">
|
|
|
|
|
+ {{ item.name }}
|
|
|
|
|
+
|
|
|
|
|
+ </div>
|
|
|
|
|
+ <div class="room-items">
|
|
|
|
|
+ <div v-for="(element, roomIndex) in item.rooms" :key="element.id" class="layout-room-item">
|
|
|
|
|
+ {{ element.name }}
|
|
|
|
|
+ <a-button @click="delLayoutRoom(element, layoutIndex, roomIndex)" type="danger" shape="circle" size="small"
|
|
|
|
|
+ icon="minus" style="margin-left: 5px" />
|
|
|
|
|
+ </div>
|
|
|
|
|
+ </div>
|
|
|
|
|
+ </div>
|
|
|
</div>
|
|
</div>
|
|
|
</div>
|
|
</div>
|
|
|
</template>
|
|
</template>
|
|
@@ -244,8 +148,8 @@ export default {
|
|
|
},
|
|
},
|
|
|
data() {
|
|
data() {
|
|
|
return {
|
|
return {
|
|
|
- floorNames:[],
|
|
|
|
|
- saveLoading: false,
|
|
|
|
|
|
|
+ floorNames: [],
|
|
|
|
|
+ saveLoading: false,
|
|
|
myArray: [
|
|
myArray: [
|
|
|
{
|
|
{
|
|
|
id: 1,
|
|
id: 1,
|
|
@@ -306,6 +210,10 @@ export default {
|
|
|
buildingTree().then((res) => {
|
|
buildingTree().then((res) => {
|
|
|
if (res.code == 200) {
|
|
if (res.code == 200) {
|
|
|
this.buildingTreeData = res.result;
|
|
this.buildingTreeData = res.result;
|
|
|
|
|
+ if (res.result && res.result.length > 0) {
|
|
|
|
|
+
|
|
|
|
|
+ this.buildingId = res.result[0].id
|
|
|
|
|
+ }
|
|
|
}
|
|
}
|
|
|
});
|
|
});
|
|
|
getAllLayouts().then((res) => {
|
|
getAllLayouts().then((res) => {
|
|
@@ -321,17 +229,17 @@ export default {
|
|
|
methods: {
|
|
methods: {
|
|
|
onBuildChange() {
|
|
onBuildChange() {
|
|
|
let bIndex = this.buildingTreeData.findIndex(s => s.id == this.buildingId)
|
|
let bIndex = this.buildingTreeData.findIndex(s => s.id == this.buildingId)
|
|
|
- let currentFloorNames = (this.buildingTreeData[bIndex].children||[]).map(s => s.name)
|
|
|
|
|
|
|
+ let currentFloorNames = (this.buildingTreeData[bIndex].children || []).map(s => s.name)
|
|
|
this.floorNames = currentFloorNames
|
|
this.floorNames = currentFloorNames
|
|
|
// this.roomTree = JSON.parse(JSON.stringify(this.roomTree))
|
|
// this.roomTree = JSON.parse(JSON.stringify(this.roomTree))
|
|
|
},
|
|
},
|
|
|
delLayoutRoom(item, layoutIndex, roomIndex) {
|
|
delLayoutRoom(item, layoutIndex, roomIndex) {
|
|
|
- this.roomTree[item.floorIndex].children.push({
|
|
|
|
|
- checked: false,
|
|
|
|
|
- name: item.name,
|
|
|
|
|
- floorIndex: item.floorIndex
|
|
|
|
|
- })
|
|
|
|
|
- this.layouts[layoutIndex].rooms.splice(roomIndex,1)
|
|
|
|
|
|
|
+ this.roomTree[item.floorIndex].children.push({
|
|
|
|
|
+ checked: false,
|
|
|
|
|
+ name: item.name,
|
|
|
|
|
+ floorIndex: item.floorIndex
|
|
|
|
|
+ })
|
|
|
|
|
+ this.layouts[layoutIndex].rooms.splice(roomIndex, 1)
|
|
|
},
|
|
},
|
|
|
moveTo(idx) {
|
|
moveTo(idx) {
|
|
|
let roomItems = [];
|
|
let roomItems = [];
|
|
@@ -387,37 +295,37 @@ export default {
|
|
|
return;
|
|
return;
|
|
|
}
|
|
}
|
|
|
let errMsg = '';
|
|
let errMsg = '';
|
|
|
-
|
|
|
|
|
- for(let i =0;i<this.roomTree.length;i++) {
|
|
|
|
|
|
|
+
|
|
|
|
|
+ for (let i = 0; i < this.roomTree.length; i++) {
|
|
|
let s = this.roomTree[i]
|
|
let s = this.roomTree[i]
|
|
|
- if(this.isExistNames(s.name)) {
|
|
|
|
|
|
|
+ if (this.isExistNames(s.name)) {
|
|
|
errMsg = '楼层名称有重复';
|
|
errMsg = '楼层名称有重复';
|
|
|
break;
|
|
break;
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
- if(errMsg == '') {
|
|
|
|
|
- for(let i =0;i<this.roomTree.length;i++) {
|
|
|
|
|
- let s = this.roomTree[i]
|
|
|
|
|
- for(let j=0;j<s.children.length;j++) {
|
|
|
|
|
- let room = s.children[j]
|
|
|
|
|
- if(!room.name){
|
|
|
|
|
- errMsg = '存在空房名,请填写'
|
|
|
|
|
- break
|
|
|
|
|
- }
|
|
|
|
|
- if(this.repeatName(s.children, j)) {
|
|
|
|
|
- errMsg = '存在重复房名'
|
|
|
|
|
- break
|
|
|
|
|
|
|
+ if (errMsg == '') {
|
|
|
|
|
+ for (let i = 0; i < this.roomTree.length; i++) {
|
|
|
|
|
+ let s = this.roomTree[i]
|
|
|
|
|
+ for (let j = 0; j < s.children.length; j++) {
|
|
|
|
|
+ let room = s.children[j]
|
|
|
|
|
+ if (!room.name) {
|
|
|
|
|
+ errMsg = '存在空房名,请填写'
|
|
|
|
|
+ break
|
|
|
|
|
+ }
|
|
|
|
|
+ if (this.repeatName(s.children, j)) {
|
|
|
|
|
+ errMsg = '存在重复房名'
|
|
|
|
|
+ break
|
|
|
|
|
+ }
|
|
|
}
|
|
}
|
|
|
|
|
+ if (errMsg) break
|
|
|
}
|
|
}
|
|
|
- if(errMsg) break
|
|
|
|
|
- }
|
|
|
|
|
}
|
|
}
|
|
|
- if(errMsg) {
|
|
|
|
|
|
|
+ if (errMsg) {
|
|
|
this.$message.error(errMsg)
|
|
this.$message.error(errMsg)
|
|
|
return
|
|
return
|
|
|
}
|
|
}
|
|
|
-
|
|
|
|
|
-
|
|
|
|
|
|
|
+
|
|
|
|
|
+
|
|
|
if (this.step == 1) {
|
|
if (this.step == 1) {
|
|
|
this.step = 2;
|
|
this.step = 2;
|
|
|
return;
|
|
return;
|
|
@@ -425,43 +333,43 @@ export default {
|
|
|
let treeData = this.getParams();
|
|
let treeData = this.getParams();
|
|
|
this.saveLoading = true
|
|
this.saveLoading = true
|
|
|
saveBatch(treeData).then(res => {
|
|
saveBatch(treeData).then(res => {
|
|
|
- if(res.code == 200) {
|
|
|
|
|
- this.$message.success("批量保存成功")
|
|
|
|
|
- this.closeCurrent()
|
|
|
|
|
|
|
+ if (res.code == 200) {
|
|
|
|
|
+ this.$message.success("批量保存成功")
|
|
|
|
|
+ this.closeCurrent()
|
|
|
}
|
|
}
|
|
|
}).finally(_ => {
|
|
}).finally(_ => {
|
|
|
this.saveLoading = false
|
|
this.saveLoading = false
|
|
|
})
|
|
})
|
|
|
},
|
|
},
|
|
|
getParams() {
|
|
getParams() {
|
|
|
- let param = {
|
|
|
|
|
- hotelId: null,
|
|
|
|
|
- buildId: null,
|
|
|
|
|
- children: [],
|
|
|
|
|
- };
|
|
|
|
|
- let hotelInfo = JSON.parse(localStorage.getItem("storeInfo"));
|
|
|
|
|
- param.buildId = this.buildingId;
|
|
|
|
|
- param.hotelId = hotelInfo.id;
|
|
|
|
|
- let roomTree = JSON.parse(JSON.stringify(this.roomTree))
|
|
|
|
|
- roomTree.forEach(a => {
|
|
|
|
|
- param.children.push({
|
|
|
|
|
- floorName: a.name,
|
|
|
|
|
- children: []
|
|
|
|
|
- })
|
|
|
|
|
|
|
+ let param = {
|
|
|
|
|
+ hotelId: null,
|
|
|
|
|
+ buildId: null,
|
|
|
|
|
+ children: [],
|
|
|
|
|
+ };
|
|
|
|
|
+ let hotelInfo = JSON.parse(localStorage.getItem("storeInfo"));
|
|
|
|
|
+ param.buildId = this.buildingId;
|
|
|
|
|
+ param.hotelId = hotelInfo.id;
|
|
|
|
|
+ let roomTree = JSON.parse(JSON.stringify(this.roomTree))
|
|
|
|
|
+ roomTree.forEach(a => {
|
|
|
|
|
+ param.children.push({
|
|
|
|
|
+ floorName: a.name,
|
|
|
|
|
+ children: []
|
|
|
})
|
|
})
|
|
|
- this.layouts.forEach(layout => {
|
|
|
|
|
- layout.rooms.forEach(room => {
|
|
|
|
|
- param.children[room.floorIndex].children.push({
|
|
|
|
|
- hotelId: hotelInfo.id,
|
|
|
|
|
- buildId: this.buildingId,
|
|
|
|
|
- layoutId: layout.id,
|
|
|
|
|
- name: room.name,
|
|
|
|
|
- prefix: this.model.prefix,
|
|
|
|
|
- })
|
|
|
|
|
- })
|
|
|
|
|
|
|
+ })
|
|
|
|
|
+ this.layouts.forEach(layout => {
|
|
|
|
|
+ layout.rooms.forEach(room => {
|
|
|
|
|
+ param.children[room.floorIndex].children.push({
|
|
|
|
|
+ hotelId: hotelInfo.id,
|
|
|
|
|
+ buildId: this.buildingId,
|
|
|
|
|
+ layoutId: layout.id,
|
|
|
|
|
+ name: room.name,
|
|
|
|
|
+ prefix: this.model.prefix,
|
|
|
|
|
+ })
|
|
|
})
|
|
})
|
|
|
|
|
+ })
|
|
|
|
|
|
|
|
- return param
|
|
|
|
|
|
|
+ return param
|
|
|
},
|
|
},
|
|
|
addRoom(index) {
|
|
addRoom(index) {
|
|
|
this.roomTree[index].children.push({
|
|
this.roomTree[index].children.push({
|
|
@@ -488,9 +396,9 @@ export default {
|
|
|
back() {
|
|
back() {
|
|
|
this.closeCurrent();
|
|
this.closeCurrent();
|
|
|
},
|
|
},
|
|
|
- check() {},
|
|
|
|
|
- genRooms() {
|
|
|
|
|
- if(!this.buildingId) {
|
|
|
|
|
|
|
+ check() { },
|
|
|
|
|
+ genRooms() {
|
|
|
|
|
+ if (!this.buildingId) {
|
|
|
this.$message.error("请先选择楼栋")
|
|
this.$message.error("请先选择楼栋")
|
|
|
return
|
|
return
|
|
|
}
|
|
}
|
|
@@ -524,7 +432,7 @@ export default {
|
|
|
}
|
|
}
|
|
|
this.roomTree = floors;
|
|
this.roomTree = floors;
|
|
|
let bIndex = this.buildingTreeData.findIndex(s => s.id == this.buildingId)
|
|
let bIndex = this.buildingTreeData.findIndex(s => s.id == this.buildingId)
|
|
|
- let currentFloorNames = (this.buildingTreeData[bIndex].children||[]).map(s => s.name)
|
|
|
|
|
|
|
+ let currentFloorNames = (this.buildingTreeData[bIndex].children || []).map(s => s.name)
|
|
|
this.floorNames = currentFloorNames
|
|
this.floorNames = currentFloorNames
|
|
|
},
|
|
},
|
|
|
isExistNames(name) {
|
|
isExistNames(name) {
|
|
@@ -533,9 +441,9 @@ export default {
|
|
|
repeatName(items, index) {
|
|
repeatName(items, index) {
|
|
|
let name = items[index].name
|
|
let name = items[index].name
|
|
|
let newArr = JSON.parse(JSON.stringify(items)).map(s => s.name)
|
|
let newArr = JSON.parse(JSON.stringify(items)).map(s => s.name)
|
|
|
- newArr.splice(index,1)
|
|
|
|
|
|
|
+ newArr.splice(index, 1)
|
|
|
|
|
|
|
|
- if(newArr.includes(items[index].name)) {
|
|
|
|
|
|
|
+ if (newArr.includes(items[index].name)) {
|
|
|
return true
|
|
return true
|
|
|
}
|
|
}
|
|
|
return false
|
|
return false
|
|
@@ -554,16 +462,19 @@ export default {
|
|
|
justify-content: center;
|
|
justify-content: center;
|
|
|
align-items: center;
|
|
align-items: center;
|
|
|
}
|
|
}
|
|
|
|
|
+
|
|
|
.bottom-btns {
|
|
.bottom-btns {
|
|
|
display: flex;
|
|
display: flex;
|
|
|
justify-content: center;
|
|
justify-content: center;
|
|
|
margin-bottom: 20px;
|
|
margin-bottom: 20px;
|
|
|
}
|
|
}
|
|
|
|
|
+
|
|
|
.floor-input {
|
|
.floor-input {
|
|
|
width: 200px;
|
|
width: 200px;
|
|
|
}
|
|
}
|
|
|
|
|
+
|
|
|
.room-items {
|
|
.room-items {
|
|
|
- display: inline-block;
|
|
|
|
|
|
|
+ display: inline-block;
|
|
|
border: 1px solid #cccccc77;
|
|
border: 1px solid #cccccc77;
|
|
|
height: 200px;
|
|
height: 200px;
|
|
|
overflow-y: auto;
|
|
overflow-y: auto;
|
|
@@ -571,6 +482,7 @@ export default {
|
|
|
border-radius: 10px;
|
|
border-radius: 10px;
|
|
|
margin-bottom: 30px;
|
|
margin-bottom: 30px;
|
|
|
}
|
|
}
|
|
|
|
|
+
|
|
|
.title-laytou {
|
|
.title-laytou {
|
|
|
font-size: 17px;
|
|
font-size: 17px;
|
|
|
font-weight: bold;
|
|
font-weight: bold;
|
|
@@ -580,12 +492,15 @@ export default {
|
|
|
line-height: 25px;
|
|
line-height: 25px;
|
|
|
background-color: antiquewhite;
|
|
background-color: antiquewhite;
|
|
|
}
|
|
}
|
|
|
|
|
+
|
|
|
.room-items-dr {
|
|
.room-items-dr {
|
|
|
border: 1px solid #f00 !important;
|
|
border: 1px solid #f00 !important;
|
|
|
}
|
|
}
|
|
|
|
|
+
|
|
|
.wait-select-title {
|
|
.wait-select-title {
|
|
|
border-bottom: 4px solid #1cb1ac;
|
|
border-bottom: 4px solid #1cb1ac;
|
|
|
}
|
|
}
|
|
|
|
|
+
|
|
|
.color-title {
|
|
.color-title {
|
|
|
background-color: #1cb1ac;
|
|
background-color: #1cb1ac;
|
|
|
color: white;
|
|
color: white;
|
|
@@ -596,6 +511,7 @@ export default {
|
|
|
border-top-right-radius: 4px;
|
|
border-top-right-radius: 4px;
|
|
|
text-align: center;
|
|
text-align: center;
|
|
|
}
|
|
}
|
|
|
|
|
+
|
|
|
.select-room-item {
|
|
.select-room-item {
|
|
|
border: 1px solid #cccccc77;
|
|
border: 1px solid #cccccc77;
|
|
|
border-radius: 4px;
|
|
border-radius: 4px;
|
|
@@ -606,17 +522,24 @@ export default {
|
|
|
background-color: white;
|
|
background-color: white;
|
|
|
cursor: pointer;
|
|
cursor: pointer;
|
|
|
}
|
|
}
|
|
|
|
|
+
|
|
|
.checked-room {
|
|
.checked-room {
|
|
|
background-color: #1cb1ac !important;
|
|
background-color: #1cb1ac !important;
|
|
|
color: white !important;
|
|
color: white !important;
|
|
|
border: none !important;
|
|
border: none !important;
|
|
|
}
|
|
}
|
|
|
|
|
+
|
|
|
.bottom-sele-btn {
|
|
.bottom-sele-btn {
|
|
|
padding-bottom: 30px;
|
|
padding-bottom: 30px;
|
|
|
}
|
|
}
|
|
|
-.layout-room-item{
|
|
|
|
|
- display: inline-block;
|
|
|
|
|
- width: fit-content;
|
|
|
|
|
- padding: 10px 12px;
|
|
|
|
|
|
|
+
|
|
|
|
|
+.layout-room-item {
|
|
|
|
|
+ display: inline-block;
|
|
|
|
|
+ width: fit-content;
|
|
|
|
|
+ padding: 10px 12px;
|
|
|
|
|
+}
|
|
|
|
|
+
|
|
|
|
|
+.room-layout-settings {
|
|
|
|
|
+ display: flex;
|
|
|
}
|
|
}
|
|
|
</style>
|
|
</style>
|