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()
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 {
//

Loading…
Cancel
Save