|
|
@ -151,16 +151,16 @@ DeliverRecordDetail.allSchemas.tableFormColumns.map(item => { |
|
|
|
value: 'customerCode' , |
|
|
|
isMainValue: true |
|
|
|
}] |
|
|
|
item.form.componentProps.searchCondition = [ |
|
|
|
{ |
|
|
|
key: 'businessType', |
|
|
|
value: businessType.value, |
|
|
|
isMainValue: false |
|
|
|
},{ |
|
|
|
key: 'customerCode', |
|
|
|
value: 'customerCode' , |
|
|
|
isMainValue: true |
|
|
|
}] |
|
|
|
// item.form.componentProps.searchCondition = [ |
|
|
|
// { |
|
|
|
// key: 'businessType', |
|
|
|
// value: businessType.value, |
|
|
|
// isMainValue: false |
|
|
|
// },{ |
|
|
|
// key: 'customerCode', |
|
|
|
// value: 'customerCode' , |
|
|
|
// isMainValue: true |
|
|
|
// }] |
|
|
|
} |
|
|
|
}) |
|
|
|
|
|
|
@ -207,6 +207,73 @@ const buttonBaseClick = (val, item) => { |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
//为true表示子表数据中存在数量为0的数据 |
|
|
|
const flag = ref(false) |
|
|
|
|
|
|
|
const submitForm = async (formType, submitData) => { |
|
|
|
|
|
|
|
let data = {...submitData} |
|
|
|
if(formType == 'create'){ |
|
|
|
if(data.masterId){ |
|
|
|
data.id = data.masterId |
|
|
|
} |
|
|
|
flag.value = false |
|
|
|
data.subList = tableData.value // 拼接子表数据参数 |
|
|
|
data.subList.forEach(item=>{ |
|
|
|
item.toWarehouseCode = data.toWarehouseCode |
|
|
|
item.toLocationCode = data.toLocationCode |
|
|
|
}) |
|
|
|
let isExist = false |
|
|
|
tableData.value.forEach(item => { |
|
|
|
let rs = tableData.value.filter(filterItem => (filterItem.itemCode == item.itemCode)) |
|
|
|
if(rs.length > 1) isExist = true |
|
|
|
}) |
|
|
|
data.businessType = businessType.value |
|
|
|
console.log(data); |
|
|
|
if (isExist) { |
|
|
|
return message.warning('物料代码重复') |
|
|
|
} |
|
|
|
data.subList.forEach(obj => { |
|
|
|
if(obj.qty == 0){ |
|
|
|
message.warning(`数量不能为0!`) |
|
|
|
flag.value = true |
|
|
|
return; |
|
|
|
} |
|
|
|
}) |
|
|
|
if(flag.value){ |
|
|
|
return |
|
|
|
} |
|
|
|
formRef.value.formLoading = true |
|
|
|
|
|
|
|
try { |
|
|
|
if (formType === 'create') { |
|
|
|
if(tableData.value.length <= 0){ |
|
|
|
message.warning(`子表明细不能为空!`) |
|
|
|
flag.value = true |
|
|
|
formRef.value.formLoading = false |
|
|
|
return; |
|
|
|
} |
|
|
|
await DeliverRecordMainApi.inducedProductCreate(data).then(res=>{ |
|
|
|
if(res.code == 200){ |
|
|
|
} |
|
|
|
}) |
|
|
|
message.success(t('common.createSuccess')) |
|
|
|
} |
|
|
|
formRef.value.dialogVisible = false |
|
|
|
// 刷新当前列表 |
|
|
|
if (formType === 'create') { |
|
|
|
getList() |
|
|
|
}else{ |
|
|
|
buttonBaseClick('refresh',null) |
|
|
|
} |
|
|
|
} finally { |
|
|
|
formRef.value.formLoading = false |
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// 列表-操作按钮 |
|
|
|