新增居民

This commit is contained in:
liuye
2022-06-16 14:06:42 +08:00
parent 7caa3114e2
commit cfbe6a7a29

View File

@@ -1,7 +1,7 @@
<template>
<div class="add">
<div class="item">
<span class="tips">*</span>
<span class="tips"></span>
<div class="border">
<span class="label">居民类型</span>
<span class="value" @click="clickSelect('residentType', 'residentType')">
@@ -61,7 +61,7 @@
</div>
</div>
<div class="item">
<span class="tips">*</span>
<span class="tips"></span>
<div class="border">
<span class="label">性别</span>
<span class="value" @click="clickSelect('sex', 'sex')">
@@ -72,7 +72,7 @@
</div>
</div>
<div class="item">
<span class="tips">*</span>
<span class="tips"></span>
<div class="border">
<span class="label">出生日期</span>
<span class="value" @click="dateShow=true">
@@ -81,6 +81,15 @@
</span>
</div>
</div>
<div class="item">
<span class="tips"></span>
<div class="border">
<span class="label">年龄</span>
<span class="value">
<input type="number" placeholder="请输入" v-model="form.age" maxlength="4">
</span>
</div>
</div>
<div class="item">
<span class="tips"></span>
<div class="border">
@@ -91,7 +100,7 @@
</div>
</div>
<div class="item">
<span class="tips">*</span>
<span class="tips"></span>
<div class="border">
<span class="label">现住址</span>
<span class="value">
@@ -106,7 +115,7 @@
</div>
</div>
<div class="item">
<span class="tips">*</span>
<span class="tips"></span>
<div class="border">
<span class="label"></span>
<span class="value">
@@ -115,7 +124,7 @@
</div>
</div>
<div class="item">
<span class="tips">*</span>
<span class="tips"></span>
<div class="border">
<span class="label"></span>
<span class="value">
@@ -132,7 +141,7 @@
<div class="text-area">
<textarea placeholder="请输入" maxlength="30" v-model="form.currentAddress"></textarea>
</div> -->
<div class="item">
<!-- <div class="item">
<span class="tips"></span>
<div class="border">
<span class="label">户籍地址</span>
@@ -155,7 +164,7 @@
</div>
<div class="text-area">
<textarea placeholder="请输入" maxlength="30" v-model="form.householdAddress"></textarea>
</div>
</div> -->
<div class="pad-b152"></div>
<div class="add-btn" @click="submit">
<div>保存</div>
@@ -216,7 +225,8 @@ export default {
methods: {
submit() {
if(this.form.residentType === '') {
return this.$u.toast('请选择居民类型')
// return this.$u.toast('请选择居民类型')
this.form.residentType ='0'
}
// if(this.form.householdName === '') {
// return this.$u.toast('请选择是否户主')
@@ -233,28 +243,28 @@ export default {
if(!this.form.idNumber) {
return this.$u.toast('请输入身份证号')
}
if(!this.form.sex) {
return this.$u.toast('请选择性别')
}
if(!this.form.birthDate) {
return this.$u.toast('请选择出生日期')
}
if(!this.form.currentAreaId) {
return this.$u.toast('请选择现住址')
}
if(!/[^0]0{0,2}$/.test(this.form.currentAreaId)) {
return this.$u.toast('现住址必须选到村级')
}
if(!this.form.currentAddressGroup) {
return this.$u.toast('请输入组')
}
if(!this.form.currentAddressNo) {
return this.$u.toast('请输入户')
}
if(this.form.householdAreaId && !/[^0]0{0,2}$/.test(this.form.householdAreaId)) {
return this.$u.toast('户籍地必须选到村级')
}
this.form.age = this.$calcAge(this.form.idNumber)
// if(!this.form.sex) {
// return this.$u.toast('请选择性别')
// }
// if(!this.form.birthDate) {
// return this.$u.toast('请选择出生日期')
// }
// if(!this.form.currentAreaId) {
// return this.$u.toast('请选择现住址')
// }
// if(!/[^0]0{0,2}$/.test(this.form.currentAreaId)) {
// return this.$u.toast('现住址必须选到村级')
// }
// if(!this.form.currentAddressGroup) {
// return this.$u.toast('请输入组')
// }
// if(!this.form.currentAddressNo) {
// return this.$u.toast('请输入户')
// }
// if(this.form.householdAreaId && !/[^0]0{0,2}$/.test(this.form.householdAreaId)) {
// return this.$u.toast('户籍地必须选到村级')
// }
// this.form.age = this.$calcAge(this.form.idNumber)
this.$http.post('/app/appresident/addOrUpdate', this.form).then(res => {
if (res.code === 0) {
this.$u.toast('新增成功')