Files
dvcp_v2_wxcp_app/library/apps/AppBuilding/detail.vue

539 lines
13 KiB
Vue
Raw Normal View History

2021-12-15 18:07:16 +08:00
<template>
<div class="detail">
<AiTopFixed>
2021-12-23 16:42:14 +08:00
<div class="select-flex" @click="showSelect=true">
<span class="name" v-text="cellName"/>
2021-12-27 17:10:37 +08:00
<span class="btn">单元切换</span>
2021-12-15 18:07:16 +08:00
</div>
<div class="line-bg"></div>
<div class="num-content">
<div class="num-item">
<div class="content">
2021-12-23 16:42:14 +08:00
<h2>{{ numInfo['实有户数'] || 0 }}</h2>
2021-12-15 18:07:16 +08:00
<p>实有户数</p>
</div>
</div>
<div class="num-item">
<div class="content">
2021-12-23 16:42:14 +08:00
<h2>{{ numInfo['实有人口'] || 0 }}</h2>
2021-12-15 18:07:16 +08:00
<p>实有人口</p>
</div>
</div>
<div class="num-item">
<div class="content">
2021-12-23 16:42:14 +08:00
<h2>{{ numInfo['流动人口'] || 0 }}</h2>
2021-12-15 18:07:16 +08:00
<p>流动人口</p>
</div>
</div>
</div>
<div class="line-bg"></div>
</AiTopFixed>
<div class="list-content">
<div class="left">
2021-12-17 17:31:12 +08:00
<div class="item-content" v-for="(item, index) in list" :key="index" @click="getHouseDetail(item.id)">
<div class="item">
2021-12-23 16:42:14 +08:00
<h2>{{ item.houseCode }}</h2>
<p v-text="`${item.livingNumber}人`.replace(/0人/,'无人')"/>
2021-12-17 17:31:12 +08:00
</div>
2021-12-15 18:07:16 +08:00
</div>
2021-12-23 16:42:14 +08:00
<AiEmpty v-if="!list.length" style="padding-bottom:80px;"/>
2021-12-15 18:07:16 +08:00
</div>
</div>
2021-12-31 16:25:32 +08:00
<u-select v-model="showSelect" :list="selectList" label-name="cellName" value-name="eachUnitNumber"
@confirm="confirmSelect"/>
2021-12-24 09:34:19 +08:00
<u-popup v-model="show" mode="bottom" border-radius="14" height="1000">
2021-12-15 18:07:16 +08:00
<div class="popup">
<div class="bg"></div>
2021-12-23 16:42:14 +08:00
<div class="title">{{ houseInfo.createAddress }}</div>
2021-12-15 18:07:16 +08:00
<div class="row-info">
<div class="row-item left">
2021-12-23 16:42:14 +08:00
<h3>{{ `${houseInfo.houseArea || 0}`.replace(/0㎡/, "未统计") }} </h3>
2021-12-15 18:07:16 +08:00
<p>房屋面积</p>
</div>
<div class="row-item center">
<span class="right-line"></span>
<span class="left-line"></span>
2021-12-23 16:42:14 +08:00
<h3>{{ $dict.getLabel('houseUseStatus', houseInfo.houseUse) || "无" }} </h3>
2021-12-15 18:07:16 +08:00
<p>房屋用途</p>
</div>
<div class="row-item right">
2021-12-23 16:42:14 +08:00
<h3>{{ $dict.getLabel('houselivingStatus', houseInfo.livingStatus) || "未使用" }}</h3>
2021-12-15 18:07:16 +08:00
<p>居住现状</p>
</div>
</div>
2021-12-23 16:42:14 +08:00
<div class="row-info" v-if="!!houseInfo.leaseSituation">
2021-12-15 18:07:16 +08:00
<div class="row-item left">
2021-12-23 16:42:14 +08:00
<h3>{{ $dict.getLabel('houseLeaseSituation', houseInfo.leaseSituation) || "无" }}</h3>
2021-12-15 18:07:16 +08:00
<p>承租情况</p>
</div>
<div class="row-item center">
<span class="right-line"></span>
<span class="left-line"></span>
2022-01-26 16:01:18 +08:00
<h3>{{ $dateFormat(houseInfo.startDate, 'YYYY-MM-DD') }}</h3>
2021-12-15 18:07:16 +08:00
<p>起租日期</p>
</div>
<div class="row-item right">
2021-12-23 16:42:14 +08:00
<h3>{{ houseInfo.isFilingCertificate == 1 ? '有' : '无' }}</h3>
2021-12-15 18:07:16 +08:00
<p>租房备案证明</p>
</div>
</div>
</div>
2021-12-17 18:06:55 +08:00
<div v-if="houseInfo.owner.length || houseInfo.renter.length">
2021-12-17 17:31:12 +08:00
<div class="line-bg"></div>
2021-12-17 18:06:55 +08:00
<div class="popup" v-if="houseInfo.owner.length">
2021-12-17 17:31:12 +08:00
<div class="title pad-t32">房主信息</div>
2021-12-17 18:06:55 +08:00
<div class="info-flex" v-for="(item, index) in houseInfo.owner" :key="index">
2021-12-17 17:31:12 +08:00
<div class="item">
<span class="label">房主</span>
2021-12-23 16:42:14 +08:00
<span class="value">{{ item.name }}</span>
2021-12-17 17:31:12 +08:00
</div>
<div class="item">
2021-12-23 16:42:14 +08:00
<span class="label">联系方式</span>{{ item.phone }}
2021-12-17 17:31:12 +08:00
</div>
2021-12-15 18:07:16 +08:00
</div>
</div>
2021-12-17 18:06:55 +08:00
<div class="popup" v-if="houseInfo.renter.length">
2021-12-17 17:31:12 +08:00
<div class="title pad-t32">承租人信息</div>
2021-12-17 18:06:55 +08:00
<div class="info-flex" v-for="(item, index) in houseInfo.renter" :key="index">
2021-12-17 17:31:12 +08:00
<div class="item">
<span class="label">房主</span>
2021-12-23 16:42:14 +08:00
<span class="value">{{ item.name }}</span>
2021-12-17 17:31:12 +08:00
</div>
<div class="item">
2021-12-23 16:42:14 +08:00
<span class="label">联系方式</span>{{ item.phone }}
2021-12-17 17:31:12 +08:00
</div>
2021-12-15 18:07:16 +08:00
</div>
</div>
</div>
2021-12-17 18:06:55 +08:00
<div v-if="houseInfo.live.length">
2021-12-17 17:31:12 +08:00
<div class="line-bg"></div>
<div class="popup">
<div class="title pad-t32">实际居住人员</div>
2021-12-17 18:06:55 +08:00
<div v-for="(item, index) in houseInfo.live" :key="index">
2021-12-17 17:31:12 +08:00
<div class="info-flex">
<div class="item">
<span class="label">居住人</span>
2021-12-23 16:42:14 +08:00
<span class="value">{{ item.name }}</span>
2021-12-17 17:31:12 +08:00
</div>
<div class="item">
2021-12-23 16:42:14 +08:00
<span class="label">联系方式</span>{{ item.phone }}
2021-12-17 17:31:12 +08:00
</div>
</div>
<div class="info-flex mar-t48">
<div class="item">
2021-12-23 16:42:14 +08:00
<span class="label">与户主关系</span>{{ $dict.getLabel('householdRelation', item.relation) }}
2021-12-17 17:31:12 +08:00
</div>
</div>
2021-12-15 18:07:16 +08:00
</div>
</div>
</div>
2021-12-24 09:34:19 +08:00
<div class="pad-b112"></div>
2021-12-23 16:42:14 +08:00
<div class="pop-btn" @click="toAdd(houseInfo.id)">编辑修改</div>
2021-12-15 18:07:16 +08:00
</u-popup>
</div>
</template>
<script>
2021-12-23 16:42:14 +08:00
import {mapState} from 'vuex'
2021-12-15 18:07:16 +08:00
export default {
2021-12-17 17:31:12 +08:00
props: ['params'],
2021-12-15 18:07:16 +08:00
data() {
return {
2021-12-17 17:31:12 +08:00
show: false,
2021-12-17 18:06:55 +08:00
communityId: '',
2021-12-17 17:31:12 +08:00
list: [],
2021-12-17 18:06:55 +08:00
houseInfo: {
2021-12-17 17:31:12 +08:00
owner: [],
renter: [],
live: []
},
numInfo: {},
showSelect: false,
selectList: [],
selectCellIndex: 0,
2021-12-23 16:42:14 +08:00
houseId: '',
2021-12-30 19:54:57 +08:00
detail: {},
2021-12-31 17:41:25 +08:00
eachUnitNumber: 1
2021-12-23 16:42:14 +08:00
}
},
computed: {
...mapState(['user']),
2021-12-31 16:25:32 +08:00
cellName() {
return this.selectList.find(e => e.eachUnitNumber == this.eachUnitNumber)?.cellName || ""
}
2021-12-15 18:07:16 +08:00
},
2021-12-24 15:27:36 +08:00
onShow() {
2022-02-14 10:26:02 +00:00
document.title = "楼栋模型"
2021-12-31 15:48:31 +08:00
this.$dict.load('householdRelation', 'houselivingStatus', 'houseLeaseSituation', 'houseUseStatus',
'isFilingCertificateStatus', 'communityBuildingType', 'yesOrNo', 'BulidResidentType')
this.getBuilding()
2022-01-26 16:01:18 +08:00
if (this.show && !!this.houseId) {
this.getHouseDetail(this.houseId)
}
2021-12-15 18:07:16 +08:00
},
methods: {
2021-12-23 16:42:14 +08:00
getSelectList(communityId) {
//通过小区ID获取楼栋列表,用来切换楼栋
2021-12-30 19:54:57 +08:00
this.$http.post(`/app/appcommunitybuildinginfo/listByUnitNumber`, null, {
2021-12-23 16:42:14 +08:00
params: {communityId, size: 999}
}).then(res => {
if (res?.data) {
2021-12-30 19:14:21 +08:00
this.selectList = []
2021-12-31 17:41:25 +08:00
let {unitNumber, buildingNumber} = this.detail,
{communityName} = res.data.records?.[0]
for (let i = 1; i <= unitNumber; i++) {
2021-12-30 19:54:57 +08:00
this.selectList.push({
2021-12-31 17:41:25 +08:00
eachUnitNumber: i,
cellName: `${communityName + buildingNumber}${i}单元`
2021-12-30 19:54:57 +08:00
})
2021-12-31 17:41:25 +08:00
}
2021-12-30 19:54:57 +08:00
this.eachUnitNumber = this.selectList[0].eachUnitNumber
this.getStatistics()
this.getList()
2021-12-23 16:42:14 +08:00
}
})
},
getBuilding() {
//获取楼栋信息
let {id} = this.$route.query
this.$http.post(`/app/appcommunitybuildinginfo/queryDetailById`, null, {
params: {id}
}).then(res => {
if (res?.data) {
this.detail = res.data
this.getSelectList(res.data.communityId)
2021-12-17 17:31:12 +08:00
}
})
},
getStatistics() {
2021-12-23 16:42:14 +08:00
//获取楼栋统计信息
2021-12-30 19:54:57 +08:00
let {id} = this.detail
2022-06-27 16:40:27 +08:00
this.$http.post(`/app/appcommunitybuildinginfo/statistics`, null, {
2021-12-30 19:54:57 +08:00
params: {id, unitNum: this.eachUnitNumber}
2021-12-17 17:31:12 +08:00
}).then(res => {
2021-12-23 16:42:14 +08:00
if (res?.data) {
2021-12-17 17:31:12 +08:00
this.numInfo = res.data.unit
}
})
},
getList() {
2021-12-23 16:42:14 +08:00
//获取房间列表
2021-12-30 19:54:57 +08:00
let {id: buildingId} = this.detail
2022-06-27 16:40:27 +08:00
this.$http.post(`/app/appcommunityhouseinfo/list`, null, {
2021-12-30 19:54:57 +08:00
params: {size: 10000, buildingId, unitNumber: this.eachUnitNumber}
2021-12-17 18:06:55 +08:00
}).then(res => {
2021-12-23 16:42:14 +08:00
if (res?.data) {
2021-12-17 18:06:55 +08:00
this.list = res.data.records
}
})
2021-12-17 17:31:12 +08:00
},
getHouseDetail(id) {
this.houseId = id
2022-06-27 16:40:27 +08:00
this.$http.post(`/app/appcommunityhouseinfo/queryDetailById?id=${id}`).then(res => {
2021-12-31 18:04:00 +08:00
if (res?.data) {
2021-12-17 18:06:55 +08:00
this.houseInfo = res.data
2021-12-17 17:31:12 +08:00
this.show = true
}
})
},
confirmSelect(e) {
2021-12-31 16:25:32 +08:00
this.eachUnitNumber = e[0].value
2021-12-17 18:06:55 +08:00
this.getStatistics()
this.getList()
2021-12-17 17:31:12 +08:00
},
2021-12-23 16:42:14 +08:00
toAdd(id) {
uni.navigateTo({url: `./add?id=${id}`})
2021-12-17 17:31:12 +08:00
}
2021-12-15 18:07:16 +08:00
}
}
</script>
<style lang="scss" scoped>
.detail {
2021-12-23 16:42:14 +08:00
.select-flex {
2021-12-15 18:07:16 +08:00
padding: 20px 40px 40px;
box-sizing: border-box;
line-height: 50px;
display: flex;
justify-content: space-between;
background-color: #fff;
2021-12-23 16:42:14 +08:00
.name {
2021-12-15 18:07:16 +08:00
width: 560px;
word-break: break-all;
font-size: 36px;
font-weight: 800;
color: #333;
}
2021-12-23 16:42:14 +08:00
.btn {
2021-12-27 17:10:37 +08:00
white-space: nowrap;
2021-12-15 18:07:16 +08:00
color: #1365DD;
font-size: 30px;
}
}
2021-12-23 16:42:14 +08:00
.num-content {
2021-12-15 18:07:16 +08:00
width: 100%;
background-color: #fff;
box-sizing: border-box;
display: flex;
2021-12-23 16:42:14 +08:00
.num-item {
2021-12-15 18:07:16 +08:00
flex: 1;
2021-12-23 16:42:14 +08:00
min-width: 0;
display: flex;
flex-direction: column;
align-items: center;
justify-content: center;
height: 142px;
padding-top: 20px;
box-sizing: border-box;
.content {
2021-12-15 18:07:16 +08:00
width: 120px;
text-align: center;
}
2021-12-23 16:42:14 +08:00
h2 {
2021-12-15 18:07:16 +08:00
font-size: 36px;
font-weight: bold;
color: #333;
line-height: 42px;
}
2021-12-23 16:42:14 +08:00
p {
2021-12-15 18:07:16 +08:00
font-size: 26px;
color: #666;
line-height: 36px;
}
}
}
2021-12-23 16:42:14 +08:00
.line-bg {
2021-12-15 18:07:16 +08:00
width: 100%;
height: 8px;
background: #F1F6F9;
}
2021-12-23 16:42:14 +08:00
.list-content {
2021-12-15 18:07:16 +08:00
background-color: #fff;
display: flex;
justify-content: space-between;
width: 100%;
padding: 48px 2px 0 32px;
box-sizing: border-box;
2021-12-23 16:42:14 +08:00
.left {
2021-12-17 17:31:12 +08:00
// width: calc(100% - 120px);
width: 100%;
2021-12-15 18:07:16 +08:00
overflow: hidden;
2021-12-23 16:42:14 +08:00
.item-content {
2021-12-17 17:31:12 +08:00
width: 33%;
padding-right: 32px;
box-sizing: border-box;
float: left;
}
2021-12-23 16:42:14 +08:00
.item {
2021-12-17 17:31:12 +08:00
width: 100%;
2021-12-15 18:07:16 +08:00
height: 158px;
background: #FAFBFF;
border-radius: 1px;
border: 1px solid #E7E7E7;
box-sizing: border-box;
text-align: center;
font-weight: bold;
margin: 0 32px 32px 0;
2021-12-23 16:42:14 +08:00
h2 {
2021-12-15 18:07:16 +08:00
font-size: 38px;
color: #5088FF;
line-height: 44px;
margin: 14px 0 26px 0;
}
2021-12-23 16:42:14 +08:00
p {
2021-12-15 18:07:16 +08:00
font-size: 32px;
color: #333;
line-height: 44px;
}
}
2021-12-23 16:42:14 +08:00
2021-12-15 18:07:16 +08:00
.item:nth-of-type(2n) {
margin-right: 0;
}
}
2021-12-23 16:42:14 +08:00
.right {
.item {
2021-12-15 18:07:16 +08:00
width: 120px;
height: 60px;
line-height: 60px;
padding: 0 8px;
background: #FAFBFF;
border-radius: 4px;
border: 1px solid #E7E7E7;
box-sizing: border-box;
font-size: 30px;
font-family: DINAlternate-Bold, DINAlternate;
color: #787878;
letter-spacing: -1px;
margin-bottom: 24px;
}
2021-12-23 16:42:14 +08:00
.active {
2021-12-15 18:07:16 +08:00
background: #5088FF;
border-radius: 2px;
border: 1px solid #E7E7E7;
color: #fff;
}
}
}
2021-12-23 16:42:14 +08:00
.popup {
2021-12-15 18:07:16 +08:00
padding-left: 32px;
2021-12-23 16:42:14 +08:00
.bg {
2021-12-15 18:07:16 +08:00
width: 64px;
height: 10px;
background: #CCC;
border-radius: 6px;
margin: 32px 0 32px 344px;
}
2021-12-23 16:42:14 +08:00
.title {
2021-12-15 18:07:16 +08:00
font-size: 36px;
font-family: PingFang-SC-Heavy, PingFang-SC;
font-weight: 800;
color: #333;
line-height: 50px;
margin-bottom: 40px;
}
2021-12-23 16:42:14 +08:00
.row-info {
2021-12-17 17:31:12 +08:00
padding-bottom: 48px;
2021-12-23 16:42:14 +08:00
.row-item {
2021-12-15 18:07:16 +08:00
display: inline-block;
width: 33%;
2021-12-23 16:42:14 +08:00
h3 {
2021-12-15 18:07:16 +08:00
font-size: 32px;
font-family: PingFangSC-Medium, PingFang SC;
font-weight: 500;
color: #4E75FE;
line-height: 64px;
}
2021-12-23 16:42:14 +08:00
p {
2021-12-15 18:07:16 +08:00
font-size: 28px;
color: #666;
line-height: 42px;
}
}
2021-12-23 16:42:14 +08:00
.left {
2021-12-15 18:07:16 +08:00
width: calc(28% - 70px);
text-align: center;
margin-right: 70px;
box-sizing: border-box;
}
2021-12-23 16:42:14 +08:00
.center {
2021-12-15 18:07:16 +08:00
width: 36%;
text-align: center;
box-sizing: border-box;
position: relative;
2021-12-23 16:42:14 +08:00
.left-line {
2021-12-15 18:07:16 +08:00
position: absolute;
top: 20px;
left: 0;
height: 64px;
border-left: 1px solid #E5E5E5;
}
2021-12-23 16:42:14 +08:00
.right-line {
2021-12-15 18:07:16 +08:00
position: absolute;
top: 20px;
right: 0;
height: 64px;
border-left: 1px solid #E5E5E5;
}
}
2021-12-23 16:42:14 +08:00
.right {
2021-12-15 18:07:16 +08:00
width: calc(33% - 40px);
text-align: center;
margin-left: 40px;
box-sizing: border-box;
}
}
2021-12-23 16:42:14 +08:00
.info-flex {
2021-12-15 18:07:16 +08:00
display: flex;
margin-bottom: 24px;
padding-right: 70px;
box-sizing: border-box;
2021-12-23 16:42:14 +08:00
.item {
2021-12-15 18:07:16 +08:00
flex: 1;
font-size: 28px;
color: #333;
line-height: 30px;
2021-12-23 16:42:14 +08:00
.label {
2021-12-15 18:07:16 +08:00
color: #999;
2021-12-17 17:31:12 +08:00
vertical-align: top;
}
2021-12-23 16:42:14 +08:00
.value {
2021-12-17 17:31:12 +08:00
display: inline-block;
width: calc(100% - 120px);
word-break: break-all;
2021-12-15 18:07:16 +08:00
}
}
}
}
2021-12-23 16:42:14 +08:00
.line-bg {
2021-12-15 18:07:16 +08:00
width: 100%;
height: 30px;
background: #F5F6FA;
}
2021-12-23 16:42:14 +08:00
.pad-t32 {
2021-12-15 18:07:16 +08:00
padding-top: 32px;
}
2021-12-23 16:42:14 +08:00
.mar-t48 {
2021-12-15 18:07:16 +08:00
margin-top: 48px;
}
2021-12-23 16:42:14 +08:00
.pop-btn {
2021-12-15 18:07:16 +08:00
width: 100%;
height: 112px;
line-height: 112px;
text-align: center;
font-size: 32px;
font-weight: 500;
color: #FFF;
background: #1365DD;
2021-12-24 09:34:19 +08:00
position: fixed;
bottom: 0;
left: 0;
}
2021-12-30 19:14:21 +08:00
.pad-b112 {
2021-12-24 09:34:19 +08:00
padding-bottom: 112px;
2021-12-15 18:07:16 +08:00
}
}
2021-12-23 16:42:14 +08:00
::v-deep .content {
padding: 0 !important;
2021-12-15 18:07:16 +08:00
}
2021-12-23 16:42:14 +08:00
</style>