|
|
@ -289,7 +289,8 @@ const handleDeleteTable = (item, index) => { |
|
|
|
|
|
|
|
// 主子数据 提交 |
|
|
|
const submitForm = async (formType, data) => { |
|
|
|
if(!validateNotRepetition(tableData.value)){ |
|
|
|
const flag = validateNotRepetition(tableData.value); |
|
|
|
if(!flag){ |
|
|
|
message.alertWarning('动态规则阶段不能重复') |
|
|
|
basicFormRef.value.formLoading = false |
|
|
|
return |
|
|
@ -312,9 +313,9 @@ const submitForm = async (formType, data) => { |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
const detailValidate = (data) => { |
|
|
|
const detailValidate = (type,data) => { |
|
|
|
let tag = true; |
|
|
|
if(!validateIfRepeat(data)){ |
|
|
|
if(!validateIfRepeat(type,data)){ |
|
|
|
tag = false |
|
|
|
message.alertWarning('动态规则阶段不能重复') |
|
|
|
} |
|
|
@ -325,8 +326,13 @@ const detailOpenForm = (type, row, masterParmas) => { |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
const validateIfRepeat = (data) => { |
|
|
|
const mergedArray = [data, ...detailList.value]; |
|
|
|
const validateIfRepeat = (type,data) => { |
|
|
|
let mergedArray: any[] = []; |
|
|
|
if(type == 'create'){ |
|
|
|
mergedArray = [data, ...detailList.value]; |
|
|
|
}else if(type == 'update'){ |
|
|
|
mergedArray = [...detailList.value]; |
|
|
|
} |
|
|
|
const stageSet = new Set(mergedArray.map(item => item.stage)); |
|
|
|
return stageSet.size === mergedArray.length; |
|
|
|
} |
|
|
|