5.9 限制说明字数

This commit is contained in:
jl-zhoujl2
2023-05-09 11:00:14 +08:00
parent 8cab3316a1
commit 6805c9b98e

View File

@ -106,8 +106,8 @@ const ZhiQiCha: React.FC<{}> = (props) => {
key: 'memo', key: 'memo',
width: "20%", width: "20%",
tooltip: "一行中存在至少一项选择【否】,当前行的说明必须填写", tooltip: "一行中存在至少一项选择【否】,当前行的说明必须填写",
fieldProps: { formItemProps: {
maxLength: 100, rules: [{ max: 500, message: "字数超长最长500字" }]
} }
}, },
]; ];
@ -203,7 +203,7 @@ const ZhiQiCha: React.FC<{}> = (props) => {
} else if (item.riskFlag == null) { } else if (item.riskFlag == null) {
riskEmptyItem = i; riskEmptyItem = i;
break; break;
} else if ((item.relationFlag == "0" || item.riskFlag == "0") && (item.memo == null || item.memo == "")) { } else if ((item.relationFlag == "0" || item.riskFlag == "0") && (item.memo == null || item.memo == "" || item.memo?.length > 500)) {
memoEmptyItem = i; memoEmptyItem = i;
break; break;
} }
@ -217,7 +217,7 @@ const ZhiQiCha: React.FC<{}> = (props) => {
return; return;
} }
if (memoEmptyItem != -1) { if (memoEmptyItem != -1) {
message.warning(`供应商A【${supplierTableData[memoEmptyItem].supplierA.name}】与供应商B【${supplierTableData[memoEmptyItem].supplierB.name}】关联情况的【说明】项未填写`); message.warning(`供应商A【${supplierTableData[memoEmptyItem].supplierA.name}】与供应商B【${supplierTableData[memoEmptyItem].supplierB.name}】关联情况的【说明】项未填写或字数超长`);
return; return;
} }
values["id"] = warningsData?.id; values["id"] = warningsData?.id;