|
@@ -196,7 +196,7 @@ function CommitAuditModal(props) {
|
|
|
const getFromData = idList => {
|
|
|
const data = JSON.parse(JSON.stringify(formComponentValues));
|
|
|
const result = [];
|
|
|
- //获取流转节点的层级关系
|
|
|
+ // 获取流转节点的层级关系
|
|
|
let len = 0;
|
|
|
let list = [];
|
|
|
idList.forEach(item => {
|
|
@@ -566,8 +566,8 @@ function CommitAuditModal(props) {
|
|
|
}
|
|
|
// 没找到就给默认值
|
|
|
if (!componentValue.find(item => item.id === tempFormItem.props.id)) {
|
|
|
- // placeholder
|
|
|
if (tempFormItem.componentName === 'TextNote') {
|
|
|
+ // 记录TextNote
|
|
|
componentValue.push({
|
|
|
name: tempFormItem.props.label,
|
|
|
id: tempFormItem.props.id,
|
|
@@ -592,14 +592,18 @@ function CommitAuditModal(props) {
|
|
|
componentValue[index] = {
|
|
|
name: formItem.props.label,
|
|
|
id: currentFieldID,
|
|
|
- value: [changedFields[currentFieldID]],
|
|
|
+ value: Array.isArray(changedFields[currentFieldID])
|
|
|
+ ? changedFields[currentFieldID]
|
|
|
+ : [changedFields[currentFieldID]],
|
|
|
};
|
|
|
break;
|
|
|
} else if (index === componentValue.length - 1) {
|
|
|
componentValue.push({
|
|
|
name: formItem.props.label,
|
|
|
id: currentFieldID,
|
|
|
- value: [changedFields[currentFieldID]],
|
|
|
+ value: Array.isArray(changedFields[currentFieldID])
|
|
|
+ ? changedFields[currentFieldID]
|
|
|
+ : [changedFields[currentFieldID]],
|
|
|
});
|
|
|
}
|
|
|
}
|
|
@@ -646,7 +650,7 @@ function CommitAuditModal(props) {
|
|
|
// };
|
|
|
|
|
|
const onFinish = async () => {
|
|
|
- if(loading) return;
|
|
|
+ if (loading) return;
|
|
|
const isOk = Object.values(approvalProcess).every(item => {
|
|
|
return item.every(cur => {
|
|
|
if (cur[0].type == 'role') return cur[0].nowValue;
|
|
@@ -700,6 +704,17 @@ function CommitAuditModal(props) {
|
|
|
const flowPath = result.map(item => getFlowPath(item));
|
|
|
setLoading(true);
|
|
|
try {
|
|
|
+ // 检查Audit form是否为空
|
|
|
+ const tempFormData = await aduitDetailForm.validateFields().catch(err => {
|
|
|
+ message.error(err.errorFields[0].errors);
|
|
|
+ setLoading(false);
|
|
|
+ return false;
|
|
|
+ });
|
|
|
+ if (tempFormData === undefined || tempFormData === false) {
|
|
|
+ return;
|
|
|
+ }
|
|
|
+ // 检查之后调用一次,防止什么都没改导致获取不到值
|
|
|
+ onFormValueChange(tempFormData, tempFormData);
|
|
|
const formList = getFromData(result);
|
|
|
let params = {
|
|
|
desc: fieldsValue.desc,
|