<template>
|
<view class="container">
|
<view class="content-box">
|
<view class="info">
|
<view class="item location">
|
<u-icon name="map" color="#AAAAAA" size="15"></u-icon>
|
<text>当前小区:</text>
|
<view class="location">
|
{{ location }}{{ room }}{{ `(共${num}人)` }}
|
</view>
|
</view>
|
</view>
|
|
|
<view class="box-title">
|
<view class="line"></view>
|
<view class="title">出租管理</view>
|
</view>
|
<view class="list">
|
<rentList :list="rentList" @refreshData="refreshData"></rentList>
|
</view>
|
</view>
|
|
|
<!-- <view class="bottom">
|
<view class="btn">
|
<u-button @click="addRent" type="primary" :plain="true" text="添加租赁信息"></u-button>
|
</view>
|
</view> -->
|
|
<footer-btn @click="addRent" text="添加租赁信息" />
|
|
|
</view>
|
</template>
|
|
<script>
|
import rentList from "@/subPackage/bs/components/list/rentList.vue"
|
import {
|
getHouseRentInfo
|
} from "@/api/doorplateAddress/doorplateAddress";
|
import {
|
logAdd
|
} from "../../../api/system/logManage";
|
export default {
|
components: {
|
rentList
|
},
|
data() {
|
return {
|
houseCode: '',
|
location: "",
|
room: "",
|
num: 0,
|
//出租列表
|
rentList: [],
|
from:""
|
}
|
},
|
onLoad(option) {
|
// const {
|
// houseCode
|
// } = option
|
// this.houseCode = houseCode
|
if(option.from){
|
uni.setNavigationBarTitle({
|
title:"租赁信息"
|
})
|
}
|
},
|
onShow() {
|
this.getHouseRent()
|
},
|
methods: {
|
async getHouseRent() {
|
if (!this.houseCode) {
|
this.houseCode = uni.getStorageSync("siteInfo").houseCode
|
}
|
const res = await getHouseRentInfo(this.houseCode)
|
const {
|
aoiName,
|
subAoi,
|
buildingName,
|
doorplateName,
|
unitName,
|
houseRentalList
|
} = res.data
|
this.rentList = []
|
this.location = (!!aoiName ? aoiName : subAoi) + buildingName
|
this.room = (!!unitName ? unitName : '') + doorplateName + "室"
|
this.num = 0
|
houseRentalList !== 0 && houseRentalList.forEach(item => {
|
const {
|
householdVOList,
|
dueTime,
|
rentalTime
|
} = item
|
item.num = householdVOList.length
|
this.num += item.num
|
if (item.num !== 0) {
|
item.name = householdVOList[0].name
|
item.housingRentalId = householdVOList[0].housingRentalId
|
}
|
this.rentList = houseRentalList
|
})
|
},
|
addRent() {
|
this.$u.func.globalNavigator("/subPackage/bs/views/rentDetail?houseCode=" + this.houseCode)
|
},
|
refreshData() {
|
this.getHouseRent()
|
}
|
}
|
}
|
</script>
|
|
<style>
|
page {
|
background-color: #F5F5F5;
|
}
|
</style>
|
|
<style scoped lang="scss">
|
.container {
|
position: relative;
|
width: 100%;
|
height: 100%;
|
display: flex;
|
flex-direction: column;
|
background: #F6F6F6;
|
|
.content-box {
|
// height: 0;
|
// flex: 1;
|
overflow-y: auto;
|
margin: 20rpx 30rpx;
|
}
|
|
.list {
|
// padding-bottom: 20px;
|
}
|
|
.item {
|
display: flex;
|
padding: 30rpx 20rpx;
|
background-color: #ffffff;
|
border-bottom: 1px solid #eff1f3;
|
}
|
|
.location {
|
font-weight: 700;
|
font-size: 27rpx;
|
|
text {
|
color: #AAAAAA;
|
}
|
}
|
|
.room {
|
font-weight: 700;
|
}
|
|
.bottom {
|
padding: 20rpx;
|
background-color: #ffffff;
|
display: flex;
|
justify-content: center;
|
align-items: center;
|
position: fixed;
|
left: 0;
|
bottom: 0;
|
width: calc(100% - 40rpx);
|
|
.btn {
|
// width: calc(100% - 40rpx);
|
}
|
}
|
|
}
|
|
.box-title {
|
margin: 25rpx 0;
|
display: flex;
|
|
.line {
|
width: 8rpx;
|
margin-right: 10rpx;
|
background-color: #2978FF;
|
}
|
|
.title {
|
font-weight: 700;
|
}
|
}
|
|
view {
|
font-size: 32rpx;
|
}
|
</style>
|