|
|
@ -299,67 +299,85 @@ const buttonTableClick = async (val, row) => { |
|
|
|
if (val == 'mainClose') { |
|
|
|
// 关闭 |
|
|
|
await message.confirm('确认要关闭吗?') |
|
|
|
tableObject.loading = true |
|
|
|
CountRequestMainApi.close(row.id) |
|
|
|
.then(() => { |
|
|
|
message.success(t('关闭成功')) |
|
|
|
tableObject.loading = false |
|
|
|
getList() |
|
|
|
}) |
|
|
|
.catch((err) => { |
|
|
|
tableObject.loading = false |
|
|
|
console.log(err) |
|
|
|
}) |
|
|
|
} else if (val == 'mainReAdd') { |
|
|
|
// 重新添加 |
|
|
|
await message.confirm('确认要重新添加吗?') |
|
|
|
tableObject.loading = true |
|
|
|
CountRequestMainApi.reAdd(row.id) |
|
|
|
.then(() => { |
|
|
|
message.success(t('添加成功')) |
|
|
|
tableObject.loading = false |
|
|
|
getList() |
|
|
|
}) |
|
|
|
.catch((err) => { |
|
|
|
tableObject.loading = false |
|
|
|
console.log(err) |
|
|
|
}) |
|
|
|
} else if (val == 'mainSubmit') { |
|
|
|
// 提交审批 |
|
|
|
await message.confirm('确认要提交审批吗?') |
|
|
|
tableObject.loading = true |
|
|
|
CountRequestMainApi.submit(row.id) |
|
|
|
.then(() => { |
|
|
|
message.success(t('提交审批成功')) |
|
|
|
tableObject.loading = false |
|
|
|
getList() |
|
|
|
}) |
|
|
|
.catch((err) => { |
|
|
|
tableObject.loading = false |
|
|
|
console.log(err) |
|
|
|
}) |
|
|
|
} else if (val == 'mainTurnDown') { |
|
|
|
// 驳回 |
|
|
|
await message.confirm('确认要驳回吗?') |
|
|
|
tableObject.loading = true |
|
|
|
CountRequestMainApi.refused(row.id) |
|
|
|
.then(() => { |
|
|
|
message.success(t('驳回成功')) |
|
|
|
tableObject.loading = false |
|
|
|
getList() |
|
|
|
}) |
|
|
|
.catch((err) => { |
|
|
|
tableObject.loading = false |
|
|
|
console.log(err) |
|
|
|
}) |
|
|
|
} else if (val == 'mainApprove') { |
|
|
|
// 审批通过 |
|
|
|
await message.confirm('确认要审批通过吗?') |
|
|
|
tableObject.loading = true |
|
|
|
CountRequestMainApi.agree(row.id) |
|
|
|
.then(() => { |
|
|
|
message.success(t('审批已通过')) |
|
|
|
tableObject.loading = false |
|
|
|
getList() |
|
|
|
}) |
|
|
|
.catch((err) => { |
|
|
|
tableObject.loading = false |
|
|
|
console.log(err) |
|
|
|
}) |
|
|
|
} else if (val == 'mainHandle') { |
|
|
|
// 处理 |
|
|
|
await message.confirm('确认要处理吗?') |
|
|
|
tableObject.loading = true |
|
|
|
CountRequestMainApi.handle(row.id) |
|
|
|
.then(() => { |
|
|
|
message.success(t('处理成功')) |
|
|
|
tableObject.loading = false |
|
|
|
getList() |
|
|
|
}) |
|
|
|
.catch((err) => { |
|
|
|
tableObject.loading = false |
|
|
|
console.log(err) |
|
|
|
}) |
|
|
|
} else if (val == 'mainReCount') { |
|
|
@ -399,12 +417,15 @@ const buttonTableClick = async (val, row) => { |
|
|
|
} else if (val == 'mainThaw') { |
|
|
|
// 解冻 |
|
|
|
await message.confirm('确认要解冻吗?') |
|
|
|
tableObject.loading = true |
|
|
|
CountRequestMainApi.thaw(row.id) |
|
|
|
.then(() => { |
|
|
|
message.success(t('解冻成功')) |
|
|
|
tableObject.loading = false |
|
|
|
getList() |
|
|
|
}) |
|
|
|
.catch((err) => { |
|
|
|
tableObject.loading = false |
|
|
|
console.log(err) |
|
|
|
}) |
|
|
|
} else if (val == 'edit') { |
|
|
@ -434,8 +455,10 @@ const handleDelete = async (id: number) => { |
|
|
|
try { |
|
|
|
// 删除的二次确认 |
|
|
|
await message.delConfirm() |
|
|
|
tableObject.loading = true |
|
|
|
// 发起删除 |
|
|
|
await CountRequestMainApi.deleteCountRequestMain(id) |
|
|
|
tableObject.loading = false |
|
|
|
message.success(t('common.delSuccess')) |
|
|
|
// 刷新列表 |
|
|
|
await getList() |
|
|
|