Browse Source

基础form 组件修改 编辑操作

master
陈薪名 1 year ago
parent
commit
d7520e7ac7
  1. 37
      src/components/BasicForm/src/BasicForm.vue

37
src/components/BasicForm/src/BasicForm.vue

@ -218,23 +218,30 @@ const submitForm = async () => {
const valid = await elForm.validate() const valid = await elForm.validate()
if (!valid) return if (!valid) return
// //
if (props.isBusiness && formType.value == 'create') { if (props.isBusiness) {
const validateForm = await tableFormRef.value.validateForm() formLoading.value = true
if (!validateForm) { if (formType.value == 'create') {
if (props.tableData.length == 0) { const validateForm = await tableFormRef.value.validateForm()
message.warning('请填写明细信息!') if (!validateForm) {
if (props.tableData.length == 0) {
message.warning('请填写明细信息!')
return
}
return return
} }
return //
} try {
// const data = unref(formRef)?.formModel
formLoading.value = true emit('submitForm', formType.value, data )
try { } finally {
const data = unref(formRef)?.formModel }
emit('submitForm', formType.value, data ) } else {
// dialogVisible.value = false //
} finally { try {
// formLoading.value = false const data = unref(formRef)?.formModel
emit('submitForm', formType.value, data )
} finally {
}
} }
} else { } else {
// //

Loading…
Cancel
Save