合并鼎诚919

This commit is contained in:
邓晓坤
2019-09-19 18:04:30 +08:00
parent 1c4edae07f
commit d5ca72a7fc
73 changed files with 3805 additions and 2281 deletions

View File

@@ -2,7 +2,12 @@
<div>
<van-cell-group>
<!-- 基本信息 -->
<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
@@ -12,7 +17,15 @@
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"
@@ -30,7 +43,7 @@
placeholder="请选择"
@click="toSelect('2')"
/>
<van-field v-model="userInfo.customerIdNumber" v-validate="'idNoTemp'" label="证件号码" name="证件号码" placeholder="请输入"></van-field>
<van-field v-model="userInfo.customerIdNumber" label="证件号码" name="证件号码" placeholder="请输入"></van-field>
<FieldDatePicter
label="证件起始日期"
name="证件起始日期"
@@ -50,11 +63,39 @@
@confirm="onDateConfirm($event, '2')"
></FieldDatePicter>
<div class="van-hairline--bottom fs14 p10 clearfix">
<van-checkbox v-model="userInfo.effectiveDateType" class="fr" :disabled="effectiveDateTypeAble" @change="isEnd">长期</van-checkbox>
<van-checkbox
v-model="userInfo.effectiveDateType"
class="fr"
:disabled="effectiveDateTypeAble"
@change="isEnd"
>长期</van-checkbox>
</div>
<van-field v-model="userInfo.email" label="电子邮箱" name="电子邮箱" v-validate="'email'" placeholder="请输入" clearable maxlength="50" />
<van-field v-model="userInfo.stature" label="身高cm" placeholder="请输入" clearable v-validate="'onlyInteger'" maxlength="3" type="number" />
<van-field v-model="userInfo.weight" label=" 体重kg" placeholder="请输入" clearable v-validate="'onlyInteger'" maxlength="3" type="number" />
<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
@@ -87,7 +128,12 @@
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
@@ -130,7 +176,13 @@
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
@@ -140,10 +192,39 @@
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>
<!-- 家庭信息 -->
@@ -167,10 +248,33 @@
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>
<!-- 字段选择 -->
@@ -179,15 +283,31 @@
</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>
@@ -201,6 +321,7 @@ import OccupationPicker from '@/components/ebiz/occipation/OccupationPicker'
import areaList from '@/assets/js/utils/area'
import utilsAge from '@/assets/js/utils/age'
import getAreaName from '@/assets/js/utils/get-area-name'
import idNoCheck from '@/assets/js/utils/idNoCheck'
import filter from '@/filters/index'
import { constants } from 'crypto'
import { userInfo } from 'os'
@@ -305,6 +426,84 @@ export default {
validateForm() {
return this.$validator.validateAll()
},
//证件类型校验
validateIdType() {
//证件是身份证
if (this.userInfo.idType == '1') {
console.log('证件类型是身份证')
if (this.userInfo.customerIdNumber.length == '15') {
//15位身份证第15位是性别位, 奇男偶女
let sexSign = this.userInfo.customerIdNumber.substr(14, 1)
if ((parseInt(sexSign) % 2 == 0 && this.userInfo.customerSex != 1) || (parseInt(sexSign) % 2 != 0 && this.userInfo.customerSex != 0)) {
return this.$toast('性别录入与身份证不符')
}
//15位身份证第7-12位是生日位, 年月日
let birthSign = this.userInfo.customerIdNumber.substr(6, 6)
if (this.userInfo.birthday) {
if (
this.userInfo.birthday.substr(2, 2) != birthSign.substr(0, 2) ||
this.userInfo.birthday.substr(5, 2) != birthSign.substr(2, 2) ||
this.userInfo.birthday.substr(8, 2) != birthSign.substr(4, 2)
) {
return this.$toast('生日录入与身份证不符')
}
}
} else if (this.userInfo.customerIdNumber.length == '18') {
//18位身份证第17位是性别位, 奇男偶女
let sexSign = this.userInfo.customerIdNumber.substr(16, 1)
if ((parseInt(sexSign) % 2 == 0 && this.userInfo.customerSex != 1) || (parseInt(sexSign) % 2 != 0 && this.userInfo.customerSex != 0)) {
return this.$toast('性别录入与身份证不符')
}
//18位身份证第7-14位是生日位, 年月日
let birthSign = this.userInfo.customerIdNumber.substr(6, 8)
if (this.userInfo.birthday) {
if (
this.userInfo.birthday.substr(0, 4) != birthSign.substr(0, 4) ||
this.userInfo.birthday.substr(5, 2) != birthSign.substr(4, 2) ||
this.userInfo.birthday.substr(8, 2) != birthSign.substr(6, 2)
) {
return this.$toast('生日录入与身份证不符')
}
}
}
// 证件号码规则校验
if (!idNoCheck.isIdno(this.userInfo.customerIdNumber)) {
return this.$toast('您填写的证件号码有误只能为18位以内数字或字母组合')
} else {
this.$parent.updateCustomerInfo()
}
//证件是户口本
} else if (this.userInfo.idType == '2' && this.userInfo.customerIdNumber.length != 18) {
console.log('证件类型是户口本')
return this.$toast('户口本的证件号码长度应等于18位')
//证件是出生证明
} else if (this.userInfo.idType == '3' && this.userInfo.customerIdNumber.length < 3) {
console.log('证件类型是出生证')
return this.$toast('出生证须大于等于3个字符')
//证件是护照
} 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.$parent.updateCustomerInfo()
}
//证件是台湾居民通行证
} else if (this.userInfo.idType == '6' && this.userInfo.customerIdNumber.length != 8) {
console.log('证件类型是台湾居民通行证')
return this.$toast('证件类型为台湾居民通行证的证件号码须为8位数字')
} else {
this.$parent.updateCustomerInfo()
}
},
censusInfo() {
let area = [{ code: this.userInfo.province }, { code: this.userInfo.city }]
this.census = getAreaName(area)
@@ -361,6 +560,7 @@ export default {
;[this.userInfo.nativeplace, this.nativeplace] = [value.id, value.text]
this.valueKey = value.text
} else if (this.pickerType == '2') {
;[this.userInfo.idType, this.idType] = [value.id, value.text]
//身份证以外的证件类型可以使用长期
if (value.id != '1') {
this.effectiveDateTypeAble = false
@@ -368,7 +568,6 @@ export default {
let age = utilsAge.getAge(this.userInfo.birthday, new Date())
this.effectiveDateTypeAble = !(age >= 45)
}
;[this.userInfo.idType, this.idType] = [value.id, value.text]
} else if (this.pickerType == '3') {
;[this.userInfo.degree, this.degree] = [value.id, value.text]
// } else if (this.pickerType == '4') {
@@ -445,11 +644,9 @@ export default {
return this.$toast('证件起始日期填写错误')
}
// 计算年龄
let certificateAge = utilsAge.getAge(val, new Date())
let birthAge = utilsAge.getAge(this.userInfo.birthday, new Date())
let age = birthAge - certificateAge
let age = utilsAge.getAge(this.userInfo.birthday, new Date())
// 长期按钮是否禁用
this.effectiveDateTypeAble = age >= 16 && age <= 45
this.effectiveDateTypeAble = age <= 45
// if(age < 45){
// this.userInfo.effectiveDateType = false
// }