|
@@ -47,38 +47,6 @@
|
|
|
</template>
|
|
|
</zz-table>
|
|
|
</div>
|
|
|
- <!-- 添加弹框 -->
|
|
|
- <div class="dialog-info">
|
|
|
- <el-dialog
|
|
|
- :visible.sync="centerDialogVisible"
|
|
|
- @close="handleDialogClose"
|
|
|
- width="1086px"
|
|
|
- :close-on-press-escape="false"
|
|
|
- :close-on-click-modal="false"
|
|
|
- >
|
|
|
- <div class="dialog">
|
|
|
- <div class="dialog-header">
|
|
|
- <i class="el-dialog__close el-icon el-icon-close" @click="centerDialogVisible = false"></i>
|
|
|
- <div class="dialogTitle">{{ rowDetail.type == 0 ? '物业通知' : '社区活动' }}详情</div>
|
|
|
- </div>
|
|
|
-
|
|
|
- <div class="dialog-contents">
|
|
|
- <previe-inform
|
|
|
- :dataDetail="rowDetail"
|
|
|
- :filePath="filePath"
|
|
|
- :successImageLists="successImageLists"
|
|
|
- :houseData="houseData"
|
|
|
- :peopleData="peopleData"
|
|
|
- :houseDataNames="houseDataNames"
|
|
|
- :houseDataNamesPeople="houseDataNamesPeople"
|
|
|
- :userType="userType"
|
|
|
- :showrightPhone="true"
|
|
|
- ref="previeInform"
|
|
|
- ></previe-inform>
|
|
|
- </div>
|
|
|
- </div>
|
|
|
- </el-dialog>
|
|
|
- </div>
|
|
|
</div>
|
|
|
</div>
|
|
|
</template>
|
|
@@ -171,34 +139,16 @@ export default {
|
|
|
slot: 'opt'
|
|
|
}
|
|
|
],
|
|
|
- mixins_post: 'post',
|
|
|
- // 显隐弹框
|
|
|
- centerDialogVisible: false,
|
|
|
- // 获取的房间信息
|
|
|
- houseData: [],
|
|
|
- houseDataNames: '',
|
|
|
- houseDataNamesPeople: '',
|
|
|
- peopleData: [],
|
|
|
- userType: '',
|
|
|
- // 选中的房间
|
|
|
- selectDataHouseTreeData: {
|
|
|
- checkData: [],
|
|
|
- userID: [],
|
|
|
- userList: []
|
|
|
- },
|
|
|
- houseNames: [],
|
|
|
- PeopleNames: []
|
|
|
+ mixins_post: 'post'
|
|
|
};
|
|
|
},
|
|
|
created() {
|
|
|
- // if (!!this.$route.params.showPop) {
|
|
|
- // this.add();
|
|
|
- // }
|
|
|
this.getCommunityList();
|
|
|
this.mixins_dataUrl = '/sc-community/notice/page';
|
|
|
this.mixins_query = {};
|
|
|
this.mixins_search();
|
|
|
this.getOrgTreeList();
|
|
|
+ this.getPeopleList();
|
|
|
},
|
|
|
mounted() {},
|
|
|
methods: {
|
|
@@ -221,10 +171,6 @@ export default {
|
|
|
},
|
|
|
/**查询按钮*/
|
|
|
searchInfo() {
|
|
|
- let detaH = this.$moment(new Date()).format('HH');
|
|
|
- let detaM = this.$moment(new Date()).format('mm');
|
|
|
- let detaS = this.$moment(new Date()).format('ss');
|
|
|
- // let d = detaH + ':' + detaM + ':' + detaS;
|
|
|
let d = '00:00:00';
|
|
|
let dEnd = '23:59:59';
|
|
|
if (this.searchTime && this.searchTime.length) {
|
|
@@ -250,176 +196,60 @@ 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.treeDataPeople.includes(Number(item.id))) {
|
|
|
- arr.splice(index, 1);
|
|
|
- arr.map((item) => {
|
|
|
- this.filterArrPeople(arr, item, index);
|
|
|
- });
|
|
|
- }
|
|
|
- },
|
|
|
- filterPeopleName(array) {
|
|
|
- var that = this;
|
|
|
- array.map((item) => {
|
|
|
- if (item.children) {
|
|
|
- that.filterPeopleName(item.children);
|
|
|
- } else if (item.children == null) {
|
|
|
- that.PeopleNames.push(item.value);
|
|
|
+
|
|
|
+ getOrgTreeList() {
|
|
|
+ this.$http.get('/sc-community/assets/tree/community/find').then(({ status, data, msg }) => {
|
|
|
+ if (status === 0 && data) {
|
|
|
+ this.houseData = data;
|
|
|
}
|
|
|
});
|
|
|
},
|
|
|
// 获取人员
|
|
|
getPeopleList() {
|
|
|
- this.PeopleNames = [];
|
|
|
this.$http.get('/sc-user-center/user/findUserList').then(({ status, data, msg }) => {
|
|
|
- if (status === 0) {
|
|
|
- this.filterPeople(data);
|
|
|
- this.filterPeopleName(data);
|
|
|
- this.clearTreeChildrenPeople(data);
|
|
|
+ if (status == 0 && data) {
|
|
|
this.peopleData = data;
|
|
|
- this.houseDataNamesPeople = this.PeopleNames.toString();
|
|
|
- } else {
|
|
|
- this.$message(error, res.msg);
|
|
|
- }
|
|
|
- });
|
|
|
- },
|
|
|
- dimension(arr) {
|
|
|
- arr.map((item, index) => {
|
|
|
- if (item.children) {
|
|
|
- if (item.children.length > 0) {
|
|
|
- this.dimension(item.children);
|
|
|
- }
|
|
|
- } else if (item.type == 'room') {
|
|
|
- this.filterArr(arr, item, index);
|
|
|
- }
|
|
|
- });
|
|
|
- },
|
|
|
- clearTreeChildren(arr) {
|
|
|
- arr.map((item, index) => {
|
|
|
- if (!!item.children && item.children.length > 0) {
|
|
|
- this.clearTreeChildren(item.children);
|
|
|
- } else {
|
|
|
- if (!!item.children) {
|
|
|
- arr.splice(index, 1);
|
|
|
- }
|
|
|
- }
|
|
|
- });
|
|
|
- },
|
|
|
- clearTreeChildrenPeople(arr) {
|
|
|
- arr.map((item, index) => {
|
|
|
- if (!!item.children && item.children.length > 0) {
|
|
|
- this.clearTreeChildrenPeople(item.children);
|
|
|
- } else {
|
|
|
- if (!!item.children && item.children.length == 0) {
|
|
|
- this.clearTreeChildrenPeopleArr(arr, index);
|
|
|
- }
|
|
|
- }
|
|
|
- });
|
|
|
- },
|
|
|
- clearTreeChildrenPeopleArr(arr, index) {
|
|
|
- arr.splice(index, 1);
|
|
|
- arr.map((item, indexs) => {
|
|
|
- if (!!item.children && item.children.length == 0) {
|
|
|
- this.clearTreeChildrenPeopleArr(arr, indexs);
|
|
|
- }
|
|
|
- });
|
|
|
- },
|
|
|
- filterArr(arr, item, index) {
|
|
|
- if (!this.rowDetail.treeData.includes(Number(item.value))) {
|
|
|
- arr.splice(index, 1);
|
|
|
- arr.map((item) => {
|
|
|
- this.filterArr(arr, item, index);
|
|
|
- });
|
|
|
- }
|
|
|
- },
|
|
|
- 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);
|
|
|
}
|
|
|
});
|
|
|
},
|
|
|
|
|
|
- // 获取房间
|
|
|
- getOrgTreeList() {
|
|
|
- this.houseNames = [];
|
|
|
- this.$http
|
|
|
- .get('/sc-community/assets/tree/community/find', { buildingType: this.buildingType })
|
|
|
- .then(({ status, data, msg }) => {
|
|
|
- if (status === 0 && data) {
|
|
|
- var arr = data.filter((item) => {
|
|
|
- return item.id == this.rowDetail.communityId;
|
|
|
- });
|
|
|
-
|
|
|
- if (arr.length > 0) {
|
|
|
- this.dimension(arr);
|
|
|
- this.clearTreeChildren(arr);
|
|
|
- this.houseData = arr;
|
|
|
- this.filterName(this.houseData);
|
|
|
- this.houseDataNames = this.houseNames.toString();
|
|
|
- }
|
|
|
- }
|
|
|
- });
|
|
|
- },
|
|
|
-
|
|
|
/** 查看详情*/
|
|
|
clickDatail(row) {
|
|
|
- this.showDetail = false;
|
|
|
- // 弹框关闭事件
|
|
|
- // this.rowDetail = [];
|
|
|
- this.$http.get('/sc-community/notice/find/' + row.id).then((res) => {
|
|
|
- if (res.status === 0) {
|
|
|
- // console.log('查看详情res.data.treeData', res.data.treeData);
|
|
|
- this.rowDetail = res.data;
|
|
|
- let treeData = JSON.parse(res.data.treeData);
|
|
|
- this.rowDetail.treeData = JSON.parse(treeData[0]);
|
|
|
- this.rowDetail.treeDataPeople = JSON.parse(treeData[1]);
|
|
|
+ this.$http.get('/sc-community/notice/find/' + row.id).then(({ data, status, msg }) => {
|
|
|
+ if (status == 0) {
|
|
|
+ let treeData = JSON.parse(data.treeData);
|
|
|
+ let treeDataHome = JSON.parse(treeData[0]);
|
|
|
+ let treeDataPeople = JSON.parse(treeData[1]);
|
|
|
let userType = '';
|
|
|
- let arr1 = this.rowDetail.treeData;
|
|
|
- let arr2 = this.rowDetail.treeDataPeople;
|
|
|
- if (arr1.length > 0 && arr2.length > 0) {
|
|
|
+ if (treeDataHome.length > 0 && treeDataPeople.length > 0) {
|
|
|
userType = 2;
|
|
|
- } else if (arr1.length > 0) {
|
|
|
+ } else if (treeDataHome.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 (userType == 0) {
|
|
|
- this.getOrgTreeList();
|
|
|
- } else if (userType == 1) {
|
|
|
- this.getPeopleList();
|
|
|
- } else {
|
|
|
- this.getOrgTreeList();
|
|
|
- this.getPeopleList();
|
|
|
- }
|
|
|
- // 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.contentHtml = res.data.content;
|
|
|
- this.centerDialogVisible = true;
|
|
|
- // this.showDetail = false;
|
|
|
- if (!!this.$refs.previeInform) {
|
|
|
- this.$refs.previeInform.closeDialog();
|
|
|
- }
|
|
|
+ new Promise((resolve) => {
|
|
|
+ this.$store.dispatch('addPopup', {
|
|
|
+ url: '/propertyManagement/common/detailView.vue',
|
|
|
+ width: '1080px',
|
|
|
+ height: '750px',
|
|
|
+ props: {
|
|
|
+ dataDetail: data,
|
|
|
+ successImageLists: JSON.parse(data.themePictrue),
|
|
|
+ filePath: JSON.parse(data.filePath),
|
|
|
+ houseData: this.houseData,
|
|
|
+ peopleData: this.peopleData,
|
|
|
+ houseDataIds: treeDataHome,
|
|
|
+ houseDataPeopleIds: treeDataPeople,
|
|
|
+ userType: userType,
|
|
|
+ showrightPhone: true,
|
|
|
+ callback: resolve
|
|
|
+ },
|
|
|
+ title: data.type == 0 ? '物业通知详情' : '社区活动详情',
|
|
|
+ showCancelButton: true,
|
|
|
+ showConfirmButton: true
|
|
|
+ });
|
|
|
+ }).then(() => {});
|
|
|
} else {
|
|
|
return this.$message.error('获取详情失败!请稍后重试');
|
|
|
}
|