fe6170b4 by joe

保单号校验

1 parent 8384bac0
......@@ -4,7 +4,7 @@ import {
httpPost
} from '@/api/fetch-api.js'
import { contactMethodCheck } from '@utils/utils.js';
import { contactMethodCheck, policyNumberCheck } from '@utils/utils.js';
import Auth from '@components/auth/auth.vue';
import modalComp from '@/components/modal-comp/modal-comp.vue';
......@@ -164,7 +164,7 @@ export default {
},
checkPolicyNumber() {
this.data.policyNumber = this.data.policyNumber ? this.data.policyNumber.replace(/\s*/g, "") : "";
if (this.data.policyNumber && this.data.policyNumber.length != 16) {
if (this.data.policyNumber && !policyNumberCheck(this.data.policyNumber)) {
this.errorTips.policyNumberErr = this.i18n.complaintAcceptance.errorTips.e3;
return false;
}
......
......@@ -270,3 +270,7 @@ export function contactMethodCheck(type, value) {
}
return true;
}
export function policyNumberCheck(policyNumber) {
return /^P(0001|0002)\d{11}$/.test(policyNumber);
}
\ No newline at end of file
......