|
|
@ -419,12 +419,16 @@ const buttonTableClick = async (val, row) => { |
|
|
|
if (row.available == 'FALSE') return message.warning('当前数据:【不可用】') |
|
|
|
await message.confirm('确认要生成备料计划吗?') |
|
|
|
tableObject.loading = true |
|
|
|
await ProductionMainApi.generatePreparetoissue(row.number).then((PreparetoissueRes) => { |
|
|
|
await ProductionMainApi.generatePreparetoissue(row.number).then((res) => { |
|
|
|
message.success(t('common.createSuccess')) |
|
|
|
tableObject.loading = false |
|
|
|
buttonBaseClick('refresh',null) |
|
|
|
// 生成发料申请 |
|
|
|
ProductionMainApi.generateIssueRequest(PreparetoissueRes.number) |
|
|
|
if (Array.isArray(res) && res.length > 0) { |
|
|
|
res.forEach(item => { |
|
|
|
ProductionMainApi.generateIssueRequest(item.number) |
|
|
|
}); |
|
|
|
} |
|
|
|
}).catch(err => { |
|
|
|
tableObject.loading = false |
|
|
|
console.log(err) |
|
|
@ -469,10 +473,13 @@ const autoCreatePlanRequest = async (row)=>{ |
|
|
|
try { |
|
|
|
if(planSwitch.value) { |
|
|
|
// /generatePreparetoissue?number |
|
|
|
let PreparetoissueRes = await ProductionMainApi.generatePreparetoissue(row.number) |
|
|
|
let res = await ProductionMainApi.generatePreparetoissue(row.number) |
|
|
|
// 生成发料申请 |
|
|
|
// generateIssueRequest |
|
|
|
ProductionMainApi.generateIssueRequest(PreparetoissueRes.number) |
|
|
|
if (Array.isArray(res) && res.length > 0) { |
|
|
|
res.forEach(item => { |
|
|
|
ProductionMainApi.generateIssueRequest(item.number) |
|
|
|
}); |
|
|
|
} |
|
|
|
} |
|
|
|
} finally { |
|
|
|
try { |
|
|
@ -597,8 +604,10 @@ const submitForm = async (formType, submitData) => { |
|
|
|
if (formType === 'create') { |
|
|
|
data.subList = tableData.value // 拼接子表数据参数 |
|
|
|
await ProductionMainApi.createProductionMain(data).then((res) => { |
|
|
|
if (res.status == '6') { |
|
|
|
autoCreatePlanRequest(res) |
|
|
|
if (Array.isArray(res) && res.length > 0) { |
|
|
|
res.forEach(item => { |
|
|
|
autoCreatePlanRequest(item); |
|
|
|
}); |
|
|
|
} |
|
|
|
message.success(t('common.createSuccess')) |
|
|
|
}) |
|
|
|