소스 검색

修改物业管理-添加模块详情展示

DESKTOP-4G80JF4\long 3 년 전
부모
커밋
11641edc8a

+ 4 - 3
operationSupport/src/components/common/buildingTree.vue

@@ -33,7 +33,7 @@
             </div>
         </div>
         <div v-show="!showHouseTree">
-            <el-input v-model="selectPeople" disabled placeholder="选择的人员" maxlength="10" suffix-icon="el-icon-search"></el-input>
+            <el-input v-model="selectPeopleInput" disabled placeholder="选择的人员" maxlength="10" suffix-icon="el-icon-search"></el-input>
             <div class="tree-style-box no-scrollbar">
                 <el-tree
                     class="tree-style"
@@ -100,7 +100,7 @@ export default {
         return {
             filterText: '',
             selectHouse: '',
-            selectPeople: '',
+            selectPeopleInput: '',
             organList: [],
             dataPeopleList: [],
             defaultProps: {
@@ -238,6 +238,7 @@ export default {
             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);
@@ -246,7 +247,7 @@ export default {
                 }
             }
             // 输入框显示的人员
-            this.selectPeople = nameArr.toString();
+            this.selectPeopleInput = nameArr.toString();
             // 选中的人员id
             this.$emit('selectPeople', arrays);
         },

+ 66 - 47
operationSupport/src/components/common/treeHouse.vue

@@ -21,7 +21,6 @@
                     :highlight-current="true"
                     :props="defaultProps"
                     :expand-on-click-node="false"
-                    @node-click="treeClick"
                     @check="clickCheckTree"
                     :default-expand-all="defaultExpandAllTree"
                     :filter-node-method="filterNode"
@@ -29,6 +28,7 @@
                     :accordion="accordion"
                     :prevDetailData="prevDetailData"
                     :default-expanded-keys="defaultSelectAll"
+                    :check-on-click-node="true"
                 >
                 </el-tree>
             </div>
@@ -44,7 +44,6 @@
                     :highlight-current="true"
                     :props="defaultPropsPeople"
                     :expand-on-click-node="false"
-                    @node-click="treeClick"
                     @check="clickCheckTreePeople"
                     :default-expand-all="defaultExpandAllTree"
                     :filter-node-method="filterNodePeople"
@@ -52,6 +51,7 @@
                     :accordion="accordionPeople"
                     :selectAll="selectAll"
                     :prevDetailData="prevDetailData"
+                    :check-on-click-node="true"
                 >
                 </el-tree>
             </div>
@@ -147,14 +147,7 @@ export default {
             });
             console.log('   this.$refs.tree.setCheckedNodes(this.organList);', this.organList);
         },
-        // 过滤选中的人员
-        filterPeople(val) {
-            return val
-                ? this.val.filter((item) => {
-                      item.id == val;
-                  })
-                : '暂无人员';
-        },
+
         // 选中所有房间
         selectAllHouse() {
             this.$nextTick(() => {
@@ -231,10 +224,12 @@ export default {
                     arr.push(Number(item.value));
                 }
             });
+            let obj = {};
+            obj.userList = arr;
+            obj.checkData = array;
+            console.log('多选框返回选中房间的数据', array);
             // 选中的房间id
-            this.$emit('selectData', arr);
-            console.log('arrays', arrays);
-            console.log('array', array);
+            this.$emit('selectData', obj);
         },
         // 多选框返回选中人员的数据
         clickCheckTreePeople(val) {
@@ -249,10 +244,34 @@ export default {
                     nameArr.push(element.label);
                 }
             }
+            let obj = {};
+            obj.userList = arrays;
+            obj.checkData = array;
+            let checkDatas = tree.getCheckedNodes();
+            // let data = tree.getCheckedKeys();
+            // [
+            //     {
+            //         id: 1,
+            //         label: 'xxx',
+            //         parentId: 0,
+            //         children: [
+            //             {
+            //                 id: 2,
+            //                 label: 'xxx',
+            //                 parentId: 1
+            //             }
+            //         ]
+            //     }
+            // ];
+            // array.map((t) => {});
+
+            console.log('多选框返回选中人员的数据', JSON.stringify(checkDatas));
+
+            console.log('====================================');
             // 输入框显示的人员
             this.selectPeople = nameArr.toString();
             // 选中的人员id
-            this.$emit('selectPeople', arrays);
+            this.$emit('selectPeople', obj);
         },
         dimension(arr) {
             arr.map((item, index) => {
@@ -286,40 +305,40 @@ export default {
         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);
-            }
         }
+        // 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();

+ 72 - 64
operationSupport/src/views/propertyManagement/common/previeInform.vue

@@ -5,12 +5,13 @@
                 <span>所属社区: </span><span class="text-right">{{ dataDetail.communityName }}</span>
             </div>
             <!-- <div class="prev-text detail">
-                <div>发布对象:</div>
-                <div class="detail-right" v-if="showTree">
+                <div>发布对象:{{ treeArr }}</div>
+                <div class="detail-right">
                     <el-tree
                         class="filter-tree"
                         ref="filterPeople"
-                        :data="detailPeople"
+                        node-key="id"
+                        :data="detailTreeData"
                         :props="defaultProps"
                         default-expand-all
                         :filter-node-method="filterNode"
@@ -61,28 +62,23 @@ export default {
     props: {
         dataDetail: {
             type: Object,
-            default() {
-                return {};
-            }
+            default: () => {}
         },
         detailPeople: {
             type: Array,
-            default() {
-                return {};
-            }
+            default: () => []
+        },
+        detailTreeData: {
+            type: Array,
+            default: () => []
         },
-
         filePath: {
             type: Array,
-            default() {
-                return {};
-            }
+            default: () => []
         },
         successImageLists: {
             type: Array,
-            default() {
-                return {};
-            }
+            default: () => []
         }
     },
     watch: {
@@ -90,71 +86,83 @@ export default {
             this.$refs.filterPeople.filter(val);
         },
         dataDetail(val) {
-            console.log('====================================');
-            console.log('dataDetail', val);
-            console.log('====================================');
+            val.treeData;
         }
+        // detailPeople(val) {
+        //     console.log('====================================');
+        //     this.filterPeople(val);
+        //     console.log('detailPeople', val);
+        //     console.log('====================================');
+        // }
     },
     computed: {},
     data() {
         return {
-            filterText: '222',
+            filterText: '',
             dataPeopleList: [],
+            detailPeopleName: [],
             showTree: false,
+            organList: [],
             defaultProps: {
                 children: 'children',
-                label: 'userId'
-            }
+                label: 'value'
+            },
+            treeArr: []
         };
     },
     created() {
-        // this.getPeopleList();
+        this.getPeopleList();
+        // this.getOrgTreeList();
     },
+    computed: {},
+
     methods: {
-        dimension(arr, arrs) {
-            // var arrs = arrss.noticeUserVoList;
-            // var arrs = [
-            //     {
-            //         userType: 1,
-            //         userId: 472,
-            //         noticeId: 66
-            //     },
-            //     {
-            //         userType: 1,
-            //         userId: 410,
-            //         noticeId: 66
-            //     }
-            // ];
-            // arr.map((item, index) => {
-            //     if (item.children) {
-            //         this.dimension(item.children);
-            //     } else {
-            //         for (let index = 0; index < arrs.length; index++) {
-            //             let userId = arrs[index].userId;
-            //             if (item.id === userId) {
-            //                 this.detailPeople.push(item.label);
-            //             }
-            //         }
-            //     }
-            // });
-            console.log('====================================');
-            console.log('dimension', this.detailPeople);
-            console.log('dimension', arrs);
-            console.log('====================================');
+        filterPeople(dataSource, currentArr) {
+            // console.log('dataSource', JSON.stringify(dataSource));
+            // console.log('currnArr', JSON.stringify(currentArr));
+            dataSource.forEach((t, i) => {
+                currentArr.forEach((x, xIndex) => {
+                    if (t.id === x.userId) {
+                        if (!this.treeArr.find((x2) => x2.id === t.id)) {
+                            this.treeArr.push({ id: t.id, label: t.label });
+                        }
+                    } else {
+                        if (Array.isArray(t.children) && t.children.length > 0) {
+                            this.filterPeople(t.children, currentArr);
+                        }
+                    }
+                });
+            });
         },
+
         // 获取人员
-        // getPeopleList() {
-        //     this.$http.get('/sc-user-center/user/findUserList').then(({ status, data, msg }) => {
-        //         if (status === 0) {
-        //             this.dataPeopleList = data;
-        //             this.dimension(this.dataPeopleList, this.dataDetail.noticeUserVoList);
-        //         } else {
-        //             this.$message(warning, '获取人员失败,请稍后重试');
-        //         }
-        //         console.log('获取人员', this.dataDetail.noticeUserVoList);
-        //     });
-        // },
+        getPeopleList() {
+            this.$http.get('/sc-user-center/user/findUserList').then(({ status, data, msg }) => {
+                if (status === 0) {
+                    this.dataPeopleList = data;
+                    // this.dimension(this.dataPeopleList, this.dataDetail.noticeUserVoList);
+                } else {
+                    this.$message(warning, '获取人员失败,请稍后重试');
+                }
+                console.log('dataPeopleList', this.dataPeopleList);
+            });
+        },
+        // 获取房间
+        getOrgTreeList() {
+            this.$http
+                .get('/sc-community/assets/tree/community/find', { buildingType: this.buildingType })
+                .then(({ status, data, msg }) => {
+                    if (status === 0 && data) {
+                        this.organList = data;
+                    }
+                    // console.log('获取房间', data);
+                });
+        },
         filterNode(value, data) {
+            // console.log('====================================');
+            // console.log('filterNode  value', value);
+            // console.log('filterNode  data', data.id);
+            // console.log('====================================');
             if (!value) return true;
             return data.label.indexOf(value) !== -1;
         }

+ 58 - 23
operationSupport/src/views/propertyManagement/inform.vue

@@ -231,6 +231,7 @@
                                         :filePath="filePath"
                                         :successImageLists="successImageLists"
                                         :detailPeople="detailPeople"
+                                        :detailTreeData="detailTreeData"
                                     ></previe-inform>
                                 </div>
                             </div>
@@ -241,7 +242,8 @@
                                 </div>
                                 <div class="dialog-right-header">
                                     <i class="el-icon-arrow-left"></i>
-                                    <div>社区活动</div>
+                                    <div v-if="showDetail">{{ this.showUploadImage ? '社区活动' : '物业通知' }}</div>
+                                    <div v-else>{{ rowDetail.type == 0 ? '物业通知' : '社区活动' }}</div>
                                 </div>
                                 <div class="center-padding"></div>
                                 <GeminiScrollbar class="my-scroll-bar" :autoshow="false" :color="red">
@@ -317,8 +319,10 @@ export default {
     data() {
         let _this = this;
         return {
+            organList: [],
             popCommunityName: '',
             detailPeople: [],
+            detailTreeData: [],
             fileList: [],
             // 显示图片上传
             showUploadImage: false,
@@ -445,9 +449,9 @@ export default {
             houseData: [],
             peopleData: [],
             // 选中的房间
-            selectDataHouseTreeData: [],
+            selectDataHouseTreeData: {},
             // 选中的人员
-            selectDataPeopleTreeData: [],
+            selectDataPeopleTreeData: {},
             // 文件上传地址
             uploadFileUrl: []
         };
@@ -460,6 +464,8 @@ export default {
         this.mixins_dataUrl = '/sc-community-web/notice/page';
         this.mixins_query = {};
         this.mixins_search();
+        this.getOrgTreeList();
+        this.getPeopleList();
     },
     mounted() {},
     watch: {},
@@ -538,25 +544,28 @@ export default {
         // 添加弹框下拉框变化
         changeCommunity(val) {
             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('获取房间失败');
-                    }
-                });
+            if (this.ruleForm.issueRoom.checkAll) {
+                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;
+            this.selectDataHouseTreeData = val;
+            this.selectDataHouseTreeData.userID = [];
             // 获取房间下的usid
-            this.$http.post('/sc-community-web/notice/queryHouseUser', val).then((res) => {
+            this.$http.post('/sc-community-web/notice/queryHouseUser', val.userList).then((res) => {
                 if (res.status === 0) {
-                    this.selectDataHouseTreeData = res.data;
+                    this.selectDataHouseTreeData.userID = res.data;
                 } else {
                     // this.$message('获取房间失败');
                 }
@@ -566,11 +575,13 @@ export default {
         // 选择的人员
         selectPeople(val) {
             this.selectDataPeopleTreeData = val;
-            console.log('选择的人员', val);
+            console.log('选择的人员inform', val);
         },
         /**监听指定房间单选框变化*/
         changeRadioRoom(val) {
-            this.showChangeRoom = false;
+            if (!this.ruleForm.popCommunityId) {
+                return this.$message.warning('请先选择所属社区');
+            }
             if (val == '指定房间') {
                 this.ruleForm.disabledRoom = true;
                 this.$refs.selectTreeHouse.selectHouseOr();
@@ -588,10 +599,13 @@ export default {
                 this.ruleForm.issueRoom.checkAll = false;
                 this.ruleForm.issueRoom.radioRoom = '';
                 this.$refs.selectTreePeoples.selectAllPeople();
+                this.$refs.selectTreeHouse.selectHouseOr();
             } else {
                 this.ruleForm.issueRoom.radioStaff = '';
                 this.ruleForm.issueRoom.checkAll = true;
                 this.ruleForm.issueRoom.radioRoom = '全部房间';
+                this.$refs.selectTreePeoples.selectPeopleOr();
+                this.$refs.selectTreeHouse.selectAllHouse();
             }
         },
         // 选择房间单选框变化
@@ -688,7 +702,7 @@ export default {
          * */
         dialogButton(type) {
             if (type === 'prev') {
-                if (this.selectDataHouseTreeData.length < 1 && this.selectDataPeopleTreeData.length < 1) {
+                if (this.selectDataHouseTreeData.userID.length < 1 && this.selectDataPeopleTreeData.userList.length < 1) {
                     return this.$message.warning('请选择房间');
                 }
                 this.$refs['ruleForm'].validate((valid) => {
@@ -707,7 +721,12 @@ export default {
                             //   pubPeople:ruleForm.informType,
                             //   pubStatus: "",
                             themePictrue: JSON.stringify(this.successImageLists),
-                            userId: this.ruleForm.issueRoom.checkAll ? this.selectDataHouseTreeData : this.selectDataPeopleTreeData,
+                            userId: this.ruleForm.issueRoom.checkAll
+                                ? this.selectDataHouseTreeData.userID
+                                : this.selectDataPeopleTreeData.userList,
+                            treeData: this.ruleForm.issueRoom.checkAll
+                                ? JSON.stringify(this.selectDataHouseTreeData.checkData)
+                                : JSON.stringify(this.selectDataPeopleTreeData.checkData),
                             title: this.ruleForm.title,
                             type: this.ruleForm.informType,
                             urgentFlag: this.ruleForm.exigencyOr == '是' ? 1 : 0,
@@ -758,19 +777,35 @@ export default {
                 });
             });
         },
+        // 获取房间
+        getOrgTreeList() {
+            this.$http
+                .get('/sc-community/assets/tree/community/find', { buildingType: this.buildingType })
+                .then(({ status, data, msg }) => {
+                    if (status === 0 && data) {
+                        this.organList = data;
+                    }
+                    console.log('获取房间', data);
+                });
+        },
+
         /** 查看详情*/
         clickDatail(row) {
             // this.rowDetail = [];
             this.$http.get('/sc-community-web/notice/find/' + row.id).then((res) => {
                 if (res.status === 0) {
+                    // this.filterHouse(this.organList, res.data.noticeUserVoList);
+
                     this.rowDetail = res.data;
                     // let fileArr = row.filePath.split(',');
                     // this.filePath = fileArr.slice(0, fileArr.length - 1);
-                    this.filePath = JSON.parse(row.filePath);
-                    this.successImageLists = JSON.parse(row.themePictrue);
-                    this.contentHtml = row.content;
+                    this.filePath = JSON.parse(res.data.filePath);
+                    this.successImageLists = JSON.parse(res.data.themePictrue);
+                    this.detailTreeData = JSON.parse(res.data.treeData);
+                    this.contentHtml = res.data.content;
                     this.centerDialogVisible = true;
                     this.showDetail = false;
+                    this.detailPeople = res.data.noticeUserVoList;
                     console.log('查看详情', res);
                 } else {
                     return this.$message('获取详情失败!请稍后重试');

+ 3 - 4
operationSupport/src/views/propertyManagement/style.scss

@@ -393,9 +393,7 @@ $fontSizeSmall: 14px;
          /deep/ .el-tree--highlight-current .el-tree-node.is-current > .el-tree-node__content{
                 background: #fff !important;
             }
-            .radio-room{
-                margin-right:10px;
-            }
+        
             .organ-tree{
                 padding: 0 !important;
                 width: auto;
@@ -409,7 +407,8 @@ $fontSizeSmall: 14px;
         }
         .selet-room{
             /deep/ .el-input__inner{
-                width: 285px;
+                width: 280px;
+                margin-left: 10px;
             }
         }
         }