Commit 71c1a104 by 何为

修改孕产妇签约页面字段校验

parent 2cb680ea
......@@ -13,7 +13,7 @@ const voucherUrl = 'http://voucher.check.icaremgt.com' // 开发
/**
* 机构控件项目接口请求地址
*/
const sjkgUrl = 'https://api-wx-service.check.icaremgt.com' // 开发
const sjkgUrl = 'http://api-wx-service.check.icaremgt.com' // 开发
// const sjkgUrl = 'https://sjkg-wx-service.icaremgt.com' // 正式
// const sjkgUrl = 'http://192.168.1.234:9005'
......
......@@ -50,7 +50,7 @@
<input type="text" class="form-control" v-model="BaseForm.lastMensesTime" v-if="signStatus=='update'" :disabled="signStatus=='update'"/>
<div class="td-table" @click="openPickerLastMensesTime" v-else>
<div class="td-table-cell text">
<span v-if="BaseForm.lastMensesTime === ''" style="color:#FF9B44;">领取儿童健康券时可不填写</span>
<span v-if="BaseForm.lastMensesTime === ''" style="color:#FF9B44;">领取儿童健康券</span>
<span v-else class="light">{{BaseForm.lastMensesTime}}</span>
<!-- {{BaseForm.lastMensesTime !== '' ? BaseForm.lastMensesTime : '请选择末次月经时间'}} -->
</div>
......@@ -818,13 +818,84 @@ export default {
BaseValidateHandle () { // 表单验证
this.BaseValidateName()
this.BaseValidateIdCard()
// this.BaseValidateMensesLastDate()
this.BaseValidateMensesLastDate()
this.BaseValidatePhone()
this.BaseValidateAddress()
this.BaseValidateStreet()
// this.BaseValidateOrg()
this.BaseValidateChooseImg()
},
// 总体校验
Validator() {
// 身份证字段校验
const _idCardFlag = this.BaseForm.idCard
if (!_idCardFlag) {
this.BaseValidate.idCardState = false
this.$toast({
message: '请输入有效的女性身份证号!',
position: 'center',
duration: 3000
})
return false
}
// 姓名字段校验
const _nameFlag = this.BaseForm.name
if (!_nameFlag) {
this.BaseValidate.nameState = false
this.$toast({
message: '请输入姓名!',
position: 'center',
duration: 3000
})
return false
}
// 手机号字段校验
const _phoneFlag = this.BaseForm.phone
if (!_phoneFlag) {
this.BaseValidate.phoneState = false
this.$toast({
message: '请输入有效手机号!',
position: 'center',
duration: 3000
})
return false
}
// 末次月经时间字段校验
const _lastMensesTimeFlag = this.BaseForm.lastMensesTime
if (!_lastMensesTimeFlag) {
this.BaseValidate.lastMensesTimeState = false
this.$toast({
message: '请选择末次月经时间!',
position: 'center',
duration: 3000
})
return false
}
// 现住址字段校验
const _addressFlag = this.BaseForm.address
if (!_addressFlag) {
this.BaseValidate.addressState = false
this.$toast({
message: '请选择现在居住地址!',
position: 'center',
duration: 3000
})
return false
}
// 详细地址字段校验
const _streetFlag = this.BaseForm.street
if (!_streetFlag) {
this.BaseValidate.streetState = false
this.$toast({
message: '请输入详细地址!',
position: 'center',
duration: 3000
})
return false
}
return true
},
BaseValidateName () { // 姓名验证
if (validatename(this.BaseForm.name)) {
this.BaseValidate.nameState = true
......@@ -910,7 +981,7 @@ export default {
}
},
BaseValidateStreet () { // 详细地址
if (this.BaseForm.street === '' && this.BaseForm.street.length > 25) {
if (this.BaseForm.street === '') {
this.BaseValidate.streetState = false
} else {
this.BaseValidate.streetState = true
......@@ -973,6 +1044,7 @@ export default {
day = '0' + day
}
this.BaseForm.lastMensesTime = selectedDate.getFullYear() + '-' + month + '-' + day
this.BaseValidate.lastMensesTimeState = true
this.saveSignInfoToCookie() // 储存用户签约录入信息
},
openPickerBirth (index) { // 打开出生日期控件
......@@ -1074,6 +1146,12 @@ export default {
duration: 3 * 1000
})
}
const flag = this.Validator()
if (!flag) {
return flag
}
this.BaseValidateHandle()
// this.$toast({
// message: 'account id=' + this.accountId,
// position: 'center',
......@@ -1097,7 +1175,7 @@ export default {
return
}
}
this.BaseValidateHandle()
if (this.pageType === 1) { // 子女
let downState = true
for (let i = 0; i < this.childrenArr.length; i++) {
......@@ -1396,6 +1474,7 @@ export default {
this.addressSearchValue = ''
this.addressForm.villages = val
this.addressForm.VillagesCode = code
this.BaseValidate.addressState = true
// this.stepCurrent = 5
this.saveSignInfoToCookie() // 储存用户签约录入信息
this.cancelPopupAddress()
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment