diff --git a/public/components/property/addOwner/addOwner.html b/public/components/property/addOwner/addOwner.html
index e623cdd03..d09ed8e97 100644
--- a/public/components/property/addOwner/addOwner.html
+++ b/public/components/property/addOwner/addOwner.html
@@ -19,9 +19,9 @@
diff --git a/public/components/property/addOwner/addOwner.js b/public/components/property/addOwner/addOwner.js
index 4197a2fc0..f56b2e670 100644
--- a/public/components/property/addOwner/addOwner.js
+++ b/public/components/property/addOwner/addOwner.js
@@ -41,20 +41,16 @@
{
limit: "required",
param: "",
- errInfo: "名称不能为空"
+ errInfo: "姓名不能为空"
},
{
limit: "maxin",
param: "2,10",
- errInfo: "名称长度必须在2位至10位"
+ errInfo: "姓名长度必须在2位至10位"
},
],
'addOwnerInfo.age': [
- {
- limit: "required",
- param: "",
- errInfo: "年龄不能为空"
- },
+
{
limit: "num",
param: "",
@@ -82,9 +78,9 @@
],
'addOwnerInfo.idCard': [
{
- limit: "maxLength",
- param: "18",
- errInfo: "身份证长度不能超过200位"
+ limit: "idCard",
+ param: "",
+ errInfo: "身份证格式错误"
}
],
'addOwnerInfo.ownerTypeCd': [
diff --git a/public/vcCore/vcFramework.js b/public/vcCore/vcFramework.js
index 80052f0e1..8beb6dbc4 100644
--- a/public/vcCore/vcFramework.js
+++ b/public/vcCore/vcFramework.js
@@ -1620,14 +1620,23 @@ vc 校验 工具类 -method
* @param {校验文本} text
*/
num: function (text) {
+ if(text == null || text == undefined){
+ return true;
+ }
let regNum = /^[0-9][0-9]*$/;
return regNum.test(text);
},
date: function (str) {
+ if(str == null || str == undefined){
+ return true;
+ }
let regDate = /^(\d{4})-(\d{2})-(\d{2})$/;
return regDate.test(str);
},
dateTime: function (str) {
+ if(str == null || str == undefined){
+ return true;
+ }
let reDateTime = /^[1-9]\d{3}-(0[1-9]|1[0-2])-(0[1-9]|[1-2][0-9]|3[0-1])\s+(20|21|22|23|[0-1]\d):[0-5]\d:[0-5]\d$/;
return reDateTime.test(str);
},
@@ -1635,10 +1644,16 @@ vc 校验 工具类 -method
金额校验
**/
money: function (text) {
+ if(text == null || text == undefined){
+ return true;
+ }
let regMoney = /^\d+\.?\d{0,2}$/;
return regMoney.test(text);
},
idCard: function (num) {
+ if(num == null || num == undefined){
+ return true;
+ }
num = num.toUpperCase();
//身份证号码为15位或者18位,15位时全为数字,18位前17位为数字,最后一位是校验位,可能为数字或字符X。
if (!(/(^\d{15}$)|(^\d{17}([0-9]|X)$)/.test(num))) {