mirror of
https://gitee.com/java110/MicroCommunityWeb.git
synced 2026-02-24 05:46:03 +08:00
加入优化
This commit is contained in:
parent
6a8b28f7ce
commit
1cfb9bd0b3
@ -19,9 +19,9 @@
|
||||
</div>
|
||||
<div class="col-sm-6">
|
||||
<div class="form-group row">
|
||||
<label class="col-sm-2 col-form-label">名称</label>
|
||||
<label class="col-sm-2 col-form-label">姓名</label>
|
||||
<div class="col-sm-10"><input v-model="addOwnerInfo.name" type="text"
|
||||
placeholder="必填,请填写名称" class="form-control"></div>
|
||||
placeholder="必填,请填写姓名" class="form-control"></div>
|
||||
</div>
|
||||
<div class="form-group row">
|
||||
<label class="col-sm-2 col-form-label">性别</label>
|
||||
@ -36,7 +36,7 @@
|
||||
<div class="form-group row">
|
||||
<label class="col-sm-2 col-form-label">年龄</label>
|
||||
<div class="col-sm-10"><input v-model="addOwnerInfo.age" type="number"
|
||||
placeholder="必填,请填写年龄" class="form-control"></div>
|
||||
placeholder="可选,请填写年龄" class="form-control"></div>
|
||||
</div>
|
||||
<div class="form-group row" v-if="addOwnerInfo.componentTitle == '成员'">
|
||||
<label class="col-sm-2 col-form-label">类型</label>
|
||||
|
||||
@ -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': [
|
||||
|
||||
@ -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))) {
|
||||
|
||||
Loading…
Reference in New Issue
Block a user