|
|
@ -279,6 +279,22 @@ const buttonTableClick = async (val, row) => { |
|
|
|
} else if (val == 'mainPlanPub') { // 发布 |
|
|
|
if (row.available == 'FALSE') return message.warning('当前数据:【不可用】') |
|
|
|
await message.confirm('确认要发布吗?') |
|
|
|
// 物料含有不可用时 是否继续执行 |
|
|
|
let isAvailable = true |
|
|
|
await ProductionMainApi.getProductionDetail(row.id).then(async res =>{ |
|
|
|
if (res.length > 0) { |
|
|
|
let rs = '' |
|
|
|
res.forEach(item => { |
|
|
|
rs += item.itemCode + ',' |
|
|
|
}) |
|
|
|
await message.confirm('物料:【'+rs +'】目前为不可用状态,是否继续发布?').catch(() => { |
|
|
|
isAvailable = false |
|
|
|
}) |
|
|
|
} |
|
|
|
}) |
|
|
|
if (!isAvailable) { |
|
|
|
return |
|
|
|
} |
|
|
|
tableObject.loading = true |
|
|
|
ProductionMainApi.publish(row.id).then(() => { |
|
|
|
message.success(t('common.updateSuccess')) |
|
|
|