diff --git a/src/components/BasicForm/src/BasicForm.vue b/src/components/BasicForm/src/BasicForm.vue index beb2baf6f..0e3fa5436 100644 --- a/src/components/BasicForm/src/BasicForm.vue +++ b/src/components/BasicForm/src/BasicForm.vue @@ -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 { // 基础数据单表——提交请求