Commit fd96bc58 authored by 前端-许佳敏's avatar 前端-许佳敏
parents 8128bba7 c1704c39
......@@ -81,13 +81,17 @@ const Add = () => {
const basicFormCol = [
{
label: intl.formatMessage({ id: 'balance.danjuzhaiyao' }), name: 'reconciliationAbstract', placeholder: '请输入对账单摘要', rules: [{ required: true, message: '请输入对账单摘要' }, {
validator: (_, value) => {
validator: (_, value, callback) => {
try {
let _str = value;
_str = _str.replace(/[\u4E00-\u9FA5]/g, "AA");
if (_str.length > 30 * 2) {
return Promise.reject(new Error(`最长60个字符,30个汉字`))
} else {
return Promise.resolve();
callback('最长60个字符,30个汉字')
// return Promise.reject(new Error(`最长60个字符,30个汉字`))
}
callback();
} catch (error) {
callback();
}
}
}]
......@@ -95,13 +99,18 @@ const Add = () => {
{
label: intl.formatMessage({ id: 'balance.beizhu' }), name: 'remark', placeholder: '请输入对备注', rules: [
{
validator: (_, value) => {
validator: (_, value, callback) => {
try {
let _str = value;
_str = _str.replace(/[\u4E00-\u9FA5]/g, "AA");
if (value.length > 60 * 2) {
return Promise.reject(new Error(`最长120个字符`))
} else {
return Promise.resolve();
callback('最长120个字符')
// return Promise.reject(new Error(`最长120个字符`))
}
callback();
// return Promise.resolve();
} catch (error) {
callback();
}
}
}
......@@ -288,7 +297,7 @@ const Add = () => {
if (!reg.test(value)) {
return Promise.reject(new Error('数量需要大于0'))
}
if(value > record.reconciliationQuantity){
if (value > record.reconciliationQuantity) {
return Promise.reject(new Error('不能大于待对账数量'))
}
return Promise.resolve()
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment