Browse Source

修改发布对象字段

D4THYL3\long 3 năm trước cách đây
mục cha
commit
0745c5d1dd

+ 57 - 95
operationSupport/src/components/common/treeHouse.vue

@@ -5,8 +5,8 @@
                 <el-input v-model="filterText" v-if="!showCheckboxTree" placeholder="请输入关键字" suffix-icon="el-icon-search"></el-input>
                 <el-input
                     v-model="selectHouse"
-                    :disabled="disabledHouse"
                     placeholder="选择的房间"
+                    @focus="inputFocue"
                     maxlength="10"
                     suffix-icon="el-icon-search"
                     v-else
@@ -41,7 +41,6 @@
                     :data="dataPeopleList"
                     ref="treePeople"
                     node-key="id"
-                    :disabled="disabledPeople"
                     :highlight-current="true"
                     :props="defaultPropsPeople"
                     :expand-on-click-node="false"
@@ -125,8 +124,8 @@ export default {
         };
     },
     watch: {
-        filterText(val) {
-            this.$refs.tree.filter(val);
+        selectHouse(val) {
+            // this.$refs.tree.filter(val);
         },
         dataPeopleList(val) {
             console.log('====================================');
@@ -137,6 +136,8 @@ export default {
     },
     computed: {},
     methods: {
+        // 输入框获得焦点
+        inputFocue() {},
         // 过滤选中的社区下的房间
         filterhouse(val, datas) {
             let array = datas;
@@ -154,7 +155,7 @@ export default {
                 this.clickCheckTree();
                 // this.$refs.tree.setCheckedNodes('C1栋');
             });
-            console.log('   this.$refs.tree.setCheckedNodes(this.organList);', this.organList);
+            console.log('this.$refs.tree.setCheckedNodes(this.organList);', this.organList);
         },
 
         // 选中所有房间
@@ -217,7 +218,6 @@ export default {
             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);
@@ -245,7 +245,6 @@ export default {
             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);
@@ -253,69 +252,65 @@ export default {
                     nameArr.push(element.label);
                 }
             }
+            let checkDatas = tree.getCheckedNodes();
+            var a = [];
+            for (let i in checkDatas) {
+                if (checkDatas[i].children == null) {
+                    a.push(checkDatas[i].id);
+                }
+            }
             let obj = {};
-            obj.userList = arrays;
+            obj.userList = a;
             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', obj);
         },
-        dimension(arr) {
-            arr.map((item, index) => {
-                if (!!item.children) {
-                    this.dimension(item.children);
-                    if (item.type == 'unit') {
-                        item.name = this.CheckChinese(item.name, '单元');
-                    } else if (item.type == 'building') {
-                        item.name = this.CheckChinese(item.name, '楼栋');
-                    }
-                }
-            });
-        },
-        CheckChinese(val, name) {
-            var reg = new RegExp('[\\u4E00-\\u9FFF]+', 'g');
-            let newVal = val;
-            if (!reg.test(val)) {
-                newVal = val + name;
-            }
-            return newVal;
-        },
-        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();
-                        });
-                    }
-                });
-        },
+        // filterPeoPle(arr) {
+        //     arr.map((item) => {
+        //         if (item.children) {
+        //             this.filterPeoPle(item.children);
+        //         } else if (item.children == null) {
+        //             item.id.concat(+',' + item.id);
+        //         }
+        //     });
+        // },
+        // dimension(arr) {
+        //     arr.map((item, index) => {
+        //         if (!!item.children) {
+        //             this.dimension(item.children);
+        //             if (item.type == 'unit') {
+        //                 item.name = this.CheckChinese(item.name, '单元');
+        //             } else if (item.type == 'building') {
+        //                 item.name = this.CheckChinese(item.name, '楼栋');
+        //             }
+        //         }
+        //     });
+        // },
+        // CheckChinese(val, name) {
+        //     var reg = new RegExp('[\\u4E00-\\u9FFF]+', 'g');
+        //     let newVal = val;
+        //     if (!reg.test(val)) {
+        //         newVal = val + name;
+        //     }
+        //     return newVal;
+        // },
+        // 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;
@@ -324,39 +319,6 @@ export default {
             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();

+ 88 - 23
operationSupport/src/views/propertyManagement/common/previeInform.vue

@@ -5,20 +5,45 @@
                 <span>所属社区: </span><span class="text-right">{{ dataDetail.communityName }}</span>
             </div>
             <!-- <div class="prev-text detail">
-                <div>发布对象:{{ dataDetail.houseDataName }}</div>
-                <div class="detail-right">
-                    <el-tree
-                        class="filter-tree"
-                        ref="filterHouse"
-                        node-key="id"
-                        :data="houseData"
-                        :props="defaultProps"
-                        :default-expand-all="false"
-                        :filter-node-method="filterNode"
-                    >
-                    </el-tree>
+                <div class="prev-obj">
+                    发布对象: <span>{{ houseDataNames }}</span>
                 </div>
-                <div>查看详情</div>
+                <div v-if="showTree">
+                    <div class="detail-right" v-if="dataDetail.userType == 0">
+                        <el-tree
+                            class="filter-tree"
+                            ref="filterHouse"
+                            node-key="id"
+                            :data="houseData"
+                            :props="defaultProps"
+                            :default-expand-all="true"
+                            :filter-node-method="filterNode"
+                            @node-collapse="closeTree"
+                        >
+                            <span class="custom-tree-node" slot-scope="{ node, data }">
+                                <span v-if="data.children == null || data.children.length > 0">{{ data.name }}</span>
+                            </span>
+                        </el-tree>
+                    </div>
+                    <div class="detail-right" v-else>
+                        <el-tree
+                            class="filter-tree"
+                            ref="filterHouse"
+                            node-key="id"
+                            :data="peopleData"
+                            :props="defaultPropsPeople"
+                            :default-expand-all="true"
+                            :filter-node-method="filterNode"
+                            @node-collapse="closeTree"
+                        >
+                            <span class="custom-tree-node" slot-scope="{ node, data }">
+                                <span v-if="data.children == null || data.children.length > 0">{{ data.label }}</span>
+                            </span>
+                        </el-tree>
+                    </div>
+                </div>
+
+                <div @click="clickDetail()" class="click-prev">{{ showTree ? '关闭详情' : '查看详情' }}</div>
             </div> -->
             <div class="prev-text">
                 <span>通知类型: </span
@@ -71,6 +96,7 @@
 export default {
     name: 'previeInform',
     props: {
+        houseDataNames: '',
         dataDetail: {
             type: Object,
             default: () => {}
@@ -79,6 +105,10 @@ export default {
             type: Array,
             default: () => []
         },
+        peopleData: {
+            type: Array,
+            default: () => []
+        },
         detailPeople: {
             type: Array,
             default: () => []
@@ -93,29 +123,43 @@ export default {
         }
     },
     watch: {
-        filterText(val) {
-            this.$refs.filterHouse.filter(val);
+        dataDetail(val) {
+            this.showTree = false;
         }
     },
     computed: {},
     data() {
         return {
-            filterText: '',
-            dataPeopleList: [],
-            detailPeopleName: [],
             showTree: false,
-            organList: [],
+            dialogVisibleHouse: false,
+            dialogVisiblePeople: false,
             defaultProps: {
                 children: 'children',
                 label: 'name'
             },
-            treeArr: []
+            defaultPropsPeople: {
+                children: 'children',
+                label: 'value'
+            }
         };
     },
     created() {},
     computed: {},
-
     methods: {
+        filter(arr) {
+            arr.map((item) => {});
+        },
+        // 关闭节点事件
+        closeTree(e) {
+            console.log('e', e);
+            if (e.type == 'community') {
+                this.showTree = false;
+            }
+        },
+        // 点击显示发布对象详情
+        clickDetail() {
+            this.showTree = !this.showTree;
+        },
         filterNode(value, data) {
             if (!value) return true;
             return data.label.indexOf(value) !== -1;
@@ -135,13 +179,28 @@ export default {
             margin-left: 25px;
         }
     }
+    .prev-obj {
+        max-width: 50%;
+        overflow: hidden;
+        white-space: nowrap;
+        text-overflow: ellipsis;
+        span {
+            margin-left: 25px;
+        }
+    }
     .detail {
         display: flex;
         position: relative;
         .detail-right {
             position: absolute;
-            top: 0;
-            right: 0;
+            top: -5px;
+            right: 4%;
+            background: #eee;
+        }
+        .click-prev {
+            color: #0eaeff;
+            cursor: pointer;
+            // margin-left: 5px;
         }
     }
     .files {
@@ -215,5 +274,11 @@ export default {
         max-width: 200px;
         max-height: 200px;
     }
+    .el-tree {
+        background: #fff;
+        padding: 0 20px;
+        height: 50vh;
+        overflow: auto;
+    }
 }
 </style>

+ 1 - 4
operationSupport/src/views/propertyManagement/index.vue

@@ -417,7 +417,7 @@ export default {
                             replyContent: this.replayForm.replay
                         };
                         this.$http.post('/sc-community-web/feedback/speed/add', querys).then((res) => {
-                            this.message(res.status, '回复');
+                            this.message(res.status, res.msg);
                             this.$refs['replayForm'].resetFields();
 
                             console.log('点击提交', res, this.mixins_query.complaintStatus, this.replayForm.replay);
@@ -458,8 +458,6 @@ export default {
                     this.rowData = row;
                     this.$message('获取详情失败!请稍后重试');
                 }
-
-                console.log('查看处理详情返回rowData', this.rowData);
             });
             let query = {
                 fid: row.id
@@ -468,7 +466,6 @@ export default {
             this.$http.get('/sc-community-web/feedback/speed/list', query).then((res) => {
                 this.recordData = res.data;
             });
-            console.log('查看处理详情', row);
         },
         /**提示消息 */
         message(status, text) {

+ 79 - 30
operationSupport/src/views/propertyManagement/inform.vue

@@ -236,6 +236,8 @@
                                         :filePath="filePath"
                                         :successImageLists="successImageLists"
                                         :houseData="houseData"
+                                        :peopleData="peopleData"
+                                        :houseDataNames="houseDataNames"
                                         ref="filterHouse"
                                     ></previe-inform>
                                 </div>
@@ -448,6 +450,7 @@ export default {
             centerDialogVisible: false,
             // 获取的房间信息
             houseData: [],
+            houseDataNames: '',
             peopleData: [],
             // 选中的房间
             selectDataHouseTreeData: {
@@ -455,6 +458,8 @@ export default {
                 userID: [],
                 userList: []
             },
+            houseNames: [],
+            PeopleNames: [],
             // 选中的人员
             selectDataPeopleTreeData: {
                 checkData: [],
@@ -485,9 +490,9 @@ export default {
     watch: {},
     methods: {
         // 人员树
-        dataPeople(data) {
-            this.peopleData = data;
-        },
+        // dataPeople(data) {
+        //     this.peopleData = data;
+        // },
         // 上传文件
         handleRemove(file, fileList) {
             console.log('上传文件', file, fileList);
@@ -563,7 +568,6 @@ export default {
         selectDataHouseTree(val) {
             this.selectDataHouseTreeData.userID = [];
             this.selectDataHouseTreeData.userID = val.userList;
-            this.selectDataPeopleTreeData.userList = [];
             // this.selectDataHouseTreeData = val;
             // 获取房间下的usid
             this.$http.post('/sc-community-web/notice/queryHouseUser', val.userList).then((res) => {
@@ -596,7 +600,6 @@ export default {
         },
         //选择员工复选框变化
         changeCheckboxStaffRoom(val) {
-            console.log('员工复选框变化', val);
             if (!this.ruleForm.popCommunityId) {
                 this.ruleForm.issueRoom.staff = false;
                 return this.$message.warning('请先选择社区');
@@ -617,7 +620,6 @@ export default {
         },
         // 选择房间复选框变化
         changeCheckboxRoom(val) {
-            console.log('选择房间复选框变化', val);
             if (!this.ruleForm.popCommunityId) {
                 this.ruleForm.issueRoom.checkAll = false;
                 return this.$message.warning('请先选择社区');
@@ -642,7 +644,6 @@ export default {
                 this.ruleForm.disabledStaffRoom = false;
                 this.$refs.selectTreePeoples.selectAllPeople();
             }
-            console.log('监听员工单选框变化', val, this.ruleForm.issueRoom.staff);
         },
         // 是否紧急
         changeRadioExigencyOr(val) {
@@ -757,7 +758,9 @@ export default {
                             userId: this.ruleForm.issueRoom.checkAll
                                 ? this.selectDataHouseTreeData.userList
                                 : this.selectDataPeopleTreeData.userList,
-                            treeData: JSON.stringify(this.selectDataHouseTreeData.userID),
+                            treeData: this.ruleForm.issueRoom.checkAll
+                                ? JSON.stringify(this.selectDataHouseTreeData.userID)
+                                : JSON.stringify(this.selectDataPeopleTreeData.userList),
                             title: this.ruleForm.title,
                             type: this.ruleForm.informType,
                             urgentFlag: this.ruleForm.exigencyOr == '是' ? 1 : 0,
@@ -815,7 +818,6 @@ export default {
             var onOption = '';
             this.$http.get('/sc-community/assets/community/list', {}).then((res) => {
                 // this.$store.commit('setAreaSelect', res.data);
-
                 console.log('获取社区列表', res);
                 res.data.map((res) => {
                     onOption = {
@@ -826,21 +828,59 @@ export default {
                 });
             });
         },
-
+        filterPeople(arr) {
+            arr.map((item, index) => {
+                if (item.children && item.children.length > 0) {
+                    this.filterPeople(item.children);
+                } else if (item.children == null) {
+                    this.filterArrPeople(arr, item, index);
+                }
+            });
+        },
+        filterArrPeople(arr, item, index) {
+            if (!this.rowDetail.treeData.includes(Number(item.id))) {
+                arr.splice(index, 1);
+                arr.map((item) => {
+                    this.filterArrPeople(arr, item, index);
+                });
+            }
+        },
+        filterPeopleName(array) {
+            console.log('====================================');
+            console.log(' filterPeopleName(array', array);
+            console.log('====================================');
+            var that = this;
+            // array.map((item) => {
+            //     if (item.children && item.children.length > 0) {
+            //         that.filterName(item.children);
+            //         that.houseNames.push(item.name);
+            //     } else if (item.type == 'room') {
+            //         that.houseNames.push(item.name);
+            //     }
+            // });
+            array.map((item) => {
+                if (item.children) {
+                    that.filterPeopleName(item.children);
+                } else if (item.children == null) {
+                    that.PeopleNames.push(item.value);
+                }
+            });
+        },
         // 获取人员
         getPeopleList() {
+            this.PeopleNames = [];
             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);
+                    this.peopleData = data;
+                    this.filterPeople(this.peopleData);
+                    this.filterPeopleName(this.peopleData);
+                    this.houseDataNames = this.PeopleNames.toString();
                 } else {
                     this.$message(warning, '获取人员失败,请稍后重试');
                 }
-                console.log('dataPeopleList', this.dataPeopleList);
             });
         },
         dimension(arr) {
-            console.log('dimensiondimensiondimensiondimension', arr);
             arr.map((item, index) => {
                 if (item.children) {
                     this.dimension(item.children);
@@ -857,32 +897,38 @@ export default {
                 });
             }
         },
-        filterName(arr) {
-            var name = '';
-            arr.map((item) => {
-                if (item.children) {
-                    this.filterName(item.children);
-                } else {
-                    name.concat(+',' + item.name);
+        filterName(array) {
+            var that = this;
+            array.map((item) => {
+                if (item.children && item.children.length > 0) {
+                    that.houseNames.push(item.name);
+                    that.filterName(item.children);
+                } else if (item.type == 'room') {
+                    that.houseNames.push(item.name);
                 }
             });
-            return name;
         },
+
         // 获取房间
         getOrgTreeList() {
+            this.houseNames = [];
             this.$http
                 .get('/sc-community/assets/tree/community/find', { buildingType: this.buildingType })
                 .then(({ status, data, msg }) => {
                     if (status === 0 && data) {
                         console.log('houseData=1', this.houseData);
-                        this.houseData = data;
+                        var arr = data.filter((item) => {
+                            return item.id == this.rowDetail.communityId;
+                        });
+                        this.houseData = arr;
                         this.dimension(this.houseData);
-                        this.rowDetail.houseDataName = this.filterName(this.houseData);
+                        this.filterName(this.houseData);
+                        let h = [...new Set(this.houseNames)];
                         console.log('====================================');
-                        console.log('houseData=2', this.houseData);
+                        console.log('houseNames', this.houseData);
                         console.log('====================================');
+                        this.houseDataNames = this.houseNames.toString();
                     }
-                    console.log('获取房间', this.rowDetail.treeData);
                 });
         },
 
@@ -891,10 +937,14 @@ export default {
             // this.rowDetail = [];
             this.$http.get('/sc-community-web/notice/find/' + row.id).then((res) => {
                 if (res.status === 0) {
-                    this.getOrgTreeList();
-                    // this.filterHouse(this.organList, res.data.noticeUserVoList);
                     this.rowDetail = res.data;
                     this.rowDetail.treeData = JSON.parse(res.data.treeData);
+                    // this.rowDetail.newName = this.houseNames.toString();
+                    if (res.data.userType == 0) {
+                        this.getOrgTreeList();
+                    } else {
+                        this.getPeopleList();
+                    }
                     // let fileArr = row.filePath.split(',');
                     // this.filePath = fileArr.slice(0, fileArr.length - 1);
                     this.filePath = JSON.parse(res.data.filePath);
@@ -903,12 +953,11 @@ export default {
                     this.centerDialogVisible = true;
                     this.showDetail = false;
                     console.log('查看详情', res);
+                    console.log('查看详情', res.data.noticeUserVoList[0].userType);
                 } else {
                     return this.$message('获取详情失败!请稍后重试');
                 }
             });
-            // this.ruleForm.title = row.managementName;
-            // this.ruleForm.newPhone = row.phone;
         }
     }
 };

+ 1 - 1
operationSupport/src/views/propertyManagement/neighbor.vue

@@ -278,7 +278,7 @@ export default {
         deletes(val) {
             console.log('删除', val);
             this.$http.post('/sc-community-web/neighbourhood/comment/delete/' + val).then((res) => {
-                this.message(res.status, '删除');
+                this.message(res.status, res.msg);
             });
         },
         // // 删除行按钮

+ 3 - 3
operationSupport/src/views/propertyManagement/phone.vue

@@ -222,7 +222,7 @@ export default {
                             console.log('query', query);
                             if (!this.enditShow) {
                                 this.$http.post('/sc-community-web/property/telephone/add', query).then((res) => {
-                                    this.message(res.status, '添加');
+                                    this.message(res.status, res.msg);
                                     this.$refs['ruleForm'].resetFields();
                                 });
                                 console.log('点击保存', this.ruleForm);
@@ -230,7 +230,7 @@ export default {
                             // this.centerDialogVisible=false;
                             else {
                                 this.$http.post('/sc-community-web/property/telephone/update', query).then((res) => {
-                                    this.message(res.status, '修改');
+                                    this.message(res.status, res.msg);
                                 });
                             }
                         } else {
@@ -252,7 +252,7 @@ export default {
                 id: this.rowId
             };
             this.$http.get('/sc-community-web/property/telephone/delete', query).then((res) => {
-                this.message(res.status, '删除');
+                this.message(res.status, res.msg);
             });
         },
         // 提示消息