-
-
+
+ checkHanzi(val, form, 'transoutNum')" ref="transoutNum">
-
-
+
+ checkHanzi(val, form, 'certificateNum')" ref="certificateNum">
-
+
-
+
-
-
+
+ checkHanzi(val, form, 'transinNum')" ref="transinNum">
-
+
ismoney(val, form, 'money')">
-
-
+
+ checkHanzi(val, form, 'customerName')" ref="customerName">
-
+
@@ -51,22 +51,22 @@
-
+
-
+
-
-
+
+ checkHanzi(val, form, 'transinName')">
-
+
@@ -100,8 +100,8 @@
diff --git a/src/pages/manage/list/business/withdrawal.vue b/src/pages/manage/list/business/withdrawal.vue
index 6c1a329..c5ead97 100644
--- a/src/pages/manage/list/business/withdrawal.vue
+++ b/src/pages/manage/list/business/withdrawal.vue
@@ -10,35 +10,35 @@
-
+
-
-
+
+ checkHanzi(val, form, 'username')" ref="username">
-
-
+
+ checkHanzi(val, form, 'voucherNum')" ref="voucherNum">
-
+
-
+
-
+
-
+
-
+
-
+
-
+
ismoney(val, form, 'money')" ref="money">
-
+
-
+
@@ -90,8 +90,8 @@
diff --git a/src/pages/manage/list/client/consumerClient.vue b/src/pages/manage/list/client/consumerClient.vue
index 91a3e2d..fccb671 100644
--- a/src/pages/manage/list/client/consumerClient.vue
+++ b/src/pages/manage/list/client/consumerClient.vue
@@ -21,7 +21,7 @@
-
+ checkName(val, form, 'userName')">
import { mapState, mapMutations } from 'vuex'
import { mobPattern, namePattern, ratePattern, vercustomer } from '@/utils/verify.js'
-import { phoneListen, mailBoxListen, checkRequired, myValidate } from '@/utils/utilFunction.js'
+import { phoneListen, mailBoxListen, checkRequired, myValidate, checkName } from '@/utils/utilFunction.js'
export default {
name: 'index',
@@ -259,7 +259,8 @@ export default {
}
},
phoneListen: phoneListen,
- mailBoxListen: mailBoxListen
+ mailBoxListen: mailBoxListen,
+ checkName: checkName
}
// watch: {
// 'form.phone'(newVal) {
@@ -270,6 +271,7 @@ export default {
\ No newline at end of file
diff --git a/src/utils/utilFunction.js b/src/utils/utilFunction.js
index 42f057a..08f4dcd 100644
--- a/src/utils/utilFunction.js
+++ b/src/utils/utilFunction.js
@@ -23,6 +23,28 @@ const checkHanzi = function(val, form, prop) {
form[prop] = val;
}
+const checkName = function(val, form, prop) {
+ // 检查符号
+ const charReg = /[`~!@#$%^&*()_\-+=<>?:"{}|,.\/;'\\[\]·~!@#¥%……&*()——\-+={}|《》?:“”【】、;‘',。、]/im;
+ // 检查空格
+ if(charReg.test(val) || /[\u4E00-\u9FA5]/i.test(val)) {
+ return;
+ }
+ form[prop] = val;
+}
+
+// 监听年利率
+const rateListen = function(val, form, prop) {
+
+ // 检查符号 允许%
+ const charReg = /[`~!@#$^&*()_\-+=<>?:"{}|,.\/;'\\[\]·~!@#¥……&*()——\-+={}|《》?:“”【】、;‘',。、]/im;
+ // 检查空格
+ if(charReg.test(val) || /[\u4E00-\u9FA5]/i.test(val)) {
+ return;
+ }
+ form[prop] = val;
+}
+
// 监听数字
const inputListen = function(val, row, prop) {
// 检查空格
@@ -94,5 +116,7 @@ const myValidate = (callback, refs) => {
inputListen,
ismoney,
checkHanzi,
- myValidate
+ myValidate,
+ checkName,
+ rateListen
}
\ No newline at end of file
diff --git a/src/utils/verify.js b/src/utils/verify.js
index 9d56bf3..e503af3 100644
--- a/src/utils/verify.js
+++ b/src/utils/verify.js
@@ -38,8 +38,11 @@ const vername = [
]
const verrate = [
{
- // pattern: /\d{1,2}(\.\d{1,2})?/,
- // pattern: /^(([1-9]\\d{0,9})|0)(\\.\\d{1,2})?%$/,
+ // 带%的形式
+ // /^(\d|[1-9]\d|100)(.\d{1,3})?%$/
+
+ // 不带%的形式
+ // /^(\d|[1-9]\d|100)(.\d{1,3})?$/
pattern: /^(\d|[1-9]\d|100)(.\d{1,3})?%$|^(\d|[1-9]\d|100)(.\d{1,3})?$/,
message: '请输入正确的年利率'
},{