linwe
2023-12-08 0d016f8d394ace564853e8ae29e69974cd5fd324
出租房bug修复
1 files modified
290 ■■■■ changed files
subPackage/bs/views/zhsb.vue 290 ●●●● patch | view | raw | blame | history
subPackage/bs/views/zhsb.vue
@@ -2,8 +2,8 @@
    <view class="container">
        <view class="content-box">
            <view class="info">
                <view class="item location">
                    <u-icon name="map" color="#AAAAAA" size="15"></u-icon>
                <view class="item location">
                    <u-icon name="map" color="#AAAAAA" size="15"></u-icon>
                    <text>当前小区:</text>
                    <view class="location">
                        {{ location }}{{ room }}{{ `(共${num}人)` }}
@@ -13,7 +13,7 @@
            <view class="box-title">
                <view class="line"></view>
                <view class="line"></view>
                <view class="title">出租管理</view>
            </view>
            <view class="list">
@@ -27,157 +27,167 @@
                <u-button @click="addRent" type="primary" :plain="true" text="添加租赁信息"></u-button>
            </view>
        </view> -->
        <footer-btn @click="addRent"  text="添加租赁信息" />
        <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: []
        }
    },
    onLoad(option) {
        const {
            houseCode
        } = option
        this.houseCode = houseCode
    },
    onShow() {
        this.getHouseRent()
    },
    methods: {
        async getHouseRent() {
            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 { houseTenantVOList, dueTime, rentalTime } = item
                item.num = houseTenantVOList.length
                this.num += item.num
                if (item.num !== 0) {
                    item.name = houseTenantVOList[0].name
                    item.housingRentalId = houseTenantVOList[0].housingRentalId
                }
                this.rentList = houseRentalList
            })
    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
        },
        addRent() {
            this.$u.func.globalNavigator("/subPackage/bs/views/rentDetail?houseCode=" + this.houseCode)
        },
        refreshData() {
            this.getHouseRent()
        data() {
            return {
                houseCode: '',
                location: "",
                room: "",
                num: 0,
                //出租列表
                rentList: []
            }
        },
        onLoad(option) {
            const {
                houseCode
            } = option
            this.houseCode = houseCode
        },
        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>
    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 {
    .container {
        position: relative;
        width: 100%;
        height: 100%;
        display: flex;
        padding: 30rpx 20rpx;
        background-color: #ffffff;
        border-bottom: 1px solid #eff1f3;
        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);
            }
        }
    }
    .location {
        font-weight: 700;
        font-size: 27rpx;
        text {
            color: #AAAAAA;
    .box-title {
        margin: 25rpx 0;
        display: flex;
        .line {
            width: 8rpx;
            margin-right: 10rpx;
            background-color: #2978FF;
        }
        .title {
            font-weight: 700;
        }
    }
    .room {
        font-weight: 700;
    view {
        font-size: 32rpx;
    }
    .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>
</style>