feat: approval,prevent create approvalRecords (#1272)

Reviewed-on: daoyoucloud/tachybase#1272
Co-authored-by: bai.zixv <bai.zixv@foxmail.com>
Co-committed-by: bai.zixv <bai.zixv@foxmail.com>
This commit is contained in:
bai.zixv 2024-07-04 15:21:14 +08:00 committed by sealday
parent aec7cc918c
commit b470ac1b12
3 changed files with 9 additions and 2 deletions

View File

@ -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?"
}

View File

@ -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?": "确定生成一份新的提交记录吗?"
}

View File

@ -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) => ({