|
|
@ -434,14 +434,27 @@ const handleDeleteTable = (item, index) => { |
|
|
|
// 主子数据 提交 |
|
|
|
const submitForm = async (formType, data) => { |
|
|
|
data.subList = tableData.value // 拼接子表数据参数 |
|
|
|
try { |
|
|
|
if (formType === 'create') { |
|
|
|
await ProductdismantleRequestMainApi.createProductdismantleRequestMain(data) |
|
|
|
message.success(t('common.createSuccess')) |
|
|
|
} else { |
|
|
|
await ProductdismantleRequestMainApi.updateProductdismantleRequestMain(data) |
|
|
|
message.success(t('common.updateSuccess')) |
|
|
|
// 判断 bom 是否添加 |
|
|
|
let childListRs = true |
|
|
|
// 根据 填写的数量 为基准 不填写数量的忽略 |
|
|
|
tableData.value.forEach((item) => { |
|
|
|
if (!item.childList) { |
|
|
|
childListRs = false |
|
|
|
} |
|
|
|
}) |
|
|
|
if (!childListRs) { |
|
|
|
message.warning('请填写Bom信息!') |
|
|
|
formRef.value.dialogVisible = false |
|
|
|
return |
|
|
|
} |
|
|
|
try { |
|
|
|
if (formType === 'create') { |
|
|
|
await ProductdismantleRequestMainApi.createProductdismantleRequestMain(data) |
|
|
|
message.success(t('common.createSuccess')) |
|
|
|
} else { |
|
|
|
await ProductdismantleRequestMainApi.updateProductdismantleRequestMain(data) |
|
|
|
message.success(t('common.updateSuccess')) |
|
|
|
} |
|
|
|
formRef.value.dialogVisible = false |
|
|
|
// 刷新当前列表 |
|
|
|
getList() |
|
|
|