diff --git a/fe/PC/README.md b/fe/PC/README.md index eda9eab98..119e7b8d5 100644 --- a/fe/PC/README.md +++ b/fe/PC/README.md @@ -114,11 +114,11 @@ pageStatus 结合active控制返回结果 [表单组件补充:currenForm] validType type仅等于input时:实时keyUp校验,类型如下: - 1、number:正整数, - 2、pointNumber:数字+带小数点(只能输入一个小数点, 小数点后方保留位数见), - 3、numberLetter: 数字+字母, - 4、letter:纯字母, - 5、letterCn:字母+中文 + 1、 number:正整数, + 2、 pointNumber:数字+带小数点(只能输入一个小数点, 小数点后方保留位数见), + 3、 numberLetter: 数字+字母, + 4、 letter:纯字母, + 5、 letterCn:字母+中文 pointNumberFixed 组合上方validType值仅等于pointNumber时: 小数点后方保留位数,如不填写默认为100位 +示例: diff --git a/fe/PC/src/utils/index.js b/fe/PC/src/utils/index.js index 33d4be2da..bec90e996 100644 --- a/fe/PC/src/utils/index.js +++ b/fe/PC/src/utils/index.js @@ -473,7 +473,7 @@ export function getMatchRegConformValue(type,value,fixedNum){ // 数字+字母 case "numberLetter": - _conformValue=value.replace(/[\W]/g,''); + _conformValue=value.replace(/[^\a-\z\A-\Z0-9]/g,''); break; // 字母 diff --git a/fe/PC/src/views/basicData/CustomerManage/Customer.vue b/fe/PC/src/views/basicData/CustomerManage/Customer.vue index 9aa0ce7d3..d9456f265 100644 --- a/fe/PC/src/views/basicData/CustomerManage/Customer.vue +++ b/fe/PC/src/views/basicData/CustomerManage/Customer.vue @@ -122,7 +122,6 @@ export default { type: 0, code: null, company: null, - shortName: null, }, //编辑 editFormData: { @@ -140,13 +139,11 @@ export default { isActive: true, type: 0, concurrencyStamp: null, - shortName: null, }, editOptions: {}, CreateForm: [ - { type: "input", label: "客户代码", prop: "code", colSpan: 12 }, + { type: "input", label: "客户代码", prop: "code", colSpan: 12, validType:'numberLetter' }, { type: "input", label: "客户名称", prop: 'name', colSpan: 12 }, - { type: "input", label: "客户简称", prop: 'shortName', colSpan: 12 }, { type: "select", label: "类型", prop: "type", options: "customerType", colSpan: 12 }, { type: "select", label: "状态", prop: "isActive", options: "openToCloseBit", colSpan: 12 }, { type: "input", label: "国家", prop: "country", colSpan: 12 }, @@ -155,14 +152,13 @@ export default { { type: "input", label: "联系人", prop: "contacts", colSpan: 12 }, { type: "input", label: "电话", prop: "phone", colSpan: 12, validType:'number', maxlength:11}, { type: "input", label: "传真", prop: "fax", colSpan: 12 }, - { type: "input", label: "邮编", prop: "postID", colSpan: 12 }, + { type: "input", label: "邮编", prop: "postID", colSpan: 12, validType:'number' }, { type: "input", label: "货币", prop: "currency", colSpan: 12 }, { type: "input", label: "备注", prop: 'remark', colSpan: 12 }, ], editForm: [ - { type: "input", label: "客户代码", prop: "code",disabled:"true", colSpan: 12 }, + { type: "input", label: "客户代码", prop: "code",disabled:"true", colSpan: 12, validType:'numberLetter' }, { type: "input", label: "客户名称", prop: 'name', colSpan: 12 }, - { type: "input", label: "客户简称", prop: 'shortName', colSpan: 12 }, { type: "select", label: "类型", prop: "type", options: "customerType", colSpan: 12 }, { type: "select", label: "状态", prop: "isActive", options: "openToCloseBit", colSpan: 12 }, { type: "input", label: "国家", prop: "country", colSpan: 12 }, @@ -171,7 +167,7 @@ export default { { type: "input", label: "联系人", prop: "contacts", colSpan: 12 }, { type: "input", label: "电话", prop: "phone", colSpan: 12, validType:'number', maxlength:11 }, { type: "input", label: "传真", prop: "fax", colSpan: 12 }, - { type: "input", label: "邮编", prop: "postID", colSpan: 12 }, + { type: "input", label: "邮编", prop: "postID", colSpan: 12, validType:'number' }, { type: "input", label: "货币", prop: "currency", colSpan: 12 }, { type: "input", label: "备注", prop: 'remark', colSpan: 12 }, ],