From b470ac1b1219c7e4baa905bbacb68949bfca8588 Mon Sep 17 00:00:00 2001 From: "bai.zixv" Date: Thu, 4 Jul 2024 15:21:14 +0800 Subject: [PATCH] feat: approval,prevent create approvalRecords (#1272) Reviewed-on: https://git.daoyoucloud.com/daoyoucloud/tachybase/pulls/1272 Co-authored-by: bai.zixv Co-committed-by: bai.zixv --- .../plugins/@tachybase/plugin-workflow/src/locale/en-US.json | 3 ++- .../plugins/@tachybase/plugin-workflow/src/locale/zh-CN.json | 4 +++- .../src/server/features/approval/ApprovalInstruction.ts | 4 ++++ 3 files changed, 9 insertions(+), 2 deletions(-) diff --git a/packages/plugins/@tachybase/plugin-workflow/src/locale/en-US.json b/packages/plugins/@tachybase/plugin-workflow/src/locale/en-US.json index 8a33f58d0..965bfaafe 100644 --- a/packages/plugins/@tachybase/plugin-workflow/src/locale/en-US.json +++ b/packages/plugins/@tachybase/plugin-workflow/src/locale/en-US.json @@ -276,5 +276,6 @@ "\"Content-Type\" only support \"application/json\", and no need to specify": "\"Content-Type\" only support \"application/json\", and no need to specify", "concat": "concat", "ms": "ms", - "reSubmit": "reSubmit" + "reSubmit": "reSubmit", + "Are you sure you want to resubmit it?": "Are you sure you want to resubmit it?" } diff --git a/packages/plugins/@tachybase/plugin-workflow/src/locale/zh-CN.json b/packages/plugins/@tachybase/plugin-workflow/src/locale/zh-CN.json index 301175c83..0748efb6d 100644 --- a/packages/plugins/@tachybase/plugin-workflow/src/locale/zh-CN.json +++ b/packages/plugins/@tachybase/plugin-workflow/src/locale/zh-CN.json @@ -356,5 +356,7 @@ "\"Content-Type\" only support \"application/json\", and no need to specify": "\"Content-Type\" 请求头仅支持 \"application/json\",无需填写", "concat": "连接", "ms": "毫秒", - "reSubmit": "重新提交" + "reSubmit": "重新提交", + "Are you sure you want to resubmit it?": "确定生成一份新的提交记录吗?" + } diff --git a/packages/plugins/@tachybase/plugin-workflow/src/server/features/approval/ApprovalInstruction.ts b/packages/plugins/@tachybase/plugin-workflow/src/server/features/approval/ApprovalInstruction.ts index fb5234216..d5860ebf3 100644 --- a/packages/plugins/@tachybase/plugin-workflow/src/server/features/approval/ApprovalInstruction.ts +++ b/packages/plugins/@tachybase/plugin-workflow/src/server/features/approval/ApprovalInstruction.ts @@ -135,6 +135,10 @@ export default class ApprovalInstruction extends Instruction { except: ['data'], }); const approvalExecution = approval.approvalExecutions.find((item) => item.executionId === processor.execution.id); + // NOTE: 属于重新提交的情况时候, 不必进入待办列表, 应该由用户手动提交 + if (approval.status === APPROVAL_STATUS.RESUBMIT) { + return job; + } const RecordModel = db.getModel('approvalRecords'); await RecordModel.bulkCreate( assignees.map((userId, index) => ({