|
|
@ -274,7 +274,7 @@ const submitForm = async () => { |
|
|
|
if (!elForm) return |
|
|
|
const valid = await elForm.validate() |
|
|
|
if (!valid) return |
|
|
|
|
|
|
|
// 针对主子表 明细校验 |
|
|
|
if (props.isBusiness) { |
|
|
|
const validateForm = await tableFormRef.value.validateForm() |
|
|
|
if (!validateForm) { |
|
|
@ -284,13 +284,20 @@ const submitForm = async () => { |
|
|
|
} |
|
|
|
return |
|
|
|
} |
|
|
|
// 主子表——提交请求 |
|
|
|
formLoading.value = true |
|
|
|
try { |
|
|
|
const data = unref(formRef)?.formModel |
|
|
|
emit('submitForm', formType.value, data ) |
|
|
|
dialogVisible.value = false |
|
|
|
} finally { |
|
|
|
formLoading.value = false |
|
|
|
} |
|
|
|
|
|
|
|
// 提交请求 |
|
|
|
} else { |
|
|
|
// 基础数据单表——提交请求 |
|
|
|
formLoading.value = true |
|
|
|
try { |
|
|
|
// const data = unref(formRef)?.formModel as ItempackagingApi.ItempackagingVO |
|
|
|
// TODO: as VO 接口 不知道怎么从props获取 所以现在没写 |
|
|
|
const data = unref(formRef)?.formModel |
|
|
|
if (formType.value === 'create') { |
|
|
|
await props.apiCreate(data) |
|
|
@ -306,6 +313,7 @@ const submitForm = async () => { |
|
|
|
formLoading.value = false |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
/** 重置表单 */ |
|
|
|
const resetForm = () => { |
|
|
@ -325,7 +333,8 @@ const emit = defineEmits([ |
|
|
|
'handleAddTable', |
|
|
|
'inpuFocus', |
|
|
|
'searchTableSuccess', |
|
|
|
'opensearchTable' |
|
|
|
'opensearchTable', |
|
|
|
'submitForm' |
|
|
|
]) |
|
|
|
//普通下拉改变事件 |
|
|
|
const formSelectChange = (field, val) => { |
|
|
|