From 40383e6a5edd25c6afc5552c95e754a038a38f47 Mon Sep 17 00:00:00 2001 From: zhaoxiao Date: Fri, 27 Aug 2021 10:46:52 +0800 Subject: [PATCH] =?UTF-8?q?=E7=A8=8E=E5=8F=B7=E6=A0=A1=E9=AA=8C=E3=80=81?= =?UTF-8?q?=E6=95=B0=E5=AD=97=E6=A0=A1=E9=AA=8C?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/utils/validate.js | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/src/utils/validate.js b/src/utils/validate.js index 83036d7..bb484d3 100644 --- a/src/utils/validate.js +++ b/src/utils/validate.js @@ -53,3 +53,19 @@ export function chineseReg(s) { export function postcode(s) { return /^[0-9]\d{5}$/.test(s) } + +/** + * 税号 + * message:15位、17位、18位、20位数字和大写英文字母 + * */ +export function taxNo(s) { + return /^[A-Z0-9]{15}$|^[A-Z0-9]{17}$|^[A-Z0-9]{18}$|^[A-Z0-9]{20}$/.test(s) +} + +/** + * 只能输入数字 + * @param s + */ +export function number(s) { + return /^[0-9]*$/.test(s) +}