|
@@ -8,10 +8,17 @@
|
|
|
<view class="chmain">
|
|
|
<uni-forms ref="form" :model="datainfo" :rules="rules">
|
|
|
<view class="upbox" @click="getaddImage">
|
|
|
- <image :src="baseUrl+datainfo.front" class="img" v-if="datainfo.front"></image>
|
|
|
+
|
|
|
<image :src="cmico" class="addimg"></image>
|
|
|
<view>扫描房产证自动填写</view>
|
|
|
</view>
|
|
|
+ <uni-forms-item label="房产证" required name="location" v-if="datainfo.houseImage">
|
|
|
+ <view class="flexc">
|
|
|
+ <view class="flex1"></view>
|
|
|
+ <image :src="baseUrl+datainfo.houseImage" class="fczimg" v-if="datainfo.houseImage" @click="getPreview(datainfo.houseImage)"></image>
|
|
|
+ <view class="rimg"></view>
|
|
|
+ </view>
|
|
|
+ </uni-forms-item>
|
|
|
<uni-forms-item label="房屋坐落" required name="location">
|
|
|
<view class="flexc">
|
|
|
<uni-easyinput :disabled="isdisabled" v-model="datainfo.location" :inputBorder='false' placeholder="自动识别" />
|
|
@@ -58,9 +65,22 @@
|
|
|
<view class="rimg"></view>
|
|
|
</view>
|
|
|
</uni-forms-item>
|
|
|
- <uni-forms-item label="门牌号" required name="detailedAddress">
|
|
|
+ <uni-forms-item label="楼栋" required name="loudong">
|
|
|
+ <view class="flexcc">
|
|
|
+ <view class="flexc ml10">
|
|
|
+ <uni-easyinput :disabled="isdisabled" v-model="datainfo.loudong" :inputBorder='false' placeholder="请输入" />
|
|
|
+ <view class="tips">栋</view>
|
|
|
+ </view>
|
|
|
+ <view class="flexc ml10">
|
|
|
+ <uni-easyinput :disabled="isdisabled" v-model="datainfo.danyuan" :inputBorder='false' placeholder="请输入" />
|
|
|
+ <view class="tips">单元</view>
|
|
|
+ </view>
|
|
|
+ <view class="rimg"></view>
|
|
|
+ </view>
|
|
|
+ </uni-forms-item>
|
|
|
+ <uni-forms-item label="详细门牌号" required name="xxaddress">
|
|
|
<view class="flexc">
|
|
|
- <uni-easyinput :disabled="isdisabled" v-model="datainfo.detailedAddress" :inputBorder='false' placeholder="请输入门牌号" />
|
|
|
+ <uni-easyinput :disabled="isdisabled" v-model="datainfo.xxaddress" :inputBorder='false' placeholder="请输入详细门牌号" />
|
|
|
<view class="rimg"></view>
|
|
|
</view>
|
|
|
</uni-forms-item>
|
|
@@ -215,13 +235,14 @@
|
|
|
"coOwner":"",//共有人姓名,多个共有人可以用逗号分隔
|
|
|
"detailedAddress":"",//房屋的详细门牌号
|
|
|
"hasParkingSpace":"",//是否有车位,Y表示有,N表示无
|
|
|
- "communityName":"",//房屋所在小区名称
|
|
|
+ "communityName":this.$store.state.user.companyName,//房屋所在小区名称
|
|
|
"houseStatus":"",//房屋状态:1-自住,2-出租,3-空闲,4-待售
|
|
|
"parkingNumber":'',//车位号
|
|
|
+ 'houseImage':'',//房本照片
|
|
|
},
|
|
|
rules: {
|
|
|
location: {rules: [{required: true,errorMessage: '请输入房屋坐落位置' }]},
|
|
|
- detailedAddress: {rules: [{required: true,errorMessage: '请输入详细门牌号' }]},
|
|
|
+ // detailedAddress: {rules: [{required: true,errorMessage: '请输入详细门牌号' }]},
|
|
|
area: {rules: [{required: true,errorMessage: '请输入面积' }]},
|
|
|
},
|
|
|
id:'',
|
|
@@ -358,13 +379,31 @@
|
|
|
houseInfoDet(this.id).then(res=>{
|
|
|
if(res.code==200){
|
|
|
this.datainfo=res.data;
|
|
|
-
|
|
|
+ if(res.data&&res.data.detailedAddress){
|
|
|
+ this.datainfo.xxaddress=res.data.detailedAddress
|
|
|
+ var address=res.data.detailedAddress;
|
|
|
+ var indxa=address.indexOf('栋')
|
|
|
+ var indxb=address.indexOf('单元')
|
|
|
+ var a = address.split(/[栋单元]/).filter(Boolean);
|
|
|
+ this.datainfo.loudong=a[0];
|
|
|
+ this.datainfo.danyuan=a[1];
|
|
|
+ this.datainfo.xxaddress=a[2];
|
|
|
+ }
|
|
|
}
|
|
|
})
|
|
|
},
|
|
|
getSubmit(){
|
|
|
this.$refs.form.validate().then(res => {
|
|
|
var params=JSON.parse(JSON.stringify(this.datainfo))
|
|
|
+ if(!params.loudong||!params.danyuan){
|
|
|
+ this.$toast("请输入楼栋")
|
|
|
+ return
|
|
|
+ }
|
|
|
+ if(!params.xxaddress){
|
|
|
+ this.$toast("请输入详细门牌号")
|
|
|
+ return
|
|
|
+ }
|
|
|
+ params.detailedAddress=`${params.loudong?params.loudong+'栋':''}` + `${params.danyuan?params.danyuan+'单元':''}` + params.xxaddress;
|
|
|
if(this.ptype=='add'){
|
|
|
houseInfoAdd(params).then(res=>{
|
|
|
if(res.code==200){
|
|
@@ -392,6 +431,17 @@
|
|
|
}
|
|
|
})
|
|
|
},
|
|
|
+ getPreview(img) {
|
|
|
+ var newArr=[];
|
|
|
+ var url=this.baseUrl+img
|
|
|
+ newArr.push(url)
|
|
|
+ uni.previewImage({
|
|
|
+ urls: newArr,
|
|
|
+ current:0,
|
|
|
+ success: function(data) {},
|
|
|
+ fail: function(err) {}
|
|
|
+ });
|
|
|
+ },
|
|
|
getaddImage(e){
|
|
|
let that = this;
|
|
|
let file =[],count=9
|
|
@@ -410,6 +460,7 @@
|
|
|
var fuwufile = [];
|
|
|
uploadIdentify('/common/upload',img,0,0,0,imglen,fuwufile,function(rs){
|
|
|
var resurl=rs[0];
|
|
|
+ that.datainfo.houseImage=resurl.fileName
|
|
|
if(rs&&rs.length>0){
|
|
|
var obj={
|
|
|
type:e,
|
|
@@ -481,4 +532,5 @@
|
|
|
}
|
|
|
}
|
|
|
.tips{font-weight: bold;color: #272727;font-size: 26rpx;margin-left: 8rpx;}
|
|
|
+.fczimg{width: 100rpx;height: 100rpx;}
|
|
|
</style>
|