index.vue 17 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566
  1. <template>
  2. <div class="workbench">
  3. <!-- 头部开始部分 -->
  4. <div class="header">
  5. <ul>
  6. <li
  7. style="background: linear-gradient(135deg, #488fff 0%, #65dcff 100%)"
  8. @click="goPath('/communityManagement/index')"
  9. >
  10. <!-- <router-link to="sc-operation/propertyManagement/inform.vue" tag="a" target="_blank"> -->
  11. <div class="header-left">
  12. <div class="header-left-top">
  13. <div class="header-icon"></div>
  14. <div>社区</div>
  15. </div>
  16. </div>
  17. <div class="header-number">{{ houseData.communityTotal }}</div>
  18. <div class="header-right">
  19. <img
  20. src="../../assets/img/img_shequ.png"
  21. alt=""
  22. />
  23. </div>
  24. <!-- </router-link> -->
  25. </li>
  26. <li
  27. style="background: linear-gradient(315deg, #5eedcc 0%, #24c3f1 100%)"
  28. @click="goPath('/buildingManagement/index')"
  29. >
  30. <div class="header-left">
  31. <div class="header-left-top">
  32. <div class="header-icon"></div>
  33. <div>楼栋</div>
  34. </div>
  35. </div>
  36. <div class="header-number">{{ houseData.buildingTotal }}</div>
  37. <div class="header-right">
  38. <img
  39. src="../../assets/img/img_loudong.png"
  40. alt=""
  41. />
  42. </div>
  43. </li>
  44. <li
  45. style="background: linear-gradient(135deg, #f0646c 0%, #f4994e 100%)"
  46. @click="goPath('/assetManagement/housingManagement/index')"
  47. >
  48. <div class="header-left">
  49. <div class="header-left-top">
  50. <div class="header-icon"></div>
  51. <div>房屋</div>
  52. </div>
  53. </div>
  54. <div class="header-number">{{ houseData.houseTotal }}</div>
  55. <div class="header-right">
  56. <img
  57. src="../../assets/img/img_fangwu.png"
  58. alt=""
  59. />
  60. </div>
  61. </li>
  62. <li
  63. style="background: linear-gradient(135deg, #7178ff 0%, #d2a4ff 100%)"
  64. @click="goPath('/assetManagement/shopManagement/index')"
  65. >
  66. <div class="header-left">
  67. <div class="header-left-top">
  68. <div class="header-icon"></div>
  69. <div>商铺</div>
  70. </div>
  71. </div>
  72. <div class="header-number">{{ houseData.shopsTotal }}</div>
  73. <div class="header-right">
  74. <img
  75. src="../../assets/img/img_shangpu.png"
  76. alt=""
  77. />
  78. </div>
  79. </li>
  80. <li
  81. style="background: linear-gradient(135deg, #884dd2 0%, #df63cc 100%)"
  82. @click="goPath('/ownerManagement/index')"
  83. >
  84. <div class="header-left">
  85. <div class="header-left-top">
  86. <div class="header-icon"></div>
  87. <div>住户</div>
  88. </div>
  89. </div>
  90. <div class="header-number">{{ houseData.residentTotal }}</div>
  91. <div class="header-right">
  92. <img
  93. src="../../assets/img/img_zhuhu.png"
  94. alt=""
  95. />
  96. </div>
  97. </li>
  98. </ul>
  99. </div>
  100. <!-- 头部结束部分 -->
  101. <!-- 中间开始部分 -->
  102. <div class="center">
  103. <div class="center-left">
  104. <div class="center-left-text">快速操作</div>
  105. <ul>
  106. <!-- <li @click="goPath('/communityManagement/pageJump/AddOrEdit')"> -->
  107. <li @click="goPathBack('/communityManagement/index', true)">
  108. <div>
  109. <img
  110. src="../../assets/img/icon_shequ.png"
  111. alt=""
  112. />
  113. </div>
  114. <span>添加社区</span>
  115. </li>
  116. <li @click="goPathBack('/buildingManagement/index', true)">
  117. <div>
  118. <img
  119. src="../../assets/img/icon_loudong.png"
  120. alt=""
  121. />
  122. </div>
  123. <span>添加楼栋</span>
  124. </li>
  125. <li @click="goPathBack('/assetManagement/housingManagement/index', true)">
  126. <div>
  127. <img
  128. src="../../assets/img/icon_fangwu.png"
  129. alt=""
  130. />
  131. </div>
  132. <span>添加房屋</span>
  133. </li>
  134. <li @click="goPathBack('/assetManagement/shopManagement/index', true)">
  135. <div>
  136. <img
  137. src="../../assets/img/icon_shangpu.png"
  138. alt=""
  139. />
  140. </div>
  141. <span>添加商铺</span>
  142. </li>
  143. <li @click="goPathBack('/ownerManagement/index', true)">
  144. <div>
  145. <img
  146. src="../../assets/img/icon_zhuhu.png"
  147. alt=""
  148. />
  149. </div>
  150. <span>添加住户</span>
  151. </li>
  152. </ul>
  153. </div>
  154. <div class="center-left center-right">
  155. <div class="center-left-text">待处理事项</div>
  156. <ul>
  157. <li @click="goPath('/ownerManagement/ownerReview/index', true)">
  158. <div>
  159. <div class="header-left">
  160. <div class="header-left-top">
  161. <div class="header-icon center-icon"></div>
  162. <div class="center-right-text">待审核业主</div>
  163. </div>
  164. </div>
  165. <div class="header-number center-number">{{ pendData.ownerReviewedTotal }}</div>
  166. <div class="center-right-image">
  167. <div></div>
  168. </div>
  169. </div>
  170. </li>
  171. <li @click="goPath('/propertyManagement/index', true)">
  172. <div>
  173. <div class="header-left">
  174. <div class="header-left-top">
  175. <div class="header-icon center-icon"></div>
  176. <div class="center-right-text">待处理投诉</div>
  177. </div>
  178. </div>
  179. <div class="header-number center-number">{{ pendData.complaintsTotal }}</div>
  180. <div class="center-right-image">
  181. <div></div>
  182. </div>
  183. </div>
  184. </li>
  185. <li @click="goPath('/workOrders/index', true)">
  186. <div>
  187. <div class="header-left">
  188. <div class="header-left-top">
  189. <div class="header-icon center-icon"></div>
  190. <div class="center-right-text">待处理工单</div>
  191. </div>
  192. </div>
  193. <div class="header-number center-number">{{ pendData.workOrderTotal }}</div>
  194. <div class="center-right-image">
  195. <div></div>
  196. </div>
  197. </div>
  198. </li>
  199. </ul>
  200. </div>
  201. </div>
  202. <!-- 中间结束部分 -->
  203. <!-- 底部开始部分 -->
  204. <div class="footer">
  205. <div class="footer-left">
  206. <div class="footer-left-text">
  207. <div>社区公告</div>
  208. <div @click="goPath('/propertyManagement/inform')">查看更多&nbsp;></div>
  209. </div>
  210. <ul v-if="informData.length > 0">
  211. <li
  212. v-for="(item, index) in informData"
  213. :key="index"
  214. @click="clickDatail(item.id)"
  215. >
  216. <div class="footer-content">
  217. <div>[{{ item.title }}]</div>
  218. <div>{{ item.content | filterHtml }}</div>
  219. <!-- <div v-html="item.content"></div> -->
  220. </div>
  221. <div>{{ item.pubDate }}</div>
  222. </li>
  223. </ul>
  224. <div
  225. v-else
  226. class="no-data"
  227. >暂无公告</div>
  228. </div>
  229. <div
  230. class="footer-left"
  231. style="margin-right: 0"
  232. >
  233. <div class="footer-left-text">
  234. <div>告警信息</div>
  235. <div @click="goPath('/alarmManagement/details')">查看更多&nbsp;></div>
  236. </div>
  237. <div v-if="warnData.length > 0">
  238. <ul>
  239. <li
  240. @click="goPath('/alarmManagement/details', true, item.id)"
  241. v-for="(item, index) in warnData"
  242. :key="index"
  243. >
  244. <div class="footer-content">
  245. <div>[{{ item.name }}]</div>
  246. <div>{{ item.alarmContent }}</div>
  247. </div>
  248. <div>{{ item.alarmStartTime }}</div>
  249. </li>
  250. </ul>
  251. </div>
  252. <div
  253. v-else
  254. class="no-data"
  255. >暂无告警信息</div>
  256. </div>
  257. </div>
  258. <!-- 底部结束部分 -->
  259. <!-- 详情显示 -->
  260. <div class="dialog-info">
  261. <el-dialog
  262. :visible.sync="showRight"
  263. width="1086px"
  264. :title="rowDetail.type == 0 ? '物业通知详情' : '社区活动详情'"
  265. :close-on-press-escape="true"
  266. :close-on-click-modal="true"
  267. @close="handleDialogClose"
  268. >
  269. <previe-inform
  270. :dataDetail="rowDetail"
  271. :filePath="filePath"
  272. :successImageLists="successImageLists"
  273. :houseData="houseData"
  274. :peopleData="peopleData"
  275. :houseDataNames="houseDataNames"
  276. :houseDataNamesPeople="houseDataNamesPeople"
  277. ref="previeInform"
  278. :showrightPhone="showrightPhone"
  279. :userType="userType"
  280. ></previe-inform>
  281. </el-dialog>
  282. </div>
  283. </div>
  284. </template>
  285. <script>
  286. import previeInform from '../propertyManagement/common/previeInform';
  287. export default {
  288. components: { previeInform },
  289. data () {
  290. return {
  291. houseData: [],
  292. warnData: [],
  293. informData: [],
  294. pendData: [],
  295. // 详情显示数据
  296. rowDetail: [],
  297. showrightPhone: false,
  298. showRight: false,
  299. PeopleNames: '',
  300. houseDataNames: '',
  301. userType: '',
  302. houseDataNamesPeople: ''
  303. };
  304. },
  305. created () {
  306. this.getHouseData();
  307. this.getWarnData();
  308. this.getInformData();
  309. this.getPendData();
  310. },
  311. methods: {
  312. // 弹框关闭事件
  313. handleDialogClose (e) {
  314. console.log('弹框关闭事件', e);
  315. this.$refs.previeInform.closeDialog();
  316. },
  317. /** 查看通知公告详情*/
  318. clickDatail (val) {
  319. // this.rowDetail = [];
  320. this.$http.get('/czc-community/notice/find/' + val).then((res) => {
  321. if (res.status === 0) {
  322. this.rowDetail = res.data;
  323. let treeData = JSON.parse(res.data.treeData);
  324. this.rowDetail.treeData = JSON.parse(treeData[0]);
  325. this.rowDetail.treeDataPeople = JSON.parse(treeData[1]);
  326. let userType = '';
  327. let arr1 = this.rowDetail.treeData;
  328. let arr2 = this.rowDetail.treeDataPeople;
  329. if (arr1.length > 0 && arr2.length > 0) {
  330. userType = 2;
  331. } else if (arr1.length > 0) {
  332. userType = 0;
  333. } else {
  334. userType = 1;
  335. }
  336. this.userType = userType;
  337. if (userType == 0) {
  338. this.getOrgTreeList();
  339. } else if (userType == 1) {
  340. this.getPeopleList();
  341. } else {
  342. this.getOrgTreeList();
  343. this.getPeopleList();
  344. }
  345. this.filePath = JSON.parse(res.data.filePath);
  346. this.successImageLists = JSON.parse(res.data.themePictrue);
  347. this.showRight = true;
  348. this.showrightPhone = true;
  349. } else {
  350. return this.$message('获取详情失败!请稍后重试');
  351. }
  352. });
  353. },
  354. filterPeople (arr) {
  355. arr.map((item, index) => {
  356. if (item.children && item.children.length > 0) {
  357. this.filterPeople(item.children);
  358. } else if (item.children == null) {
  359. this.filterArrPeople(arr, item, index);
  360. }
  361. });
  362. },
  363. filterArrPeople (arr, item, index) {
  364. if (!this.rowDetail.treeDataPeople.includes(Number(item.id))) {
  365. arr.splice(index, 1);
  366. arr.map((item) => {
  367. this.filterArrPeople(arr, item, index);
  368. });
  369. }
  370. },
  371. filterPeopleName (array) {
  372. console.log('====================================');
  373. console.log(' filterPeopleName(array', array);
  374. console.log('====================================');
  375. var that = this;
  376. // array.map((item) => {
  377. // if (item.children && item.children.length > 0) {
  378. // that.filterName(item.children);
  379. // that.houseNames.push(item.name);
  380. // } else if (item.type == 'room') {
  381. // that.houseNames.push(item.name);
  382. // }
  383. // });
  384. array.map((item) => {
  385. if (item.children) {
  386. that.filterPeopleName(item.children);
  387. } else if (item.children == null) {
  388. that.PeopleNames.push(item.value);
  389. }
  390. });
  391. },
  392. // 获取人员
  393. getPeopleList () {
  394. this.PeopleNames = [];
  395. this.$http.get('/czc-user-center/user/findUserList').then(({ status, data, msg }) => {
  396. if (status === 0) {
  397. this.peopleData = data;
  398. this.filterPeople(this.peopleData);
  399. this.filterPeopleName(this.peopleData);
  400. this.clearTreeChildrenPeople(data);
  401. this.houseDataNamesPeople = this.PeopleNames.toString();
  402. } else {
  403. this.$message(warning, msg);
  404. }
  405. });
  406. },
  407. clearTreeChildrenPeople (arr) {
  408. arr.map((item, index) => {
  409. if (!!item.children && item.children.length > 0) {
  410. this.clearTreeChildrenPeople(item.children);
  411. } else {
  412. if (!!item.children && item.children.length == 0) {
  413. this.clearTreeChildrenPeopleArr(arr, index);
  414. }
  415. }
  416. });
  417. },
  418. clearTreeChildrenPeopleArr (arr, index) {
  419. arr.splice(index, 1);
  420. arr.map((item, indexs) => {
  421. if (!!item.children && item.children.length == 0) {
  422. this.clearTreeChildrenPeopleArr(arr, indexs);
  423. }
  424. });
  425. },
  426. dimension (arr) {
  427. arr.map((item, index) => {
  428. if (item.children) {
  429. this.dimension(item.children);
  430. } else if (item.type == 'room') {
  431. this.filterArr(arr, item, index);
  432. }
  433. });
  434. },
  435. filterArr (arr, item, index) {
  436. if (!this.rowDetail.treeData.includes(Number(item.value))) {
  437. arr.splice(index, 1);
  438. arr.map((item) => {
  439. this.filterArr(arr, item, index);
  440. });
  441. }
  442. },
  443. filterName (array) {
  444. var that = this;
  445. array.map((item) => {
  446. if (item.children && item.children.length > 0) {
  447. that.houseNames.push(item.name);
  448. that.filterName(item.children);
  449. } else if (item.type == 'room') {
  450. that.houseNames.push(item.name);
  451. }
  452. });
  453. },
  454. clearTreeChildren (arr) {
  455. arr.map((item, index) => {
  456. if (!!item.children && item.children.length > 0) {
  457. this.clearTreeChildren(item.children);
  458. } else {
  459. if (!!item.children) {
  460. arr.splice(index, 1);
  461. }
  462. }
  463. });
  464. },
  465. // 获取房间
  466. getOrgTreeList () {
  467. this.houseNames = [];
  468. this.$http
  469. .get('/czc-community/assets/tree/community/find', { buildingType: this.buildingType })
  470. .then(({ status, data, msg }) => {
  471. if (status === 0 && data) {
  472. var arr = data.filter((item) => {
  473. return item.id == this.rowDetail.communityId;
  474. });
  475. if (arr.length > 0) {
  476. this.dimension(arr);
  477. this.clearTreeChildren(arr);
  478. this.houseData = arr;
  479. this.filterName(this.houseData);
  480. this.houseDataNames = this.houseNames.toString();
  481. }
  482. }
  483. });
  484. },
  485. // 打开新页 跳转的路径
  486. goPath (path, showDialog, id) {
  487. this.$router.push({ path, query: { showDialog: showDialog, id: id } });
  488. // let routeData = this.$router.resolve({
  489. // path: path,
  490. // query: {
  491. // showDialog: showDialog,
  492. // id: id
  493. // }
  494. // });
  495. // window.open(routeData.href, '_blank');
  496. },
  497. // 跳转路由页面 返回
  498. goPathBack (path, showDialog, id) {
  499. this.$router.push({ path, query: { showDialog: showDialog, id: id } });
  500. },
  501. // 获取待处理事项
  502. getPendData () {
  503. this.$http.get('/czc-community/Workbench/pendingMatters').then((res) => {
  504. if (res.status == 0) {
  505. this.pendData = res.data;
  506. } else {
  507. this.$message.warning('获取待处理事项失败');
  508. }
  509. });
  510. },
  511. // 获取房屋信息
  512. getHouseData () {
  513. this.$http.get('/czc-community/Workbench/totalHouseInfo').then((res) => {
  514. if (res.status == 0) {
  515. this.houseData = res.data;
  516. } else {
  517. this.$message.warning('获取房屋信息失败');
  518. }
  519. });
  520. },
  521. // 获取告警信息
  522. getWarnData () {
  523. this.$http.get('/czc-community/Workbench/getWaringInfo').then((res) => {
  524. if (res.status == 0) {
  525. this.warnData = res.data;
  526. } else {
  527. this.$message.warning('获取告警信息失败');
  528. }
  529. });
  530. },
  531. // 获取通知信息
  532. getInformData () {
  533. this.$http.get('/czc-community/Workbench/getNoticeInfo').then((res) => {
  534. if (res.status == 0) {
  535. let data = res.data;
  536. this.informData = data;
  537. } else {
  538. this.$message.warning('获取通知信息失败');
  539. }
  540. });
  541. }
  542. }
  543. };
  544. </script>
  545. <style lang="scss" scoped>
  546. @import './style.scss';
  547. /deep/ .el-dialog__body {
  548. padding: 0;
  549. }
  550. .el-dialog__header {
  551. background-color: #f8fcff;
  552. }
  553. /deep/ .detail .prev-detail-right {
  554. left: 11% !important;
  555. }
  556. </style>