Commit 20ddb87696df1baf8b8917adcf1a7ff6d9c17672
1 parent
8fc7c791
优化房屋产权
Showing
7 changed files
with
24 additions
and
161 deletions
src/components/car/floorUnitTree.vue deleted
| 1 | -<template> | ||
| 2 | - <el-card class="tree-card"> | ||
| 3 | - <el-tree | ||
| 4 | - ref="tree" | ||
| 5 | - :data="treeData" | ||
| 6 | - :props="defaultProps" | ||
| 7 | - node-key="id" | ||
| 8 | - :default-expanded-keys="expandedKeys" | ||
| 9 | - :highlight-current="true" | ||
| 10 | - @node-click="handleNodeClick" | ||
| 11 | - > | ||
| 12 | - <template #default="{ node, data }"> | ||
| 13 | - <span class="custom-tree-node"> | ||
| 14 | - <img :src="data.icon" class="tree-icon" v-if="data.icon"> | ||
| 15 | - <span>{{ node.label }}</span> | ||
| 16 | - </span> | ||
| 17 | - </template> | ||
| 18 | - </el-tree> | ||
| 19 | - <div v-if="!treeData || treeData.length === 0" class="no-data"> | ||
| 20 | - {{ $t('floorUnitTree.noBuilding') }} | ||
| 21 | - </div> | ||
| 22 | - </el-card> | ||
| 23 | -</template> | ||
| 24 | - | ||
| 25 | -<script> | ||
| 26 | -import { queryFloorAndUnits } from '@/api/car/carStructureApi' | ||
| 27 | -import { getCommunityId } from '@/api/community/communityApi' | ||
| 28 | - | ||
| 29 | -export default { | ||
| 30 | - name: 'FloorUnitTree', | ||
| 31 | - props: { | ||
| 32 | - floorId: { | ||
| 33 | - type: String, | ||
| 34 | - default: '' | ||
| 35 | - } | ||
| 36 | - }, | ||
| 37 | - data() { | ||
| 38 | - return { | ||
| 39 | - treeData: [], | ||
| 40 | - defaultProps: { | ||
| 41 | - children: 'children', | ||
| 42 | - label: 'text' | ||
| 43 | - }, | ||
| 44 | - expandedKeys: [], | ||
| 45 | - communityId: '' | ||
| 46 | - } | ||
| 47 | - }, | ||
| 48 | - watch: { | ||
| 49 | - floorId(newVal) { | ||
| 50 | - this.$nextTick(() => { | ||
| 51 | - if (newVal) { | ||
| 52 | - const node = this.$refs.tree.getNode('f_' + newVal) | ||
| 53 | - if (node) { | ||
| 54 | - this.$refs.tree.setCurrentKey(node.key) | ||
| 55 | - } | ||
| 56 | - } | ||
| 57 | - }) | ||
| 58 | - } | ||
| 59 | - }, | ||
| 60 | - created() { | ||
| 61 | - this.communityId = getCommunityId() | ||
| 62 | - this.loadFloorAndUnits() | ||
| 63 | - }, | ||
| 64 | - methods: { | ||
| 65 | - async loadFloorAndUnits() { | ||
| 66 | - try { | ||
| 67 | - const params = { | ||
| 68 | - communityId: this.communityId | ||
| 69 | - } | ||
| 70 | - const data = await queryFloorAndUnits(params) | ||
| 71 | - this.treeData = this.formatTreeData(data) | ||
| 72 | - this.setDefaultExpanded() | ||
| 73 | - } catch (error) { | ||
| 74 | - this.$message.error(this.$t('floorUnitTree.fetchError')) | ||
| 75 | - } | ||
| 76 | - }, | ||
| 77 | - formatTreeData(data) { | ||
| 78 | - const formattedData = [] | ||
| 79 | - const floorMap = {} | ||
| 80 | - | ||
| 81 | - // First pass: create floor nodes | ||
| 82 | - data.forEach(item => { | ||
| 83 | - if (!floorMap[item.floorId]) { | ||
| 84 | - floorMap[item.floorId] = { | ||
| 85 | - id: 'f_' + item.floorId, | ||
| 86 | - floorId: item.floorId, | ||
| 87 | - floorNum: item.floorNum, | ||
| 88 | - icon: require('@/assets/img/floor.png'), | ||
| 89 | - text: `${item.floorNum}${this.$t('floorUnitTree.building')}(${item.floorName})`, | ||
| 90 | - children: [] | ||
| 91 | - } | ||
| 92 | - formattedData.push(floorMap[item.floorId]) | ||
| 93 | - } | ||
| 94 | - | ||
| 95 | - // Add unit if it exists and not '0' | ||
| 96 | - if (item.unitId && item.unitNum !== '0') { | ||
| 97 | - floorMap[item.floorId].children.push({ | ||
| 98 | - id: 'u_' + item.unitId, | ||
| 99 | - unitId: item.unitId, | ||
| 100 | - text: `${item.unitNum}${this.$t('floorUnitTree.unit')}`, | ||
| 101 | - icon: require('@/assets/img/unit.png') | ||
| 102 | - }) | ||
| 103 | - } | ||
| 104 | - }) | ||
| 105 | - | ||
| 106 | - return formattedData | ||
| 107 | - }, | ||
| 108 | - setDefaultExpanded() { | ||
| 109 | - if (this.treeData.length > 0) { | ||
| 110 | - this.expandedKeys = [this.treeData[0].id] | ||
| 111 | - } | ||
| 112 | - }, | ||
| 113 | - handleNodeClick(data) { | ||
| 114 | - if (data.id.startsWith('f_')) { | ||
| 115 | - this.$emit('switchFloor', { floorId: data.floorId }) | ||
| 116 | - } else if (data.id.startsWith('u_')) { | ||
| 117 | - this.$emit('switchUnit', { unitId: data.unitId }) | ||
| 118 | - } | ||
| 119 | - }, | ||
| 120 | - refreshTree(params) { | ||
| 121 | - if (params && params.floorId) { | ||
| 122 | - this.floorId = params.floorId | ||
| 123 | - } | ||
| 124 | - this.loadFloorAndUnits() | ||
| 125 | - } | ||
| 126 | - } | ||
| 127 | -} | ||
| 128 | -</script> | ||
| 129 | - | ||
| 130 | -<style lang="scss" scoped> | ||
| 131 | -.tree-card { | ||
| 132 | - height: 100%; | ||
| 133 | - | ||
| 134 | - .custom-tree-node { | ||
| 135 | - display: flex; | ||
| 136 | - align-items: center; | ||
| 137 | - } | ||
| 138 | - | ||
| 139 | - .tree-icon { | ||
| 140 | - width: 16px; | ||
| 141 | - height: 16px; | ||
| 142 | - margin-right: 5px; | ||
| 143 | - } | ||
| 144 | - | ||
| 145 | - .no-data { | ||
| 146 | - padding: 10px; | ||
| 147 | - text-align: center; | ||
| 148 | - color: #909399; | ||
| 149 | - } | ||
| 150 | -} | ||
| 151 | -</style> | ||
| 152 | \ No newline at end of file | 0 | \ No newline at end of file |
src/components/room/editPropertyRightRegistrationDetail.vue
| @@ -114,30 +114,32 @@ export default { | @@ -114,30 +114,32 @@ export default { | ||
| 114 | this.visible = true | 114 | this.visible = true |
| 115 | }, | 115 | }, |
| 116 | loadPhotos() { | 116 | loadPhotos() { |
| 117 | + setTimeout(() => { | ||
| 117 | if (this.editPropertyRightRegistrationDetailInfo.securities === '001' && this.editPropertyRightRegistrationDetailInfo.idCardUrl) { | 118 | if (this.editPropertyRightRegistrationDetailInfo.securities === '001' && this.editPropertyRightRegistrationDetailInfo.idCardUrl) { |
| 118 | - const urls = this.editPropertyRightRegistrationDetailInfo.idCardUrl.trim() | 119 | + const urls = this.editPropertyRightRegistrationDetailInfo.idCardUrl |
| 119 | if (urls) { | 120 | if (urls) { |
| 120 | this.$refs.idCardUpload.setImages(urls.split(',')) | 121 | this.$refs.idCardUpload.setImages(urls.split(',')) |
| 121 | } | 122 | } |
| 122 | } | 123 | } |
| 123 | if (this.editPropertyRightRegistrationDetailInfo.securities === '002' && this.editPropertyRightRegistrationDetailInfo.housePurchaseUrl) { | 124 | if (this.editPropertyRightRegistrationDetailInfo.securities === '002' && this.editPropertyRightRegistrationDetailInfo.housePurchaseUrl) { |
| 124 | - const urls = this.editPropertyRightRegistrationDetailInfo.housePurchaseUrl.trim() | 125 | + const urls = this.editPropertyRightRegistrationDetailInfo.housePurchaseUrl |
| 125 | if (urls) { | 126 | if (urls) { |
| 126 | this.$refs.housePurchaseUpload.setImages(urls.split(',')) | 127 | this.$refs.housePurchaseUpload.setImages(urls.split(',')) |
| 127 | } | 128 | } |
| 128 | } | 129 | } |
| 129 | if (this.editPropertyRightRegistrationDetailInfo.securities === '003' && this.editPropertyRightRegistrationDetailInfo.repairUrl) { | 130 | if (this.editPropertyRightRegistrationDetailInfo.securities === '003' && this.editPropertyRightRegistrationDetailInfo.repairUrl) { |
| 130 | - const urls = this.editPropertyRightRegistrationDetailInfo.repairUrl.trim() | 131 | + const urls = this.editPropertyRightRegistrationDetailInfo.repairUrl |
| 131 | if (urls) { | 132 | if (urls) { |
| 132 | this.$refs.repairUpload.setImages(urls.split(',')) | 133 | this.$refs.repairUpload.setImages(urls.split(',')) |
| 133 | } | 134 | } |
| 134 | } | 135 | } |
| 135 | if (this.editPropertyRightRegistrationDetailInfo.securities === '004' && this.editPropertyRightRegistrationDetailInfo.deedTaxUrl) { | 136 | if (this.editPropertyRightRegistrationDetailInfo.securities === '004' && this.editPropertyRightRegistrationDetailInfo.deedTaxUrl) { |
| 136 | - const urls = this.editPropertyRightRegistrationDetailInfo.deedTaxUrl.trim() | 137 | + const urls = this.editPropertyRightRegistrationDetailInfo.deedTaxUrl |
| 137 | if (urls) { | 138 | if (urls) { |
| 138 | - this.$refs.deedTaxUpload.setImages(urls.split(',')) | 139 | + this.$refs.deedTaxUpload.setImages(urls.split(',')) |
| 140 | + } | ||
| 139 | } | 141 | } |
| 140 | - } | 142 | + }, 1000) |
| 141 | }, | 143 | }, |
| 142 | handleIdCardImageChange(photos) { | 144 | handleIdCardImageChange(photos) { |
| 143 | this.editPropertyRightRegistrationDetailInfo.idCardPhotos = photos | 145 | this.editPropertyRightRegistrationDetailInfo.idCardPhotos = photos |
src/components/room/floorUnitTree.vue
| @@ -48,6 +48,13 @@ export default { | @@ -48,6 +48,13 @@ export default { | ||
| 48 | refreshTree(param) { | 48 | refreshTree(param) { |
| 49 | this.handleRefreshTree(param) | 49 | this.handleRefreshTree(param) |
| 50 | }, | 50 | }, |
| 51 | + selectFirstUnit(){ | ||
| 52 | + if(this.treeData.length > 0){ | ||
| 53 | + this.handleNodeClick(this.treeData[0].children[0]) | ||
| 54 | + // 并且展开 | ||
| 55 | + | ||
| 56 | + } | ||
| 57 | + }, | ||
| 51 | handleRefreshTree(param) { | 58 | handleRefreshTree(param) { |
| 52 | if (param) { | 59 | if (param) { |
| 53 | this.currentFloorId = param.floorId | 60 | this.currentFloorId = param.floorId |
src/views/car/carStructureList.vue
| @@ -46,6 +46,9 @@ export default { | @@ -46,6 +46,9 @@ export default { | ||
| 46 | }, | 46 | }, |
| 47 | created() { | 47 | created() { |
| 48 | this.communityId = getCommunityId() | 48 | this.communityId = getCommunityId() |
| 49 | + setTimeout(() => { | ||
| 50 | + this.$refs.floorUnitTree.selectFirstUnit() | ||
| 51 | + }, 1000) | ||
| 49 | }, | 52 | }, |
| 50 | methods: { | 53 | methods: { |
| 51 | switchFloorUnit(data) { | 54 | switchFloorUnit(data) { |
src/views/room/listPropertyRightRegistrationDetailList.vue
| 1 | <template> | 1 | <template> |
| 2 | <div class="property-right-detail-container"> | 2 | <div class="property-right-detail-container"> |
| 3 | <el-card class="box-card"> | 3 | <el-card class="box-card"> |
| 4 | - <div slot="header" class="clearfix"> | ||
| 5 | - <div class="card-header"> | 4 | + <div slot="header" class="flex justify-between"> |
| 6 | <div> | 5 | <div> |
| 7 | <span>{{ listPropertyRightRegistrationDetailInfo.conditions.floorNum }}-{{ | 6 | <span>{{ listPropertyRightRegistrationDetailInfo.conditions.floorNum }}-{{ |
| 8 | listPropertyRightRegistrationDetailInfo.conditions.unitNum }}-{{ | 7 | listPropertyRightRegistrationDetailInfo.conditions.unitNum }}-{{ |
| @@ -15,7 +14,7 @@ | @@ -15,7 +14,7 @@ | ||
| 15 | <span>{{ $t('common.back') }}</span> | 14 | <span>{{ $t('common.back') }}</span> |
| 16 | </el-button> | 15 | </el-button> |
| 17 | </div> | 16 | </div> |
| 18 | - </div> | 17 | + |
| 19 | </div> | 18 | </div> |
| 20 | 19 | ||
| 21 | <el-table :data="listPropertyRightRegistrationDetailInfo.propertyRightRegistrationDetails" border | 20 | <el-table :data="listPropertyRightRegistrationDetailInfo.propertyRightRegistrationDetails" border |
src/views/room/propertyRightRegistrationManageList.vue
| @@ -305,7 +305,7 @@ export default { | @@ -305,7 +305,7 @@ export default { | ||
| 305 | 305 | ||
| 306 | <style lang="scss" scoped> | 306 | <style lang="scss" scoped> |
| 307 | .property-right-registration-container { | 307 | .property-right-registration-container { |
| 308 | - padding: 0; | 308 | + padding: 10px; |
| 309 | margin: 0; | 309 | margin: 0; |
| 310 | 310 | ||
| 311 | .search-wrapper { | 311 | .search-wrapper { |
src/views/room/roomStructureList.vue
| @@ -70,6 +70,9 @@ export default { | @@ -70,6 +70,9 @@ export default { | ||
| 70 | }, | 70 | }, |
| 71 | created() { | 71 | created() { |
| 72 | this.communityId = getCommunityId() | 72 | this.communityId = getCommunityId() |
| 73 | + setTimeout(() => { | ||
| 74 | + this.$refs.floorUnitTree.selectFirstUnit() | ||
| 75 | + }, 1500) | ||
| 73 | }, | 76 | }, |
| 74 | methods: { | 77 | methods: { |
| 75 | handleSwitchUnit(params) { | 78 | handleSwitchUnit(params) { |