|
@@ -3,21 +3,24 @@
|
|
|
<div style="background:#fff">
|
|
<div style="background:#fff">
|
|
|
<div class="home-box">
|
|
<div class="home-box">
|
|
|
<div class="select-top">
|
|
<div class="select-top">
|
|
|
- <uni-data-select style="width:auto;border: none;flex: none;" :clear="false" v-model="hotelIds" :localdata="range" @change="change"></uni-data-select>
|
|
|
|
|
|
|
+ <uni-data-select style="border: none;flex: none;" iconColor="#FFF" :clear="false" v-model="hotelIds" :localdata="range" @change="change"></uni-data-select>
|
|
|
</div>
|
|
</div>
|
|
|
|
|
+ <div class="grid-data">
|
|
|
|
|
+ <div>
|
|
|
|
|
+ <div>今日总收款/元</div>
|
|
|
|
|
+ <div style="font-size: 18px;">{{todayTotalIncome}}</div>
|
|
|
|
|
+ </div>
|
|
|
|
|
+ <div>
|
|
|
|
|
+ <div>在住/空置</div>
|
|
|
|
|
+ <div style="font-size: 18px;">{{roomData.checkInRoomData}}/{{roomData.allRoomData - roomData.checkInRoomData}}</div>
|
|
|
|
|
+ </div>
|
|
|
|
|
+ <div>
|
|
|
|
|
+ <div>入住率</div>
|
|
|
|
|
+ <div style="font-size: 18px;">{{(((roomData.checkInRoomData/roomData.allRoomData) || 0)*100).toFixed(2)}}%</div>
|
|
|
|
|
+ </div>
|
|
|
|
|
+ </div>
|
|
|
<div class="grid-data">
|
|
<div class="grid-data">
|
|
|
- <div>
|
|
|
|
|
- <div>今日总收款/元</div>
|
|
|
|
|
- <div style="font-size: 18px;">{{todayTotalIncome}}</div>
|
|
|
|
|
- </div>
|
|
|
|
|
- <div>
|
|
|
|
|
- <div>在住/空置</div>
|
|
|
|
|
- <div style="font-size: 18px;">{{roomData.checkInRoomData}}/{{roomData.allRoomData - roomData.checkInRoomData}}</div>
|
|
|
|
|
- </div>
|
|
|
|
|
- <div>
|
|
|
|
|
- <div>入住率</div>
|
|
|
|
|
- <div style="font-size: 18px;">{{((roomData.checkInRoomData/roomData.allRoomData) || 0).toFixed(2)}}%</div>
|
|
|
|
|
- </div>
|
|
|
|
|
|
|
+
|
|
|
<div>
|
|
<div>
|
|
|
<div>今日总收入/元</div>
|
|
<div>今日总收入/元</div>
|
|
|
<div style="font-size: 18px;">{{todayIncome.reduce((pre, cur) => pre+cur.amount,0 ) || 0}}</div>
|
|
<div style="font-size: 18px;">{{todayIncome.reduce((pre, cur) => pre+cur.amount,0 ) || 0}}</div>
|
|
@@ -59,7 +62,7 @@
|
|
|
<div class="grid-tabbar">
|
|
<div class="grid-tabbar">
|
|
|
<div v-for="(item, index) in tabbarList" @click="handleToPage(item)" :key="index" style="display:flex;flex-direction:column;align-items:center">
|
|
<div v-for="(item, index) in tabbarList" @click="handleToPage(item)" :key="index" style="display:flex;flex-direction:column;align-items:center">
|
|
|
<image :src="item.icon" style="width:30px;height:30px;" />
|
|
<image :src="item.icon" style="width:30px;height:30px;" />
|
|
|
- <div>{{item.name}}</div>
|
|
|
|
|
|
|
+ <div class="tbr-name">{{item.name}}</div>
|
|
|
</div>
|
|
</div>
|
|
|
</div>
|
|
</div>
|
|
|
<div class="notice">
|
|
<div class="notice">
|
|
@@ -432,10 +435,11 @@ export default {
|
|
|
},
|
|
},
|
|
|
async mounted() {
|
|
async mounted() {
|
|
|
// this.onload()
|
|
// this.onload()
|
|
|
- await this.getHotel();
|
|
|
|
|
- this.onload()
|
|
|
|
|
-
|
|
|
|
|
},
|
|
},
|
|
|
|
|
+ onShow() {
|
|
|
|
|
+ this.getHotel();
|
|
|
|
|
+
|
|
|
|
|
+ },
|
|
|
methods: {
|
|
methods: {
|
|
|
//获取酒店数据
|
|
//获取酒店数据
|
|
|
async getHotel() {
|
|
async getHotel() {
|
|
@@ -443,18 +447,25 @@ export default {
|
|
|
if (data.code == 200) {
|
|
if (data.code == 200) {
|
|
|
this.$nextTick(() => {
|
|
this.$nextTick(() => {
|
|
|
this.$store.commit('setHotelIdList', data.result.records)
|
|
this.$store.commit('setHotelIdList', data.result.records)
|
|
|
- this.hotelIds = data.result.records[0].id
|
|
|
|
|
- this.$store.commit('setHotelId', data.result.records[0].id)
|
|
|
|
|
|
|
+ let cacheStore = uni.getStorageSync("hotelInfo")
|
|
|
|
|
+ if(cacheStore) {
|
|
|
|
|
+ this.hotelIds = cacheStore.id
|
|
|
|
|
+ this.$store.commit('setHotelId', cacheStore.id)
|
|
|
|
|
+ } else {
|
|
|
|
|
+ this.hotelIds = data.result.records[0].id
|
|
|
|
|
+ uni.setStorageSync("hotelInfo",data.result.records[0])
|
|
|
|
|
+ this.$store.commit('setHotelId', data.result.records[0].id)
|
|
|
|
|
+ }
|
|
|
|
|
+ this.onload()
|
|
|
})
|
|
})
|
|
|
}
|
|
}
|
|
|
return data
|
|
return data
|
|
|
},
|
|
},
|
|
|
onload() {
|
|
onload() {
|
|
|
- let str = new Date().toLocaleDateString()
|
|
|
|
|
|
|
+ let str = new Date()
|
|
|
//后一天
|
|
//后一天
|
|
|
- let end = new Date(new Date().getTime() + 24 * 60 * 60 * 1000).toLocaleDateString()
|
|
|
|
|
- str = str.replace(/\//g, '-')
|
|
|
|
|
- end = end.replace(/\//g, '-')
|
|
|
|
|
|
|
+ let end = new Date(new Date().getTime() + 24 * 60 * 60 * 1000)
|
|
|
|
|
+
|
|
|
|
|
|
|
|
// 房间数据统计
|
|
// 房间数据统计
|
|
|
getRevPAR().then(res => {
|
|
getRevPAR().then(res => {
|
|
@@ -492,20 +503,23 @@ export default {
|
|
|
})
|
|
})
|
|
|
|
|
|
|
|
//今日总收款
|
|
//今日总收款
|
|
|
|
|
+ console.log("nidayede ",str,end)
|
|
|
getTodayTotalIncome({
|
|
getTodayTotalIncome({
|
|
|
- startTime: str,
|
|
|
|
|
- endTime: end
|
|
|
|
|
|
|
+ startTime: str.format("yyyy-MM-dd"),
|
|
|
|
|
+ endTime: end.format("yyyy-MM-dd")
|
|
|
}).then(res => {
|
|
}).then(res => {
|
|
|
|
|
+
|
|
|
if (res.code == 200 && res.result.records.length > 0) {
|
|
if (res.code == 200 && res.result.records.length > 0) {
|
|
|
let brr = []
|
|
let brr = []
|
|
|
let data = res.result.records
|
|
let data = res.result.records
|
|
|
|
|
+ this.todayTotalIncome = 0
|
|
|
data.forEach(item => {
|
|
data.forEach(item => {
|
|
|
let arr = []
|
|
let arr = []
|
|
|
arr = Object.keys(item).filter(items => items != 'department' && items != 'hotel_name')
|
|
arr = Object.keys(item).filter(items => items != 'department' && items != 'hotel_name')
|
|
|
brr = Object.keys(item).filter(items => items == '现金' || items == '微信' || items == '支付宝')
|
|
brr = Object.keys(item).filter(items => items == '现金' || items == '微信' || items == '支付宝')
|
|
|
console.log(arr);
|
|
console.log(arr);
|
|
|
arr.forEach(ele => {
|
|
arr.forEach(ele => {
|
|
|
- this.todayTotalIncome += item[ele] * 1
|
|
|
|
|
|
|
+ this.todayTotalIncome += parseFloat(item[ele]) * 1
|
|
|
})
|
|
})
|
|
|
})
|
|
})
|
|
|
let obj = {}
|
|
let obj = {}
|
|
@@ -580,6 +594,11 @@ export default {
|
|
|
change(e) {
|
|
change(e) {
|
|
|
console.log("e:", e);
|
|
console.log("e:", e);
|
|
|
this.hotelIds = e
|
|
this.hotelIds = e
|
|
|
|
|
+ let hotels = this.hotelIdList
|
|
|
|
|
+ let idx = (hotels||[]).findIndex(s=>s.id == e)
|
|
|
|
|
+ if(idx > -1) {
|
|
|
|
|
+ uni.setStorageSync("hotelInfo",hotels[idx])
|
|
|
|
|
+ }
|
|
|
this.$store.commit('setHotelId', e)
|
|
this.$store.commit('setHotelId', e)
|
|
|
this.onload()
|
|
this.onload()
|
|
|
},
|
|
},
|
|
@@ -672,7 +691,7 @@ page {
|
|
|
// height: 200px;
|
|
// height: 200px;
|
|
|
// width: 200px;
|
|
// width: 200px;
|
|
|
background-color: rgb(0, 186, 173);
|
|
background-color: rgb(0, 186, 173);
|
|
|
- border-radius: 0 0 20% 20%;
|
|
|
|
|
|
|
+ border-radius: 0 0 10% 10%;
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
.select-top {
|
|
.select-top {
|
|
@@ -723,17 +742,19 @@ page {
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
.grid-data {
|
|
.grid-data {
|
|
|
- display: grid;
|
|
|
|
|
|
|
+ display: flex;
|
|
|
grid-template-columns: repeat(3, 1fr);
|
|
grid-template-columns: repeat(3, 1fr);
|
|
|
grid-template-rows: repeat(2, 1fr);
|
|
grid-template-rows: repeat(2, 1fr);
|
|
|
grid-gap: 30px 10px;
|
|
grid-gap: 30px 10px;
|
|
|
color: #fff;
|
|
color: #fff;
|
|
|
|
|
+ margin-top: 26rpx;
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
.grid-data>div {
|
|
.grid-data>div {
|
|
|
/* background-color: #fff; */
|
|
/* background-color: #fff; */
|
|
|
/* border: 1px solid #eee; */
|
|
/* border: 1px solid #eee; */
|
|
|
display: flex;
|
|
display: flex;
|
|
|
|
|
+ width: 100%;
|
|
|
justify-content: space-between;
|
|
justify-content: space-between;
|
|
|
flex-direction: column;
|
|
flex-direction: column;
|
|
|
align-items: center;
|
|
align-items: center;
|
|
@@ -742,13 +763,20 @@ page {
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
.grid-tabbar {
|
|
.grid-tabbar {
|
|
|
- display: grid;
|
|
|
|
|
- grid-template-columns: repeat(5, 1fr);
|
|
|
|
|
- grid-template-rows: repeat(3, 1fr);
|
|
|
|
|
- gap: 10px;
|
|
|
|
|
|
|
+ display: flex;
|
|
|
|
|
+ flex-wrap: wrap;
|
|
|
|
|
+ justify-content: center;
|
|
|
|
|
+ align-items: center;
|
|
|
margin-top: 20px;
|
|
margin-top: 20px;
|
|
|
background: #fff;
|
|
background: #fff;
|
|
|
}
|
|
}
|
|
|
|
|
+.tbr-name{
|
|
|
|
|
+ font-size: .8rem;
|
|
|
|
|
+}
|
|
|
|
|
+.grid-tabbar>div{
|
|
|
|
|
+ width: 20%;
|
|
|
|
|
+ margin: 10px 0;
|
|
|
|
|
+}
|
|
|
|
|
|
|
|
// .bgco {
|
|
// .bgco {
|
|
|
// position: fixed;
|
|
// position: fixed;
|