|
|
@ -221,61 +221,82 @@ const butttondata = (row) => { |
|
|
|
// 列表-操作按钮事件 |
|
|
|
const buttonTableClick = async (val, row) => { |
|
|
|
if (val == 'mainPlanOpe') { // 打开 |
|
|
|
tableObject.loading = true |
|
|
|
ProductionMainApi.open(row.id).then(() => { |
|
|
|
message.success(t('common.updateSuccess')) |
|
|
|
tableObject.loading = false |
|
|
|
getList() |
|
|
|
}).catch(err => { |
|
|
|
tableObject.loading = false |
|
|
|
console.log(err) |
|
|
|
}) |
|
|
|
} else if (val == 'mainPlanClo') { // 关闭 |
|
|
|
await message.confirm('确认要关闭吗?') |
|
|
|
tableObject.loading = true |
|
|
|
ProductionMainApi.close(row.id).then(() => { |
|
|
|
message.success(t('common.updateSuccess')) |
|
|
|
tableObject.loading = false |
|
|
|
getList() |
|
|
|
}).catch(err => { |
|
|
|
tableObject.loading = false |
|
|
|
console.log(err) |
|
|
|
}) |
|
|
|
} else if (val == 'mainPlanSub') { // 提交审批 |
|
|
|
if (row.available == 'FALSE') return message.warning('当前数据:【不可用】') |
|
|
|
await message.confirm('确认要提交审批吗?') |
|
|
|
tableObject.loading = true |
|
|
|
ProductionMainApi.submit(row.id).then(() => { |
|
|
|
message.success(t('common.updateSuccess')) |
|
|
|
tableObject.loading = false |
|
|
|
getList() |
|
|
|
}).catch(err => { |
|
|
|
tableObject.loading = false |
|
|
|
console.log(err) |
|
|
|
}) |
|
|
|
} else if (val == 'mainPlanTur') { // 驳回 |
|
|
|
await message.confirm('确认要驳回吗?') |
|
|
|
tableObject.loading = true |
|
|
|
ProductionMainApi.reject(row.id).then(() => { |
|
|
|
message.success(t('common.updateSuccess')) |
|
|
|
tableObject.loading = false |
|
|
|
getList() |
|
|
|
}).catch(err => { |
|
|
|
tableObject.loading = false |
|
|
|
console.log(err) |
|
|
|
}) |
|
|
|
} else if (val == 'mainPlanApp') { // 审批通过 |
|
|
|
if (row.available == 'FALSE') return message.warning('当前数据:【不可用】') |
|
|
|
await message.confirm('确认要审批通过吗?') |
|
|
|
tableObject.loading = true |
|
|
|
ProductionMainApi.agree(row.id).then(() => { |
|
|
|
message.success(t('common.updateSuccess')) |
|
|
|
tableObject.loading = false |
|
|
|
getList() |
|
|
|
}).catch(err => { |
|
|
|
tableObject.loading = false |
|
|
|
console.log(err) |
|
|
|
}) |
|
|
|
} else if (val == 'mainPlanPub') { // 发布 |
|
|
|
if (row.available == 'FALSE') return message.warning('当前数据:【不可用】') |
|
|
|
await message.confirm('确认要发布吗?') |
|
|
|
tableObject.loading = true |
|
|
|
ProductionMainApi.publish(row.id).then(() => { |
|
|
|
message.success(t('common.updateSuccess')) |
|
|
|
tableObject.loading = false |
|
|
|
getList() |
|
|
|
}).catch(err => { |
|
|
|
tableObject.loading = false |
|
|
|
console.log(err) |
|
|
|
}) |
|
|
|
} else if (val == 'mainPlanRes') { // 重置 |
|
|
|
await message.confirm('确认要重置吗?') |
|
|
|
tableObject.loading = true |
|
|
|
ProductionMainApi.resetting(row.id).then(() => { |
|
|
|
message.success(t('common.updateSuccess')) |
|
|
|
tableObject.loading = false |
|
|
|
getList() |
|
|
|
}).catch(err => { |
|
|
|
tableObject.loading = false |
|
|
|
console.log(err) |
|
|
|
}) |
|
|
|
} else if (val == 'edit') { // 编辑 |
|
|
@ -328,9 +349,11 @@ const handleDelete = async (id: number) => { |
|
|
|
try { |
|
|
|
// 删除的二次确认 |
|
|
|
await message.delConfirm() |
|
|
|
tableObject.loading = true |
|
|
|
// 发起删除 |
|
|
|
await ProductionMainApi.deleteProductionMain(id) |
|
|
|
message.success(t('common.delSuccess')) |
|
|
|
tableObject.loading = false |
|
|
|
// 刷新列表 |
|
|
|
await getList() |
|
|
|
} catch {} |
|
|
|