GULIMMO
2023-11-03 66085d0dbc901f3586267fae47d155105d994ec6
首页跳转、租户上报等页面修改
7 files modified
224 ■■■■ changed files
api/doorplateAddress/doorplateAddress.js 26 ●●●●● patch | view | raw | blame | history
pages/home/index.vue 7 ●●●●● patch | view | raw | blame | history
subPackage/bs/components/list/rentList.vue 37 ●●●● patch | view | raw | blame | history
subPackage/bs/views/rentDetail.vue 21 ●●●●● patch | view | raw | blame | history
subPackage/bs/views/zhsb.vue 7 ●●●● patch | view | raw | blame | history
subPackage/house/roomControl/index.vue 27 ●●●● patch | view | raw | blame | history
subPackage/house/roomDetails/index.vue 99 ●●●●● patch | view | raw | blame | history
api/doorplateAddress/doorplateAddress.js
@@ -1,4 +1,14 @@
import http from '@/http/api.js'
import {
    devUrl,
    prodUrl,
    contentType
} from '@/common/setting'
import {
    clientId,
    clientSecret
} from '@/common/setting'
export const getDoorplateAddressList = (code, type) => {
    return http.request({
@@ -75,14 +85,14 @@
    })
}
export const uploadFile = (data) => {
    return http.request({
        url: 'blade-resource/oss/endpoint/put-file',
        method: 'post',
        custom: {
            Authorization: true
        },
        data
export const uploadFile = (file) => {
    return uni.uploadFile({
        url: (process.env.NODE_ENV === 'development' ? devUrl : prodUrl ) + '/blade-resource/oss/endpoint/put-file',
        filePath: file,
        name: 'file',
        header: {
            Authorization: uni.getStorageSync('accessToken')
        }
    })
}
pages/home/index.vue
@@ -525,6 +525,13 @@
            navTo() {
                if (this.curHouseCode === '') {
                    uni.showToast({
                        title: "请选择地址",
                        icon: "error"
                    })
                    return
                }
                this.$u.func.globalNavigator(`/subPackage/bs/views/zhsb?houseCode=${this.curHouseCode}`, "navTo")
            },
subPackage/bs/components/list/rentList.vue
@@ -22,7 +22,7 @@
                <u-button icon="calendar" class="btn-item" type="primary" plain text="续租"
                    @click="xzHandleClick(item)"></u-button>
                <u-button icon="order" class="btn-item" type="primary" plain text="终止"
                    @click="terminate(item)"></u-button>
                    :disabled="item.status == 1 || item.status == 2" @click="terminate(item)"></u-button>
            </view>
        </view>
@@ -58,8 +58,7 @@
                istPickerShow: false,
                currentRentalId: '',
                isModelShow: false,
                status: [
                    {
                status: [{
                        name: '未到期',
                        value: 0
                    },
@@ -90,8 +89,16 @@
                    code,
                    data
                } = await deleteRentalInfo(this.currentRentalId)
                console.log(code, data)
                if (code !== 200) {
                    uni.showToast({
                        title: "删除失败",
                        icon: "error",
                        duration: 1500
                    })
                    return
                }
                this.isModelShow = false
                this.$emit('refreshData')
            },
            pushPage(item) {
                const {
@@ -113,9 +120,18 @@
                    id: this.currentRentalId,
                    dueTime: time
                })
                if (res.code !== 200) {
                    uni.showToast({
                        title: "续租失败",
                        icon: "error",
                        duration: 1500
                    })
                    return
                }
                this.isPickerShow = false
                this.$emit('refreshData')
            },
            async terminate(item) {
            terminate(item) {
                this.currentRentalId = item.housingRentalId
                this.istPickerShow = true
            },
@@ -125,7 +141,16 @@
                    id: this.currentRentalId,
                    terminationTime: time
                })
                this.isPickerShow = false
                if (res.code !== 200) {
                    uni.showToast({
                        title: "终止失败",
                        icon: "error",
                        duration: 1500
                    })
                    return
                }
                this.istPickerShow = false
                this.$emit('refreshData')
            }
        }
    }
subPackage/bs/views/rentDetail.vue
@@ -9,13 +9,13 @@
                    <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="houseType">
                    class="form-item" labelWidth="100" label="房屋状态:" required prop="houseTypeName">
                    <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="rentalUse">
                    class="form-item" labelWidth="100" label="租房用途:" required prop="rentalUseName">
                    <u--input border="none" v-model="rentalUseName" disabled disabledColor="#ffffff" placeholder="请选择">
                    </u--input>
                    <u-icon slot="right" name="arrow-right"></u-icon>
@@ -107,6 +107,8 @@
                form: {
                    relation: "",
                    rentTime: "",
                    houseTypeName: "",
                    rentalUseName: "",
                    dueTime: "",
                },
                imagesList: [],
@@ -115,11 +117,11 @@
                        required: true,
                        message: '请选择租客关系'
                    }],
                    houseType: [{
                    houseTypeName: [{
                        required: true,
                        message: '请选择房屋状态'
                    }],
                    rentalUse: [{
                    rentalUseName: [{
                        required: true,
                        message: '请选择房屋用途'
                    }],
@@ -225,10 +227,8 @@
                this.dueTimeShow = false
            },
            async afterReadImg(e) {
                // const formData = new FormData()
                // const { file } = e
                // formData.append('file', file[0])
                // const res = await uploadFile(formData)
                console.log(this.$store);
            },
            addRentForm() {
                this.rentFormNum++
@@ -252,12 +252,13 @@
                }catch(e){
                    uni.showToast({
                        title: "删除失败",
                        icon: "success",
                        icon: "error",
                        duration: 1500
                    })
                }
            },
            saveOrUpdate() {
                console.log(this.rentalUseName, this.houseTypeName);
                this.$refs.form.validate().then(res => {
                    let rentFormValidGroup = []
                    this.$refs.rentform.forEach(item => {
@@ -376,6 +377,8 @@
                    relation: tenantRelationship,
                    rentTime: rentalTime,
                    dueTime: dueTime,
                    houseTypeName: houseStatus,
                    rentalUseName: rentalUse
                }
                this.rentalUseName = this.findObjValue(rentalUse, this.dataList.rentalUse)
                this.relationName = this.findObjValue(tenantRelationship, this.dataList.relation)
subPackage/bs/views/zhsb.vue
@@ -22,7 +22,7 @@
                <view class="title">出租管理</view>
            </view>
            <view class="list">
                <rentList :list="rentList"></rentList>
                <rentList :list="rentList" @refreshData="refreshData"></rentList>
            </view>
        </view>
@@ -80,18 +80,23 @@
            this.rentList = []
            this.location = (!!aoiName ? aoiName : '') + 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
            })
        },
        addRent() {
            this.$u.func.globalNavigator("/subPackage/bs/views/rentDetail?houseCode=" + this.houseCode)
        },
        refreshData() {
            this.getHouseRent()
        }
    }
}
subPackage/house/roomControl/index.vue
@@ -12,17 +12,17 @@
                        </u-form-item>
                        <u-form-item class="form-item" labelWidth="100" label="地址" required>
                            <u--input border="none" v-model="form.address">
                            <u--input border="none" v-model="form.address" disabled>
                            </u--input>
                        </u-form-item>
                        <u-form-item class="form-item" labelWidth="100" label="物业月费" required>
                            <u--input border="none" v-model="form.property_price">
                            <u--input border="none" v-model="form.property_price" disabled>
                            </u--input>
                        </u-form-item>
                        <u-form-item class="form-item" labelWidth="100" label="到期时间" required>
                            <u--input border="none" v-model="form.service_due">
                            <u--input border="none" v-model="form.service_due" disabled>
                            </u--input>
                        </u-form-item>
                    </view>
@@ -39,7 +39,8 @@
                    <box-title title="房屋标签"></box-title>
                    <view class="mt-20 flex label-btn-box b-c-w">
                        <view v-for="(item, index) in labelBtnList" :key="index">
                            <u-button color="#000" size="mini" type="primary" :plain="true" :text="item.name" @click="showLabelPopup(item)"></u-button>
                            <u-button color="#000" size="mini" type="primary" :plain="true" :text="item.name"
                                @click="showLabelPopup(item)"></u-button>
                        </view>
                    </view>
                </u-form>
@@ -50,7 +51,8 @@
            </view>
        </view>
        <u-modal style="flex: none;" :show="popupShow" :closeOnClickOverlay="true" showCancelButton @cancel="popupShow = false" @confirm="popupConfirm">
        <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 }}
@@ -78,7 +80,8 @@
    import uploadMixin from "@/mixin/uploadMixin";
    import {
        getHouseDetail,
        getHouseLabelList
        getHouseLabelList,
        uploadFile
    } from "@/api/doorplateAddress/doorplateAddress";
    export default {
        mixins: [uploadMixin],
@@ -142,7 +145,9 @@
        },
        onLoad(option) {
            const { code } = option
            const {
                code
            } = option
            this.houseCode = code
        },
        onShow() {
@@ -178,6 +183,14 @@
            async getLabelList() {
                const res = await getHouseLabelList()
                this.labelBtnList = res.data
            },
            async afterReadImg(event) {
                let lists = [].concat(event.file)
                lists.forEach(item => {
                    const { url } = item
                    uploadFile(item)
                })
            }
        }
    }
subPackage/house/roomDetails/index.vue
@@ -22,7 +22,7 @@
                        <view class="l flex-1 flex">
                            <view class="flex_base">
                                <view class="head-img flex_base">
                                    <u--image shape="circle" :showLoading="true" :src="item.src" width="120rpx"
                                    <u--image shape="circle" :showLoading="true" :src="item.src|| '/static/icon/user-01.png'"  width="120rpx"
                                        height="120rpx"></u--image>
                                </view>
                            </view>
@@ -77,17 +77,20 @@
                                {{item.rentalTime}} - {{item.dueTime}}
                            </view>
                            <view class="r">
                                {{item.status == 1 ? '已到期' : '未到期'}}
                                {{findObjValue(item.status, status)}}
                            </view>
                        </view>
                        <view class="btn-box flex j-c-s-a">
                            <u-button color="#CDF3DF" text="修改"></u-button>
                            <u-button color="#DAE7FF" text="续租"></u-button>
                            <u-button color="#FCCED3" text="终止"></u-button>
                            <u-button color="#CDF3DF" text="修改" @click="editRent(item)"></u-button>
                            <u-button color="#DAE7FF" text="续租" @click="reletRent(item)"></u-button>
                            <u-button color="#FCCED3" text="终止" @click="deleteRent(item)"></u-button>
                        </view>
                    </view>
                </view>
                <u-datetime-picker :show="isPickerShow" @cancel="isPickerShow = false" mode="date"
                    @confirm="dueTimeConfirm"></u-datetime-picker>
                <u-datetime-picker :show="istPickerShow" @cancel="istPickerShow = false" mode="date"
                    @confirm="terminateTimeConfirm"></u-datetime-picker>
                <u-divider text="已经到底了"></u-divider>
            </view>
@@ -100,6 +103,7 @@
                    <u-button type="primary" :plain="true" text="添加租赁信息" @click="addRental"></u-button>
                </view>
            </view>
        </view>
    </view>
</template>
@@ -108,6 +112,10 @@
    import {
        getHouseRentInfo
    } from "@/api/doorplateAddress/doorplateAddress";
    import {
        deleteRentalInfo,
        updateDueTime
    } from "@/api/houseRental/houseRental.js";
    export default {
        components: {},
@@ -125,7 +133,24 @@
                    allNum: 0
                },
                ownerInfoList: [],
                rentOutList: []
                rentOutList: [],
                isPickerShow: false,
                istPickerShow: false,
                currentRentalId: '',
                isModelShow: false,
                status: [{
                        name: '未到期',
                        value: 0
                    },
                    {
                        name: '已到期',
                        value: 1
                    },
                    {
                        name: '已终止',
                        value: 2
                    },
                ]
            }
        },
@@ -157,14 +182,15 @@
                    houseName,
                    unitName,
                    houseRentalList,
                    householdList
                    householdList,
                    subAoi
                } = res.data
                this.houseCode = addressCode
                this.rentOutList = houseRentalList
                this.ownerInfoList = householdList
                this.houseInfo.houseName = houseName
                this.houseInfo.unitName = unitName
                this.houseInfo.houseTitle = aoiName + ':' + buildingName
                this.houseInfo.houseTitle =( aoiName || subAoi) + ':' + buildingName
                // 判断当前租客有没有过期
                this.rentOutList.forEach(item => {
                    // 事件格式处理
@@ -174,6 +200,7 @@
                    item.allNum = item.houseTenantVOList.length
                    // 多人个租客将第一个作为显示
                    item.tenant = item.houseTenantVOList.length > 0 ? item.houseTenantVOList[0].name : ''
                    item.housingRentalId = item.houseTenantVOList[0]?.housingRentalId
                })
                this.houseInfo.allNum = householdList.length
@@ -188,7 +215,61 @@
            },
            addMember() {
                this.$u.func.globalNavigator('/subPackage/house/member/index')
            },
            editRent(item) {
                const { houseCode, id } = item
                this.$u.func.globalNavigator(`/subPackage/bs/views/rentDetail?houseCode=${houseCode}&id=${id}`)
            },
            reletRent(item) {
                console.log(item);
                this.currentRentalId = item.housingRentalId
                this.isPickerShow = true
            },
            deleteRent(item) {
                this.currentRentalId = item.housingRentalId
                this.istPickerShow = true
            },
            async dueTimeConfirm(e) {
                const time = uni.$u.timeFormat(e.value, 'yyyy-mm-dd')
                const res = await updateDueTime({
                    id: this.currentRentalId,
                    dueTime: time
                })
                if (res.code !== 200) {
                    uni.showToast({
                        title: "续租失败",
                        icon: "error",
                        duration: 1500
                    })
                    return
            }
                this.isPickerShow = false
                this.getHouseRentInfoList()
            },
            async terminateTimeConfirm(e) {
                const time = uni.$u.timeFormat(e.value, 'yyyy-mm-dd')
                const res = await updateDueTime({
                    id: this.currentRentalId,
                    terminationTime: time
                })
                if (res.code !== 200) {
                    uni.showToast({
                        title: "终止失败",
                        icon: "error",
                        duration: 1500
                    })
                    return
                }
                this.istPickerShow = false
                this.getHouseRentInfoList()
            },
            findObjValue(value, obj) {
                const res = obj.find(item => {
                    return item.value == value
                })
                return res.name
            },
        }
    }
</script>