GULIMMO
2023-11-03 753e273d8e97ac29c18000ee6432361a44ba77d0
房屋详情、房屋管理修改
3 files modified
132 ■■■■ changed files
api/houseRental/houseRental.js 22 ●●●●● patch | view | raw | blame | history
subPackage/house/roomControl/index.vue 80 ●●●● patch | view | raw | blame | history
subPackage/house/roomDetails/index.vue 30 ●●●● patch | view | raw | blame | history
api/houseRental/houseRental.js
@@ -27,11 +27,31 @@
// 续租
export const updateRetalInfo = (data) => {
    return http.request({
        url: '/blade-houseRental/houseRental/updateHouseRental',
        url: 'blade-houseRental/houseRental/updateHouseRental',
        method: 'POST',
        custom: {
            'Authorization': true
        },
        data
    })
}
// 房屋标签修改
export const updateHouseLabel = (data) => {
    return http.request({
        url: 'blade-houseLabel/houseLabel/saveOrUpdateHouseLabel',
        method: 'POST',
        data
    })
}
// 房屋标签撤销
export const removeHouseLabel = (ids) => {
    return http.request({
        url: 'blade-houseLabel/houseLabel/remove',
        method: 'POST',
        params: {
            ids
        }
    })
}
subPackage/house/roomControl/index.vue
@@ -80,9 +80,13 @@
    import uploadMixin from "@/mixin/uploadMixin";
    import {
        getHouseDetail,
        getHouseLabelList,
        uploadFile
        getHouseLabelList,
        uploadFile,
    } from "@/api/doorplateAddress/doorplateAddress";
    import {
        updateHouseLabel,
        removeHouseLabel
    } from "@/api/houseRental/houseRental.js";
    export default {
        mixins: [uploadMixin],
        data() {
@@ -130,6 +134,8 @@
                        color: '#EE0A24'
                    }
                ],
                currentLabelInfo: {},
                currentColorInfo: {},
                labelModelInfo: {
                    title: '',
                    selectedColor: ''
@@ -158,6 +164,7 @@
            showLabelPopup(item) {
                this.popupShow = true
                this.labelModelInfo.title = item.name
                this.currentLabelInfo = item
            },
            popupConfirm() {
@@ -165,32 +172,67 @@
            },
            radioChange(item) {
                this.currentColorInfo = item
            },
            async popupConfirm() {
                const {
                    id
                } = this.currentLabelInfo
                const {
                    color,
                    name
                } = this.currentColorInfo
                let res = null
                if (name === '撤销') {
                    res = await removeHouseLabel(id)
                } else {
                    res = await updateHouseLabel({
                        houseCode: this.houseCode,
                        labelId: id,
                        color
                    })
                }
                if (res.code !== 200) {
                    uni.showToast({
                        title: "修改失败",
                        icon: "error",
                        duration: 1500
                    })
                    return
                }
                this.getLabelList()
                this.popupShow = false
            },
            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
                //     ]
                // }
                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
            },
            async afterReadImg(event) {
                let lists = [].concat(event.file)
                lists.forEach(item => {
                    const { url } = item
                    uploadFile(item)
                })
                // let lists = [].concat(event.file)
                // lists.forEach(item => {
                //     const { url } = item
                //     uploadFile(item)
                // })
            }
        }
    }
subPackage/house/roomDetails/index.vue
@@ -69,7 +69,7 @@
                                租客:{{item.tenant}}(共{{item.allNum}}人)
                            </view>
                            <view class="r">
                                <u-icon name="trash-fill" color="red"></u-icon>
                                <u-icon name="trash-fill" color="red" @click="deleteRent(item)"></u-icon>
                            </view>
                        </view>
                        <view class="t flex j-c-s-b a-i-c">
@@ -83,7 +83,7 @@
                        <view class="btn-box flex j-c-s-a">
                            <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>
                            <u-button color="#FCCED3" text="终止" @click="terRent(item)"></u-button>
                        </view>
                    </view>
                </view>
@@ -91,7 +91,9 @@
                    @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>
                <u-divider text="已经到底了"></u-divider>
                <u-modal :show="isModelShow" width="auto" :showCancelButton="true" title="提示" content="请确认是否删除当前租户信息"
                    @cancel="isModelShow = false" @confirm="deleteRentalConfirm"></u-modal>
            </view>
            <view class="edit-btn">
@@ -226,9 +228,13 @@
                this.isPickerShow = true
            },
            
            deleteRent(item) {
            terRent(item) {
                this.currentRentalId = item.housingRentalId
                this.istPickerShow = true
            },
            deleteRent(item) {
                this.currentRentalId = item.housingRentalId
                this.isModelShow = true
            },
            async dueTimeConfirm(e) {
                const time = uni.$u.timeFormat(e.value, 'yyyy-mm-dd')
@@ -264,6 +270,22 @@
                this.istPickerShow = false
                this.getHouseRentInfoList()
            },
            async deleteRentalConfirm() {
                const {
                    code,
                    data
                } = await deleteRentalInfo(this.currentRentalId)
                if (code !== 200) {
                    uni.showToast({
                        title: "删除失败",
                        icon: "error",
                        duration: 1500
                    })
                    return
                }
                this.isModelShow = false
                this.getHouseRentInfoList()
            },
            findObjValue(value, obj) {
                const res = obj.find(item => {
                    return item.value == value