|
|
@ -287,6 +287,12 @@ const handleDeleteTable = (item, index) => { |
|
|
|
// 主子数据 提交 |
|
|
|
const submitForm = async (formType, data) => { |
|
|
|
const flag = validateNotRepetition(tableData.value); |
|
|
|
const emptyFlag = validateDetailEmpty(tableData.value); |
|
|
|
if(!emptyFlag){ |
|
|
|
message.alertWarning('明细不能为空') |
|
|
|
basicFormRef.value.formLoading = false |
|
|
|
return |
|
|
|
} |
|
|
|
if(!flag){ |
|
|
|
message.alertWarning('动态规则阶段不能重复') |
|
|
|
basicFormRef.value.formLoading = false |
|
|
@ -335,6 +341,13 @@ const validateIfRepeat = (type,data) => { |
|
|
|
return stageSet.size === mergedArray.length; |
|
|
|
} |
|
|
|
|
|
|
|
const validateDetailEmpty = (data) => { |
|
|
|
const codes = data.map(item => item.stage); |
|
|
|
if(codes.length == 0){ |
|
|
|
return false; |
|
|
|
} |
|
|
|
return true; |
|
|
|
} |
|
|
|
const validateNotRepetition = (data) => { |
|
|
|
// 提取所有的 dictionaryTypeAndCode 值 |
|
|
|
const codes = data.map(item => item.stage); |
|
|
|