瀏覽代碼

修改物业管理-物业电话的id,修改发布活动的弹框选项

DESKTOP-4G80JF4\long 3 年之前
父節點
當前提交
572c896014

+ 17 - 0
operationSupport/src/components/common/buildingTree.vue

@@ -126,6 +126,23 @@ export default {
     },
     computed: {},
     methods: {
+        // 过滤选中的社区下的房间
+        filterhouse(val, datas) {
+            let array = datas;
+            let data;
+            for (let index = 0; index < array.length; index++) {
+                const element = array[index];
+                if (element.id == val && element.children) {
+                    data = element.children;
+                }
+            }
+            this.organList = data;
+            this.$nextTick(() => {
+                this.$refs.tree.setCheckedNodes(this.organList);
+                this.clickCheckTree();
+            });
+            console.log('   this.$refs.tree.setCheckedNodes(this.organList);', this.organList);
+        },
         // 过滤选中的人员
         filterPeople(val) {
             return val

+ 3 - 1
operationSupport/src/components/common/index.js

@@ -19,6 +19,7 @@ import alramform from './alramform';
 import xkUpload from './XKUpload';
 import select from './select';
 import buildingTree from './buildingTree';
+import treeHouse from './treeHouse.vue';
 // 注册全局组件
 export default {
     install() {
@@ -35,7 +36,8 @@ export default {
             organTree,
             xkUpload,
             select,
-            buildingTree
+            buildingTree,
+            treeHouse
         ];
         _.each(components, (v) => {
             Vue.component(v.name, v);

+ 349 - 0
operationSupport/src/components/common/treeHouse.vue

@@ -0,0 +1,349 @@
+<template>
+    <div class="organ-tree">
+        <div v-show="showHouseTree">
+            <div>
+                <el-input v-model="filterText" v-if="!showCheckboxTree" placeholder="请输入关键字" suffix-icon="el-icon-search"></el-input>
+                <el-input
+                    v-model="selectHouse"
+                    disabled
+                    placeholder="选择的房间"
+                    maxlength="10"
+                    suffix-icon="el-icon-search"
+                    v-else
+                ></el-input>
+            </div>
+            <div class="tree-style-box no-scrollbar">
+                <el-tree
+                    class="tree-style"
+                    :data="organList"
+                    ref="tree"
+                    node-key="id"
+                    :highlight-current="true"
+                    :props="defaultProps"
+                    :expand-on-click-node="false"
+                    @node-click="treeClick"
+                    @check="clickCheckTree"
+                    :default-expand-all="defaultExpandAllTree"
+                    :filter-node-method="filterNode"
+                    :show-checkbox="showCheckboxTree"
+                    :accordion="accordion"
+                    :prevDetailData="prevDetailData"
+                    :default-expanded-keys="defaultSelectAll"
+                >
+                </el-tree>
+            </div>
+        </div>
+        <div v-show="!showHouseTree">
+            <el-input v-model="selectPeople" disabled placeholder="选择的人员" maxlength="10" suffix-icon="el-icon-search"></el-input>
+            <div class="tree-style-box no-scrollbar">
+                <el-tree
+                    class="tree-style"
+                    :data="dataPeopleList"
+                    ref="treePeople"
+                    node-key="id"
+                    :highlight-current="true"
+                    :props="defaultPropsPeople"
+                    :expand-on-click-node="false"
+                    @node-click="treeClick"
+                    @check="clickCheckTreePeople"
+                    :default-expand-all="defaultExpandAllTree"
+                    :filter-node-method="filterNodePeople"
+                    :show-checkbox="showCheckboxTree"
+                    :accordion="accordionPeople"
+                    :selectAll="selectAll"
+                    :prevDetailData="prevDetailData"
+                >
+                </el-tree>
+            </div>
+        </div>
+    </div>
+</template>
+
+<script>
+export default {
+    name: 'treeHouse',
+    props: {
+        buildingType: { type: String, default: 'buildingType' },
+        showCheckboxTree: {
+            //显示多选框
+            type: Boolean,
+            default: false
+        },
+        defaultExpandAllTree: {
+            //是否默认展开所有节点
+            type: Boolean,
+            default: true
+        },
+        showHouseTree: {
+            //显示房间树
+            type: Boolean,
+            default: true
+        },
+
+        accordion: {
+            //房间展开手风琴
+            type: Boolean,
+            default: false
+        },
+        accordionPeople: {
+            //人员展开手风琴
+            type: Boolean,
+            default: false
+        },
+        prevDetailData: {
+            type: Array,
+            default() {
+                return [];
+            }
+        }
+    },
+    data() {
+        return {
+            filterText: '',
+            selectHouse: '',
+            selectPeople: '',
+            organList: [],
+            dataPeopleList: [],
+            defaultSelectAll: [],
+            defaultProps: {
+                children: 'children',
+                label: 'name'
+            },
+            defaultPropsPeople: {
+                children: 'children',
+                label: 'label'
+            }
+        };
+    },
+    watch: {
+        filterText(val) {
+            this.$refs.tree.filter(val);
+        },
+        dataPeopleList(val) {
+            console.log('====================================');
+            console.log('dataPeopleList', val);
+            console.log('====================================');
+            this.$refs.tree.filter(val);
+        }
+    },
+    computed: {},
+    methods: {
+        // 过滤选中的社区下的房间
+        filterhouse(val, datas) {
+            let array = datas;
+            let data;
+            for (let index = 0; index < array.length; index++) {
+                const element = array[index];
+                if (element.id == val && element.children) {
+                    data = element.children;
+                }
+            }
+            this.$nextTick(() => {
+                this.organList = data;
+                this.defaultSelectAll = data;
+                this.selectAllHouse();
+                this.clickCheckTree();
+                // this.$refs.tree.setCheckedNodes('C1栋');
+            });
+            console.log('   this.$refs.tree.setCheckedNodes(this.organList);', this.organList);
+        },
+        // 过滤选中的人员
+        filterPeople(val) {
+            return val
+                ? this.val.filter((item) => {
+                      item.id == val;
+                  })
+                : '暂无人员';
+        },
+        // 选中所有房间
+        selectAllHouse() {
+            this.$nextTick(() => {
+                this.$refs.tree.setCheckedNodes(this.organList);
+                this.clickCheckTree();
+            });
+        },
+        // 选中指定房间
+        selectHouseOr() {
+            this.$nextTick(() => {
+                this.$refs.tree.setCheckedKeys([]);
+                this.clickCheckTree();
+            });
+        },
+        // 选中所有人员
+        selectAllPeople() {
+            this.$nextTick(() => {
+                this.$refs.treePeople.setCheckedNodes(this.dataPeopleList);
+                this.clickCheckTreePeople();
+            });
+        },
+        // 选中指定人员
+        selectPeopleOr() {
+            this.$nextTick(() => {
+                this.$refs.treePeople.setCheckedKeys([]);
+                this.clickCheckTreePeople();
+            });
+        },
+        // 获取人员
+        getPeopleList() {
+            this.$http.get('/sc-user-center/user/findUserList').then(({ status, data, msg }) => {
+                if (status === 0) {
+                    this.dataPeopleList = data;
+                    this.$emit('dataPeople', data);
+                } else {
+                    this.$message(warning, '获取人员失败,请稍后重试');
+                }
+                console.log('获取人员', data);
+            });
+        },
+        getSelect(data) {
+            var str = [];
+            const getStr = function (list) {
+                list.forEach(function (row) {
+                    if (row.children) {
+                        getStr(row.children);
+                    } else {
+                        str.push(row.value);
+                    }
+                });
+            };
+            getStr(data);
+            return str;
+            console.log('getStr', str);
+        },
+        // 多选框返回选中房间的数据
+        clickCheckTree(val) {
+            let tree = this.$refs.tree;
+            let nameArr = [];
+            let array = tree.getCheckedNodes();
+            let arrays = tree.getCheckedKeys();
+            for (let index = 0; index < array.length; index++) {
+                const element = array[index];
+                nameArr.push(element.name);
+                if (Array.isArray(element) && element.length > 0) {
+                    nameArr.push(element.name);
+                }
+            }
+            // 输入框显示的房间
+            this.selectHouse = nameArr;
+            var arr = [];
+            array.forEach(function (item) {
+                if (item.type === 'room' && Number(item.value) !== String) {
+                    arr.push(Number(item.value));
+                }
+            });
+            // 选中的房间id
+            this.$emit('selectData', arr);
+            console.log('arrays', arrays);
+            console.log('array', array);
+        },
+        // 多选框返回选中人员的数据
+        clickCheckTreePeople(val) {
+            let nameArr = [];
+            let tree = this.$refs.treePeople;
+            let array = tree.getCheckedNodes();
+            let arrays = tree.getCheckedKeys();
+            for (let index = 0; index < array.length; index++) {
+                const element = array[index];
+                nameArr.push(element.label);
+                if (Array.isArray(element) && element.length > 0) {
+                    nameArr.push(element.label);
+                }
+            }
+            // 输入框显示的人员
+            this.selectPeople = nameArr.toString();
+            // 选中的人员id
+            this.$emit('selectPeople', arrays);
+        },
+        dimension(arr) {
+            arr.map((item, index) => {
+                if (!!item.children & (item.type !== 'unit')) {
+                    this.dimension(item.children);
+                } else {
+                    if (item.name.indexOf('单元') === -1 && item.type === 'unit') {
+                        item.name = item.name + '单元';
+                    }
+                }
+            });
+        },
+        getOrgTreeList() {
+            this.$http
+                .get('/sc-community/assets/tree/community/find', { buildingType: this.buildingType })
+                .then(({ status, data, msg }) => {
+                    if (status === 0 && data) {
+                        this.organList = data;
+                        this.dimension(data);
+                        this.$nextTick().then(() => {
+                            const firstNode = document.querySelector('.el-tree-node');
+                            firstNode.click();
+                        });
+                    }
+                });
+        },
+        filterNode(value, data) {
+            if (!value) return true;
+            return data.name.indexOf(value) !== -1;
+        },
+        filterNodePeople(value, data) {
+            if (!value) return true;
+            return data.label.indexOf(value) !== -1;
+        },
+        treeClick(e) {
+            if (e.value == 0) return;
+            let onData = '';
+            let newValueIds = e.id.split('-');
+            let thisE = this.$refs.tree.getNode(e);
+            if (e.type == 'building') {
+                onData = {
+                    communityId: thisE.parent.data.value,
+                    buildingId: e.value,
+                    unitId: '',
+                    roomId: ''
+                };
+                this.$emit('buildingInformation', onData);
+            } else if (e.type == 'unit') {
+                onData = {
+                    communityId: thisE.parent.parent.data.value,
+                    buildingId: thisE.parent.data.value,
+                    unitId: e.value,
+                    roomId: ''
+                };
+                this.$emit('buildingInformation', onData);
+            } else if (e.type == 'room') {
+                onData = {
+                    communityId: newValueIds.length == 4 ? thisE.parent.parent.parent.data.value : thisE.parent.parent.data.value,
+                    buildingId: newValueIds.length == 4 ? thisE.parent.parent.data.value : thisE.parent.data.value,
+                    unitId: newValueIds.length == 4 ? thisE.parent.data.value : '',
+                    roomId: e.value
+                };
+                this.$emit('buildingInformation', onData);
+            } else {
+                this.$emit('buildingInformation', e);
+            }
+        }
+    },
+    created() {
+        // this.getOrgTreeList();
+        this.getPeopleList();
+    }
+};
+</script>
+
+<style lang="scss" scoped>
+.organ-tree {
+    width: 260px;
+    background: #ffffff;
+    padding: 20px;
+    box-sizing: border-box;
+    float: left;
+    height: 100%;
+    overflow: auto;
+    &::before {
+        clear: both;
+    }
+    .tree-style-box {
+        margin-top: 20px;
+        max-height: calc(100vh - 200px);
+        overflow: scroll;
+    }
+}
+</style>

+ 26 - 20
operationSupport/src/views/propertyManagement/inform.vue

@@ -95,7 +95,7 @@
                                                     </el-radio-group>
                                                 </div>
                                                 <div class="selet-room" v-show="ruleForm.issueRoom.checkAll">
-                                                    <building-tree
+                                                    <tree-house
                                                         @buildingInformation="buildingInformation"
                                                         :buildingType="1"
                                                         :showCheckboxTree="true"
@@ -104,7 +104,7 @@
                                                         :selectAll="true"
                                                         @selectData="selectDataHouseTree"
                                                         ref="selectTreeHouse"
-                                                    ></building-tree>
+                                                    ></tree-house>
                                                 </div>
                                             </div>
                                             <div class="issueRoom">
@@ -125,7 +125,7 @@
                                                     </el-radio-group>
                                                 </div>
                                                 <div class="selet-room" v-show="ruleForm.issueRoom.staff">
-                                                    <building-tree
+                                                    <tree-house
                                                         ref="selectTreePeoples"
                                                         :buildingType="1"
                                                         :showCheckboxTree="true"
@@ -135,7 +135,7 @@
                                                         :selectAll="true"
                                                         @dataPeople="dataPeople"
                                                         @selectPeople="selectPeople"
-                                                    ></building-tree>
+                                                    ></tree-house>
                                                 </div>
                                             </div>
                                         </el-form-item>
@@ -472,15 +472,15 @@ export default {
         buildingInformation(data) {
             this.houseData = data;
             console.log('buildingInformation', data);
-            if (!!data.type && data.type == 'community') {
-                this.mixins_query = { communityId: data.value, buildingType: 1 };
-            } else {
-                this.mixins_query.communityId = data.communityId;
-                this.mixins_query.id = data.roomId;
-                this.mixins_query.buildingId = data.buildingId;
-                this.mixins_query.unitName = data.unitId;
-            }
-            this.mixins_search();
+            // if (!!data.type && data.type == 'community') {
+            //     this.mixins_query = { communityId: data.value, buildingType: 1 };
+            // } else {
+            //     this.mixins_query.communityId = data.communityId;
+            //     this.mixins_query.id = data.roomId;
+            //     this.mixins_query.buildingId = data.buildingId;
+            //     this.mixins_query.unitName = data.unitId;
+            // }
+            // this.mixins_search();
         },
         // 上传文件
         handleRemove(file, fileList) {
@@ -535,15 +535,21 @@ export default {
         handleDownload(file) {
             console.log(file);
         },
-        // 下拉框变化
+        // 添加弹框下拉框变化
         changeCommunity(val) {
-            for (let index = 0; index < this.communityList.length; index++) {
-                const element = this.communityList[index];
-                if (element.id == val) {
-                    return (this.popCommunityName = element.label);
-                }
-            }
+            console.log('添加弹框下拉框变化', val);
+            this.$http
+                .get('/sc-community/assets/tree/community/find', { buildingType: this.buildingType })
+                .then(({ status, data, msg }) => {
+                    if (status === 0 && data) {
+                        this.$refs.selectTreeHouse.filterhouse(val, data);
+                        this.ruleForm.issueRoom.radioRoom = '全部房间';
+                    } else {
+                        this.$message.warning('获取房间失败');
+                    }
+                });
         },
+
         // 选中的房间
         selectDataHouseTree(val) {
             // this.selectDataHouseTreeData = val;

+ 18 - 12
operationSupport/src/views/propertyManagement/phone.vue

@@ -9,7 +9,7 @@
                 v-model="mixins_query.location"
             ></el-input>
             <el-select placeholder="请选择所属地区" v-model="mixins_query.communityId" clearable>
-                <el-option v-for="(item, index) in communityList" :key="index" :label="item.label" :value="item.regionId"></el-option>
+                <el-option v-for="(item, index) in communityListCreate" :key="index" :label="item.label" :value="item.id"></el-option>
             </el-select>
             <el-button type="primary" placeholder="状态" class="search-btn" @click="searchInfo" icon="el-icon-search" v-preventReClick
                 >查询
@@ -60,10 +60,10 @@
                                 <el-form-item label="所属社区" prop="communityList">
                                     <el-select placeholder="请选择所属社区" v-model="ruleForm.communityList" class="dialog-select">
                                         <el-option
-                                            v-for="(item, index) in communityList"
+                                            v-for="(item, index) in communityListCreate"
                                             :key="index"
                                             :label="item.label"
-                                            :value="item.regionId"
+                                            :value="item.id"
                                             >{{ item.label }}</el-option
                                         >
                                     </el-select>
@@ -145,7 +145,7 @@ export default {
             // 输入地址
             location: '',
             //社区列表
-            communityList: [],
+            communityListCreate: [],
             cols: [
                 {
                     label: '所属社区',
@@ -153,7 +153,7 @@ export default {
                     format(val) {
                         let va = '';
                         _this.$store.getters['getAreaSelect'].forEach((element) => {
-                            if (element.regionId === val) {
+                            if (element.id === val) {
                                 va = element.communityName;
                             }
                         });
@@ -274,25 +274,31 @@ export default {
         },
         /** 获取社区列表*/
         getCommunityList() {
-            this.communityList = [];
+            this.communityListCreate = [];
             let onOption = '';
             this.$http.get('/sc-community/assets/community/list', {}).then((res) => {
                 console.log('获取社区列表', res);
                 this.$store.commit('setAreaSelect', res.data);
-                res.data.map((res) => {
+                res.data.map((item) => {
                     onOption = {
-                        label: res.communityName,
-                        id: res.id,
-                        regionId: res.regionId
+                        label: item.communityName,
+                        id: item.id
                     };
-                    this.communityList.push(onOption);
+                    this.communityListCreate.push(onOption);
                 });
+                // console.log('this.communityListCreate', this.communityListCreate);
             });
         },
         /** 查看处理详情*/
         clickEdit(type, row) {
             console.log('查看处理详情', row);
-            this.ruleForm.communityList = row.communityId;
+            let communityId = row.communityId;
+            var that = this;
+            this.$store.getters['getAreaSelect'].forEach((element) => {
+                if (element.id === communityId) {
+                    that.ruleForm.communityList = element.communityName;
+                }
+            });
             this.ruleForm.newManagementName = row.name;
             this.ruleForm.newPhone = row.telephone;
             this.ruleForm.id = row.id;

+ 11 - 1
operationSupport/src/views/propertyManagement/style.scss

@@ -382,9 +382,14 @@ $fontSizeSmall: 14px;
         /deep/ .el-range-editor--small.el-input__inner{
             width: 100% !important;
         }
+     
         .issueRoom{
             display: flex;
-            justify-content: space-between;
+            // justify-content: space-around;
+
+            .organ-tree{
+                width: 100%;
+            }
          /deep/ .el-tree--highlight-current .el-tree-node.is-current > .el-tree-node__content{
                 background: #fff !important;
             }
@@ -402,6 +407,11 @@ $fontSizeSmall: 14px;
            
             // justify-content: space-between;
         }
+        .selet-room{
+            /deep/ .el-input__inner{
+                width: 285px;
+            }
+        }
         }
         .dialog-right{
             width: 283px;