|
|
@ -422,12 +422,19 @@ 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 => { |
|
|
|
// 已发布 |
|
|
|
if(item.status == '6'){ |
|
|
|
ProductionMainApi.generateIssueRequest(item.number) |
|
|
|
} |
|
|
|
}); |
|
|
|
} |
|
|
|
}).catch(err => { |
|
|
|
tableObject.loading = false |
|
|
|
console.log(err) |
|
|
@ -602,11 +609,16 @@ 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 => { |
|
|
|
// 已发布 |
|
|
|
if(item.status == '6'){ |
|
|
|
ProductionMainApi.generateIssueRequest(item.number) |
|
|
|
} |
|
|
|
}); |
|
|
|
} |
|
|
|
} |
|
|
|
} finally { |
|
|
|
try { |
|
|
|