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