Files
dvcp_v2_wxcp_app/src/apps/AppBuilding/add.vue

291 lines
8.8 KiB
Vue
Raw Normal View History

2021-12-15 18:07:16 +08:00
<template>
<div class="add">
<div class="title">
2021-12-24 12:05:40 +08:00
<span class="tips"/>房屋信息
2021-12-15 18:07:16 +08:00
</div>
2021-12-15 18:26:33 +08:00
<div class="pad-l32">
<div class="item">
<span class="label">房屋面积</span>
<div class="value">
2021-12-23 16:42:14 +08:00
<u-input type="digit" placeholder="请输入" v-model="houseInfo.houseArea" input-align="right"
placeholder-style="color:#999;font-size:16px;" height="48" :maxlength="7"/>
2021-12-15 18:26:33 +08:00
</div>
</div>
<div class="item">
<span class="label">居住现状</span>
2021-12-17 18:06:55 +08:00
<div class="value" @click="selectClick('houselivingStatus', 'livingStatus')">
2021-12-23 16:42:14 +08:00
<span
:class="houseInfo.livingStatus === '' ? 'color-999' : ''">{{
$dict.getLabel('houselivingStatus', houseInfo.livingStatus) || '请选择'
}}</span>
2021-12-24 12:05:40 +08:00
<u-icon name="arrow-right" color="#cccccc" size="14"/>
2021-12-15 18:26:33 +08:00
</div>
</div>
<div class="item">
<span class="label">房屋用途</span>
2021-12-17 18:08:02 +08:00
<div class="value" @click="selectClick('houseUseStatus', 'houseUse')">
2021-12-23 16:42:14 +08:00
<span
:class="houseInfo.houseUse === '' ? 'color-999' : ''">{{
$dict.getLabel('houseUseStatus', houseInfo.houseUse) || '请选择'
}}</span>
2021-12-24 12:05:40 +08:00
<u-icon name="arrow-right" color="#cccccc" size="14"/>
2021-12-15 18:26:33 +08:00
</div>
</div>
2021-12-18 11:19:54 +08:00
<div class="item" v-if="houseInfo.livingStatus == 1">
2021-12-15 18:26:33 +08:00
<span class="label">承租情况</span>
2021-12-18 11:19:54 +08:00
<div class="value" @click="selectClick('houseLeaseSituation', 'leaseSituation')">
2021-12-23 16:42:14 +08:00
<span
:class="houseInfo.leaseSituation === '' ? 'color-999' : ''">{{
$dict.getLabel('houseLeaseSituation', houseInfo.leaseSituation) || '请选择'
}}</span>
2021-12-24 12:05:40 +08:00
<u-icon name="arrow-right" color="#cccccc" size="14"/>
2021-12-15 18:26:33 +08:00
</div>
</div>
2021-12-18 11:19:54 +08:00
<div class="item" v-if="houseInfo.livingStatus == 1">
2021-12-15 18:26:33 +08:00
<span class="label">起租日期</span>
2021-12-18 11:19:54 +08:00
<div class="value" @click="dateShow=true">
2021-12-23 16:42:14 +08:00
<span :class="houseInfo.startDate === '' ? 'color-999' : ''">{{ houseInfo.startDate || '请选择' }}</span>
2021-12-24 12:05:40 +08:00
<u-icon name="arrow-right" color="#cccccc" size="14"/>
2021-12-15 18:26:33 +08:00
</div>
</div>
2021-12-18 11:19:54 +08:00
<div class="item" v-if="houseInfo.livingStatus == 1">
2021-12-15 18:26:33 +08:00
<span class="label">租房备案证明</span>
2021-12-17 18:08:02 +08:00
<div class="value" @click="selectClick('isFilingCertificateStatus', 'isFilingCertificate')">
2021-12-23 16:42:14 +08:00
<span
:class="houseInfo.isFilingCertificate === '' ? 'color-999' : ''">{{
$dict.getLabel('isFilingCertificateStatus', houseInfo.isFilingCertificate) || '请选择'
}}</span>
2021-12-24 12:05:40 +08:00
<u-icon name="arrow-right" color="#cccccc" size="14"/>
2021-12-15 18:26:33 +08:00
</div>
</div>
</div>
2021-12-24 12:05:40 +08:00
<div class="line-bg"/>
2021-12-15 18:26:33 +08:00
<div class="title">
2021-12-24 12:05:40 +08:00
<span class="tips"/>房主信息
<AiPagePicker class="select" :selected.sync="houseInfo.owner">选择人员</AiPagePicker>
2021-12-15 18:26:33 +08:00
</div>
<div class="pad-l32">
2021-12-18 11:19:54 +08:00
<div class="item" v-for="(item, index) in houseInfo.owner" :key="index">
2021-12-23 16:42:14 +08:00
<span class="label">{{ item.name }}</span>
2021-12-18 11:19:54 +08:00
<div class="value" @click="tableRelationSelect('owner', index)">
2021-12-23 16:42:14 +08:00
<span
:class=" item.relation === '' ? 'color-999' : ''">{{
$dict.getLabel('householdRelation', item.relation) || '与户主关系'
}}</span>
2021-12-24 12:05:40 +08:00
<u-icon name="arrow-right" color="#cccccc" size="14"/>
2021-12-15 18:26:33 +08:00
</div>
</div>
</div>
2021-12-24 12:05:40 +08:00
<div class="line-bg"/>
2021-12-15 18:26:33 +08:00
<div class="title">
2021-12-24 12:05:40 +08:00
<span class="tips"/>承租人信息
2021-12-24 14:01:56 +08:00
<AiPagePicker class="select" :selected.sync="houseInfo.renter">选择人员</AiPagePicker>
2021-12-15 18:26:33 +08:00
</div>
<div class="pad-l32">
2021-12-18 11:19:54 +08:00
<div class="item" v-for="(item, index) in houseInfo.renter" :key="index">
2021-12-23 16:42:14 +08:00
<span class="label">{{ item.name }}</span>
2021-12-18 11:19:54 +08:00
<div class="value" @click="tableRelationSelect('renter', index)">
2021-12-23 16:42:14 +08:00
<span
:class=" item.relation === '' ? 'color-999' : ''">{{
$dict.getLabel('householdRelation', item.relation) || '与户主关系'
}}</span>
2021-12-24 12:05:40 +08:00
<u-icon name="arrow-right" color="#cccccc" size="14"/>
2021-12-15 18:26:33 +08:00
</div>
</div>
</div>
2021-12-24 12:05:40 +08:00
<div class="line-bg"/>
2021-12-15 18:26:33 +08:00
<div class="title">
2021-12-24 12:05:40 +08:00
<span class="tips"/>实际居住人员
2021-12-24 14:01:56 +08:00
<AiPagePicker class="select" :selected.sync="houseInfo.live">选择人员</AiPagePicker>
2021-12-15 18:26:33 +08:00
</div>
<div class="pad-l32">
2021-12-18 11:19:54 +08:00
<div class="item" v-for="(item, index) in houseInfo.live" :key="index">
2021-12-23 16:42:14 +08:00
<span class="label">{{ item.name }}</span>
2021-12-18 11:19:54 +08:00
<div class="value" @click="tableRelationSelect('live', index)">
2021-12-23 16:42:14 +08:00
<span
:class=" item.relation === '' ? 'color-999' : ''">{{
$dict.getLabel('householdRelation', item.relation) || '与户主关系'
}}</span>
2021-12-24 12:05:40 +08:00
<u-icon name="arrow-right" color="#cccccc" size="14"/>
2021-12-15 18:26:33 +08:00
</div>
</div>
</div>
2021-12-18 11:19:54 +08:00
<div class="footer" @click="submit">
2021-12-15 18:26:33 +08:00
<div class="btn">保存</div>
</div>
2021-12-17 18:06:55 +08:00
2021-12-23 16:42:14 +08:00
<u-picker mode="time" v-model="dateShow" :params="deteParams" start-year="2010" @confirm="dateConfirm">请选择
</u-picker>
<u-select v-model="showSelect" :list="selectList" label-name="dictName" value-name="dictValue"
2021-12-24 12:05:40 +08:00
@confirm="confirmSelect"/>
2021-12-23 16:42:14 +08:00
<u-select v-model="showRelation" :list="$dict.getDict('householdRelation')" label-name="dictName"
2021-12-24 12:05:40 +08:00
value-name="dictValue" @confirm="confirmRelation"/>
2021-12-15 18:07:16 +08:00
</div>
</template>
<script>
2021-12-23 16:42:14 +08:00
import {mapActions, mapState} from 'vuex'
2021-12-15 18:07:16 +08:00
export default {
data() {
return {
2021-12-17 18:06:55 +08:00
houseInfo: {},
showSelect: false,
selectList: [],
2021-12-18 11:19:54 +08:00
formName: '',
dateShow: false,
2021-12-23 16:42:14 +08:00
deteParams: {year: true, month: true, day: true, hour: false, minute: false, second: false},
2021-12-18 11:19:54 +08:00
showRelation: false,
tableName: '',
tableIndex: '',
2021-12-23 16:42:14 +08:00
lockSelector: false
2021-12-15 18:07:16 +08:00
}
},
2021-12-23 16:42:14 +08:00
computed: {...mapState(['user'])},
created() {
this.$dict.load('householdRelation', 'houselivingStatus', 'houseLeaseSituation', 'houseUseStatus',
'isFilingCertificateStatus', 'communityBuildingType', 'yesOrNo', 'BulidResidentType').then(() => {
2021-12-17 18:06:55 +08:00
this.getDetail()
})
2021-12-24 15:27:36 +08:00
},
onShow() {
document.title = '房屋信息'
2021-12-15 18:07:16 +08:00
},
methods: {
2021-12-18 11:19:54 +08:00
...mapActions(['selectEnterpriseContact']),
tableRelationSelect(name, index) {
this.tableName = name
this.tableIndex = index
this.showRelation = true
},
confirmRelation(e) {
this.houseInfo[this.tableName][this.tableIndex].relation = e[0].value
},
2021-12-17 18:06:55 +08:00
getDetail() {
2021-12-23 16:42:14 +08:00
let {id} = this.$route.query
id && this.$http.post(`app/appcommunityhouseinfo/queryDetailById?id=${id}`).then(res => {
if (res?.data) {
if (res.data.startDate) {
2021-12-17 18:06:55 +08:00
res.data.startDate = res.data.startDate.substring(0, 10)
}
this.houseInfo = res.data
}
})
},
2021-12-18 11:19:54 +08:00
submit() {
this.$http.post(`app/appcommunityhouseinfo/update`, this.houseInfo).then(res => {
if (res.code == 0) {
this.$u.toast('提交成功')
setTimeout(() => {
2021-12-23 16:42:14 +08:00
uni.navigateBack({})
2021-12-18 11:19:54 +08:00
}, 600)
}
})
},
2021-12-17 18:06:55 +08:00
selectClick(dictName, formName) {
this.selectList = this.$dict.getDict(dictName)
this.formName = formName
this.showSelect = true
},
confirmSelect(e) {
this.houseInfo[this.formName] = e[0].value
2021-12-18 11:19:54 +08:00
},
dateConfirm(e) {
this.houseInfo.startDate = `${e.year}-${e.month}-${e.day}`
2021-12-17 18:06:55 +08:00
}
2021-12-15 18:07:16 +08:00
}
}
</script>
<style lang="scss" scoped>
.add {
2021-12-15 18:26:33 +08:00
padding-bottom: 112px;
2021-12-23 16:42:14 +08:00
.title {
2021-12-15 18:07:16 +08:00
width: 100%;
height: 96px;
line-height: 96px;
background: #FFF;
font-size: 32px;
font-weight: 500;
color: #262B36;
padding-right: 32px;
box-sizing: border-box;
overflow: hidden;
2021-12-23 16:42:14 +08:00
.tips {
2021-12-15 18:07:16 +08:00
display: inline-block;
width: 8px;
height: 32px;
background: #4E75FE;
2021-12-23 16:42:14 +08:00
box-shadow: 0 8px 24px 2px #C9D8FA;
2021-12-15 18:07:16 +08:00
border-radius: 4px;
vertical-align: middle;
margin-right: 22px;
}
2021-12-23 16:42:14 +08:00
.select {
2021-12-15 18:07:16 +08:00
float: right;
font-size: 30px;
color: #1365DD;
}
}
2021-12-23 16:42:14 +08:00
.item {
2021-12-15 18:26:33 +08:00
width: 100%;
padding: 34px 32px 34px 0;
background: #FFFFFF;
border-bottom: 1px solid #D8DDE6;
display: flex;
justify-content: space-between;
font-size: 32px;
font-family: PingFangSC-Regular, PingFang SC;
color: #333;
line-height: 44px;
box-sizing: border-box;
2021-12-23 16:42:14 +08:00
.color-999 {
2021-12-15 18:26:33 +08:00
color: #999;
}
2021-12-23 16:42:14 +08:00
.value {
.u-icon {
2021-12-15 18:26:33 +08:00
margin-left: 16px;
}
}
}
2021-12-23 16:42:14 +08:00
.footer {
2021-12-15 18:26:33 +08:00
width: 100%;
position: fixed;
bottom: 0;
left: 0;
}
2021-12-23 16:42:14 +08:00
.btn {
2021-12-15 18:26:33 +08:00
width: 100%;
height: 112px;
line-height: 112px;
text-align: center;
background: #1365DD;
font-size: 32px;
font-family: PingFangSC-Medium, PingFang SC;
font-weight: 500;
color: #FFF;
}
2021-12-23 16:42:14 +08:00
.line-bg {
2021-12-15 18:26:33 +08:00
width: 100%;
height: 16px;
background: #F5F5F5;
}
2021-12-23 16:42:14 +08:00
.pad-l32 {
2021-12-15 18:26:33 +08:00
padding-left: 32px;
background-color: #fff;
}
2021-12-15 18:07:16 +08:00
}
2021-12-23 16:42:14 +08:00
</style>