소스 검색

修改通知公告多选框,以及详情页展示

long 3 년 전
부모
커밋
4c0a4e5632

+ 19 - 16
operationSupport/src/components/common/treeHouse.vue

@@ -12,7 +12,7 @@
                     v-else
                 ></el-input>
             </div>
-            <div class="tree-house-style-box" v-show="inputFocueHouse">
+            <div class="tree-house-style-box" v-show="inputFocueHouse" :style="{ 'z-index': inputFocueHouse ? index : 0 }">
                 <GeminiScrollbar class="my-scroll-bar" :autoshow="true">
                     <el-tree
                         :data="organList"
@@ -44,10 +44,10 @@
                 v-model="selectPeople"
                 placeholder="选择的人员"
                 maxlength="10"
-                @focus="inputFocue()"
+                @focus="inputFocues()"
                 suffix-icon="el-icon-search"
             ></el-input>
-            <div class="transfer-style-box" v-show="inputFocuePeople">
+            <div class="transfer-style-box" v-show="inputFocuePeople" :style="{ 'z-index': inputFocuePeople ? index : 0 }">
                 <GeminiScrollbar class="my-scroll-bar" :autoshow="true">
                     <el-tree
                         :data="dataPeopleList"
@@ -127,6 +127,7 @@ export default {
             //输入框获得焦点
             inputFocueHouse: false,
             inputFocuePeople: false,
+            index: 99,
             filterText: '',
             selectHouse: '',
             selectPeople: '',
@@ -158,11 +159,16 @@ export default {
     methods: {
         // 输入框获得焦点
         inputFocue(val) {
-            if (val) {
-                this.inputFocueHouse = true;
-            } else {
-                this.inputFocuePeople = true;
-            }
+            this.index++;
+            console.log('输入框获得焦点', val);
+            this.inputFocueHouse = true;
+            this.inputFocuePeople = false;
+        },
+        inputFocues() {
+            this.index++;
+            console.log('输入框获得焦点inputFocues');
+            this.inputFocueHouse = false;
+            this.inputFocuePeople = true;
         },
         endBtn() {
             this.inputFocueHouse = false;
@@ -178,13 +184,11 @@ export default {
                     data = element.children;
                 }
             }
-            this.$nextTick(() => {
-                this.organList = data;
-                this.defaultSelectAll = data;
-                this.selectAllHouse();
-                this.clickCheckTree();
-                // this.$refs.tree.setCheckedNodes('C1栋');
-            });
+            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);
         },
 
@@ -336,7 +340,6 @@ export default {
 .organ-trees-view {
     box-sizing: border-box;
     float: left;
-    z-index: 99999;
     &::before {
         clear: both;
     }

+ 36 - 13
operationSupport/src/views/propertyManagement/common/previeInform.vue

@@ -6,18 +6,26 @@
         <!-- 详情左侧部分 -->
         <div class="detail-left">
             <div class="prev-text" style="margin-top: 0">
-                <span>所属社区: </span><span class="text-right">{{ dataDetail.communityName }}</span>
+                <span>所属社区:</span><span class="text-right">{{ dataDetail.communityName }}</span>
             </div>
             <div class="prev-text detail">
                 <div class="prev-obj">
                     <div class="files-text">发布对象:</div>
-                    <div class="prev-obj-right">
-                        <div class="prev-obj-text" v-if="dataDetail.userType == 0">
-                            社区住户/{{ '指定房间' }}/
-                            <!-- <span v-for="(item, index) in houseDataNames" :key="index">{{ item }}</span> -->
-                            <!-- {{ houseData[0].name }}-{{ houseData[0].children.name }}- -->
-                            {{ houseDataNames }}
+                    <div v-if="userType == 2">
+                        <div class="prev-obj-right">
+                            <div class="prev-obj-text">社区住户/{{ '指定房间' }}/{{ houseDataNames }}</div>
+                            <div @click="clickDetail()" class="click-prev">{{ showTreeHouse ? '关闭详情' : '查看详情' }}</div>
                         </div>
+                        <div class="prev-obj-right">
+                            <div class="prev-obj-text">
+                                社区员工/{{ '指定员工' }}/{{ peopleData[0].value }}/
+                                <span v-for="(item, index) in peopleData.children" :key="index">{{ item }}</span>
+                            </div>
+                            <div @click="clickDetailPeople()" class="click-prev">{{ showTreePeople ? '关闭详情' : '查看详情' }}</div>
+                        </div>
+                    </div>
+                    <div class="prev-obj-right" v-else>
+                        <div class="prev-obj-text" v-if="userType == 0">社区住户/{{ '指定房间' }}/{{ houseDataNames }}</div>
                         <div class="prev-obj-text" v-else>社区员工/{{ '指定房间' }}/{{ peopleData[0].value }}/{{ houseDataNames }}</div>
                         <div @click="clickDetail()" class="click-prev">{{ showTree ? '关闭详情' : '查看详情' }}</div>
                     </div>
@@ -25,7 +33,7 @@
                 <div v-if="showTree">
                     <div>
                         <!-- 社区住户 -->
-                        <div class="prev-detail-right" v-if="dataDetail.userType == 0">
+                        <div class="prev-detail-right" v-if="(userType == 0 || userType == 2) && showTreeHouse">
                             <GeminiScrollbar class="prev-my-scroll-bar" :autoshow="true">
                                 <el-tree
                                     class="filter-tree"
@@ -47,7 +55,7 @@
                             </GeminiScrollbar>
                         </div>
                         <!-- 社区人员 -->
-                        <div class="prev-detail-right" v-else>
+                        <div class="prev-detail-right-two" v-if="userType == 1 || (userType == 2 && showTreePeople)">
                             <GeminiScrollbar class="prev-my-scroll-bar" :autoshow="true">
                                 <el-tree
                                     class="filter-tree"
@@ -70,6 +78,7 @@
                     </div>
                 </div>
             </div>
+
             <div class="prev-text">
                 <span class="files-text">通知类型: </span
                 ><span class="text-right">{{ dataDetail.type == 0 ? '物业通知' : dataDetail.type == 1 ? '社区活动' : '其他' }}</span>
@@ -163,6 +172,7 @@ export default {
     props: {
         showrightPhone: false,
         houseDataNames: '',
+        userType: '',
         dataDetail: {
             type: Object,
             default: () => {}
@@ -196,6 +206,8 @@ export default {
     computed: {},
     data() {
         return {
+            showTreeHouse: false,
+            showTreePeople: false,
             showTree: false,
             dialogVisibleHouse: false,
             dialogVisiblePeople: false,
@@ -212,9 +224,6 @@ export default {
     created() {},
     computed: {},
     methods: {
-        filter(arr) {
-            arr.map((item) => {});
-        },
         // 关闭节点事件
         closeTree(e) {
             console.log('e', e);
@@ -223,8 +232,16 @@ export default {
             }
         },
         // 点击显示发布对象详情
-        clickDetail() {
+        clickDetail(val) {
             this.showTree = !this.showTree;
+            this.showTreeHouse = !this.showTreeHouse;
+            // if (val == 1) {
+            //     this.showTreePeople = !this.showTreePeople;
+            // }
+        },
+        clickDetailPeople() {
+            this.showTree = !this.showTree;
+            this.showTreePeople = !this.showTreePeople;
         },
         filterNode(value, data) {
             if (!value) return true;
@@ -408,6 +425,7 @@ export default {
                     overflow: hidden;
                     white-space: nowrap;
                     text-overflow: ellipsis;
+                    margin-bottom: 10px;
                 }
                 .click-prev {
                     color: #0eaeff;
@@ -433,6 +451,10 @@ export default {
                 // .prev-my-scroll-bar {
                 // }
             }
+            .prev-detail-right-two {
+                @extend .prev-detail-right;
+                top: 44px !important;
+            }
         }
         .files {
             display: flex;
@@ -506,6 +528,7 @@ export default {
         /deep/ .wscnph {
             max-width: 200px;
             max-height: 200px;
+            vertical-align: middle;
         }
     }
 }

+ 85 - 28
operationSupport/src/views/propertyManagement/inform.vue

@@ -240,6 +240,7 @@
                                         :houseData="houseData"
                                         :peopleData="peopleData"
                                         :houseDataNames="houseDataNames"
+                                        :userType="userType"
                                         ref="filterHouse"
                                     ></previe-inform>
                                 </div>
@@ -454,6 +455,7 @@ export default {
             houseData: [],
             houseDataNames: '',
             peopleData: [],
+            userType: '',
             // 选中的房间
             selectDataHouseTreeData: {
                 checkData: [],
@@ -555,10 +557,10 @@ export default {
                 .then(({ status, data, msg }) => {
                     if (status === 0 && data) {
                         this.$refs.selectTreeHouse.filterhouse(val, data);
-                        this.ruleForm.issueRoom.checkAll = true;
-                        this.ruleForm.issueRoom.radioRoom = '全部房间';
-                        this.ruleForm.issueRoom.radioStaff = '';
-                        this.ruleForm.issueRoom.staff = false;
+                        // this.ruleForm.issueRoom.checkAll = true;
+                        // this.ruleForm.issueRoom.radioRoom = '全部房间';
+                        // this.ruleForm.issueRoom.radioStaff = '';
+                        // this.ruleForm.issueRoom.staff = false;
                     } else {
                         this.$message.error('获取房间失败');
                     }
@@ -578,16 +580,20 @@ export default {
                     // this.$message('获取房间失败');
                 }
             });
-            console.log('选中的房间val', val);
+            console.log('选中的房间inval', val);
         },
         // 选择的人员
         selectPeople(val) {
+            if (val.userList.length < 1) {
+                this.ruleForm.issueRoom.radioStaff = '指定员工';
+            }
             this.selectDataPeopleTreeData = val;
             console.log('选择的人员inform', val);
         },
         /**监听指定房间单选框变化*/
         changeRadioRoom(val) {
             if (!this.ruleForm.popCommunityId) {
+                ruleForm.issueRoom.checkAll = false;
                 return this.$message.warning('请先选择所属社区');
             }
             if (val == '指定房间') {
@@ -601,22 +607,23 @@ export default {
         },
         //选择员工复选框变化
         changeCheckboxStaffRoom(val) {
+            console.log('选择员工复选框变化', val);
             if (!this.ruleForm.popCommunityId) {
                 this.ruleForm.issueRoom.staff = false;
                 return this.$message.warning('请先选择社区');
             }
             if (val) {
                 this.ruleForm.issueRoom.radioStaff = '全部员工';
-                this.ruleForm.issueRoom.checkAll = false;
-                this.ruleForm.issueRoom.radioRoom = '';
+                // this.ruleForm.issueRoom.checkAll = false;
+                // this.ruleForm.issueRoom.radioRoom = '';
                 this.$refs.selectTreePeoples.selectAllPeople();
-                this.$refs.selectTreeHouse.selectHouseOr();
+                // this.$refs.selectTreeHouse.selectHouseOr();
             } else {
                 this.ruleForm.issueRoom.radioStaff = '';
-                this.ruleForm.issueRoom.checkAll = true;
-                this.ruleForm.issueRoom.radioRoom = '全部房间';
+                // this.ruleForm.issueRoom.checkAll = true;
+                // this.ruleForm.issueRoom.radioRoom = '全部房间';
                 this.$refs.selectTreePeoples.selectPeopleOr();
-                this.$refs.selectTreeHouse.selectAllHouse();
+                // this.$refs.selectTreeHouse.selectAllHouse();
             }
         },
         // 选择房间复选框变化
@@ -626,10 +633,10 @@ export default {
                 return this.$message.warning('请先选择社区');
             }
             if (val) {
-                this.ruleForm.issueRoom.staff = false;
-                this.ruleForm.issueRoom.checkAll = true;
+                // this.ruleForm.issueRoom.staff = false;
+                // this.ruleForm.issueRoom.checkAll = true;
                 this.ruleForm.issueRoom.radioRoom = '全部房间';
-                this.ruleForm.issueRoom.radioStaff = '';
+                // this.ruleForm.issueRoom.radioStaff = '';
                 this.$refs.selectTreeHouse.selectAllHouse();
             } else {
                 this.ruleForm.issueRoom.radioRoom = '';
@@ -742,16 +749,43 @@ export default {
                         if (img.length > 3) {
                             return this.$message.warning('最多插入三张图片');
                         }
+                        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`);
                         let endTime = this.$moment(this.ruleForm.activeTime[1]).format(`YYYY-MM-DDTHH:mm:ss`);
+                        let userVos = [];
+                        let obj = {};
+                        let arr1 = this.selectDataHouseTreeData.userID;
+                        let arr2 = this.selectDataPeopleTreeData.userList;
+                        let treeData = [];
+                        treeData[0] = JSON.stringify(arr1);
+                        treeData[1] = JSON.stringify(arr2);
+                        if (arr1.length > 0) {
+                            for (let index = 0; index < arr1.length; index++) {
+                                let element = arr1[index];
+                                obj.noticeId = '';
+                                obj.userId = element;
+                                obj.userType = 0;
+                                userVos.push(obj);
+                            }
+                        }
+                        if (arr2.length > 0) {
+                            for (let index = 0; index < arr2.length; index++) {
+                                let element = arr2[index];
+                                console.log('arr2', element);
+                                obj.noticeId = '';
+                                obj.userId = element;
+                                obj.userType = 0;
+                                userVos.push(obj);
+                            }
+                        }
                         let query = {
                             communityId: this.ruleForm.popCommunityId,
                             content: this.ruleForm.editorContents,
@@ -763,16 +797,22 @@ export default {
                             //   pubPeople:ruleForm.informType,
                             //   pubStatus: "",
                             themePictrue: JSON.stringify(this.successImageLists),
-                            userId: this.ruleForm.issueRoom.checkAll
-                                ? this.selectDataHouseTreeData.userList
-                                : this.selectDataPeopleTreeData.userList,
-                            treeData: this.ruleForm.issueRoom.checkAll
-                                ? JSON.stringify(this.selectDataHouseTreeData.userID)
-                                : JSON.stringify(this.selectDataPeopleTreeData.userList),
+                            treeData: JSON.stringify(treeData),
+                            // userId: this.ruleForm.issueRoom.checkAll
+                            // ? this.selectDataHouseTreeData.userList
+                            // : this.selectDataPeopleTreeData.userList,
+                            // 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,
-                            userType: this.ruleForm.issueRoom.checkAll ? 0 : 1
+                            userVos: userVos
+                            // userVos: [
+                            //     { noticeId: '', userId: this.selectDataHouseTreeData.userList, userType: 0 },
+                            //     { noticeId: '', userId: this.selectDataPeopleTreeData.userList, userType: 1 }
+                            // ]
+                            // userType: userType
                         };
                         this.$http.post('/sc-community-web/notice/add', query).then((res) => {
                             if (res.status === 0) {
@@ -845,7 +885,7 @@ export default {
             });
         },
         filterArrPeople(arr, item, index) {
-            if (!this.rowDetail.treeData.includes(Number(item.id))) {
+            if (!this.rowDetail.treeDataPeople.includes(Number(item.id))) {
                 arr.splice(index, 1);
                 arr.map((item) => {
                     this.filterArrPeople(arr, item, index);
@@ -853,9 +893,6 @@ export default {
             }
         },
         filterPeopleName(array) {
-            console.log('====================================');
-            console.log(' filterPeopleName(array', array);
-            console.log('====================================');
             var that = this;
             // array.map((item) => {
             //     if (item.children && item.children.length > 0) {
@@ -940,12 +977,32 @@ export default {
             // this.rowDetail = [];
             this.$http.get('/sc-community-web/notice/find/' + row.id).then((res) => {
                 if (res.status === 0) {
+                    console.log('查看详情res.data.treeData', res.data.treeData);
                     this.rowDetail = res.data;
-                    this.rowDetail.treeData = JSON.parse(res.data.treeData);
+                    let treeData = JSON.parse(res.data.treeData);
+                    this.rowDetail.treeData = JSON.parse(treeData[0]);
+                    this.rowDetail.treeDataPeople = JSON.parse(treeData[1]);
+                    let userType = '';
+                    let arr1 = this.rowDetail.treeData;
+                    let arr2 = this.rowDetail.treeDataPeople;
+                    if (arr1.length > 0 && arr2.length > 0) {
+                        userType = 2;
+                    } else if (arr1.length > 0) {
+                        userType = 0;
+                    } else {
+                        userType = 1;
+                    }
+                    this.userType = userType;
+                    console.log('查看详情this.userType', this.rowDetail.treeData);
+                    console.log('查看详情this.rowDetail.treeData', this.rowDetail.treeData);
+                    console.log('查看详情this.rowDetail.treeDataPeople', this.rowDetail.treeDataPeople);
                     // this.rowDetail.newName = this.houseNames.toString();
-                    if (res.data.userType == 0) {
+                    if (userType == 0) {
                         this.getOrgTreeList();
+                    } else if (userType == 1) {
+                        this.getPeopleList();
                     } else {
+                        this.getOrgTreeList();
                         this.getPeopleList();
                     }
                     // let fileArr = row.filePath.split(',');

+ 22 - 5
operationSupport/src/views/workbench/index.vue

@@ -214,6 +214,7 @@
                     :houseDataNames="houseDataNames"
                     ref="filterHouse"
                     :showrightPhone="showrightPhone"
+                    :userType="userType"
                 ></previe-inform>
             </el-dialog>
         </div>
@@ -235,7 +236,8 @@ export default {
             showrightPhone: false,
             showRight: false,
             PeopleNames: '',
-            houseDataNames: ''
+            houseDataNames: '',
+            userType: ''
         };
     },
     created() {
@@ -252,11 +254,26 @@ export default {
             this.$http.get('/sc-community-web/notice/find/' + val).then((res) => {
                 if (res.status === 0) {
                     this.rowDetail = res.data;
-                    this.rowDetail.treeData = JSON.parse(res.data.treeData);
-                    // this.rowDetail.newName = this.houseNames.toString();
-                    if (res.data.userType == 0) {
+                    let treeData = JSON.parse(res.data.treeData);
+                    this.rowDetail.treeData = JSON.parse(treeData[0]);
+                    this.rowDetail.treeDataPeople = JSON.parse(treeData[1]);
+                    let userType = '';
+                    let arr1 = this.rowDetail.treeData;
+                    let arr2 = this.rowDetail.treeDataPeople;
+                    if (arr1.length > 0 && arr2.length > 0) {
+                        userType = 2;
+                    } else if (arr1.length > 0) {
+                        userType = 0;
+                    } else {
+                        userType = 1;
+                    }
+                    this.userType = userType;
+                    if (userType == 0) {
                         this.getOrgTreeList();
+                    } else if (userType == 1) {
+                        this.getPeopleList();
                     } else {
+                        this.getOrgTreeList();
                         this.getPeopleList();
                     }
                     this.filePath = JSON.parse(res.data.filePath);
@@ -279,7 +296,7 @@ export default {
             });
         },
         filterArrPeople(arr, item, index) {
-            if (!this.rowDetail.treeData.includes(Number(item.id))) {
+            if (!this.rowDetail.treeDataPeople.includes(Number(item.id))) {
                 arr.splice(index, 1);
                 arr.map((item) => {
                     this.filterArrPeople(arr, item, index);