|
@@ -4,18 +4,37 @@
|
|
|
|
|
|
|
|
<!-- 操作按钮区域 -->
|
|
<!-- 操作按钮区域 -->
|
|
|
<div class="table-operator">
|
|
<div class="table-operator">
|
|
|
|
|
+ <a-tag color="pink" v-if="buildingFloorSearchTag.name" >
|
|
|
|
|
+ {{ buildingFloorSearchTag.name }}
|
|
|
|
|
+ <a-icon type="close" @click="onFliterClose" />
|
|
|
|
|
+ </a-tag>
|
|
|
<a-button @click="handleAdd" type="primary" icon="plus"
|
|
<a-button @click="handleAdd" type="primary" icon="plus"
|
|
|
>新增房间</a-button
|
|
>新增房间</a-button
|
|
|
>
|
|
>
|
|
|
- <a-button @click="onAddBatch" type="primary" icon="plus"
|
|
|
|
|
|
|
+ <a-button @click="onAddBatch" type="primary" icon="tags"
|
|
|
>批量新增</a-button
|
|
>批量新增</a-button
|
|
|
>
|
|
>
|
|
|
- <a-button @click="onDelAll" type="primary" icon="plus">全部删除</a-button>
|
|
|
|
|
- <a-dropdown v-if="selectedRowKeys.length > 0">
|
|
|
|
|
|
|
+ <a-popconfirm
|
|
|
|
|
+ title="确定全部删除吗?"
|
|
|
|
|
+ @confirm="delAll"
|
|
|
|
|
+ >
|
|
|
|
|
+ <a-button :disabled="delLoading" :loading="delLoading" type="primary" icon="stop">全部删除</a-button>
|
|
|
|
|
+ </a-popconfirm>
|
|
|
|
|
+
|
|
|
|
|
+ <a-popconfirm
|
|
|
|
|
+ v-if="selectedRowKeys.length > 0"
|
|
|
|
|
+ title="确定删除吗?"
|
|
|
|
|
+ @confirm="delBatch"
|
|
|
|
|
+ >
|
|
|
|
|
+ <a-button :disabled="delLoading" :loading="delLoading" icon="stop" style="margin-left: 8px">
|
|
|
|
|
+ 批量删除</a-button>
|
|
|
|
|
+ </a-popconfirm>
|
|
|
|
|
+
|
|
|
|
|
+ <!-- <a-dropdown v-if="selectedRowKeys.length > 0">
|
|
|
<a-button style="margin-left: 8px">
|
|
<a-button style="margin-left: 8px">
|
|
|
批量操作 <a-icon type="down"
|
|
批量操作 <a-icon type="down"
|
|
|
/></a-button>
|
|
/></a-button>
|
|
|
- </a-dropdown>
|
|
|
|
|
|
|
+ </a-dropdown> -->
|
|
|
<a-button type="primary" @click="searchQuery" icon="search"
|
|
<a-button type="primary" @click="searchQuery" icon="search"
|
|
|
>查询</a-button
|
|
>查询</a-button
|
|
|
>
|
|
>
|
|
@@ -70,22 +89,26 @@
|
|
|
</a-table>
|
|
</a-table>
|
|
|
</div>
|
|
</div>
|
|
|
<room-num-modal ref="modalForm" @ok="modalFormOk"></room-num-modal>
|
|
<room-num-modal ref="modalForm" @ok="modalFormOk"></room-num-modal>
|
|
|
|
|
+ <room-imgs @saveOk="onImgSave" ref="roomimgmodal"></room-imgs>
|
|
|
</a-card>
|
|
</a-card>
|
|
|
</template>
|
|
</template>
|
|
|
|
|
|
|
|
<script>
|
|
<script>
|
|
|
import { JeecgListMixin } from "@/mixins/JeecgListMixin";
|
|
import { JeecgListMixin } from "@/mixins/JeecgListMixin";
|
|
|
import roomNumModal from "./roomNumModal.vue"; // todo roomLayoutForm 需要替换成房型的表单弹窗
|
|
import roomNumModal from "./roomNumModal.vue"; // todo roomLayoutForm 需要替换成房型的表单弹窗
|
|
|
-
|
|
|
|
|
|
|
+import roomImgs from './roomImagesForm.vue'
|
|
|
import { getAllLayouts } from "@/api/roomLayout";
|
|
import { getAllLayouts } from "@/api/roomLayout";
|
|
|
|
|
+import { delBatch, delAll } from '@/api/roomBuildingApi'
|
|
|
let hotelInfo = JSON.parse(localStorage.getItem("storeInfo"));
|
|
let hotelInfo = JSON.parse(localStorage.getItem("storeInfo"));
|
|
|
export default {
|
|
export default {
|
|
|
mixins: [JeecgListMixin],
|
|
mixins: [JeecgListMixin],
|
|
|
components: {
|
|
components: {
|
|
|
roomNumModal,
|
|
roomNumModal,
|
|
|
|
|
+ roomImgs
|
|
|
},
|
|
},
|
|
|
data() {
|
|
data() {
|
|
|
return {
|
|
return {
|
|
|
|
|
+ delLoading: false,
|
|
|
layouts: [],
|
|
layouts: [],
|
|
|
queryParam: {},
|
|
queryParam: {},
|
|
|
// 分页参数
|
|
// 分页参数
|
|
@@ -151,6 +174,9 @@ export default {
|
|
|
exportXlsUrl: "/rooms/cesRooms/exportXls",
|
|
exportXlsUrl: "/rooms/cesRooms/exportXls",
|
|
|
importExcelUrl: "rooms/cesRooms/importExcel",
|
|
importExcelUrl: "rooms/cesRooms/importExcel",
|
|
|
},
|
|
},
|
|
|
|
|
+ buildingFloorSearchTag: {
|
|
|
|
|
+ name: null
|
|
|
|
|
+ },
|
|
|
dictOptions: {},
|
|
dictOptions: {},
|
|
|
superFieldList: [],
|
|
superFieldList: [],
|
|
|
selectedRowKeys: [],
|
|
selectedRowKeys: [],
|
|
@@ -170,6 +196,32 @@ export default {
|
|
|
});
|
|
});
|
|
|
},
|
|
},
|
|
|
methods: {
|
|
methods: {
|
|
|
|
|
+ onImgSave() {
|
|
|
|
|
+ this.loadData()
|
|
|
|
|
+ },
|
|
|
|
|
+ onFliterClose() {
|
|
|
|
|
+ this.filters['buildId'] = null
|
|
|
|
|
+ this.filters['floorId'] = null
|
|
|
|
|
+ this.ipagination.current = 1
|
|
|
|
|
+ this.buildingFloorSearchTag.name = null
|
|
|
|
|
+ this.loadData()
|
|
|
|
|
+ },
|
|
|
|
|
+ // 搜索
|
|
|
|
|
+ searchParam(id, name, isBuilding) {
|
|
|
|
|
+ this.$set(this.buildingFloorSearchTag,'name',name)
|
|
|
|
|
+ if(isBuilding) {
|
|
|
|
|
+ this.filters['buildId'] = id
|
|
|
|
|
+ if(this.filters['floorId']) {
|
|
|
|
|
+ delete this.filters.floorId
|
|
|
|
|
+ }
|
|
|
|
|
+ } else {
|
|
|
|
|
+ this.filters['floorId'] = id
|
|
|
|
|
+ if(this.filters['buildId']) {
|
|
|
|
|
+ delete this.filters.buildId
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
|
|
+ this.loadData()
|
|
|
|
|
+ },
|
|
|
getLayoutName(row) {
|
|
getLayoutName(row) {
|
|
|
let i = this.layouts.findIndex((s) => s.id == row.layoutId);
|
|
let i = this.layouts.findIndex((s) => s.id == row.layoutId);
|
|
|
if (i > -1) {
|
|
if (i > -1) {
|
|
@@ -177,6 +229,40 @@ export default {
|
|
|
}
|
|
}
|
|
|
return "";
|
|
return "";
|
|
|
},
|
|
},
|
|
|
|
|
+ // 批量删除
|
|
|
|
|
+ delBatch() {
|
|
|
|
|
+ let hotelInfo = JSON.parse(localStorage.getItem('storeInfo'))
|
|
|
|
|
+ let keys = this.selectedRowKeys
|
|
|
|
|
+ this.delLoading = true
|
|
|
|
|
+ delBatch({
|
|
|
|
|
+ hotelId: hotelInfo.id,
|
|
|
|
|
+ idStr: keys.toString()
|
|
|
|
|
+ }).then(res => {
|
|
|
|
|
+ if(res.code == 200) {
|
|
|
|
|
+ this.selectedRowKeys = []
|
|
|
|
|
+ this.$message.success('删除成功');
|
|
|
|
|
+ this.loadData()
|
|
|
|
|
+ }
|
|
|
|
|
+ }).finally(_ => {
|
|
|
|
|
+ this.delLoading = false
|
|
|
|
|
+ })
|
|
|
|
|
+ },
|
|
|
|
|
+ // 删除所有
|
|
|
|
|
+ delAll() {
|
|
|
|
|
+ let hotelInfo = JSON.parse(localStorage.getItem('storeInfo'))
|
|
|
|
|
+ this.delLoading = true
|
|
|
|
|
+ delAll({
|
|
|
|
|
+ hotelId: hotelInfo.id,
|
|
|
|
|
+ }).then(res => {
|
|
|
|
|
+ if(res.code == 200) {
|
|
|
|
|
+ this.selectedRowKeys = []
|
|
|
|
|
+ this.$message.success('全部删除成功');
|
|
|
|
|
+ this.loadData()
|
|
|
|
|
+ }
|
|
|
|
|
+ }).finally(_ => {
|
|
|
|
|
+ this.delLoading = false
|
|
|
|
|
+ })
|
|
|
|
|
+ },
|
|
|
// 批量添加按钮
|
|
// 批量添加按钮
|
|
|
onAddBatch() {
|
|
onAddBatch() {
|
|
|
this.$router.push('/tenant/gen/rooms');
|
|
this.$router.push('/tenant/gen/rooms');
|
|
@@ -185,7 +271,7 @@ export default {
|
|
|
onDelAll() {},
|
|
onDelAll() {},
|
|
|
// 显示图片弹窗
|
|
// 显示图片弹窗
|
|
|
handleImage(row) {
|
|
handleImage(row) {
|
|
|
-
|
|
|
|
|
|
|
+ this.$refs.roomimgmodal.setModel(row)
|
|
|
},
|
|
},
|
|
|
onSaveOk() {
|
|
onSaveOk() {
|
|
|
this.loadData();
|
|
this.loadData();
|