Lou
2024-01-03 b635858327dcf0a098636deb1f88d64e7e7819e5
更新
5 files modified
376 ■■■■■ changed files
subPackage/house/member/householdLabel.vue 61 ●●●● patch | view | raw | blame | history
subPackage/house/member/index.vue 143 ●●●● patch | view | raw | blame | history
subPackage/house/roomControl/index.vue 61 ●●●● patch | view | raw | blame | history
subPackage/house/roomDetails/index.vue 6 ●●●● patch | view | raw | blame | history
subPackage/user/family/list.vue 105 ●●●●● patch | view | raw | blame | history
subPackage/house/member/householdLabel.vue
@@ -189,7 +189,7 @@
                    })
                })
                if (this.id) {
                if (this.id || this.householdInfo.householdLabelList) {
                    let householdLabelList = this.householdInfo.householdLabelList
                    if (householdLabelList.length > 0) {
                        labelChildAll.forEach(e => {
@@ -242,12 +242,6 @@
                let res = null
                if (name === '撤销') {
                    if (this.number == 1) {
                        // const data = {
                        //     labelId: id,
                        //     householdId: this.householdInfo.id
                        // }
                        // res = await removeHouseholdLabel(data)
                        this.removeLabel(id)
                    } else {
                        uni.showToast({
@@ -258,27 +252,12 @@
                        return
                    }
                } else {
                    // res = await saveOrUpdateHouseholdLabel({
                    //     householdId: this.householdInfo.id,
                    //     labelId: id,
                    //     remark: this.remark,
                    //     lableType: 1,
                    //     color,
                    //     houseCode: this.houseCode,
                    //     userId: this.householdInfo.associatedUserId
                    // })
                    this.addLabel(id, color)
                }
                // if (res.code !== 200) {
                //     uni.showToast({
                //         title: "修改失败",
                //         icon: "error",
                //         duration: 1500
                //     })
                //     return
                // }
                // 刷新页面
                this.getLabelList()
                if (!this.from) {
                    this.getLabelList()
                }
                this.popupShow = false
            },
@@ -286,7 +265,6 @@
                if (this.from) {
                    let item = this.labelBtnList[this.fIndex];
                    item.children[this.cIndex].color = "";
                    // this.labelBtnList[this.fIndex].children[this.cIndex]
                    this.$set(this.labelBtnList, this.fIndex, item);
                    this.updatePrePageData()
                } else {
@@ -307,15 +285,12 @@
            },
            addLabel(id, color) {
                console.log("color==>", color);
                if (this.from) {
                    let item = this.labelBtnList[this.fIndex].children[this.cIndex];
                    item.color = color;
                    item.remark = this.remark;
                    console.log(item);
                    // this.labelBtnList[this.fIndex].children[this.cIndex]
                    this.$set(this.labelBtnList[this.fIndex].children, this.cIndex, item);
                    // this.updatePrePageData()
                    let item = this.labelBtnList[this.fIndex];
                    item.children[this.cIndex].color = color;
                    item.children[this.cIndex].remark = this.remark;
                    this.$set(this.labelBtnList, this.fIndex, item);
                    this.updatePrePageData()
                } else {
                    saveOrUpdateHouseholdLabel({
                        householdId: this.householdInfo.id,
@@ -337,6 +312,7 @@
                }
            },
            //更新上个页面数据
            updatePrePageData() {
                let pages = getCurrentPages();
                let prePage = pages[pages.length - 2];
@@ -354,22 +330,7 @@
                        }
                    }
                }
                prePage.$vm.form.householdLabelList = arr;
                // householdLabelList:    [
                //      {
                //     color: "#30D17C"
                //     createTime: null
                //     houseCode: "00B2E27337554723B2F4843DCE4DE613"
                //     householdId: "1738448756973039617"
                //     id: 837
                //     labelId: 4
                //     labelName: "特困人员"
                //     lableType: 1
                //     remark: ""
                //     userId: null
                //     }]
                this.$set(prePage.$vm.form, "householdLabelList", arr);
            }
        }
subPackage/house/member/index.vue
@@ -152,7 +152,12 @@
                        <u-form-item class="form-item" labelWidth="100" label="标签" @click="navTo">
                            <view class="">
                                <text style="color: #c0c4cc;"
                                    v-if="!form.householdLabelList || !form.householdLabelList.length">请选择</text>
                                <text class="f-28" v-else style="margin-right:5rpx;"
                                    v-for="i in form.householdLabelList">{{i.labelName}}</text>
                            </view>
                            <u-icon slot="right" name="arrow-right"></u-icon>
                        </u-form-item>
@@ -270,7 +275,12 @@
                </view>
            </view> -->
            <footer-btn :text="addOrUpdateTitle" @click="submit" />
            <view class="footer flex j-c-s-b a-i-c bgc-ff" v-if="type == 2 && from == 'family'">
                <button class="del-btn footer-btn" @click="delAction">删除</button>
                <button class="save-btn footer-btn" @click="submit">保存</button>
            </view>
            <footer-btn v-if="(type == 1 && from == 'family')  || !from" :text="addOrUpdateTitle" @click="submit" />
        </view>
        <!-- 事件类型下拉框 -->
@@ -442,7 +452,10 @@
                showRegion: false,
                navtivePlaceDefault: [],
                residentadDefault: [],
                isEdit: false
                isEdit: false,
                from: "",
                type: "",
                id: ""
            }
        },
        created() {
@@ -453,18 +466,44 @@
            console.log("data==>", data)
            this.houseCode = data.houseCode
            this.getRegionList()
            this.type = data.type;
            if (data.id) {
                this.id = data.id;
            }
            if (data.type == 1) {
                this.isEdit = false;
                this.addOrUpdateTitle = "保存"
                this.getAllBizDict()
                if (option.from) {
                    uni.setNavigationBarTitle({
                        title: "添加成员"
                    })
                }
            }
            if (data.type == 2) {
                this.isEdit = true;
                this.addOrUpdateTitle = "修改"
                if (option.from) {
                    uni.setNavigationBarTitle({
                        title: "编辑成员资料"
                    })
                }
                this.getHouseholdInfo(data)
            }
            if (option.from) {
                this.from = option.from;
            }
        },
        onShow() {
            console.log(this.form);
            if (this.id) {
                this.getHouseholdInfo()
            }
        },
        methods: {
            //选择籍贯
@@ -545,12 +584,12 @@
                })
            },
            // 获取住户信息
            async getHouseholdInfo(data) {
            async getHouseholdInfo() {
                // 获取所有字典
                await this.getAllBizDict()
                // this.form = data
                getHouseholdDetail({
                    id: data.id
                    id: this.id
                }).then(res => {
                    if (res.code == 200) {
                        this.form = res.data;
@@ -621,37 +660,6 @@
            // 新增更新操作
            async saveOrUpdate() {
                this.form['houseCode'] = this.houseCode
                // 字典解析
                // const roleTypeIndex = this.dataList.roleList.findIndex(item => item.name === this.roleTypeName)
                // const relationshipIndex = this.dataList.relationshipList.findIndex(item => item.name === this
                //     .relationshipName)
                // const genderIndex = this.dataList.genderList.findIndex(item => item.name === this.genderName)
                // const isPrimaryContactIndex = this.dataList.isPrimaryContactList.findIndex(item => item.name === this
                //     .isPrimaryContactName)
                // const ethnicityIndex = this.dataList.ethnicityList.findIndex(item => item.name === this.ethnicityName)
                // const educationIndex = this.dataList.educationList.findIndex(item => item.name === this.educationName)
                // const partyEmberIndex = this.dataList.partyEmberList.findIndex(item => item.name === this
                //     .partyEmberName)
                // const workStatusIndex = this.dataList.workStatusList.findIndex(item => item.name === this
                //     .workStatusName)
                // const maritalStatusIndex = this.dataList.maritalStatusList.findIndex(item => item.name === this
                //     .maritalStatusName)
                // this.form['roleType'] = roleTypeIndex >= 0 ? this.dataList.roleList[roleTypeIndex].value : ""
                // this.form['relationship'] = relationshipIndex >= 0 ? this.dataList.relationshipList[relationshipIndex]
                //     .value : ""
                // this.form['gender'] = genderIndex >= 0 ? this.dataList.genderList[genderIndex].value : ""
                // this.form['isPrimaryContact'] = isPrimaryContactIndex >= 0 ? this.dataList.isPrimaryContactList[
                //     isPrimaryContactIndex].value : ""
                // this.form['ethnicity'] = ethnicityIndex >= 0 ? this.dataList.ethnicityList[ethnicityIndex].value : ""
                // this.form['education'] = educationIndex >= 0 ? this.dataList.educationList[educationIndex].value : ""
                // this.form['partyEmber'] = partyEmberIndex >= 0 ? this.dataList.partyEmberList[partyEmberIndex].value :
                //     ""
                // this.form['workStatus'] = workStatusIndex >= 0 ? this.dataList.workStatusList[workStatusIndex].value :
                //     ""
                // this.form['maritalStatus'] = maritalStatusIndex >= 0 ? this.dataList.maritalStatusList[
                //     maritalStatusIndex].value : ""
                const res = await saveOrUpdateHousehold(this.form)
                if (res.code !== 200) {
                    uni.showToast({
@@ -705,9 +713,35 @@
                    this.$u.func.globalNavigator(
                        `householdLabel?data=${JSON.stringify(data)}`)
                }
            },
            delAction() {
                uni.showModal({
                    title: "提示!",
                    content: "是否要删除该家人信息?",
                    success: (res) => {
                        if (res.confirm) {
                            this.ddelActionRequest()
                        }
                    }
                })
            },
            ddelActionRequest() {
                removeHousehold(this.form.id).then(res => {
                    if (res.code == 200) {
                        setTimeout(() => {
                            uni.navigateBack();
                        }, 1000)
                    } else {
                        uni.showToast({
                            title: "删除失败",
                            icon: "error",
                            duration: 1500
                        })
                    }
                })
            }
        }
    }
</script>
@@ -797,6 +831,41 @@
        .c-30 {
            color: #303133;
        }
    }
    .footer {
        width: 100%;
        padding: 20rpx 30rpx;
        box-sizing: border-box;
        z-index: 999;
        position: fixed;
        bottom: 0;
        left: 0;
        backgroun-color: #fff;
        padding-bottom: calc(env(safe-area-inset-bottom) + 20rpx);
        box-shadow: 0rpx 0rpx 10rpx 1rpx rgba(0, 0, 0, 0.1);
        .footer-btn {
            width: 48%;
            height: 78rpx;
            line-height: 78rpx;
            border-radius: 8rpx 8rpx 8rpx 8rpx;
            font-size: 32rpx;
            color: #fff;
        }
        .add-btn {
            width: 100%;
            background: linear-gradient(163deg, #01BDFC 0%, #017BFC 100%);
        }
        .del-btn {
            background: linear-gradient(163deg, #FE6C5C 0%, #EA1F1F 99%);
        }
        .save-btn {
            background: linear-gradient(163deg, #01BDFC 0%, #017BFC 100%);
        }
    }
</style>
subPackage/house/roomControl/index.vue
@@ -4,24 +4,30 @@
            <view class="content">
                <u-form labelWidth="70" :model="form" ref="form" :rules="rules">
                    <view class="basic-info">
                        <u-form-item class="form-item" labelWidth="100" label="绑定手机" required prop="phone">
                            <u--input border="none" v-model="form.phone"  :disabled="roleType == 2?true:false"  placeholder="请输入">
                        <u-form-item class="form-item" labelWidth="100" label="绑定手机" required borderBottom prop="phone">
                            <u--input border="none" v-model="form.phone" :disabled="roleType == 2?true:false"
                                :placeholder="setPlaceholder(1)">
                            </u--input>
                        </u-form-item>
                        <u-form-item class="form-item" labelWidth="100" label="地址">
                            <u--input border="none" v-model="form.address" disabled>
                        <u-form-item class="form-item" labelWidth="100" label="地址" borderBottom>
                            <u--input border="none" :placeholder="setPlaceholder(1)" v-model="form.address"
                                :disabled="roleType == 2?true:false">
                            </u--input>
                        </u-form-item>
                        <u-form-item class="form-item" labelWidth="100" label="物业月费">
                            <u--input border="none" v-model="form.propertyPrice" disabled>
                        <u-form-item class="form-item" labelWidth="100" label="物业月费" borderBottom>
                            <u--input border="none" :placeholder="setPlaceholder(1)" v-model="form.propertyPrice"
                                :disabled="roleType == 2?true:false">
                            </u--input>
                        </u-form-item>
                        <u-form-item class="form-item" labelWidth="100" label="到期时间">
                            <u--input border="none" v-model="form.serviceDue" disabled>
                        <u-form-item class="form-item" labelWidth="100" label="到期时间" borderBottom
                            @click="showSelectDate = true">
                            <u--input border="none" :placeholder="setPlaceholder(2)" v-model="form.serviceDue" disabled
                                disabledColor="#ffffff">
                            </u--input>
                            <u-icon slot="right" name="arrow-right" v-show="roleType != 2"></u-icon>
                        </u-form-item>
                    </view>
@@ -33,7 +39,7 @@
                            @delete="deletePic" uploadIcon="/static/icon/upload.png">
                        </u-upload>
                    </view>
                    <view class=" flex label-btn-box b-c-w"  v-if="roleType == 2">
                    <view class=" flex label-btn-box b-c-w" v-if="roleType == 2">
                        <newBoxTitle title="房屋标签"></newBoxTitle>
                        <view class="list">
                            <view v-for="(item, index) in labelBtnList" :key="index">
@@ -75,6 +81,11 @@
        <my-select v-if="showList.relation" :show="showList.relation" v-model="form.relation" type="radio"
            popupTitle="请选择租客关系" :dataLists="dataList.relation" @cancel="showList.relation = false">
        </my-select>
        <u-datetime-picker ref="datetimePicker" :show="showSelectDate" v-model="serveTime" mode="datetime"
            :formatter="formatter" @confirm="confirmDate" @cancel="showSelectDate = false"></u-datetime-picker>
    </view>
</template>
@@ -179,7 +190,9 @@
                remark: '',
                // 标记
                number: 0,
                roleType:1
                roleType: 1,
                showSelectDate: false,
                serveTime: Number(new Date()),
            }
        },
@@ -190,17 +203,17 @@
        },
        onLoad(option) {
            if(option.code){
            if (option.code) {
                this.houseCode = option.code;
            }else {
            } else {
                this.houseCode = uni.getStorageSync("siteInfo").houseCode;
                uni.setNavigationBarTitle({
                    title:"我的房屋"
                    title: "我的房屋"
                })
            }
            let roleName = uni.getStorageSync("activeRole").roleName;
            if(roleName == "网格员"){
            if (roleName == "网格员") {
                this.roleType = 2;
            }
        },
@@ -209,6 +222,22 @@
            this.getHouseDetailInfo()
        },
        methods: {
            confirmDate(e) {
                if (this.roleType == 2) return;
                this.showSelectDate = false;
                this.form.serviceDue = uni.$u.timeFormat(e.value, 'yyyy-mm-dd hh:MM:ss')
            },
            setPlaceholder(type) {
                if (this.roleType == 2) {
                    return "未完善"
                } else {
                    return type == 1 ? "请输入" : "请选择"
                }
            },
            // 获取房屋详情
            async getHouseDetailInfo() {
                var that = this;
@@ -492,4 +521,4 @@
            }
        }
    }
</style>
</style>
subPackage/house/roomDetails/index.vue
@@ -240,7 +240,7 @@
                this.from = e.from;
            }
            this.getHouseRentInfoList()
        },
@@ -254,6 +254,10 @@
        },
        onShow() {
            this.getHouseRentInfoList()
        },
        methods: {
            // 跳转住户标签管理页面
            goToHouseholdLabel(data) {
subPackage/user/family/list.vue
@@ -1,22 +1,22 @@
<template>
    <view class="">
        <view class="list">
           <view class="list-item flex j-c-s-b a-i-c"  v-for="(item,index) in list" :key="index">
                   <view class="flex">
                    <u-avatar  src="/static/icon/user-01.png"  size="44"></u-avatar>
                       <view class="flex f-d-c ml-40 j-c-s-b">
                           <text class="f-28">{{item.name}}</text>
            <view class="list-item flex j-c-s-b a-i-c" v-for="(item,index) in list" :key="index">
                <view class="flex">
                    <u-avatar src="/static/icon/user-01.png" size="44"></u-avatar>
                    <view class="flex f-d-c ml-40 j-c-s-b">
                        <text class="f-28">{{item.name}}</text>
                        <!-- <view class="flex a-i-c">
                            <u-icon name="phone-fill"   color="#017BFC"></u-icon>
                            <text class="f-24 ml-10 c-99">13807937200</text>
                        </view> -->
                       </view>
                   </view>
                <button class="action-btn c-main f-24"   @click="navTo(2,item)">管理</button>
           </view>
                    </view>
                </view>
                <button class="action-btn c-main f-24" @click="navTo(2,item)">管理</button>
            </view>
        </view>
        <footer-btn  text="添加成员"  @click="navTo(1)"  />
        <footer-btn text="添加成员" @click="navTo(1)" />
    </view>
</template>
@@ -25,61 +25,76 @@
        getHouseRentInfo
    } from "@/api/doorplateAddress/doorplateAddress";
    export default {
        data(){
        data() {
            return {
                list:[]
                list: []
            }
        },
        onShow(){
        onShow() {
            this.getList()
        },
        methods:{
            getList(){
        methods: {
            getList() {
                let code = uni.getStorageSync("siteInfo").houseCode
                getHouseRentInfo(code).then(res=>{
                getHouseRentInfo(code).then(res => {
                    console.log(res);
                    if(res.code == 200){
                    if (res.code == 200) {
                        this.list = res.data.householdList;
                    }
                })
            },
            navTo(type,item){
                if(type == 2){
                    uni.navigateTo({
                        url:`edit?type=${type}&data=${JSON.stringify(item)}`
                    })
                }else {
                    uni.navigateTo({
                        url:`edit?type=${type}`
                    })
            // navTo(type,item){
            //     if(type == 2){
            //         uni.navigateTo({
            //             url:`edit?type=${type}&data=${JSON.stringify(item)}`
            //         })
            //     }else {
            //         uni.navigateTo({
            //             url:`edit?type=${type}`
            //         })
            //     }
            // }
            navTo(type, data = {}) {
                if (type == 1) {
                    data['type'] = 1
                    data['houseCode'] = this.houseCode
                }
            }
                if (type == 2) {
                    data['type'] = 2
                }
                var navData = JSON.stringify(data);
                this.$u.func.globalNavigator(`/subPackage/house/member/index?data=${navData}&from=family`)
            },
        }
    }
</script>
<style lang="scss">
    .list{
        padding:0 30rpx 130rpx;
        .list-item{
            padding:30rpx 0;
            border-bottom:1px solid #F5F5F5;
    .list {
        padding: 0 30rpx 130rpx;
        .list-item {
            padding: 30rpx 0;
            border-bottom: 1px solid #F5F5F5;
        }
        .action-btn{
            width:88rpx;
            height:40rpx;
        .action-btn {
            width: 88rpx;
            height: 40rpx;
            line-height: 40rpx;
            border-radius: 30rpx;
            border:1px solid currentColor;
            padding:0;
            margin:0;
            border: 1px solid currentColor;
            padding: 0;
            margin: 0;
        }
        .ml-40{
            margin-left:40rpx;
        .ml-40 {
            margin-left: 40rpx;
        }
    }
</style>