diff --git a/src/pages/manage/list/ImportantCash/controlCash/cashOut.vue b/src/pages/manage/list/ImportantCash/controlCash/cashOut.vue index 14b9cc4..0c5c61f 100644 --- a/src/pages/manage/list/ImportantCash/controlCash/cashOut.vue +++ b/src/pages/manage/list/ImportantCash/controlCash/cashOut.vue @@ -42,6 +42,7 @@ diff --git a/src/pages/manage/list/servicesAccount/relieveLost.vue b/src/pages/manage/list/servicesAccount/relieveLost.vue index 13f6706..72bd22b 100644 --- a/src/pages/manage/list/servicesAccount/relieveLost.vue +++ b/src/pages/manage/list/servicesAccount/relieveLost.vue @@ -7,15 +7,15 @@
- +

请刷银行卡

- - + + @@ -26,16 +26,16 @@
- - + +

请刷身份证

- - + +
@@ -66,8 +66,8 @@ diff --git a/src/utils/utilFunction.js b/src/utils/utilFunction.js index e2ebb00..42f057a 100644 --- a/src/utils/utilFunction.js +++ b/src/utils/utilFunction.js @@ -1,4 +1,4 @@ -import { MessageBox } from 'element-ui'; +import { MessageBox, Message } from 'element-ui'; const phoneListen = function(val, form, prop) { if(/^[0-9]*$/.test(val)) { @@ -63,11 +63,36 @@ const checkRequired = function(form, obj) { return ''; } +const myValidate = (callback, refs) => { + return (valid, obj) => { + if (valid) { + callback() + } else { + let tmpObj = {}; + for(const key in obj) { + tmpObj = obj[key][0] + break; + } + const { message, field } = tmpObj + refs[field].focus(); + Message.info({ + center: true, + message + }) + // Message.message(message + '', '提示', { + // type: 'info', + // confirmButtonText: message + // }); + } + } +} + export { phoneListen, mailBoxListen, checkRequired, inputListen, ismoney, - checkHanzi + checkHanzi, + myValidate } \ No newline at end of file diff --git a/src/utils/verify.js b/src/utils/verify.js index ede9e34..9d56bf3 100644 --- a/src/utils/verify.js +++ b/src/utils/verify.js @@ -3,10 +3,26 @@ const veren = /(^[a-zA-Z]+$)/ const vernum = /^[0-9]*$/ const verdou = /^[0-9]+(.[0-9]{1,3})?$/ const vermail = /^([a-zA-Z0-9_-])+@([a-zA-Z0-9_-])+((\.[a-zA-Z0-9_-]{2,3}){1,2})$/ + +const mobPattern = /^1[3456789][0-9]{9}$/ +const namePattern = /(^[A-Z][a-z]*(\s[A-Z][a-z]*)*$)|(^[\u4e00-\u9fa5]{2,4}$)/ +const ratePattern = /^(\d|[1-9]\d|100)(.\d{1,3})?%$|^(\d|[1-9]\d|100)(.\d{1,3})?$/ +const vercustomer = [ + { + required: true, + message: '请输入客户姓名', + trigger: 'blur' + }, + { + pattern: namePattern, + message: '客户姓名格式有误' + } +] + const vermob = [ { pattern: /^1[3456789][0-9]{9}$/, - message: '号码格式有误' + message: '手机号格式有误' }, { message: '请输入12位以下数字', max: 11 @@ -17,7 +33,7 @@ const vername = [ // pattern: /^[\u4e00-\u9fa5]{2,4}$/, // pattern: /^(?:[\u4e00-\u9fa5]+)(?:●[\u4e00-\u9fa5]+)*$|^[a-zA-Z0-9]+\s?[\.·\-()a-zA-Z]*[a-zA-Z]+$/, pattern: /(^[A-Z][a-z]*(\s[A-Z][a-z]*)*$)|(^[\u4e00-\u9fa5]{2,4}$)/, - message: '名字格式有误' + message: '该名字格式有误' } ] const verrate = [ @@ -47,5 +63,9 @@ const requiremoney = [ vermail, vermob, vername, - verrate + verrate, + mobPattern, + namePattern, + ratePattern, + vercustomer }