mirror of
https://gitee.com/java110/PropertyApp.git
synced 2026-02-23 21:36:39 +08:00
优化代码
This commit is contained in:
parent
9013154f49
commit
14b8a68b0f
@ -1,15 +1,23 @@
|
|||||||
<template>
|
<template>
|
||||||
<view>
|
<view>
|
||||||
<view class="block__title">基本信息</view>
|
<view class="block__title">基本信息</view>
|
||||||
|
<view class="cu-form-group">
|
||||||
|
<view class="title">人员角色</view>
|
||||||
|
<picker :value="personRoleIndex" :range="personRoles" range-key="name" @change="_changePersonRole">
|
||||||
|
<view class="picker">
|
||||||
|
{{personRoleIndex == -1 ?'请选择':personRoles[personRoleIndex].name}}
|
||||||
|
</view>
|
||||||
|
</picker>
|
||||||
|
</view>
|
||||||
<view class="cu-form-group">
|
<view class="cu-form-group">
|
||||||
<view class="title">姓名</view>
|
<view class="title">姓名</view>
|
||||||
<input v-model="name" placeholder="必填,请输入成员名称"></input>
|
<input v-model="name" placeholder="必填,请输入成员名称"></input>
|
||||||
</view>
|
</view>
|
||||||
<view class="cu-form-group">
|
<view class="cu-form-group" >
|
||||||
<view class="title">身份证</view>
|
<view class="title">身份证</view>
|
||||||
<input v-model="idCard" placeholder="选填,请输入身份证"></input>
|
<input v-model="idCard" placeholder="选填,请输入身份证"></input>
|
||||||
</view>
|
</view>
|
||||||
<view class="cu-form-group">
|
<view class="cu-form-group" >
|
||||||
<view class="title">性别</view>
|
<view class="title">性别</view>
|
||||||
<picker bindchange="PickerChange" :value="index" :range="sexArr" @change="sexChange">
|
<picker bindchange="PickerChange" :value="index" :range="sexArr" @change="sexChange">
|
||||||
<view class="picker">
|
<view class="picker">
|
||||||
@ -17,24 +25,21 @@
|
|||||||
</view>
|
</view>
|
||||||
</picker>
|
</picker>
|
||||||
</view>
|
</view>
|
||||||
<view class="cu-form-group">
|
|
||||||
<view class="title">人员类型</view>
|
|
||||||
<picker :value="typeCdIndex" :range="typeCds" range-key="name" @change="_changeTypeCd">
|
|
||||||
<view class="picker">
|
|
||||||
{{typeCdIndex == -1 ?'请选择':typeCds[typeCdIndex].name}}
|
|
||||||
</view>
|
|
||||||
</picker>
|
|
||||||
</view>
|
|
||||||
<view class="cu-form-group">
|
<view class="cu-form-group">
|
||||||
<view class="title">房屋</view>
|
<view class="title">房屋</view>
|
||||||
<input v-model="roomName" placeholder="必填,请输入房屋楼栋-单元-房屋"></input>
|
<input v-model="roomName" placeholder="必填,请输入房屋楼栋-单元-房屋"></input>
|
||||||
</view>
|
</view>
|
||||||
<view class="cu-form-group">
|
<view class="cu-form-group">
|
||||||
<view class="title">家庭住址</view>
|
<view class="title">地址</view>
|
||||||
<input type="text" v-model="address" placeholder="选填,请输入家庭住址"></input>
|
<input type="text" v-model="address" placeholder="选填,请输入地址"></input>
|
||||||
</view>
|
</view>
|
||||||
|
|
||||||
<view class="block__title">联系信息</view>
|
<view class="block__title">联系信息</view>
|
||||||
|
<view class="cu-form-group" v-if="personType == 'C'">
|
||||||
|
<view class="title">联系人</view>
|
||||||
|
<input v-model="concactPerson" placeholder="必填,请输入联系人"></input>
|
||||||
|
</view>
|
||||||
<view class="cu-form-group">
|
<view class="cu-form-group">
|
||||||
<view class="title">手机号</view>
|
<view class="title">手机号</view>
|
||||||
<input v-model="link" placeholder="必填,请输入手机号(没有手机号随便写一个)"></input>
|
<input v-model="link" placeholder="必填,请输入手机号(没有手机号随便写一个)"></input>
|
||||||
@ -75,29 +80,32 @@
|
|||||||
sex: "0",
|
sex: "0",
|
||||||
link: "",
|
link: "",
|
||||||
remark: "",
|
remark: "",
|
||||||
typeCds: [{
|
personRoles: [{
|
||||||
value: '1001',
|
value: '3',
|
||||||
name: '业主'
|
|
||||||
},
|
|
||||||
{
|
|
||||||
value: '1002',
|
|
||||||
name: '家庭成员'
|
name: '家庭成员'
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
value: '1003',
|
value: '2',
|
||||||
name: '租客'
|
name: '租客'
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
value: '1005',
|
value: '4',
|
||||||
|
name: '公司员工'
|
||||||
|
},
|
||||||
|
{
|
||||||
|
value: '99',
|
||||||
name: '其他'
|
name: '其他'
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
typeCdIndex: -1,
|
personRoleIndex: -1,
|
||||||
ownerTypeCd: "",
|
personRole:'',
|
||||||
|
personType:'P',
|
||||||
|
ownerTypeCd: "2002",
|
||||||
idCard: "",
|
idCard: "",
|
||||||
address: "",
|
address: "",
|
||||||
roomName: "",
|
roomName: "",
|
||||||
communityId:'',
|
communityId:'',
|
||||||
|
concactPerson:'',
|
||||||
photos: [],
|
photos: [],
|
||||||
uploadImage: {
|
uploadImage: {
|
||||||
maxPhotoNum: 1,
|
maxPhotoNum: 1,
|
||||||
@ -129,6 +137,8 @@
|
|||||||
"link": this.link,
|
"link": this.link,
|
||||||
"remark": this.remark,
|
"remark": this.remark,
|
||||||
"ownerTypeCd": this.ownerTypeCd,
|
"ownerTypeCd": this.ownerTypeCd,
|
||||||
|
"personRole":this.personRole,
|
||||||
|
"personType":this.personType,
|
||||||
"roomName": this.roomName,
|
"roomName": this.roomName,
|
||||||
"communityId": this.getCommunityId(),
|
"communityId": this.getCommunityId(),
|
||||||
"idCard": this.idCard,
|
"idCard": this.idCard,
|
||||||
@ -138,9 +148,7 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
let msg = "";
|
let msg = "";
|
||||||
if (obj.ownerId == "") {
|
if (obj.name == "") {
|
||||||
msg = "请填写业主";
|
|
||||||
} else if (obj.name == "") {
|
|
||||||
msg = "请填写姓名";
|
msg = "请填写姓名";
|
||||||
} else if (obj.link == "") {
|
} else if (obj.link == "") {
|
||||||
msg = "请填写手机号";
|
msg = "请填写手机号";
|
||||||
@ -166,9 +174,13 @@
|
|||||||
uni.navigateBack()
|
uni.navigateBack()
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
_changeTypeCd: function(e) {
|
_changePersonRole: function(e) {
|
||||||
this.typeCdIndex = e.detail.value;
|
this.personRoleIndex = e.detail.value;
|
||||||
this.ownerTypeCd = this.typeCds[this.typeCdIndex].value;
|
this.personRole = this.personRoles[this.personRoleIndex].value;
|
||||||
|
},
|
||||||
|
_changePersonType: function(e) {
|
||||||
|
this.personTypeIndex = e.detail.value;
|
||||||
|
this.personType = this.personTypes[this.personTypeIndex].value;
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user