shuishen
2023-11-01 dd4b75d3f418e7107a44d21cb2f22ca20b791dc8
Merge branch 'master' of http://s16s652780.51mypc.cn:49896/r/jczz_app
6 files modified
1 files added
405 ■■■■ changed files
api/doorplateAddress/doorplateAddress.js 47 ●●●●● patch | view | raw | blame | history
subPackage/bs/components/form/rentForm.vue 60 ●●●●● patch | view | raw | blame | history
subPackage/bs/views/rentDetail.vue 104 ●●●● patch | view | raw | blame | history
subPackage/bs/views/zhsb.vue 62 ●●●●● patch | view | raw | blame | history
subPackage/house/family/index.vue 2 ●●● patch | view | raw | blame | history
subPackage/house/roomControl/index.vue 88 ●●●●● patch | view | raw | blame | history
subPackage/house/roomDetails/index.vue 42 ●●●● patch | view | raw | blame | history
api/doorplateAddress/doorplateAddress.js
@@ -11,7 +11,7 @@
        }
    })
}
// 获取社区信息
export const getHouseList = (type, name) => {
    return http.request({
        url: '/blade-doorplateAddress/doorplateAddress/getHousesList',
@@ -23,6 +23,7 @@
    })
}
// 获取当前楼栋信息
export const getHouseInfoList = (type, code) => {
    return http.request({
        url: '/blade-doorplateAddress/doorplateAddress/getHousesList',
@@ -34,6 +35,7 @@
    })
}
// 获取当前房屋出租信息
export const getHouseRentInfo = (code) => {
    return http.request({
        url: '/blade-doorplateAddress/doorplateAddress/getHouseRentInfo',
@@ -43,3 +45,46 @@
        }
    })
}
// 获取房屋标签信息
export const getHouseLabelList = () => {
    return http.request({
        url: '/blade-label/label/getLabelList',
        method: 'GET',
        params: {
            parentId: 1001
        }
    })
}
// 获取房屋详细信息
export const getHouseDetail = (houseCode) => {
    return http.request({
        url: '/blade-house/house/getHouseDetail',
        method: 'GET',
        params: {
            houseCode
        }
    })
}
// 获取房屋详细信息
export const addHouseRental = (data) => {
    return http.request({
        url: 'blade-houseRental/houseRental/add',
        method: 'POST',
        data
    })
}
export const uploadFile = (data) => {
    return http.request({
        url: '/blade-resource/oss/endpoint/put-file',
        method: 'post',
        custom: {
            Authorization: true
        },
        data
    })
}
subPackage/bs/components/form/rentForm.vue
New file
@@ -0,0 +1,60 @@
<template>
    <u-form :model="form" class="form-box" :rules="rules">
        <u-form-item class="form-item" label="姓名" required prop="name" labelWidth="80">
            <u-input v-model="form.name" border="none" placeholder="姓名" />
        </u-form-item>
        <u-form-item class="form-item" label="联系方式" labelWidth="80">
            <u-input v-model="form.phone" border="none" placeholder="联系方式" />
        </u-form-item>
        <u-form-item class="form-item" label="身份证号码" required prop="idCard" labelWidth="80">
            <u-input v-model="form.idCard" border="none" placeholder="身份证号码" />
        </u-form-item>
        <u-form-item class="form-item" label="户籍地址" labelWidth="80">
            <u-input v-model="form.domicile" border="none" placeholder="选填" />
        </u-form-item>
        <u-form-item class="form-item" label="工作单位" labelWidth="80">
            <u-input v-model="form.workUnit" border="none" placeholder="选填" />
        </u-form-item>
    </u-form>
</template>
<script>
    export default {
        data() {
            return {
                form: {
                    name: '',
                    phone: '',
                    idCard: '',
                    domicile: '',
                    workUnit: ''
                },
                rules: {
                    name: [{
                        required: true,
                        message: '请输入姓名',
                        // 可以单个或者同时写两个触发验证方式
                        trigger: ['change', 'blur'],
                    }],
                    idCard: [{
                        required: true,
                        message: '请输入身份证号',
                        // 可以单个或者同时写两个触发验证方式
                        trigger: ['change', 'blur'],
                    }]
                }
            }
        }
    }
</script>
<style lang="scss" scoped>
    .form-box {
        background: #fff;
        .form-item {
            padding: 5rpx 20rpx;
            border-bottom: 1px solid #eff1f3;
        }
    }
</style>
subPackage/bs/views/rentDetail.vue
@@ -5,59 +5,55 @@
                <box-title title="基础信息"></box-title>
            </view>
            <view class="basic-info">
                <u-form-item @click="showSelectBus(dataList.relation, '租客关系', 'relationName','relation')"
                    class="form-item" labelWidth="100" label="租客关系" required prop="type">
                    <u--input border="none" v-model="relationName" disabled disabledColor="#ffffff" placeholder="请选择">
                    </u--input>
                    <u-icon slot="right" name="arrow-right"></u-icon>
                </u-form-item>
                <u-form-item @click="showSelectBus(dataList.houseType, '房屋状态', 'houseTypeName','houseType')"
                    class="form-item" labelWidth="100" label="房屋状态:" required prop="type">
                    <u--input border="none" v-model="houseTypeName" disabled disabledColor="#ffffff" placeholder="请选择">
                    </u--input>
                    <u-icon slot="right" name="arrow-right"></u-icon>
                </u-form-item>
                <u-form-item @click="showSelectBus(dataList.rentalUse, '租房用途', 'rentalUseName','rentalUse')"
                    class="form-item" labelWidth="100" label="租房用途:" required prop="type">
                    <u--input border="none" v-model="rentalUseName" disabled disabledColor="#ffffff" placeholder="请选择">
                    </u--input>
                    <u-icon slot="right" name="arrow-right"></u-icon>
                </u-form-item>
                <u-form-item @click="rentTimeShow = true" class="form-item" labelWidth="100" label="租房时间:" required
                    prop="type">
                    <u--input border="none" v-model="form.rentTime" disabled disabledColor="#ffffff" placeholder="请选择">
                    </u--input>
                    <u-icon slot="right" name="arrow-right"></u-icon>
                </u-form-item>
            </view>
            <view class="box-title">
                <box-title title="合同上传"></box-title>
            </view>
            <view class="pic">
                <u-upload :fileList="form.images" :previewFullImage="uploadConfig.previewFullImage"
                    :accept="uploadConfig.acceptImg" :multiple="uploadConfig.multiple" :maxCount="uploadConfig.maxCount"
                    :capture="uploadConfig.capture" @afterRead="afterReadImg" @delete="deletePic">
                <u-upload :fileList="imagesList"
                    :previewFullImage="uploadConfig.previewFullImage" :accept="uploadConfig.acceptImg"
                    :multiple="uploadConfig.multiple" :maxCount="uploadConfig.maxCount" :capture="uploadConfig.capture"
                    @afterRead="afterReadImg" @delete="deletePic">
                </u-upload>
            </view>
            <view class="box-title">
                <box-title title="租客信息"></box-title>
            </view>
            <view class="rent-info">
                <view v-for="item in rentFormNum" :key="item">
                    <view class="box-title">
                        <box-title :title="'租客信息-#'+item">
                            <template #titleMore v-if="item !== 1">
                                <u-icon size="25" name="trash" color='#EF0724'></u-icon>
                            </template>
                        </box-title>
                    </view>
                    <rentForm ref="rentform" />
                </view>
            </view>
@@ -69,10 +65,15 @@
            :popupTitle="selectBusTitle" :dataLists="selectBusList" @cancel="typeShow = false" @submit="typeSelect">
        </select-bus>
        <!--出租时间选择-->
        <u-datetime-picker :show="rentTimeShow" v-model="form.rentTime" mode="date"></u-datetime-picker>
        <u-datetime-picker :show="rentTimeShow" v-model="form.rentTime" mode="date"
            @confirm="rentTimeShow = false"></u-datetime-picker>
        <view class="bottom-tools">
            <u-button plain class="btn-item" type="success" @click="addRentForm">再加一人</u-button>
            <u-button class="btn-item" type="error" @click="decRentForm">删除</u-button>
            <u-button class="btn-item" type="primary" @click="save">保存</u-button>
        </view>
    </view>
@@ -80,22 +81,28 @@
<script>
    import selectBus from "@/components/my-components/selectBus.vue"
    import rentForm from '../components/form/rentForm.vue'
    import uploadMixin from "@/mixin/uploadMixin";
    import {
        uploadFile,
        addHouseRental
    } from "@/api/doorplateAddress/doorplateAddress";
    export default {
        mixins: [uploadMixin],
        components: {
            selectBus
            selectBus,
            rentForm
        },
        data() {
            return {
                form: {
                    relation: "",
                    houseTyep: "",
                    rentTime: "",
                },
                imagesList: [],
                rules: {},
                rentTimeShow: false,
                rentFormNum: 1,
                relationName: "",
                houseTypeName: "",
                rentalUseName: "",
@@ -140,9 +147,8 @@
                selectBusTitle: '',
                selectBusModel: '',
                selectBusKey: '',
                typeShow: false
                typeShow: false,
                houseCode: ''
            }
        },
        created() {
@@ -152,7 +158,7 @@
        },
        onLoad(option) {
            this.houseCode = option.houseCode
        },
        onShow() {
@@ -171,6 +177,36 @@
                this.form[this.selectBusKey] = item.value
                this.typeShow = !this.typeShow
            },
            beforeUpload(e) {
                console.log(e)
                return false
            },
            addRentForm() {
                this.rentFormNum++
            },
            decRentForm() {
                this.rentFormNum > 1 && this.rentFormNum--
            },
            async save() {
                let houseTenantVOList = []
                this.$refs.rentform.forEach(item => {
                    houseTenantVOList.push(item.form)
                })
                const relationIndex = this.dataList.relation.findIndex(item => item.name === this.relationName)
                const statusIndex = this.dataList.houseType.findIndex(item => item.name === this.houseTypeName)
                const rentalIndex = this.dataList.rentalUse.findIndex(item => item.name === this.rentalUseName)
                let params = {
                    houseCode: this.houseCode,
                    tenantRelationship: this.dataList.relation[relationIndex].value,
                    rentalTime: this.form.rentalTime,
                    houseStatus: this.dataList.houseType[statusIndex].value,
                    rentalUse: this.dataList.rentalUse[rentalIndex].value,
                    houseTenantVOList
                }
                const res = await addHouseRental(params)
                console.log(res)
            }
        }
    }
</script>
@@ -179,10 +215,10 @@
    .container {
        position: relative;
        width: 100%;
        height: 100%;
        display: flex;
        flex-direction: column;
        background: #F9F9FA;
        padding-bottom: 200rpx;
        .box-title {
            padding: 10px 0;
@@ -214,6 +250,18 @@
            }
        }
        .bottom-tools {
            display: flex;
            background-color: #ffffff;
            position: fixed;
            bottom: 0;
            width: 100%;
            border-top: 1rpx solid #e4e4e4;
            z-index: 999;
            .btn-item {
                margin: 40rpx;
            }
        }
    }
</style>
subPackage/bs/views/zhsb.vue
@@ -19,7 +19,6 @@
            <view class="box-title">
                <box-title title="出租管理"></box-title>
            </view>
            <view class="list">
                <rentList :list="rentList"></rentList>
            </view>
@@ -36,12 +35,19 @@
<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: "万达晶座:11栋楼",
                room: "一单元303室",
                num: "1",
@@ -53,39 +59,53 @@
                        startTime: "2022-01-01",
                        endTime: "2023-12-23",
                        status: "未到期"
                    },
                    {
                        name: "测试",
                        num: "2",
                        startTime: "2022-01-01",
                        endTime: "2023-12-23",
                        status: "未到期"
                    },
                    {
                        name: "张三",
                        num: "1",
                        startTime: "2022-01-01",
                        endTime: "2023-12-23",
                        status: "未到期"
                    }
                ]
                }]
            }
        },
        created() {
        },
        mounted() {
            console.log(this.$store)
        },
        onLoad(option) {
            const {
                houseCode
            } = option
            this.houseCode = houseCode
        },
        onShow() {
            this.getHouseRent()
        },
        methods: {
            async getHouseRent() {
                const res = await getHouseRentInfo(this.houseCode)
                const {
                    aoiName,
                    buildingName,
                    doorplateName,
                    unitName,
                    houseRentalList: {
                        houseTenantVOList
                    }
                } = res.data
                console.log(res.data)
                this.location = aoiName + buildingName
                this.room = unitName + doorplateName + "室"
                this.rentList = houseTenantVOList || []
                this.rentList.length !== 0 && this.rentList.forEach(item => {
                    if (!item.houseTenantVOList) {
                        num += item.houseTenantVOList.length
                    }
                    // 事件格式处理
                    item.startTime = item.rentalTime.split(' ')[0]
                    item.endTime = item.dueTime.split(' ')[0]
                    item.status === 1 ? '未到期' : '到期'
                    item.num = item.houseTenantVOList.length
                })
            },
            addRent() {
                this.$u.func.globalNavigator("/subPackage/bs/views/rentDetail")
                this.$u.func.globalNavigator("/subPackage/bs/views/rentDetail?houseCode="+this.houseCode)
            }
        }
    }
subPackage/house/family/index.vue
@@ -18,7 +18,7 @@
                                <u-grid class="flex flex-wrap" col="2" :border="true">
                                    <u-grid-item v-for="(scItem, scIndex) in cItem.children" :key="scItem.id"  @click.native="pushPage(scItem)">
                                        <view class="room-box flex f-d-c">
                                            <view class="flex a-i-c j-c-s-b" v-show="scItem.residentialStatus">
                                            <view class="flex a-i-c j-c-s-b">
                                                <view class="l">{{scItem.realName}}</view>
                                                <view class="r flex">
                                                    <view v-show="scItem.residentialStatus">
subPackage/house/roomControl/index.vue
@@ -2,34 +2,34 @@
    <view class="container">
        <view class="main">
            <view class="content">
                <u-form labelWidth="70" :model="form" :rules="rules" ref="form">
                <u-form labelWidth="70" :model="form" ref="form">
                    <box-title title=""></box-title>
                    <view class="basic-info mt-20">
                        <u-form-item class="form-item" labelWidth="100" label="绑定手机" required prop="location">
                            <u--input border="none" v-model="form.location" placeholder="请输入">
                        <u-form-item class="form-item" labelWidth="100" label="绑定手机" required>
                            <u--input border="none" v-model="form.phone" placeholder="请输入">
                            </u--input>
                        </u-form-item>
                        <u-form-item class="form-item" labelWidth="100" label="地址" required prop="location">
                            <u--input border="none" v-model="form.location">
                        <u-form-item class="form-item" labelWidth="100" label="地址" required>
                            <u--input border="none" v-model="form.address">
                            </u--input>
                        </u-form-item>
                        <u-form-item class="form-item" labelWidth="100" label="物业月费" required prop="location">
                            <u--input border="none" v-model="form.location">
                        <u-form-item class="form-item" labelWidth="100" label="物业月费" required>
                            <u--input border="none" v-model="form.property_price">
                            </u--input>
                        </u-form-item>
                        <u-form-item class="form-item" labelWidth="100" label="到期时间" required prop="location">
                            <u--input border="none" v-model="form.location">
                        <u-form-item class="form-item" labelWidth="100" label="到期时间" required>
                            <u--input border="none" v-model="form.service_due">
                            </u--input>
                        </u-form-item>
                    </view>
                    <box-title class="mt-20" title="房屋外观"></box-title>
                    <view class="pic mt-20">
                        <u-upload :fileList="form.images" :previewFullImage="uploadConfig.previewFullImage"
                        <u-upload :fileList="form.image_urls" :previewFullImage="uploadConfig.previewFullImage"
                            :accept="uploadConfig.acceptImg" :multiple="uploadConfig.multiple"
                            :maxCount="uploadConfig.maxCount" :capture="uploadConfig.capture" @afterRead="afterReadImg"
                            @delete="deletePic">
@@ -53,12 +53,12 @@
        <u-modal style="flex: none;" :show="popupShow" :closeOnClickOverlay="true" showCancelButton @cancel="popupShow = false" @confirm="popupConfirm">
            <view class="slot-content">
                <view class="flex_base">
                    安置房
                    {{ labelModelInfo.title }}
                </view>
                <u-radio-group class="mt-40" v-model="labelValue" placement="row">
                    <u-radio :customStyle="{marginBottom: '8px'}" v-for="(item, index) in labelList" :key="index"
                        :label="item.name" :name="item.name" :activeColor="item.color" @change="radioChange">
                        :label="item.name" :name="item.name" :activeColor="item.color" @change="radioChange(item)">
                    </u-radio>
                </u-radio-group>
@@ -76,12 +76,21 @@
<script>
    import uploadMixin from "@/mixin/uploadMixin";
    import {
        getHouseDetail,
        getHouseLabelList
    } from "@/api/doorplateAddress/doorplateAddress";
    export default {
        mixins: [uploadMixin],
        data() {
            return {
                houseCode: '',
                form: {
                    relation: ""
                    phone: "",
                    address: "",
                    property_price: "",
                    service_due: "",
                    image_urls: []
                },
                showList: {
                    relation: false
@@ -95,25 +104,7 @@
                popupShow: false,
                labelBtnList: [{
                        name: '商品房'
                    },
                    {
                        name: '自建房'
                    },
                    {
                        name: '安置房'
                    },
                    {
                        name: '公房'
                    },
                    {
                        name: '危房'
                    },
                    {
                        name: '出租房'
                    },
                ],
                labelBtnList: [],
                // 安置房弹框中
                labelList: [{
@@ -136,7 +127,12 @@
                        color: '#EE0A24'
                    }
                ],
                labelModelInfo: {
                    title: '',
                    selectedColor: ''
                },
                labelValue: '苹果',
                value1: ''
            }
        },
        created() {
@@ -146,18 +142,42 @@
        },
        onLoad(option) {
            const { code } = option
            this.houseCode = code
        },
        onShow() {
            this.getLabelList()
        },
        methods: {
            showLabelPopup(item) {
                this.popupShow = true
                this.labelModelInfo.title = item.name
            },
            
            popupConfirm(){
                this.popupShow = false
            },
            radioChange(item) {
            },
            async getHouseDetailInfo() {
                const res = await getHouseDetail()
                const { phone, address, property_price, service_due, image_urls } = res.data
                this.form = {
                    phone,
                    address,
                    property_price,
                    service_due,
                    image_urls: [
                        image_urls
                    ]
                }
            },
            async getLabelList() {
                const res = await getHouseLabelList()
                this.labelBtnList = res.data
            }
        }
    }
subPackage/house/roomDetails/index.vue
@@ -4,15 +4,15 @@
            <view class="content">
                <view class="base b-c-w">
                    <view class="flex a-i-c">
                        <u-icon name="photo"></u-icon> {{ houseTitle }}
                        <u-icon name="photo"></u-icon> {{ houseInfo.houseTitle }}
                    </view>
                    <view class="flex j-c-s-b">
                        <view>
                            {{ unitName }}单元 {{ houseName }}室
                            <!-- (共2人) -->
                            {{ houseInfo.unitName }}单元 {{ houseInfo.houseName }}室(共{{ houseInfo.allNum }}人)
                        </view>
                        <view class="flex a-i-c">
                            <u-button size='small' shape="circle" type="primary" :plain="true" text="房屋管理"></u-button>
                            <u-button @click="pushPage" size='small' shape="circle" type="primary" :plain="true"
                                text="房屋管理"></u-button>
                        </view>
                    </view>
                </view>
@@ -113,17 +113,25 @@
        data() {
            return {
                houseTitle: '',
                currentId: '',
                houseInfo: {
                    // 房间号
                houseName: '',
                    // 单元号
                unitName: '',
                    houseTitle: '',
                    // 人员数量
                    allNum: 0
                },
                ownerInfoList: [],
                rentOutList: []
            }
        },
        onLoad(e) {
            const { id } = e
            const {
                id
            } = e
            this.currentId = id
        },
        onShow() {
@@ -133,12 +141,20 @@
        methods: {
            async getHouseRentInfoList() {
                const res = await getHouseRentInfo(this.currentId)
                const { districtName, doorplateName, buildingName, houseName, unitName, houseRentalList, householdList } = res.data
                this.houseTitle = districtName + ':' + buildingName
                const {
                    aoiName,
                    buildingName,
                    houseName,
                    unitName,
                    houseRentalList,
                    householdList
                } = res.data
                console.log(res.data)
                this.rentOutList = houseRentalList
                this.ownerInfoList = householdList
                this.houseName = houseName
                this.unitName = unitName
                this.houseInfo.houseName = houseName
                this.houseInfo.unitName = unitName
                this.houseInfo.houseTitle = aoiName + ':' + buildingName
                // 判断当前租客有没有过期
                this.rentOutList.forEach(item => {
                    // 事件格式处理
@@ -149,6 +165,12 @@
                    // 多人个租客将第一个作为显示
                    item.tenant = item.houseTenantVOList.length > 0 ? item.houseTenantVOList[0].name : ''
                })
                this.houseInfo.allNum = householdList.length
                console.log(res.data)
            },
            pushPage() {
                const url = `/subPackage/house/roomControl/index?code=${this.currentId}`
                this.$u.func.globalNavigator(url, "navTo")
            }
        }
    }