|
|
@ -218,23 +218,30 @@ const submitForm = async () => { |
|
|
|
const valid = await elForm.validate() |
|
|
|
if (!valid) return |
|
|
|
// 针对主子表 明细校验 |
|
|
|
if (props.isBusiness && formType.value == 'create') { |
|
|
|
const validateForm = await tableFormRef.value.validateForm() |
|
|
|
if (!validateForm) { |
|
|
|
if (props.tableData.length == 0) { |
|
|
|
message.warning('请填写明细信息!') |
|
|
|
if (props.isBusiness) { |
|
|
|
formLoading.value = true |
|
|
|
if (formType.value == 'create') { |
|
|
|
const validateForm = await tableFormRef.value.validateForm() |
|
|
|
if (!validateForm) { |
|
|
|
if (props.tableData.length == 0) { |
|
|
|
message.warning('请填写明细信息!') |
|
|
|
return |
|
|
|
} |
|
|
|
return |
|
|
|
} |
|
|
|
return |
|
|
|
} |
|
|
|
// 主子表——提交请求 |
|
|
|
formLoading.value = true |
|
|
|
try { |
|
|
|
const data = unref(formRef)?.formModel |
|
|
|
emit('submitForm', formType.value, data ) |
|
|
|
// dialogVisible.value = false |
|
|
|
} finally { |
|
|
|
// formLoading.value = false |
|
|
|
// 主子表——提交请求 |
|
|
|
try { |
|
|
|
const data = unref(formRef)?.formModel |
|
|
|
emit('submitForm', formType.value, data ) |
|
|
|
} finally { |
|
|
|
} |
|
|
|
} else { |
|
|
|
// 编辑 |
|
|
|
try { |
|
|
|
const data = unref(formRef)?.formModel |
|
|
|
emit('submitForm', formType.value, data ) |
|
|
|
} finally { |
|
|
|
} |
|
|
|
} |
|
|
|
} else { |
|
|
|
// 基础数据单表——提交请求 |
|
|
|