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