Browse Source

物业通知修改所选房间提示

D4THYL3\long 3 years ago
parent
commit
bd9973a274

+ 16 - 32
operationSupport/src/views/propertyManagement/common/previeInform.vue

@@ -1,17 +1,17 @@
 <template>
-    <div class="prev">
+    <div class="prev" v-if="dataDetail">
         <div>
             <div class="prev-text" style="margin-top: 0">
                 <span>所属社区: </span><span class="text-right">{{ dataDetail.communityName }}</span>
             </div>
             <!-- <div class="prev-text detail">
-                <div>发布对象:{{ treeArr }}</div>
+                <div>发布对象:{{ dataDetail.treeData }}</div>
                 <div class="detail-right">
                     <el-tree
                         class="filter-tree"
                         ref="filterPeople"
                         node-key="id"
-                        :data="detailTreeData"
+                        :data="organList"
                         :props="defaultProps"
                         default-expand-all
                         :filter-node-method="filterNode"
@@ -73,16 +73,12 @@ export default {
     props: {
         dataDetail: {
             type: Object,
-            default: () => {}
+            default: {}
         },
         detailPeople: {
             type: Array,
             default: () => []
         },
-        detailTreeData: {
-            type: Array,
-            default: () => []
-        },
         filePath: {
             type: Array,
             default: () => []
@@ -116,13 +112,13 @@ export default {
             organList: [],
             defaultProps: {
                 children: 'children',
-                label: 'value'
+                label: 'name'
             },
             treeArr: []
         };
     },
     created() {
-        this.getPeopleList();
+        // this.getPeopleList();
         // this.getOrgTreeList();
     },
     computed: {},
@@ -146,29 +142,17 @@ export default {
             });
         },
 
-        // 获取人员
-        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);
-                });
-        },
+        // 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);

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

@@ -99,7 +99,6 @@
                                                 </div>
                                                 <div class="selet-room" v-show="ruleForm.issueRoom.checkAll">
                                                     <tree-house
-                                                        @buildingInformation="buildingInformation"
                                                         :buildingType="1"
                                                         :showCheckboxTree="true"
                                                         :defaultExpandAllTree="false"
@@ -228,14 +227,12 @@
                                         </el-form-item>
                                     </el-form>
                                 </div>
-                                <div v-else>
+                                <div v-if="!showDetail">
                                     <!-- 详情显示 -->
                                     <previe-inform
                                         :dataDetail="rowDetail"
                                         :filePath="filePath"
                                         :successImageLists="successImageLists"
-                                        :detailPeople="detailPeople"
-                                        :detailTreeData="detailTreeData"
                                     ></previe-inform>
                                 </div>
                             </div>
@@ -327,8 +324,6 @@ export default {
         return {
             organList: [],
             popCommunityName: '',
-            detailPeople: [],
-            detailTreeData: [],
             fileList: [],
             // 显示图片上传
             showUploadImage: false,
@@ -471,13 +466,14 @@ export default {
         this.mixins_query = {};
         this.mixins_search();
         this.getOrgTreeList();
+        // 显示弹框
+        // this.getPeople();
         if (this.$route.query.showDialog && this.$route.query.id && !this.$route.query.closeDialog) {
             let row = {
                 id: this.$route.query.id
             };
             this.clickDatail(row);
         }
-        // this.getPeopleList();
     },
     mounted() {},
     watch: {},
@@ -486,20 +482,6 @@ export default {
         dataPeople(data) {
             this.peopleData = data;
         },
-        // 房间树
-        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();
-        },
         // 上传文件
         handleRemove(file, fileList) {
             console.log('上传文件', file, fileList);
@@ -574,13 +556,13 @@ export default {
         // 选中的房间
         selectDataHouseTree(val) {
             this.selectDataHouseTreeData.userID = [];
+            this.selectDataHouseTreeData.userID = val.userList;
             this.selectDataPeopleTreeData.userList = [];
-            this.selectDataHouseTreeData = val;
-
+            // this.selectDataHouseTreeData = val;
             // 获取房间下的usid
             this.$http.post('/sc-community-web/notice/queryHouseUser', val.userList).then((res) => {
                 if (res.status === 0) {
-                    this.selectDataHouseTreeData.userID = res.data;
+                    this.selectDataHouseTreeData.userList = res.data;
                 } else {
                     // this.$message('获取房间失败');
                 }
@@ -743,12 +725,14 @@ export default {
             if (type === 'prev') {
                 this.$refs['ruleForm'].validate((valid) => {
                     if (valid) {
+                        console.log('this.selectDataPeopleTreeData.userList', this.selectDataPeopleTreeData.userList);
+                        console.log('this.selectDataHouseTreeData.userList', this.selectDataHouseTreeData.userList);
                         if (
                             this.selectDataHouseTreeData.userList.length === 0 &&
                             this.selectDataPeopleTreeData &&
                             this.selectDataPeopleTreeData.userList.length === 0
                         ) {
-                            return this.$message.warning('请选择发布对象');
+                            return this.$message.warning('所选房间暂无住户,不可发布');
                         }
                         // this.showDetail = false;
                         let startTime = this.$moment(this.ruleForm.activeTime[0]).format(`YYYY-MM-DDTHH:mm:ss`);
@@ -767,7 +751,7 @@ export default {
                             userId: this.ruleForm.issueRoom.checkAll
                                 ? this.selectDataHouseTreeData.userList
                                 : this.selectDataPeopleTreeData.userList,
-                            treeData: JSON.stringify([]),
+                            treeData: JSON.stringify(this.selectDataHouseTreeData.userID),
                             title: this.ruleForm.title,
                             type: this.ruleForm.informType,
                             urgentFlag: this.ruleForm.exigencyOr == '是' ? 1 : 0,
@@ -836,15 +820,45 @@ export default {
                 });
             });
         },
+
+        // 获取人员
+        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);
+            });
+        },
+        dimension(arr) {
+            console.log('dimensiondimensiondimensiondimension', arr);
+            arr.map((item, index) => {
+                debugger;
+                if (item.children) {
+                    this.dimension(item.children);
+                } else if (item.type == 'room' && !this.rowDetail.treeData.includes(Number(item.value))) {
+                    console.log('roomroomroomroom', arr);
+                    arr = arr.splice(index, 1);
+                }
+            });
+        },
+        CheckChinese(val) {
+            return this.rowDetail.treeData.includes(val);
+        },
         // 获取房间
         getOrgTreeList() {
+            debugger;
             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.houseData = data;
                     }
-                    console.log('获取房间', data);
+                    console.log('获取房间', this.rowDetail.treeData);
                 });
         },
 
@@ -853,17 +867,16 @@ 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;
                     // let fileArr = row.filePath.split(',');
                     // this.filePath = fileArr.slice(0, fileArr.length - 1);
                     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('获取详情失败!请稍后重试');