details.vue 11 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462
  1. <template>
  2. <div class="main">
  3. <div class="top-title">
  4. <h1>房屋号:{{ detailsData.roomNumber }}<span class="titleType">住宅</span></h1>
  5. <el-button
  6. class="right"
  7. type="primary"
  8. @click="close()"
  9. >返回</el-button>
  10. <div class="text">
  11. <span>所属社区: {{ detailsData.communityId | matchingVal($store.getters['getCommunityArray']) }}</span>
  12. <span>楼栋:{{ detailsData.communityName }}</span>
  13. </div>
  14. </div>
  15. <div class="content">
  16. <div class="tages">
  17. <div
  18. v-for="(item, index) in tabs"
  19. :key="index"
  20. class="tages-list"
  21. :class="tabsIndex === index ? 'active' : ''"
  22. >
  23. <span @click="toggleTab(index)">{{ item.lable }}</span>
  24. </div>
  25. </div>
  26. <div
  27. class="content-item"
  28. v-show="tabsIndex === 0"
  29. >
  30. <div class="widthFlex">
  31. <household-table
  32. :tableName="houseTable.left"
  33. :tabData="detailsData"
  34. ></household-table>
  35. <household-table
  36. :tableName="houseTable.right"
  37. :tabData="detailsData"
  38. ></household-table>
  39. </div>
  40. </div>
  41. <div
  42. class="content-item"
  43. v-show="tabsIndex === 1"
  44. >
  45. <div class="formContent-item_title">基础信息</div>
  46. <div class="widthFlex">
  47. <household-table
  48. :tableName="householdTable.left"
  49. :tabData="houseData"
  50. ></household-table>
  51. <household-table
  52. :tableName="householdTable.right"
  53. :tabData="houseData"
  54. ></household-table>
  55. </div>
  56. <div class="formContent-item_title">人脸信息</div>
  57. <div class="detailImg">
  58. <div class="clickUpText">
  59. <img
  60. class="dataImg"
  61. v-if="!!houseData.facePictureUrl"
  62. :src="houseData.facePictureUrl"
  63. />
  64. <template v-else>
  65. <img
  66. class="bg-img"
  67. src="@/assets/img/ownerManagement/img_zhaopian2@2x.png"
  68. alt=""
  69. />
  70. <div>无人脸图片</div>
  71. </template>
  72. </div>
  73. </div>
  74. </div>
  75. <div
  76. class="content-item"
  77. v-show="tabsIndex === 2"
  78. >
  79. <zz-table
  80. :cols="cols"
  81. :data="memberData"
  82. :settings="{ stripe: true, hideFoot: true }"
  83. >
  84. <template
  85. slot="opt"
  86. slot-scope="scope"
  87. >
  88. <el-tooltip
  89. class="item"
  90. effect="light"
  91. placement="bottom"
  92. content="查看"
  93. >
  94. <i
  95. class="zoniot_font zoniot-icon-xiangqing"
  96. @click="lookPage(scope.row)"
  97. ></i>
  98. </el-tooltip>
  99. </template>
  100. </zz-table>
  101. </div>
  102. </div>
  103. </div>
  104. </template>
  105. <script>
  106. import list from '@utils/list.js';
  107. import householdTable from '../stepPage/householdTable.vue';
  108. export default {
  109. components: { householdTable },
  110. mixins: [list],
  111. name: 'housingManagementDetails',
  112. data () {
  113. let _this = this;
  114. return {
  115. tabsIndex: 0,
  116. id: null,
  117. detailsData: {},
  118. memberData: [],
  119. houseData: {
  120. // name: '',
  121. // phone: '',
  122. // idNumber: '',
  123. // birthDate: '',
  124. // nation: '',
  125. // householdType: '',
  126. // personnelNumber: '',
  127. // sex: '',
  128. // nationality: '',
  129. // permanentAddress: '',
  130. // facePictureUrl:null,
  131. },
  132. tabs: [
  133. {
  134. lable: '房屋信息'
  135. },
  136. {
  137. lable: '业主信息'
  138. },
  139. {
  140. lable: '成员信息'
  141. }
  142. ],
  143. houseTable: {
  144. left: [
  145. {
  146. lable: '所属社区',
  147. prop: 'communityName'
  148. },
  149. {
  150. lable: '单元',
  151. prop: 'unitName'
  152. },
  153. {
  154. lable: '房屋号',
  155. prop: 'roomNumber'
  156. },
  157. {
  158. lable: '建筑面积',
  159. prop: 'buildingArea'
  160. },
  161. {
  162. lable: '公摊面积',
  163. prop: 'publicArea'
  164. },
  165. {
  166. lable: '装修性质',
  167. prop: 'decorateProperties',
  168. typeArray: [
  169. { type: 1, lable: '毛胚' },
  170. { type: 2, lable: '简单装修' },
  171. { type: 3, lable: '中等装修' },
  172. { type: 4, lable: '精装修' },
  173. { type: 5, lable: '豪华装修' }
  174. ]
  175. },
  176. {
  177. lable: '房屋编号',
  178. prop: 'assetNumber'
  179. }
  180. ],
  181. right: [
  182. {
  183. lable: '楼栋名称',
  184. prop: 'buildingName'
  185. },
  186. {
  187. lable: '楼层',
  188. prop: 'floorNumber'
  189. },
  190. {
  191. lable: '房屋类型',
  192. prop: 'buildingType',
  193. typeArray: [
  194. { type: 1, lable: '住宅' },
  195. { type: 2, lable: '商用' }
  196. ]
  197. },
  198. {
  199. lable: '使用面积 ',
  200. prop: 'useArea'
  201. },
  202. {
  203. lable: '房屋户型',
  204. prop: 'housingType',
  205. typeArray: [
  206. { type: 1, lable: '室' },
  207. { type: 2, lable: '厅' },
  208. { type: 3, lable: '卫' }
  209. ]
  210. },
  211. {
  212. lable: '房屋朝向',
  213. prop: 'orientationOfRoom',
  214. typeArray: [
  215. { type: 1, lable: '东' },
  216. { type: 2, lable: '南' },
  217. { type: 3, lable: '西' },
  218. { type: 4, lable: '北' },
  219. { type: 5, lable: '东南' },
  220. { type: 6, lable: '西南' },
  221. { type: 7, lable: '西北' },
  222. { type: 8, lable: '东北' }
  223. ]
  224. },
  225. {
  226. lable: '备注',
  227. prop: 'remarks'
  228. }
  229. ]
  230. },
  231. householdTable: {
  232. left: [
  233. {
  234. lable: '姓名',
  235. prop: 'name'
  236. },
  237. {
  238. lable: '手机号',
  239. prop: 'phone'
  240. },
  241. {
  242. lable: '身份证号',
  243. prop: 'idNumber'
  244. },
  245. {
  246. lable: '出生日期',
  247. prop: 'birthDate'
  248. },
  249. {
  250. lable: '民族',
  251. prop: 'nation'
  252. }
  253. // {
  254. // lable: '入住时间',
  255. // prop: 'checkInDate'
  256. // }
  257. ],
  258. right: [
  259. {
  260. lable: '类型',
  261. prop: 'householdType',
  262. const: true,
  263. format (val) {
  264. debugger
  265. return '业主';
  266. }
  267. },
  268. {
  269. lable: '人员编号',
  270. prop: 'personnelNumber'
  271. },
  272. {
  273. lable: '性别',
  274. prop: 'sex',
  275. typeArray: [
  276. { type: 0, lable: '未知' },
  277. { type: 1, lable: '男' },
  278. { type: 2, lable: '女' }
  279. ]
  280. },
  281. {
  282. lable: '国籍',
  283. prop: 'nationality',
  284. typeArray: [
  285. { type: 1, lable: '中国' },
  286. { type: 2, lable: '其他' }
  287. ]
  288. },
  289. {
  290. lable: '户籍地址',
  291. prop: 'permanentAddress'
  292. }
  293. ]
  294. },
  295. cols: [
  296. {
  297. label: '姓名',
  298. prop: 'name'
  299. },
  300. {
  301. label: '手机号',
  302. prop: 'phone'
  303. },
  304. {
  305. label: '身份证号',
  306. prop: 'idNumber'
  307. },
  308. {
  309. label: '关系',
  310. prop: 'householdType',
  311. format (val) {
  312. switch (val) {
  313. case 1:
  314. return '业主';
  315. case 2:
  316. return '亲属';
  317. case 3:
  318. return '租客';
  319. }
  320. }
  321. },
  322. {
  323. label: '操作',
  324. slot: 'opt',
  325. width: 150
  326. }
  327. ],
  328. mixins_pageset: {
  329. total: 0,
  330. pageNum: 1,
  331. pageSize: 15,
  332. sortColumn: null, // 当前列的字段
  333. sortOrder: null // 排序方式 顺序:ASC 倒序:DESC
  334. }
  335. };
  336. },
  337. filters: {
  338. matchingVal (val, arr) {
  339. let v = '--';
  340. if (!!val) {
  341. arr.forEach((item) => {
  342. if (!!item.code && item.code === val) {
  343. v = item.name;
  344. } else if (item.type === val) {
  345. v = item.lable;
  346. } else if (!!item.communityName && item.id === val) {
  347. v = item.communityName;
  348. }
  349. });
  350. }
  351. return v;
  352. }
  353. },
  354. created () {
  355. this.id = this.$route.query.id;
  356. this.getDetails();
  357. this.getMember();
  358. },
  359. methods: {
  360. toggleTab (index) {
  361. this.tabsIndex = index;
  362. },
  363. close () {
  364. let tagsList = this.$store.getters['getTagsList'];
  365. let activeRout = this.$route;
  366. if (tagsList.length > 1) {
  367. tagsList.forEach((item, index) => {
  368. if (item.title == "房屋管理" || item.name == 'assetManagement/housingManagement/index') {
  369. this.$router.push({
  370. path: item.path
  371. })
  372. }
  373. // if (item.title == activeRout.meta.title || item.path == activeRout.path) {
  374. // tagsList.splice(index, 1);
  375. // this.$router.push({
  376. // path: tagsList[index - 1].path
  377. // });
  378. // }
  379. });
  380. } else {
  381. this.$router.push({
  382. path: '/'
  383. });
  384. }
  385. },
  386. getDetails () {
  387. this.$http
  388. .get('/czc-community/assets/house/find/house?houseId=' + this.id)
  389. .then((res) => {
  390. if (!!res) {
  391. this.detailsData = res;
  392. if (!!res.residentId) {
  393. this.getHouse(res.residentId);
  394. }
  395. } else {
  396. this.$message.error('系统繁忙,请稍后重试');
  397. }
  398. })
  399. .catch(() => { });
  400. },
  401. getMember () {
  402. this.$http
  403. .get('/czc-community/assets/house/list?id=' + this.id)
  404. .then(({ data, status, msg }) => {
  405. if (0 === status) {
  406. this.memberData = data;
  407. } else {
  408. this.$message.error(msg);
  409. }
  410. })
  411. .catch(() => { });
  412. },
  413. getHouse (id) {
  414. this.$http
  415. .get('/czc-community/scResident/find/' + id)
  416. .then(({ data, status, msg }) => {
  417. if (0 === status) {
  418. if (data !== null) {
  419. debugger
  420. this.houseData = data;
  421. }
  422. } else {
  423. this.$message.error(msg);
  424. }
  425. })
  426. .catch(() => { });
  427. },
  428. lookPage (row) {
  429. this.$store.dispatch('addPopup', {
  430. url: '/assetManagement/stepPage/houseDataPop.vue',
  431. width: '1044px',
  432. height: '600px',
  433. props: {
  434. data: row
  435. },
  436. notip: true,
  437. showCancelButton: true,
  438. showConfirmButton: true,
  439. title: '成员信息'
  440. });
  441. }
  442. }
  443. };
  444. </script>
  445. <style lang='scss' scoped >
  446. @import '../style.scss';
  447. .detailImg {
  448. width: 200px;
  449. height: 280px;
  450. background: #f8fcff;
  451. border-radius: 4px;
  452. border: 1px solid #e0e1e3;
  453. color: #424656;
  454. text-align: center;
  455. .clickUpText {
  456. position: inherit;
  457. img.bg-img {
  458. width: 100px;
  459. }
  460. }
  461. }
  462. </style>