zhongrj
2023-11-05 a3f6fb796222a1afc37e748495bd6b515a4c4c53
住户字典挂接
4 files modified
142 ■■■■■ changed files
api/system/dict.js 2 ●●● patch | view | raw | blame | history
subPackage/house/family/index.vue 2 ●●● patch | view | raw | blame | history
subPackage/house/member/index.vue 130 ●●●●● patch | view | raw | blame | history
subPackage/house/roomDetails/index.vue 8 ●●●●● patch | view | raw | blame | history
api/system/dict.js
@@ -11,7 +11,7 @@
export const bizDictionary = (params) => {
    return http.request({
        url: '/api/blade-system/dict-biz/dictionary',
        url: '/blade-system/dict-biz/dictionary',
        method: 'GET',
        params
    })
subPackage/house/family/index.vue
@@ -25,7 +25,7 @@
                                                        <u-icon name="photo"></u-icon>
                                                    </view>
                                                    <view v-show="!!scItem.roleType === '业主'">
                                                    <view v-show="!!scItem.roleType == 1">
                                                        <u-icon name="photo"></u-icon>
                                                    </view>
                                                </view>
subPackage/house/member/index.vue
@@ -171,6 +171,9 @@
    import {
        saveOrUpdateHousehold,removeHousehold
    } from '@/api/house/household.js'
    import {
        bizDictionary
    } from '@/api/system/dict.js'
    export default {
        components: {
            selectBus
@@ -201,92 +204,8 @@
                typeShow: false,
                roleName: "",
                dataList: {
                    roleList: [{
                            value: "1",
                            name: '业主',
                        },
                        {
                            value: "2",
                            name: '出租户',
                        },
                        {
                            value: "3",
                            name: '空挂户',
                        },
                    ],
                    relationshipList: [{
                            value: 1,
                            name: '业主',
                        },
                        {
                            value: 2,
                            name: '妻子',
                        },
                        {
                            value: 3,
                            name: '丈夫',
                        },
                        {
                            value: 4,
                            name: '女儿',
                        },
                        {
                            value: 5,
                            name: '儿子',
                        },
                        {
                            value: 6,
                            name: '母亲',
                        },
                        {
                            value: 7,
                            name: '父亲',
                        },
                        {
                            value: 8,
                            name: '爷爷',
                        },
                        {
                            value: 9,
                            name: '女婿',
                        },
                        {
                            value: 10,
                            name: '孙子',
                        },
                        {
                            value: 11,
                            name: '孙女',
                        },
                        {
                            value: 12,
                            name: '外公',
                        },
                        {
                            value: 13,
                            name: '外婆',
                        },
                        {
                            value: 14,
                            name: '外孙女',
                        },
                        {
                            value: 15,
                            name: '外孙',
                        },
                        {
                            value: 16,
                            name: '儿媳',
                        },
                        {
                            value: 17,
                            name: '租户',
                        },
                        {
                            value: 18,
                            name: '其他',
                        },
                    ],
                    roleList: [],
                    relationshipList: [],
                    genderList:[
                        {
                            value: 1,
@@ -378,10 +297,36 @@
            }
        },
        onShow() {
        },
        methods: {
            // 获取业务字典
            async getBizDict(code,list){
                const param = {
                    code: code
                }
                const res = await bizDictionary(param)
                res.data.forEach(e=>{
                    list.push({
                        name:e.dictValue,
                        value:Number(e.dictKey)
                    })
                })
            },
            // 获取住户信息
            getHouseholdInfo(data){
            async getHouseholdInfo(data){
                // 获取角色关系字典
                await this.getBizDict('roleRelation',this.dataList.relationshipList)
                // 获取角色字典
                await this.getBizDict('roleType',this.dataList.roleList)
                // 获取民族字典
                await this.getBizDict('nationType',this.dataList.ethnicityList)
                // 获取学历字典
                await this.getBizDict('educationType',this.dataList.educationList)
                // 获取工作状态字典
                await this.getBizDict('workStatusType',this.dataList.workStatusList)
                // 获取婚姻状态字典
                await this.getBizDict('marriageStatusType',this.dataList.maritalStatusList)
                this.form = data
                this.roleTypeName = this.findObjValue(data.roleType, this.dataList.roleList)
                this.relationshipName = this.findObjValue(data.relationship, this.dataList.relationshipList)
@@ -458,10 +403,13 @@
                })
            },
            findObjValue(value, obj) {
                const res = obj.find(item => {
                    return item.value == value
                })
                return res.name
                if(value){
                    const res = obj.find(item => {
                        return item.value == value
                    })
                    return res.name
                }
                return ""
            },
            // 跳转到首页
            navigator() {
subPackage/house/roomDetails/index.vue
@@ -34,8 +34,8 @@
                                <view class="flex">
                                    关系:
                                    <view class="flex a-i-c">
                                        <u-tag :text="item.relationship" size="mini"
                                            :bgColor="item.residentialStatus == 1 ? '#07C160' : '#1989FA'"></u-tag>
                                        <u-tag :text="item.roleRelationName" size="mini"
                                            :bgColor="item.relationship == 1 ? '#07C160' : '#1989FA'"></u-tag>
                                    </view>
                                </view>
                            </view>
@@ -165,10 +165,9 @@
                        name: '已终止',
                        value: 2
                    },
                ]
                ],
            }
        },
        onLoad(e) {
            const {
                id
@@ -178,7 +177,6 @@
        onShow() {
            this.getHouseRentInfoList()
        },
        methods: {
            // 跳转住户标签管理页面
            goToHouseholdLabel(data){