feat/approval-0702 (#1266)

Reviewed-on: daoyoucloud/tachybase#1266
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-03 16:21:13 +08:00 committed by sealday
parent 0d8bbba1da
commit 37103eac50
3 changed files with 10 additions and 3 deletions

View File

@ -32,6 +32,7 @@ export function useSubmit() {
data: form.values,
status: contextApprovalStatus,
schemaFormId: workflow.config.applyForm,
summaryConfig: workflow.config.summary,
},
});

View File

@ -6,7 +6,7 @@ import { useHandleRefresh } from '../../common/useHandleRefresh';
// 撤回
export function useWithdrawAction() {
const { refreshTable } = useHandleRefresh(100);
const { refreshTable } = useHandleRefresh();
const field = useField();
const approval = useApproval();

View File

@ -76,8 +76,7 @@ const approvals = {
return actions.create(context, next);
},
async update(context, next) {
const { collectionName, data, status, schemaFormId } = context.action.params.values ?? {};
const { collectionName, data, status, schemaFormId, summaryConfig } = context.action.params.values ?? {};
const [dataSourceName, cName] = parseCollectionName(collectionName);
const dataSource = context.app.dataSourceManager.dataSources.get(dataSourceName);
const collection = dataSource.collectionManager.getCollection(cName);
@ -98,11 +97,18 @@ const approvals = {
values: data,
updateAssociationValues,
});
const summary = getSummary({
summaryConfig,
data: data,
});
context.action.mergeParams({
values: {
status: status ?? APPROVAL_STATUS.SUBMITTED,
data: target.toJSON(),
applicantRoleName: context.state.currentRole,
summary,
},
});
return actions.update(context, next);