证件类型修改

This commit is contained in:
zhouna
2019-10-10 18:07:42 +08:00
parent e21396fc64
commit e844c157a9
10 changed files with 350 additions and 437 deletions

View File

@@ -37,20 +37,10 @@
ref="certiexpiredate"
@confirm="onDateConfirm($event, '1')"
></FieldDatePicter>
<div class="border-bt relative fs14 p10 flex align-center" >
<van-checkbox
v-model="userInfo.effectiveDateType"
class="fr"
:disabled="effectiveDateTypeAble"
@change="isEnd"
>长期</van-checkbox>
<div class="border-bt relative fs14 p10 flex align-center">
<van-checkbox v-model="userInfo.effectiveDateType" class="fr" :disabled="effectiveDateTypeAble" @change="isEnd">长期</van-checkbox>
</div>
<select-radio
:radios="sexRadio"
label="性别"
:value.sync="userInfo.customerSex"
:required="false"
></select-radio>
<select-radio :radios="sexRadio" label="性别" :value.sync="userInfo.customerSex" :required="false"></select-radio>
<van-field
:value="userInfo.nativeplace | idToText('nativeplace')"
readonly
@@ -60,15 +50,7 @@
placeholder="请选择"
@click="toSelect('1')"
/>
<van-field
:value="census"
readonly
label="户籍"
name="户籍"
right-icon="arrow"
placeholder="请选择"
@click="censusShow = true"
/>
<van-field :value="census" readonly label="户籍" name="户籍" right-icon="arrow" placeholder="请选择" @click="censusShow = true" />
<FieldDatePicter
label="出生日期"
:value.sync="userInfo.birthday"
@@ -77,32 +59,9 @@
@confirm="onDateConfirm($event, '2')"
ref="birthday"
></FieldDatePicter>
<van-field
v-model="userInfo.email"
label="电子邮箱"
name="电子邮箱"
v-validate="'email'"
placeholder="请输入"
clearable
maxlength="50"
/>
<van-field
v-model="userInfo.stature"
label="身高cm"
name="身高"
placeholder="请输入"
clearable
v-validate="'onlyNumber|stature'"
maxlength="5"
/>
<van-field
v-model="userInfo.weight"
label=" 体重kg"
name="体重"
placeholder="请输入"
clearable
v-validate="'onlyNumber|avoirdupois'"
/>
<van-field v-model="userInfo.email" label="电子邮箱" name="电子邮箱" v-validate="'email'" placeholder="请输入" clearable maxlength="50" />
<van-field v-model="userInfo.stature" label="身高cm" name="身高" placeholder="请输入" clearable v-validate="'onlyNumber|stature'" maxlength="5" />
<van-field v-model="userInfo.weight" label=" 体重kg" name="体重" placeholder="请输入" clearable v-validate="'onlyNumber|avoirdupois'" />
<van-field
:value="userInfo.customerType | idToText('customerType')"
readonly
@@ -135,12 +94,7 @@
placeholder="请选择"
@click="toSelect('3')"
/>
<select-radio
:radios="medicalRadio"
label="有无社保"
:value.sync="userInfo.socialSecurity"
:required="false"
></select-radio>
<select-radio :radios="medicalRadio" label="有无社保" :value.sync="userInfo.socialSecurity" :required="false"></select-radio>
<van-field
:value="userInfo.taxIdentity | idToText('taxIdentity')"
readonly
@@ -183,13 +137,7 @@
clearable
maxlength="5"
/>
<van-field
v-model="userInfo.workUnits"
label="工作单位"
placeholder="请输入工作单位"
clearable
maxlength="50"
/>
<van-field v-model="userInfo.workUnits" label="工作单位" placeholder="请输入工作单位" clearable maxlength="50" />
<van-field
:value="userInfo.workCondition | idToText('workCondition')"
readonly
@@ -199,39 +147,10 @@
placeholder="请选择"
@click="toSelect('9')"
/>
<van-field
v-model="areaName"
readonly
label="单位地址"
name="单位地址"
right-icon="arrow"
placeholder="请选择"
@click="areaShow = true"
/>
<van-field
v-model="userInfo.companyAddress"
label
name="详细地址"
placeholder="请输入详细地址"
maxlength="30"
/>
<van-field
v-model="userInfo.companyZip"
type="number"
label="邮编"
placeholder="请输入"
clearable
maxlength="6"
v-validate="'zipCode'"
/>
<van-field
v-model="userInfo.companyPhone"
label="单位电话"
name="单位电话"
placeholder="请输入"
clearable
maxlength="13"
/>
<van-field v-model="areaName" readonly label="单位地址" name="单位地址" right-icon="arrow" placeholder="请选择" @click="areaShow = true" />
<van-field v-model="userInfo.companyAddress" label name="详细地址" placeholder="请输入详细地址" maxlength="30" />
<van-field v-model="userInfo.companyZip" type="number" label="邮编" placeholder="请输入" clearable maxlength="6" v-validate="'zipCode'" />
<van-field v-model="userInfo.companyPhone" label="单位电话" name="单位电话" placeholder="请输入" clearable maxlength="13" />
</van-cell-group>
<!-- 家庭信息 -->
@@ -255,33 +174,10 @@
placeholder="请输入"
clearable
/>
<van-field
v-model="homeName"
readonly
label="家庭地址"
name="家庭地址"
right-icon="arrow"
placeholder="请选择"
@click="homeShow = true"
/>
<van-field v-model="homeName" readonly label="家庭地址" name="家庭地址" right-icon="arrow" placeholder="请选择" @click="homeShow = true" />
<van-field v-model="userInfo.homeAddress" label name="详细地址" placeholder="请输入详细地址" />
<van-field
v-model="userInfo.homeZip"
type="number"
label="邮编"
placeholder="请输入"
clearable
maxlength="6"
v-validate="'zipCode'"
/>
<van-field
v-model="userInfo.homePhone"
label="家庭电话"
name="家庭电话"
placeholder="请输入"
clearable
maxlength="13"
/>
<van-field v-model="userInfo.homeZip" type="number" label="邮编" placeholder="请输入" clearable maxlength="6" v-validate="'zipCode'" />
<van-field v-model="userInfo.homePhone" label="家庭电话" name="家庭电话" placeholder="请输入" clearable maxlength="13" />
</van-cell-group>
<!-- 字段选择 -->
@@ -290,31 +186,15 @@
</van-popup>
<!-- 地区选择 -->
<van-popup v-model="areaShow" position="bottom">
<van-area
:area-list="areaList"
value="110101"
@confirm="sureArea($event, '1')"
@cancel="areaShow = false"
/>
<van-area :area-list="areaList" value="110101" @confirm="sureArea($event, '1')" @cancel="areaShow = false" />
</van-popup>
<!-- 家庭地址选择 -->
<van-popup v-model="homeShow" position="bottom">
<van-area
:area-list="areaList"
value="110101"
@confirm="sureArea($event, '2')"
@cancel="homeShow = false"
/>
<van-area :area-list="areaList" value="110101" @confirm="sureArea($event, '2')" @cancel="homeShow = false" />
</van-popup>
<!-- 户籍选择 -->
<van-popup v-model="censusShow" position="bottom">
<van-area
:area-list="areaList"
value="110101"
:columns-num="2"
@confirm="sureArea($event, '3')"
@cancel="areaShow = false"
/>
<van-area :area-list="areaList" value="110101" :columns-num="2" @confirm="sureArea($event, '3')" @cancel="areaShow = false" />
</van-popup>
</div>
</template>
@@ -508,41 +388,47 @@ export default {
}
//证件是户口本
} else if (this.userInfo.idType == '2') {
if (age >= 16) {
return this.$toast('客户年龄在16周岁以上,不能使用户口本作为有效证件')
} else if (this.userInfo.customerIdNumber.length != 18) {
return this.$toast('户口本的证件号码长度应等于18位')
} else {
if (age > 16) {
return this.$toast('客户年龄在16周岁以上不能使用户口本作为有效证件')
}
// else if (this.userInfo.customerIdNumber.length != 18) {
// return this.$toast('户口本的证件号码长度应等于18位')
// }
else {
this.checkMarr()
}
//证件是出生证明
} else if (this.userInfo.idType == '3') {
if (age >= 3) {
return this.$toast('客户年龄在3周岁及以上,不能使用出生证作为有效证件')
} else if (this.userInfo.customerIdNumber.length < 3) {
return this.$toast('出生证须大于等于3个字符')
} else {
if (age >= 2) {
return this.$toast('客户年龄在2周岁及以上,不能使用出生证作为有效证件')
}
// else if (this.userInfo.customerIdNumber.length < 3) {
// return this.$toast('出生证须大于等于3个字符')
// }
else {
this.checkMarr()
}
//证件是护照
} else if (this.userInfo.idType == '4' && this.userInfo.customerIdNumber.length < 3) {
console.log('证件类型是护照')
return this.$toast('护照须大于等于3个字符')
//证件是港澳居民通行证
} else if (this.userInfo.idType == '5') {
console.log('证件类型是港澳居民通行证')
if (this.userInfo.customerIdNumber.length != 9) {
return this.$toast('证件类型为港澳居民通行证的证件号码须为9位')
} else if (!/^(H|M)[0-9]{8}$/.test(this.userInfo.customerIdNumber)) {
return this.$toast('证件类型为港澳居民通行证的,证件号码首位字母为"H"/"M",证件号码第2位至第9位为阿拉伯数字')
} else {
this.checkMarr()
}
//证件是台湾居民通行证
} else if (this.userInfo.idType == '6' && this.userInfo.customerIdNumber.length != 8) {
console.log('证件类型是台湾居民通行证')
return this.$toast('证件类型台湾居民通行证证件号码须为8位数字')
} else {
}
// else if (this.userInfo.idType == '4' && this.userInfo.customerIdNumber.length < 3) {
// console.log('证件类型是护照')
// return this.$toast('护照须大于等于3个字符')
// //证件是港澳居民通行证
// } else if (this.userInfo.idType == '5') {
// console.log('证件类型是港澳居民通行证')
// if (this.userInfo.customerIdNumber.length != 9) {
// return this.$toast('证件类型为港澳居民通行证的证件号码须为9位')
// } else if (!/^(H|M)[0-9]{8}$/.test(this.userInfo.customerIdNumber)) {
// return this.$toast('证件类型为港澳居民通行证的,证件号码首位字母为"H"/"M",证件号码第2位至第9位为阿拉伯数字')
// } else {
// this.checkMarr()
// }
// //证件是台湾居民通行证
// } else if (this.userInfo.idType == '6' && this.userInfo.customerIdNumber.length != 8) {
// console.log('证件类型台湾居民通行证')
// return this.$toast('证件类型为台湾居民通行证的证件号码须为8位数字')
// }
else {
this.checkMarr()
}
},
@@ -781,7 +667,7 @@ export default {
[class*='van-hairline']::after {
border: none !important;
}
.van-checkbox{
.van-checkbox {
margin-left: auto;
}
</style>