123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566 |
- <template>
- <div class="workbench">
- <!-- 头部开始部分 -->
- <div class="header">
- <ul>
- <li
- style="background: linear-gradient(135deg, #488fff 0%, #65dcff 100%)"
- @click="goPath('/communityManagement/index')"
- >
- <!-- <router-link to="sc-operation/propertyManagement/inform.vue" tag="a" target="_blank"> -->
- <div class="header-left">
- <div class="header-left-top">
- <div class="header-icon"></div>
- <div>社区</div>
- </div>
- </div>
- <div class="header-number">{{ houseData.communityTotal }}</div>
- <div class="header-right">
- <img
- src="../../assets/img/img_shequ.png"
- alt=""
- />
- </div>
- <!-- </router-link> -->
- </li>
- <li
- style="background: linear-gradient(315deg, #5eedcc 0%, #24c3f1 100%)"
- @click="goPath('/buildingManagement/index')"
- >
- <div class="header-left">
- <div class="header-left-top">
- <div class="header-icon"></div>
- <div>楼栋</div>
- </div>
- </div>
- <div class="header-number">{{ houseData.buildingTotal }}</div>
- <div class="header-right">
- <img
- src="../../assets/img/img_loudong.png"
- alt=""
- />
- </div>
- </li>
- <li
- style="background: linear-gradient(135deg, #f0646c 0%, #f4994e 100%)"
- @click="goPath('/assetManagement/housingManagement/index')"
- >
- <div class="header-left">
- <div class="header-left-top">
- <div class="header-icon"></div>
- <div>房屋</div>
- </div>
- </div>
- <div class="header-number">{{ houseData.houseTotal }}</div>
- <div class="header-right">
- <img
- src="../../assets/img/img_fangwu.png"
- alt=""
- />
- </div>
- </li>
- <li
- style="background: linear-gradient(135deg, #7178ff 0%, #d2a4ff 100%)"
- @click="goPath('/assetManagement/shopManagement/index')"
- >
- <div class="header-left">
- <div class="header-left-top">
- <div class="header-icon"></div>
- <div>商铺</div>
- </div>
- </div>
- <div class="header-number">{{ houseData.shopsTotal }}</div>
- <div class="header-right">
- <img
- src="../../assets/img/img_shangpu.png"
- alt=""
- />
- </div>
- </li>
- <li
- style="background: linear-gradient(135deg, #884dd2 0%, #df63cc 100%)"
- @click="goPath('/ownerManagement/index')"
- >
- <div class="header-left">
- <div class="header-left-top">
- <div class="header-icon"></div>
- <div>住户</div>
- </div>
- </div>
- <div class="header-number">{{ houseData.residentTotal }}</div>
- <div class="header-right">
- <img
- src="../../assets/img/img_zhuhu.png"
- alt=""
- />
- </div>
- </li>
- </ul>
- </div>
- <!-- 头部结束部分 -->
- <!-- 中间开始部分 -->
- <div class="center">
- <div class="center-left">
- <div class="center-left-text">快速操作</div>
- <ul>
- <!-- <li @click="goPath('/communityManagement/pageJump/AddOrEdit')"> -->
- <li @click="goPathBack('/communityManagement/index', true)">
- <div>
- <img
- src="../../assets/img/icon_shequ.png"
- alt=""
- />
- </div>
- <span>添加社区</span>
- </li>
- <li @click="goPathBack('/buildingManagement/index', true)">
- <div>
- <img
- src="../../assets/img/icon_loudong.png"
- alt=""
- />
- </div>
- <span>添加楼栋</span>
- </li>
- <li @click="goPathBack('/assetManagement/housingManagement/index', true)">
- <div>
- <img
- src="../../assets/img/icon_fangwu.png"
- alt=""
- />
- </div>
- <span>添加房屋</span>
- </li>
- <li @click="goPathBack('/assetManagement/shopManagement/index', true)">
- <div>
- <img
- src="../../assets/img/icon_shangpu.png"
- alt=""
- />
- </div>
- <span>添加商铺</span>
- </li>
- <li @click="goPathBack('/ownerManagement/index', true)">
- <div>
- <img
- src="../../assets/img/icon_zhuhu.png"
- alt=""
- />
- </div>
- <span>添加住户</span>
- </li>
- </ul>
- </div>
- <div class="center-left center-right">
- <div class="center-left-text">待处理事项</div>
- <ul>
- <li @click="goPath('/ownerManagement/ownerReview/index', true)">
- <div>
- <div class="header-left">
- <div class="header-left-top">
- <div class="header-icon center-icon"></div>
- <div class="center-right-text">待审核业主</div>
- </div>
- </div>
- <div class="header-number center-number">{{ pendData.ownerReviewedTotal }}</div>
- <div class="center-right-image">
- <div></div>
- </div>
- </div>
- </li>
- <li @click="goPath('/propertyManagement/index', true)">
- <div>
- <div class="header-left">
- <div class="header-left-top">
- <div class="header-icon center-icon"></div>
- <div class="center-right-text">待处理投诉</div>
- </div>
- </div>
- <div class="header-number center-number">{{ pendData.complaintsTotal }}</div>
- <div class="center-right-image">
- <div></div>
- </div>
- </div>
- </li>
- <li @click="goPath('/workOrders/index', true)">
- <div>
- <div class="header-left">
- <div class="header-left-top">
- <div class="header-icon center-icon"></div>
- <div class="center-right-text">待处理工单</div>
- </div>
- </div>
- <div class="header-number center-number">{{ pendData.workOrderTotal }}</div>
- <div class="center-right-image">
- <div></div>
- </div>
- </div>
- </li>
- </ul>
- </div>
- </div>
- <!-- 中间结束部分 -->
- <!-- 底部开始部分 -->
- <div class="footer">
- <div class="footer-left">
- <div class="footer-left-text">
- <div>社区公告</div>
- <div @click="goPath('/propertyManagement/inform')">查看更多 ></div>
- </div>
- <ul v-if="informData.length > 0">
- <li
- v-for="(item, index) in informData"
- :key="index"
- @click="clickDatail(item.id)"
- >
- <div class="footer-content">
- <div>[{{ item.title }}]</div>
- <div>{{ item.content | filterHtml }}</div>
- <!-- <div v-html="item.content"></div> -->
- </div>
- <div>{{ item.pubDate }}</div>
- </li>
- </ul>
- <div
- v-else
- class="no-data"
- >暂无公告</div>
- </div>
- <div
- class="footer-left"
- style="margin-right: 0"
- >
- <div class="footer-left-text">
- <div>告警信息</div>
- <div @click="goPath('/alarmManagement/details')">查看更多 ></div>
- </div>
- <div v-if="warnData.length > 0">
- <ul>
- <li
- @click="goPath('/alarmManagement/details', true, item.id)"
- v-for="(item, index) in warnData"
- :key="index"
- >
- <div class="footer-content">
- <div>[{{ item.name }}]</div>
- <div>{{ item.alarmContent }}</div>
- </div>
- <div>{{ item.alarmStartTime }}</div>
- </li>
- </ul>
- </div>
- <div
- v-else
- class="no-data"
- >暂无告警信息</div>
- </div>
- </div>
- <!-- 底部结束部分 -->
- <!-- 详情显示 -->
- <div class="dialog-info">
- <el-dialog
- :visible.sync="showRight"
- width="1086px"
- :title="rowDetail.type == 0 ? '物业通知详情' : '社区活动详情'"
- :close-on-press-escape="true"
- :close-on-click-modal="true"
- @close="handleDialogClose"
- >
- <previe-inform
- :dataDetail="rowDetail"
- :filePath="filePath"
- :successImageLists="successImageLists"
- :houseData="houseData"
- :peopleData="peopleData"
- :houseDataNames="houseDataNames"
- :houseDataNamesPeople="houseDataNamesPeople"
- ref="previeInform"
- :showrightPhone="showrightPhone"
- :userType="userType"
- ></previe-inform>
- </el-dialog>
- </div>
- </div>
- </template>
- <script>
- import previeInform from '../propertyManagement/common/previeInform';
- export default {
- components: { previeInform },
- data () {
- return {
- houseData: [],
- warnData: [],
- informData: [],
- pendData: [],
- // 详情显示数据
- rowDetail: [],
- showrightPhone: false,
- showRight: false,
- PeopleNames: '',
- houseDataNames: '',
- userType: '',
- houseDataNamesPeople: ''
- };
- },
- created () {
- this.getHouseData();
- this.getWarnData();
- this.getInformData();
- this.getPendData();
- },
- methods: {
- // 弹框关闭事件
- handleDialogClose (e) {
- console.log('弹框关闭事件', e);
- this.$refs.previeInform.closeDialog();
- },
- /** 查看通知公告详情*/
- clickDatail (val) {
- // this.rowDetail = [];
- this.$http.get('/czc-community/notice/find/' + val).then((res) => {
- if (res.status === 0) {
- 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]);
- 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);
- this.successImageLists = JSON.parse(res.data.themePictrue);
- this.showRight = true;
- this.showrightPhone = true;
- } else {
- return this.$message('获取详情失败!请稍后重试');
- }
- });
- },
- 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) {
- 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('/czc-user-center/user/findUserList').then(({ status, data, msg }) => {
- if (status === 0) {
- this.peopleData = data;
- this.filterPeople(this.peopleData);
- this.filterPeopleName(this.peopleData);
- this.clearTreeChildrenPeople(data);
- this.houseDataNamesPeople = this.PeopleNames.toString();
- } else {
- this.$message(warning, msg);
- }
- });
- },
- 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);
- }
- });
- },
- dimension (arr) {
- arr.map((item, index) => {
- if (item.children) {
- this.dimension(item.children);
- } else if (item.type == 'room') {
- this.filterArr(arr, item, index);
- }
- });
- },
- 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);
- }
- });
- },
- 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);
- }
- }
- });
- },
- // 获取房间
- getOrgTreeList () {
- this.houseNames = [];
- this.$http
- .get('/czc-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();
- }
- }
- });
- },
- // 打开新页 跳转的路径
- goPath (path, showDialog, id) {
- this.$router.push({ path, query: { showDialog: showDialog, id: id } });
- // let routeData = this.$router.resolve({
- // path: path,
- // query: {
- // showDialog: showDialog,
- // id: id
- // }
- // });
- // window.open(routeData.href, '_blank');
- },
- // 跳转路由页面 返回
- goPathBack (path, showDialog, id) {
- this.$router.push({ path, query: { showDialog: showDialog, id: id } });
- },
- // 获取待处理事项
- getPendData () {
- this.$http.get('/czc-community/Workbench/pendingMatters').then((res) => {
- if (res.status == 0) {
- this.pendData = res.data;
- } else {
- this.$message.warning('获取待处理事项失败');
- }
- });
- },
- // 获取房屋信息
- getHouseData () {
- this.$http.get('/czc-community/Workbench/totalHouseInfo').then((res) => {
- if (res.status == 0) {
- this.houseData = res.data;
- } else {
- this.$message.warning('获取房屋信息失败');
- }
- });
- },
- // 获取告警信息
- getWarnData () {
- this.$http.get('/czc-community/Workbench/getWaringInfo').then((res) => {
- if (res.status == 0) {
- this.warnData = res.data;
- } else {
- this.$message.warning('获取告警信息失败');
- }
- });
- },
- // 获取通知信息
- getInformData () {
- this.$http.get('/czc-community/Workbench/getNoticeInfo').then((res) => {
- if (res.status == 0) {
- let data = res.data;
- this.informData = data;
- } else {
- this.$message.warning('获取通知信息失败');
- }
- });
- }
- }
- };
- </script>
- <style lang="scss" scoped>
- @import './style.scss';
- /deep/ .el-dialog__body {
- padding: 0;
- }
- .el-dialog__header {
- background-color: #f8fcff;
- }
- /deep/ .detail .prev-detail-right {
- left: 11% !important;
- }
- </style>
|