|
|
@@ -8,10 +8,10 @@
|
|
|
{{ buildingFloorSearchTag.name }}
|
|
|
<a-icon type="close" @click="onFliterClose" />
|
|
|
</a-tag>
|
|
|
- <div style="display:flex;align-items:center;width:100%;">
|
|
|
- <div class="list-container">
|
|
|
- <div class="list-item" v-for="(item, index) in list" :key="index" :class="{active: activeIndex === index}" @click="handleClick(index)">
|
|
|
- {{ item }}
|
|
|
+ <div style="">
|
|
|
+ <div class="list-container-1">
|
|
|
+ <div class="list-item" v-for="(item, index) in layouts" :key="index" :class="{active: activeIndex === index}" @click="handleClick(item, index)">
|
|
|
+ {{ item.name }}
|
|
|
</div>
|
|
|
</div>
|
|
|
</div>
|
|
|
@@ -19,42 +19,41 @@
|
|
|
|
|
|
<!-- table区域-begin -->
|
|
|
<div class="grid-clear">
|
|
|
- <a-table ref="table" size="middle" bordered rowKey="id" :columns="columns" :dataSource="[1]" :pagination="false" :loading="loading" :rowSelection="{
|
|
|
- selectedRowKeys: selectedRowKeys,
|
|
|
- onChange: onSelectChange,
|
|
|
- }" class="j-table-force-nowrap" @change="handleTableChange">
|
|
|
- <template slot="houseType">
|
|
|
+ <a-table ref="table" size="middle" bordered rowKey="id" :columns="columns" :dataSource="[layouts[activeIndex]]" :pagination="false" :loading="loading" class="j-table-force-nowrap" @change="handleTableChange">
|
|
|
+ <template slot="houseType" v-if="layouts.length>0">
|
|
|
<div>
|
|
|
- {{list[activeIndex]}}
|
|
|
+ {{layouts[activeIndex].name}}
|
|
|
</div>
|
|
|
</template>
|
|
|
<template slot="continueConsume" slot-scope="text, record">
|
|
|
- <div class="flex" style="margin-bottom:10px;">
|
|
|
- <div>一次性牙刷(套)</div> <a-input-number :min="0" :max="1000" :step="1" />
|
|
|
- </div>
|
|
|
- <div class="flex">
|
|
|
- <div>一次性香皂(个)</div><a-input-number :min="0" :max="1000" :step="1" />
|
|
|
+ <div class="flex" style="margin-bottom:10px;" v-for="(item, index) in xfData.filter(item => item.type == 1)" :key="index">
|
|
|
+ <div>{{item.goodName}}</div>
|
|
|
+ <a-input-number v-model="item.num" :min="0" :max="1000" :step="1" />
|
|
|
</div>
|
|
|
+ <!-- <div class="flex">
|
|
|
+ <div>一次性香皂(个)</div>
|
|
|
+ <a-input-number :min="0" :max="1000" :step="1" />
|
|
|
+ </div> -->
|
|
|
</template>
|
|
|
<template slot="Linen" slot-scope="text, record">
|
|
|
- <div class="flex">
|
|
|
- <div>床单(张)</div><a-input-number :min="0" :max="1000" :step="1" />
|
|
|
+ <div class="flex" style="margin-bottom:10px;" v-for="(item, index) in xfData.filter(item => item.type == 2)" :key="index">
|
|
|
+ <div>{{item.goodName}}</div>
|
|
|
+ <a-input-number v-model="item.num" :min="0" :max="1000" :step="1" />
|
|
|
</div>
|
|
|
</template>
|
|
|
<template slot="outConsume">
|
|
|
- <div class="flex" style="margin-bottom:10px;">
|
|
|
- <div>一次性牙刷(套)</div> <a-input-number :min="0" :max="1000" :step="1" />
|
|
|
- </div>
|
|
|
- <div class="flex">
|
|
|
- <div>一次性香皂(个)</div><a-input-number :min="0" :max="1000" :step="1" />
|
|
|
+ <div class="flex" style="margin-bottom:10px;" v-for="(item, index) in tfData.filter(item => item.type == 1)" :key="index">
|
|
|
+ <div>{{item.goodName}}</div>
|
|
|
+ <a-input-number v-model="item.num" :min="0" :max="1000" :step="1" />
|
|
|
</div>
|
|
|
</template>
|
|
|
<template slot="outLinen">
|
|
|
- <div class="flex">
|
|
|
- <div>床单(张)</div><a-input-number :min="0" :max="1000" :step="1" />
|
|
|
+ <div class="flex" style="margin-bottom:10px;" v-for="(item, index) in tfData.filter(item => item.type == 2)" :key="index">
|
|
|
+ <div>{{item.goodName}}</div>
|
|
|
+ <a-input-number v-model="item.num" :min="0" :max="1000" :step="1" />
|
|
|
</div>
|
|
|
</template>
|
|
|
- <span slot="action" slot-scope="text, record">
|
|
|
+ <!-- <span slot="action" slot-scope="text, record">
|
|
|
<a @click="handleEdit(record)">编辑</a>
|
|
|
|
|
|
<a-divider type="vertical" />
|
|
|
@@ -63,7 +62,7 @@
|
|
|
</a-popconfirm>
|
|
|
<a-divider type="vertical" />
|
|
|
<a @click="handleImage(record)">图片</a>
|
|
|
- </span>
|
|
|
+ </span> -->
|
|
|
</a-table>
|
|
|
</div>
|
|
|
<!-- <room-num-modal ref="modalForm" @ok="modalFormOk"></room-num-modal> -->
|
|
|
@@ -84,6 +83,17 @@ import {
|
|
|
delBatch,
|
|
|
delAll
|
|
|
} from '@/api/roomBuildingApi'
|
|
|
+
|
|
|
+import {
|
|
|
+ deleteAction,
|
|
|
+ getAction,
|
|
|
+ downFile,
|
|
|
+ getFileAccessHttpUrl
|
|
|
+} from '@/api/manage'
|
|
|
+import {
|
|
|
+ postAction
|
|
|
+} from '../../../api/manage';
|
|
|
+
|
|
|
let hotelInfo = JSON.parse(localStorage.getItem("storeInfo"));
|
|
|
export default {
|
|
|
mixins: [JeecgListMixin],
|
|
|
@@ -93,11 +103,13 @@ export default {
|
|
|
},
|
|
|
data() {
|
|
|
return {
|
|
|
- list: ['零压双床房', '零压大床房', '休闲家庭房', '特价房', '豪华大床套房','豪华麻将房','单间'],
|
|
|
+ list: [],
|
|
|
activeIndex: 0,
|
|
|
delLoading: false,
|
|
|
layouts: [],
|
|
|
- queryParam: {},
|
|
|
+ queryParam: {
|
|
|
+ roomLayoutId: '',
|
|
|
+ },
|
|
|
// 分页参数
|
|
|
ipagination: {
|
|
|
current: 1,
|
|
|
@@ -114,7 +126,7 @@ export default {
|
|
|
columns: [{
|
|
|
title: "房型",
|
|
|
align: "center",
|
|
|
- width:150,
|
|
|
+ width: 150,
|
|
|
scopedSlots: {
|
|
|
customRender: "houseType"
|
|
|
},
|
|
|
@@ -125,51 +137,53 @@ export default {
|
|
|
// align: "center",
|
|
|
// dataIndex: "floorName",
|
|
|
children: [{
|
|
|
- title: '客房易耗品',
|
|
|
- dataIndex: 'continueConsume',
|
|
|
- // key: 'companyAddress',
|
|
|
- width: 200,
|
|
|
- scopedSlots: {
|
|
|
- customRender: "continueConsume"
|
|
|
- },
|
|
|
- },
|
|
|
- {
|
|
|
- title: '布草',
|
|
|
- dataIndex: 'Linen',
|
|
|
- // key: 'companyAddress',
|
|
|
- width: 200,
|
|
|
- scopedSlots: {
|
|
|
- customRender: "Linen"
|
|
|
+ title: '客房易耗品',
|
|
|
+ // dataIndex: 'continueConsume',
|
|
|
+ // key: 'companyAddress',
|
|
|
+ width: 200,
|
|
|
+ scopedSlots: {
|
|
|
+ customRender: "continueConsume"
|
|
|
+ },
|
|
|
},
|
|
|
- }],
|
|
|
+ {
|
|
|
+ title: '布草',
|
|
|
+ // dataIndex: 'Linen',
|
|
|
+ // key: 'companyAddress',
|
|
|
+ width: 200,
|
|
|
+ scopedSlots: {
|
|
|
+ customRender: "Linen"
|
|
|
+ },
|
|
|
+ }
|
|
|
+ ],
|
|
|
},
|
|
|
{
|
|
|
title: "退房",
|
|
|
// align: "center",
|
|
|
// dataIndex: "buildName",
|
|
|
children: [{
|
|
|
- title: '客房易耗品',
|
|
|
- dataIndex: 'outConsume',
|
|
|
- // key: 'companyAddress',
|
|
|
- width: 200,
|
|
|
- scopedSlots: {
|
|
|
- customRender: "outConsume"
|
|
|
+ title: '客房易耗品',
|
|
|
+ // dataIndex: 'outConsume',
|
|
|
+ // key: 'companyAddress',
|
|
|
+ width: 200,
|
|
|
+ scopedSlots: {
|
|
|
+ customRender: "outConsume"
|
|
|
+ },
|
|
|
},
|
|
|
- },
|
|
|
- {
|
|
|
- title: '布草',
|
|
|
- // dataIndex: 'buildName',
|
|
|
- // key: 'companyAddress',
|
|
|
- width: 200,
|
|
|
- scopedSlots: {
|
|
|
- customRender: "outLinen"
|
|
|
- },
|
|
|
- }],
|
|
|
+ {
|
|
|
+ title: '布草',
|
|
|
+ // dataIndex: 'buildName',
|
|
|
+ // key: 'companyAddress',
|
|
|
+ width: 200,
|
|
|
+ scopedSlots: {
|
|
|
+ customRender: "outLinen"
|
|
|
+ },
|
|
|
+ }
|
|
|
+ ],
|
|
|
}
|
|
|
],
|
|
|
url: {
|
|
|
// list: 'org.jeecg.modules.business/busMarketMember/list',
|
|
|
- list: "/rooms/cesRooms/list",
|
|
|
+ list: "/fw/fwRoomLayoutInConsumable/layoutInConsumableList",
|
|
|
delete: "/rooms/cesRooms/remove",
|
|
|
deleteBatch: "/rooms/cesRooms/deleteBatch",
|
|
|
exportXlsUrl: "/rooms/cesRooms/exportXls",
|
|
|
@@ -185,6 +199,8 @@ export default {
|
|
|
column: "createTime",
|
|
|
order: "desc",
|
|
|
},
|
|
|
+ xfData: [],
|
|
|
+ tfData: [],
|
|
|
};
|
|
|
},
|
|
|
created() {
|
|
|
@@ -192,7 +208,12 @@ export default {
|
|
|
getAllLayouts().then((res) => {
|
|
|
if (res.code == 200) {
|
|
|
this.layouts = res.result.records;
|
|
|
- this.loadData();
|
|
|
+ this.layouts.forEach(ele => {
|
|
|
+ ele.children = []
|
|
|
+ })
|
|
|
+ this.queryParam.roomLayoutId = this.layouts[0].id;
|
|
|
+ this.loadData(0, 1);
|
|
|
+ this.loadData(0, 2);
|
|
|
}
|
|
|
});
|
|
|
},
|
|
|
@@ -277,9 +298,14 @@ export default {
|
|
|
onSaveOk() {
|
|
|
this.loadData();
|
|
|
},
|
|
|
- handleClick(index) {
|
|
|
+ handleClick(item, index) {
|
|
|
this.activeIndex = index
|
|
|
- this.searchQuery()
|
|
|
+ this.queryParam.roomLayoutId = item.id
|
|
|
+ this.loadData(0, 1);
|
|
|
+ setTimeout(() => {
|
|
|
+ this.loadData(0, 2);
|
|
|
+ }, 1000);
|
|
|
+ // this.searchQuery()
|
|
|
},
|
|
|
onChange(checkedValues) {
|
|
|
console.log('checked = ', checkedValues)
|
|
|
@@ -288,6 +314,86 @@ export default {
|
|
|
onChangeTime(date, dateString) {
|
|
|
console.log(date, dateString)
|
|
|
},
|
|
|
+ loadData(arg, type) {
|
|
|
+ if (this.url.list == 2) {
|
|
|
+ return
|
|
|
+ }
|
|
|
+ if (this.layouts.length == 0) {
|
|
|
+ return
|
|
|
+ }
|
|
|
+ if (!this.url.list) {
|
|
|
+ this.$message.error("请设置url.list属性!")
|
|
|
+ return
|
|
|
+ }
|
|
|
+ //加载数据 若传入参数1则加载第一页的内容
|
|
|
+ if (arg === 1) {
|
|
|
+ this.ipagination.current = 1;
|
|
|
+ }
|
|
|
+ var params = this.getQueryParams(); //查询条件
|
|
|
+ if (type) {
|
|
|
+ params.type = type
|
|
|
+ }
|
|
|
+ this.loading = true;
|
|
|
+ getAction(this.url.list, params).then((res) => {
|
|
|
+ if (res.success) {
|
|
|
+ //update-begin---author:zhangyafei Date:20201118 for:适配不分页的数据列表------------
|
|
|
+ this.dataSource = res.result.records || res.result;
|
|
|
+ if (type == 1) {
|
|
|
+ this.xfData = res.result.records || res.result;
|
|
|
+ } else if (type == 2) {
|
|
|
+ this.tfData = res.result.records || res.result;
|
|
|
+ }
|
|
|
+ if (res.result.total) {
|
|
|
+ this.ipagination.total = res.result.total;
|
|
|
+ } else {
|
|
|
+ this.ipagination.total = 0;
|
|
|
+ }
|
|
|
+ //update-end---author:zhangyafei Date:20201118 for:适配不分页的数据列表------------
|
|
|
+ } else {
|
|
|
+ this.$message.warning(res.message)
|
|
|
+ }
|
|
|
+ }).finally(() => {
|
|
|
+ this.loading = false
|
|
|
+ })
|
|
|
+ },
|
|
|
+ submitForm() {
|
|
|
+ if (this.xfData.length == 0 && this.tfData.length == 0) {
|
|
|
+ this.$message.error("未获取到数据!")
|
|
|
+ return
|
|
|
+ }
|
|
|
+ if (this.xfData.length > 0) {
|
|
|
+
|
|
|
+ this.xfData.forEach(ele => {
|
|
|
+ ele.roomLayoutId = this.layouts[this.activeIndex].id
|
|
|
+ })
|
|
|
+
|
|
|
+ postAction('/fw/fwRoomLayoutInConsumable/layoutInConsumableSave', this.xfData).then((res) => {
|
|
|
+ if (res.success) {
|
|
|
+ // this.$message.success("保存成功!")
|
|
|
+ this.$emit('ok')
|
|
|
+ } else {
|
|
|
+ this.$message.warning(res.message)
|
|
|
+ }
|
|
|
+ }).finally(() => {
|
|
|
+
|
|
|
+ })
|
|
|
+ }
|
|
|
+ if (this.tfData.length > 0) {
|
|
|
+ this.tfData.forEach(ele => {
|
|
|
+ ele.roomLayoutId = this.layouts[this.activeIndex].id
|
|
|
+ })
|
|
|
+ postAction('/fw/fwRoomLayoutInConsumable/layoutInConsumableSave', this.tfData).then((res) => {
|
|
|
+ if (res.success) {
|
|
|
+ this.$message.success("保存成功!")
|
|
|
+ this.$emit('ok')
|
|
|
+ } else {
|
|
|
+ this.$message.warning(res.message)
|
|
|
+ }
|
|
|
+ }).finally(() => {
|
|
|
+
|
|
|
+ })
|
|
|
+ }
|
|
|
+ },
|
|
|
},
|
|
|
};
|
|
|
</script>
|
|
|
@@ -295,16 +401,13 @@ export default {
|
|
|
<style scoped>
|
|
|
@import "~@assets/less/common.less";
|
|
|
|
|
|
-.list-container {
|
|
|
- display: grid;
|
|
|
- grid-template-columns: 1fr 1fr 1fr 1fr 1fr 1fr 1fr;
|
|
|
- border: solid 1px #d9d9d9;
|
|
|
- width: 70%;
|
|
|
- border-radius: 5px;
|
|
|
- /* margin-bottom: 20px; */
|
|
|
- margin-right: 10px;
|
|
|
+.list-container-1 {
|
|
|
+ display: flex;
|
|
|
+ /* margin-right: 10px; */
|
|
|
+ width: 100%;
|
|
|
}
|
|
|
-.flex{
|
|
|
+
|
|
|
+.flex {
|
|
|
display: flex;
|
|
|
align-items: center;
|
|
|
justify-content: space-between;
|
|
|
@@ -312,9 +415,13 @@ export default {
|
|
|
|
|
|
.list-item {
|
|
|
padding: 10px;
|
|
|
- border-right: solid 1px #d9d9d9;
|
|
|
+ border: solid 1px #d9d9d9;
|
|
|
cursor: pointer;
|
|
|
text-align: center;
|
|
|
+ border-radius: 5px;
|
|
|
+ margin-right: 20px;
|
|
|
+ /* width:60px */
|
|
|
+ width: 100px;
|
|
|
}
|
|
|
|
|
|
.list-item.active {
|