|
|
@@ -31,34 +31,16 @@
|
|
|
|
|
|
<!-- table区域-begin -->
|
|
|
<div class="grid-clear">
|
|
|
- <a-table ref="table" size="middle" :scroll="{ x: true }" bordered rowKey="id" :columns="columns" :dataSource="dataSource" :pagination="false" :loading="loading" :rowSelection="{
|
|
|
- selectedRowKeys: selectedRowKeys,
|
|
|
- onChange: onSelectChange,
|
|
|
- }" class="j-table-force-nowrap" @change="handleTableChange">
|
|
|
+ <a-table ref="table" size="middle" bordered rowKey="id" :columns="columns" :dataSource="dataSource" :pagination="ipagination" :loading="loading" class="j-table-force-nowrap" @change="handleTableChange">
|
|
|
|
|
|
- <template slot="layoutId" slot-scope="text, record">
|
|
|
- {{ getLayoutName(record) }}
|
|
|
- </template>
|
|
|
- <template slot="prefix_name" slot-scope="text, record">
|
|
|
- {{ (record.prefix || "") + record.name }}
|
|
|
- </template>
|
|
|
- <template slot="pictureSlot" slot-scope="text, record">
|
|
|
- <img :src="record.cover" style="width:40px;height40px;" />
|
|
|
- </template>
|
|
|
- <template slot="htmlSlot" slot-scope="text">
|
|
|
- <div v-html="text"></div>
|
|
|
- </template>
|
|
|
+ <template slot="footer" v-if="dataList.length>0">
|
|
|
+ <div class="tableData">
|
|
|
|
|
|
- <span slot="action" slot-scope="text, record">
|
|
|
- <a @click="handleEdit(record)">编辑</a>
|
|
|
+ </div>
|
|
|
+ <a-table size="middle" bordered :showHeader="false" :pagination="false" :columns="columns" :dataSource="dataList">
|
|
|
|
|
|
- <a-divider type="vertical" />
|
|
|
- <a-popconfirm title="确定删除吗?" @confirm="() => handleDelete(record.id)">
|
|
|
- <a>删除</a>
|
|
|
- </a-popconfirm>
|
|
|
- <a-divider type="vertical" />
|
|
|
- <a @click="handleImage(record)">图片</a>
|
|
|
- </span>
|
|
|
+ </a-table>
|
|
|
+ </template>
|
|
|
</a-table>
|
|
|
<a-card>
|
|
|
<a-checkbox-group @change="onChange">
|
|
|
@@ -112,13 +94,31 @@ export default {
|
|
|
// roomNumModal,
|
|
|
// roomImgs
|
|
|
},
|
|
|
+ computed:{
|
|
|
+ dataList(){
|
|
|
+ if (this.dataSource.length === 0) {
|
|
|
+ return []
|
|
|
+ }
|
|
|
+ let keyArr = Object.keys(this.dataSource[0])
|
|
|
+ keyArr = keyArr.filter(item=>item!=='waiter_name')
|
|
|
+ let obj = {}
|
|
|
+ keyArr.forEach(item=>{
|
|
|
+ obj[item] = this.dataSource.reduce((pre, cur)=> pre + cur[item], 0)
|
|
|
+ })
|
|
|
+ obj.waiter_name = '合计'
|
|
|
+ return [obj]
|
|
|
+ }
|
|
|
+ },
|
|
|
data() {
|
|
|
return {
|
|
|
list: ['今天', '昨日', '本周', '本月', '更多'],
|
|
|
activeIndex: 0,
|
|
|
delLoading: false,
|
|
|
layouts: [],
|
|
|
- queryParam: {},
|
|
|
+ queryParam: {
|
|
|
+ startTime: new Date().toLocaleString().substring(0, 10).replace(/\//g, "-"),
|
|
|
+ endTime: new Date(new Date().getTime() + 24*60*60*1000).toLocaleString().substring(0, 10).replace(/\//g, "-"),
|
|
|
+ },
|
|
|
// 分页参数
|
|
|
ipagination: {
|
|
|
current: 1,
|
|
|
@@ -135,65 +135,72 @@ export default {
|
|
|
columns: [{
|
|
|
title: "房屋人员",
|
|
|
align: "center",
|
|
|
- dataIndex: "waiterName",
|
|
|
+ dataIndex: "waiter_name",
|
|
|
+ width: 180,
|
|
|
},
|
|
|
{
|
|
|
title: "退房",
|
|
|
// align: "center",
|
|
|
- dataIndex: "buildName",
|
|
|
+ dataIndex: "tf_num",
|
|
|
+ width: 120,
|
|
|
children: [{
|
|
|
title: '脏房数',
|
|
|
- dataIndex: 'buildName',
|
|
|
+ dataIndex: 'tf_num',
|
|
|
// key: 'companyAddress',
|
|
|
- // width: 200,
|
|
|
+ width: 120,
|
|
|
}],
|
|
|
},
|
|
|
{
|
|
|
title: "续房",
|
|
|
// align: "center",
|
|
|
- dataIndex: "floorName",
|
|
|
+ dataIndex: "xf_num",
|
|
|
+ width: 120,
|
|
|
children: [{
|
|
|
title: '脏房',
|
|
|
- dataIndex: 'floorName',
|
|
|
+ dataIndex: 'xf_num',
|
|
|
// key: 'companyAddress',
|
|
|
- // width: 200,
|
|
|
+ width: 120,
|
|
|
}],
|
|
|
},
|
|
|
{
|
|
|
title: "钟点",
|
|
|
- align: "center",
|
|
|
- dataIndex: "layoutId",
|
|
|
- scopedSlots: {
|
|
|
- customRender: "layoutId"
|
|
|
- },
|
|
|
+ // align: "center",
|
|
|
+ dataIndex: "zd_num",
|
|
|
+ width: 120,
|
|
|
+ // scopedSlots: {
|
|
|
+ // customRender: "layoutId"
|
|
|
+ // },
|
|
|
},
|
|
|
{
|
|
|
title: "特脏",
|
|
|
- align: "center",
|
|
|
- dataIndex: "name",
|
|
|
- scopedSlots: {
|
|
|
- customRender: ""
|
|
|
- },
|
|
|
+ // align: "center",
|
|
|
+ dataIndex: "",
|
|
|
+ width: 120,
|
|
|
+ // scopedSlots: {
|
|
|
+ // customRender: ""
|
|
|
+ // },
|
|
|
},
|
|
|
{
|
|
|
title: "合计房间数",
|
|
|
- align: "center",
|
|
|
- dataIndex: "createAt",
|
|
|
+ // align: "center",
|
|
|
+ dataIndex: "count",
|
|
|
+ width: 120,
|
|
|
},
|
|
|
{
|
|
|
title: "提成金额",
|
|
|
- dataIndex: "action",
|
|
|
- align: "center",
|
|
|
- fixed: "right",
|
|
|
- width: 147,
|
|
|
- scopedSlots: {
|
|
|
- customRender: "action"
|
|
|
- },
|
|
|
+ dataIndex: "tc_money",
|
|
|
+ // align: "center",
|
|
|
+ width: 120,
|
|
|
+ // fixed: "right",
|
|
|
+ // width: 147,
|
|
|
+ // scopedSlots: {
|
|
|
+ // customRender: "action"
|
|
|
+ // },
|
|
|
},
|
|
|
],
|
|
|
url: {
|
|
|
// list: 'org.jeecg.modules.business/busMarketMember/list',
|
|
|
- list: "/fw/fwRoomClean/list",
|
|
|
+ list: "/fw/fwRoomClean/roomCleanSummary",
|
|
|
delete: "/rooms/cesRooms/remove",
|
|
|
deleteBatch: "/rooms/cesRooms/deleteBatch",
|
|
|
exportXlsUrl: "/rooms/cesRooms/exportXls",
|
|
|
@@ -303,14 +310,57 @@ export default {
|
|
|
},
|
|
|
handleClick(index) {
|
|
|
this.activeIndex = index
|
|
|
+ if (index == 4) {
|
|
|
+ return
|
|
|
+ }
|
|
|
+ this.queryParam.startTime = this.getTime(index).startTime
|
|
|
+ this.queryParam.endTime = this.getTime(index).endTime
|
|
|
this.searchQuery()
|
|
|
},
|
|
|
+ getTime(type) {
|
|
|
+ let startTime;
|
|
|
+ let endTime;
|
|
|
+ let now = new Date(); //当前日期
|
|
|
+ let nowDayOfWeek = now.getDay(); //今天本周的第几天
|
|
|
+ let nowDay = now.getDate(); //当前日
|
|
|
+ let nowMonth = now.getMonth(); //当前月
|
|
|
+ let nowYear = now.getFullYear(); //当前年
|
|
|
+ let jd=Math.ceil((nowMonth + 1) / 3)
|
|
|
+ if (type == 0) {
|
|
|
+ startTime = new Date().toLocaleString().substring(0, 10)
|
|
|
+ endTime = new Date(new Date().getTime() + 24 * 60 * 60 * 1000).toLocaleString().substring(0, 10)
|
|
|
+ }
|
|
|
+ if (type == 1) {
|
|
|
+ startTime = new Date(new Date().getTime() - 24 * 60 * 60 * 1000 * 2).toLocaleString().substring(0, 10)
|
|
|
+ endTime = new Date(new Date().getTime() - 24 * 60 * 60 * 1000).toLocaleString().substring(0, 10)
|
|
|
+ }
|
|
|
+ if(type == 2){
|
|
|
+ startTime = new Date(nowYear, nowMonth, nowDay - nowDayOfWeek+1).toLocaleString().substring(0, 10)
|
|
|
+ endTime = new Date(nowYear, nowMonth, nowDay + 6 - nowDayOfWeek+1).toLocaleString().substring(0, 10)
|
|
|
+ }
|
|
|
+ if (type==3) {
|
|
|
+ startTime = new Date(nowYear, nowMonth, 1).toLocaleString().substring(0, 9)
|
|
|
+ endTime = new Date(nowYear, nowMonth + 1, 0).toLocaleString().substring(0, 10)
|
|
|
+ }
|
|
|
+
|
|
|
+ return {
|
|
|
+ startTime: startTime.replace(/\//g, '-'),
|
|
|
+ endTime: endTime.replace(/\//g, '-')
|
|
|
+ }
|
|
|
+ // return {
|
|
|
+ // startTime,
|
|
|
+ // endTime
|
|
|
+ // }
|
|
|
+ },
|
|
|
onChange(checkedValues) {
|
|
|
console.log('checked = ', checkedValues)
|
|
|
},
|
|
|
//选择日期
|
|
|
onChangeTime(date, dateString) {
|
|
|
console.log(date, dateString)
|
|
|
+ this.queryParam.startTime = dateString[0]
|
|
|
+ this.queryParam.endTime = dateString[1]
|
|
|
+ this.searchQuery()
|
|
|
},
|
|
|
},
|
|
|
};
|
|
|
@@ -343,7 +393,31 @@ export default {
|
|
|
|
|
|
.grid-clear {
|
|
|
display: grid;
|
|
|
- grid-template-columns: 2fr 1fr;
|
|
|
+ grid-template-columns: 1.5fr 1fr;
|
|
|
grid-gap: 10px;
|
|
|
}
|
|
|
+/deep/ .ant-table-content .ant-table-body {
|
|
|
+ position: relative;
|
|
|
+ z-index: 2;
|
|
|
+ background: #FFFFFF;
|
|
|
+}
|
|
|
+
|
|
|
+/deep/ .ant-table-footer .ant-table-body {
|
|
|
+ overflow: hidden !important;
|
|
|
+ position: relative !important;
|
|
|
+ z-index: 1 !important;
|
|
|
+}
|
|
|
+
|
|
|
+/deep/ .ant-table-content>.ant-table-footer {
|
|
|
+ padding: 0 !important;
|
|
|
+ top: 0px;
|
|
|
+ position: relative;
|
|
|
+ z-index: 0;
|
|
|
+}
|
|
|
+/deep/.ant-table-footer{
|
|
|
+ padding: 0 !important;
|
|
|
+ top: -8px;
|
|
|
+ position: relative;
|
|
|
+ z-index: 2;
|
|
|
+}
|
|
|
</style>
|