guoshilong
2023-11-04 709941a83810c4069f6caa2899c5f0c886671497
Merge branch 'master' of http://s16s652780.51mypc.cn:49896/r/jczz_app
13 files modified
4 files added
408 ■■■■ changed files
api/doorplateAddress/doorplateAddress.js 38 ●●●●● patch | view | raw | blame | history
api/house/house.js 20 ●●●●● patch | view | raw | blame | history
api/house/houseLabel.js 32 ●●●●● patch | view | raw | blame | history
api/houseRental/houseRental.js 12 ●●●●● patch | view | raw | blame | history
api/label/label.js 9 ●●●●● patch | view | raw | blame | history
common/setting.js 3 ●●●● patch | view | raw | blame | history
mixin/uploadMixin.js 7 ●●●●● patch | view | raw | blame | history
pages/home/index.vue 26 ●●●● patch | view | raw | blame | history
pages/login/login-account.vue 38 ●●●● patch | view | raw | blame | history
static/icon/nav-07.png patch | view | raw | blame | history
static/icon/nav-08.png patch | view | raw | blame | history
subPackage/bs/components/list/rentList.vue 2 ●●●●● patch | view | raw | blame | history
subPackage/bs/views/rentDetail.vue 2 ●●● patch | view | raw | blame | history
subPackage/bs/views/zhsb.vue 4 ●●●● patch | view | raw | blame | history
subPackage/house/roomControl/index.vue 166 ●●●● patch | view | raw | blame | history
subPackage/house/roomDetails/index.vue 44 ●●●● patch | view | raw | blame | history
subPackage/workbench/views/cscj.vue 5 ●●●● patch | view | raw | blame | history
api/doorplateAddress/doorplateAddress.js
@@ -10,6 +10,7 @@
    clientSecret
} from '@/common/setting'
// 获取楼栋集合数据
export const getDoorplateAddressList = (code, type) => {
    return http.request({
        url: 'blade-doorplateAddress/doorplateAddress/getDoorplateAddressList',
@@ -21,8 +22,7 @@
    })
}
// 获取功能菜单数据
export const getFuncList = (type, roleName) => {
    return http.request({
        url: 'blade-doorplateAddress/doorplateAddress/getFuncList',
@@ -42,7 +42,7 @@
    })
}
// 获取当前房屋出租信息
// 获取当前房屋/出租屋信息
export const getHouseRentInfo = (code) => {
    return http.request({
        url: 'blade-doorplateAddress/doorplateAddress/getHouseRentInfo',
@@ -50,38 +50,6 @@
        params: {
            code
        }
    })
}
// 获取房屋标签信息
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
    })
}
api/house/house.js
New file
@@ -0,0 +1,20 @@
import http from '@/http/api.js'
// 获取房屋详细信息
export const getHouseDetail = (param) => {
    return http.request({
        url: 'blade-house/house/getHouseDetail',
        method: 'GET',
        params: param
    })
}
// 获取房屋详细信息
export const saveOrUpdateHouse = (data) => {
    return http.request({
        url: 'blade-house/house/saveOrUpdateHouse',
        method: 'POST',
        data: data
    })
}
api/house/houseLabel.js
New file
@@ -0,0 +1,32 @@
import http from '@/http/api.js'
// 获取房屋详细信息
export const getHouseDetail = (houseCode) => {
    return http.request({
        url: 'blade-house/house/getHouseDetail',
        method: 'GET',
        params: {
            houseCode
        }
    })
}
// 房屋标签修改
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
        }
    })
}
api/houseRental/houseRental.js
@@ -1,5 +1,15 @@
import http from '@/http/api.js'
// 添加租赁信息
export const addHouseRental = (data) => {
    return http.request({
        url: 'blade-houseRental/houseRental/add',
        method: 'POST',
        data
    })
}
//删除
export const deleteRentalInfo = (id) => {
    return http.request({
@@ -27,7 +37,7 @@
// 续租
export const updateRetalInfo = (data) => {
    return http.request({
        url: '/blade-houseRental/houseRental/updateHouseRental',
        url: 'blade-houseRental/houseRental/updateHouseRental',
        method: 'POST',
        custom: {
            'Authorization': true
api/label/label.js
@@ -7,4 +7,13 @@
        method: 'GET',
        params
    })
}
// 获取标签信息
export const getLabelListByParentId = (param) => {
    return http.request({
        url: 'blade-label/label/getLabelList',
        method: 'GET',
        params: param
    })
}
common/setting.js
@@ -11,7 +11,8 @@
    // 开发环境接口Url
    // devUrl: 'https://sk.hubeishuiyi.cn',
    // devUrl: 'http://192.168.1.156:9528',
    devUrl:'http://192.168.0.207:9528',
    devUrl:'http://192.168.1.50:9528',
    minioBaseUrl:"http://60.220.177.113:9000/jczz/",
    // 数据中台接口url
    // dataCenterUrl: 'http://10.10.2.192/services',
    dataCenterUrl: 'https://sk.hubeishuiyi.cn/services',
mixin/uploadMixin.js
@@ -63,7 +63,7 @@
        //上传成功后对返回数据进行处理
        async afterReadImg(event) {
            this.showLoading()
            var that = this;
            // 当设置 multiple 为 true 时, file 为数组格式,否则为对象格式
            let lists = [].concat(event.file)
            let fileListLen = this.form.images.length
@@ -76,8 +76,9 @@
            })
            for (let i = 0; i < lists.length; i++) {
                const result = await this.uploadFilePromise(lists[i].url)
                this.form.images.splice(fileListLen, 1, Object.assign({}, {
                    url: result.data.link
                that.form.images.splice(fileListLen, 1, Object.assign({}, {
                    url: result.data.link,
                    name:result.data.name
                }))
                fileListLen++
            }
pages/home/index.vue
@@ -10,8 +10,8 @@
            </view>
        </u-navbar>
        <view class="content">
            <view class="swiper">
                <u-swiper :list="swiperList"></u-swiper>
            <view class="swiper mb-30">
                <u-swiper :list="swiperList"  height="320rpx"></u-swiper>
            </view>
            <view class="" v-if="roleType != 1">
                <u-grid :border="false" :col="roleType == 2?3:4">
@@ -91,7 +91,7 @@
                        :key="index" :customStyle="{paddingTop:20+'rpx'}">
                        <view class="grid-item flex f-d-c a-i-c" :style="{background:item.style.background}">
                            <u-icon :name="item.icon" width="60rpx" height="60rpx"></u-icon>
                            <text class="grid-text f-24 mt-10">{{item.text}}</text>
                            <text class="grid-text f-24 fw mt-10">{{item.text}}</text>
                        </view>
                    </u-grid-item>
                </u-grid>
@@ -107,17 +107,17 @@
                <view class="row flex j-c-s-b">
                    <view class="row-item flex_base">
                        <u-icon></u-icon>
                        <view class="flex f-d-c fw">
                        <u-icon name="/static/icon/nav-07.png"  width="90rpx"  height="90rpx"></u-icon>
                        <view class="flex f-d-c fw ml-20">
                            <text class="f-28">一次性</text>
                            <text class="f-36">8</text>
                            <text class="f-36 c-main">8</text>
                        </view>
                    </view>
                    <view class="row-item flex_base">
                        <u-icon></u-icon>
                        <view class="flex f-d-c fw">
                        <u-icon name="/static/icon/nav-08.png"  width="90rpx"  height="90rpx"></u-icon>
                        <view class="flex f-d-c fw ml-20">
                            <text class="f-28">周期性</text>
                            <text class="f-36">8</text>
                            <text class="f-36"  style="color:#FD7F19">8</text>
                        </view>
                    </view>
                </view>
@@ -582,6 +582,9 @@
</script>
<style lang="scss" scoped>
    page{
        color:#333;
    }
    .top {
        width: 530rpx;
@@ -637,11 +640,10 @@
    .caption {
        width: 100%;
        padding: 40rpx 0 0;
        padding: 30rpx 0 0;
        .line {
            width: 6rpx;
            height: 29rpx;
            height: 28rpx;
            background-color: #017BFC;
            margin-right: 14rpx;
        }
pages/login/login-account.vue
@@ -1,10 +1,15 @@
<template>
    <view class="container">
        <view class="logo">
            <!--             <image src="https://sk.hubeishuiyi.cn/business/xcxImg/wxlogo.png" lazy-load show-menu-by-longpress
                style="width: 100rpx;height: 100rpx;"></image> -->
            <view class="title">基层智治</view>
        </view>
        <!-- <view class="logo">
                        <image src="https://sk.hubeishuiyi.cn/business/xcxImg/wxlogo.png" lazy-load show-menu-by-longpress
                style="width: 100rpx;height: 100rpx;"></image>
            <view class="title">基层智治</view>
        </view>-->
            <image class="bg"  src="/static/img/login-bg.png"  :style="{height:screenHeight}"  mode="aspectFill"></image>
        <view class="content">
            <view class="top">
                <u--form labelPosition="top" labelWidth="60" :model="form" :rules="rules" ref="form">
@@ -98,9 +103,15 @@
                passwordProps: {
                    passwordIcon: "eye-off",
                    passwordType: "password"
                }
                },
                screenHeight:""
            }
        },
        onLoad(){
            this.screenHeight = `${uni.getSystemInfoSync().screenHeight}px`;
        },
        methods: {
            submit() {
                const that = this
@@ -131,6 +142,12 @@
</script>
<style lang="scss">
    .bg{
        width:100%;
        display: block;
    }
    .privacy-policy {
        width: 100%;
        padding: 40rpx 40rpx 0 80rpx;
@@ -141,7 +158,8 @@
        min-height: 100vh;
        overflow: hidden;
        // background: url("https://sk.hubeishuiyi.cn/business/xcxImg/reservoirImg/default.jpg") no-repeat;
        background-size: 100% 100%;
        // background-size: 100% 100%;
        position: relative;
        .set-icon {
            vertical-align: middle;
@@ -174,14 +192,16 @@
        flex-direction: column;
        justify-content: space-around;
        align-items: center;
        position: absolute;
        top:0;
        left:0;
        // height: 90vh;
        width: 100%;
        .top {
            width: 100%;
            width: 100%;
            background: #fff;
            // background: #fff;
            padding: 20px 0;
            position: fixed;
            bottom: 0px;
static/icon/nav-07.png
static/icon/nav-08.png
subPackage/bs/components/list/rentList.vue
@@ -18,8 +18,10 @@
            <view class="list-btn">
                <u-button icon="edit-pen" class="btn-item" type="primary" plain text="修改"
                :disabled="item.status == 1 || item.status == 2"
                    @click="pushPage(item)"></u-button>
                <u-button icon="calendar" class="btn-item" type="primary" plain text="续租"
                :disabled="item.status == 2"
                    @click="xzHandleClick(item)"></u-button>
                <u-button icon="order" class="btn-item" type="primary" plain text="终止"
                    :disabled="item.status == 1 || item.status == 2" @click="terminate(item)"></u-button>
subPackage/bs/views/rentDetail.vue
@@ -83,10 +83,10 @@
    import uploadMixin from "@/mixin/uploadMixin";
    import {
        uploadFile,
        addHouseRental,
        getHouseRentInfo,
    } from "@/api/doorplateAddress/doorplateAddress";
    import {
        addHouseRental,
        updateRetalInfo
    } from '@/api/houseRental/houseRental.js'
    import {
subPackage/bs/views/zhsb.vue
@@ -53,7 +53,6 @@
            location: "",
            room: "",
            num: 0,
            //出租列表
            rentList: []
        }
@@ -72,13 +71,14 @@
            const res = await getHouseRentInfo(this.houseCode)
            const {
                aoiName,
                subAoi,
                buildingName,
                doorplateName,
                unitName,
                houseRentalList
            } = res.data
            this.rentList = []
            this.location = (!!aoiName ? aoiName : '') + buildingName
            this.location = (!!aoiName ? aoiName : subAoi) + buildingName
            this.room = (!!unitName ? unitName : '') + doorplateName + "室"
            this.num = 0
            houseRentalList !== 0 && houseRentalList.forEach(item => {
subPackage/house/roomControl/index.vue
@@ -11,28 +11,27 @@
                            </u--input>
                        </u-form-item>
                        <u-form-item class="form-item" labelWidth="100" label="地址" required>
                        <u-form-item class="form-item" labelWidth="100" label="地址" >
                            <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" disabled>
                        <u-form-item class="form-item" labelWidth="100" label="物业月费" >
                            <u--input border="none" v-model="form.propertyPrice" 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" disabled>
                        <u-form-item class="form-item" labelWidth="100" label="到期时间" >
                            <u--input border="none" v-model="form.serviceDue" disabled>
                            </u--input>
                        </u-form-item>
                    </view>
                    <box-title class="mt-20" title="房屋外观"></box-title>
                    <view class="pic mt-20">
                        <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">
                        <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>
                    </view>
@@ -47,7 +46,7 @@
            </view>
            <view class="edit-btn">
                <u-button type="primary" text="修改数据"></u-button>
                <u-button type="primary" text="修改数据" @click="updateHouseInfo(item)"></u-button>
            </view>
        </view>
@@ -79,10 +78,21 @@
<script>
    import uploadMixin from "@/mixin/uploadMixin";
    import {
        getHouseDetail,
        getHouseLabelList,
        uploadFile
    } from "@/api/doorplateAddress/doorplateAddress";
    import {
        getLabelListByParentId
    } from "@/api/label/label.js";
    import {
        updateHouseLabel,
        removeHouseLabel
    } from "@/api/houseRental/houseRental.js";
    import {
        getHouseDetail,saveOrUpdateHouse
    } from "@/api/house/house.js";
    import {
        minioBaseUrl
    } from '@/common/setting'
    export default {
        mixins: [uploadMixin],
        data() {
@@ -91,9 +101,9 @@
                form: {
                    phone: "",
                    address: "",
                    property_price: "",
                    service_due: "",
                    image_urls: []
                    propertyPrice: "",
                    serviceDue: "",
                    imageUrls: "",
                },
                showList: {
                    relation: false
@@ -130,6 +140,8 @@
                        color: '#EE0A24'
                    }
                ],
                currentLabelInfo: {},
                currentColorInfo: {},
                labelModelInfo: {
                    title: '',
                    selectedColor: ''
@@ -155,9 +167,43 @@
            this.getHouseDetailInfo()
        },
        methods: {
            // 更新房屋数据
            async updateHouseInfo(){
                this.form['houseCode'] = this.houseCode
                if (this.form.images.length > 0) {
                    let urls = []
                    this.form.images.forEach(e => {
                        urls.push(e.name)
                    })
                    this.form.imageUrls = urls.join(",")
                }
                const {
                    code,
                    data
                } = await saveOrUpdateHouse(this.form)
                if (code !== 200) {
                    uni.showToast({
                        title: "房屋信息修改失败",
                        icon: "error",
                        duration: 1500
                    })
                    return
                }
                uni.showToast({
                    title: "房屋信息修改成功",
                    icon: "success",
                    duration: 1500,
                    success: () => {
                        setTimeout(() => {
                            uni.navigateBack()
                        }, 1500)
                    }
                })
            },
            showLabelPopup(item) {
                this.popupShow = true
                this.labelModelInfo.title = item.name
                this.currentLabelInfo = item
            },
            popupConfirm() {
@@ -165,33 +211,81 @@
            },
            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 param = {
                    houseCode : this.houseCode
                }
                const res = await getHouseDetail(param)
                if(null != res.data){
                    const images = []
                    const {
                        phone,
                        address,
                        propertyPrice,
                        serviceDue,
                        imageUrls
                    } = res.data
                    if(imageUrls.length>0){
                        const urls = imageUrls.split(',')
                        // 遍历
                        urls.forEach(e=>{
                            images.push({
                                url:minioBaseUrl + e,
                                name: e
                            })
                        })
                    }
                    this.form = {
                        phone,
                        address,
                        propertyPrice,
                        serviceDue,
                        imageUrls,
                        images
                    }
                }
            },
            // 获取房屋标签信息
            async getLabelList() {
                const res = await getHouseLabelList()
                const param = {
                    parentId:1001
                }
                const res = await getLabelListByParentId(param)
                this.labelBtnList = res.data
            },
            async afterReadImg(event) {
                let lists = [].concat(event.file)
                lists.forEach(item => {
                    const { url } = item
                    uploadFile(item)
                })
            }
        }
    }
</script>
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">
@@ -81,9 +81,12 @@
                            </view>
                        </view>
                        <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 icon="edit-pen" class="btn-item" type="primary" plain text="修改"
                                :disabled="item.status == 1 || item.status == 2" @click="editRent(item)"></u-button>
                            <u-button icon="calendar" class="btn-item" type="primary" plain text="续租"
                                :disabled="item.status == 2" @click="reletRent(item)"></u-button>
                            <u-button icon="order" class="btn-item" type="primary" plain text="终止"
                                :disabled="item.status == 1 || item.status == 2" @click="terRent(item)"></u-button>
                        </view>
                    </view>
                </view>
@@ -91,7 +94,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 +231,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')
@@ -262,6 +271,22 @@
                    return
                }
                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) {
@@ -353,6 +378,13 @@
                            &>.u-button {
                                margin: 0 16rpx;
                            }
                            .btn-item {
                                margin: 0 10rpx;
                                border: 0;
                                color: #009FFF;
                                font-weight: 700;
                            }
                        }
                    }
                }
subPackage/workbench/views/cscj.vue
@@ -415,14 +415,11 @@
            submit() {
                const that = this
                this.$refs.form.validate().then(valid => {
                    if (valid) {
                        if (this.form.images.length > 0) {
                            let urls = []
                            this.form.images.forEach(e => {
                                urls.push(e.url)
                                urls.push(e.name)
                            })
                            this.form.imageUrls = urls.join(",")
                        }