|
@@ -104,6 +104,7 @@ function Detail(props) {
|
|
|
data.tasks = tasks || [];
|
|
|
data.cc_userids = cc_userids;
|
|
|
data.formComponentValues = form_component_values?.filter(item => item.name);
|
|
|
+ if (version.status == 1) data.status = -1;
|
|
|
}
|
|
|
return data;
|
|
|
}, [instanceDetail, version]);
|
|
@@ -351,8 +352,42 @@ function Detail(props) {
|
|
|
};
|
|
|
|
|
|
const onApprove = (flag, taskId) => {
|
|
|
+ const callback = () => {
|
|
|
+ // 更新flow流程图
|
|
|
+ dispatch({
|
|
|
+ type: 'xflow/queryBoomFlowDetail',
|
|
|
+ payload: {
|
|
|
+ id: templateId,
|
|
|
+ },
|
|
|
+ });
|
|
|
+
|
|
|
+ // 更新审批流
|
|
|
+ dispatch({
|
|
|
+ type: 'detail/queryDingInstanceDetail',
|
|
|
+ payload: {
|
|
|
+ process_instance_id: version.ding_instance_id, //创建表单成功返回的id
|
|
|
+ },
|
|
|
+ });
|
|
|
+ };
|
|
|
+
|
|
|
+ const request = async () => {
|
|
|
+ let param = {
|
|
|
+ request: {
|
|
|
+ process_instance_id: version.ding_instance_id,
|
|
|
+ result: flag ? 'agree' : 'refuse',
|
|
|
+ actioner_userid: currentUser.DingUserId || getCurrentUser()?.DingUserId,
|
|
|
+ task_id: taskId,
|
|
|
+ },
|
|
|
+ };
|
|
|
+ let res = await queryDingInstanceExecute(param);
|
|
|
+ if (res?.data?.result) {
|
|
|
+ callback();
|
|
|
+ }
|
|
|
+ };
|
|
|
+
|
|
|
if (!flag) {
|
|
|
- setAuditVisible(true);
|
|
|
+ // setAuditVisible(true);
|
|
|
+ request();
|
|
|
return;
|
|
|
}
|
|
|
|
|
@@ -392,75 +427,6 @@ function Detail(props) {
|
|
|
);
|
|
|
}
|
|
|
}
|
|
|
- /*Modal.confirm({
|
|
|
- title: '提示',
|
|
|
- content:
|
|
|
- isSingle
|
|
|
- ? `节点【${serviceNode.label}】只能拥有一个清单,是否覆盖?`
|
|
|
- : `是否通过审批。`,
|
|
|
- okText: '确定',
|
|
|
- cancelText: '取消',
|
|
|
- onOk: () => {
|
|
|
- dispatch({
|
|
|
- type: 'detail/approve',
|
|
|
- payload: {
|
|
|
- id: flow.active_id,
|
|
|
- project_id: projectId,
|
|
|
- audit_status: 3,
|
|
|
- flow_id: flowNode.flow_id,
|
|
|
- node_id: flowNode.seq,
|
|
|
- },
|
|
|
- callback: newVersion => {
|
|
|
- // 更新flow流程图
|
|
|
- dispatch({
|
|
|
- type: 'xflow/queryBoomFlowDetail',
|
|
|
- payload: {
|
|
|
- id: templateId,
|
|
|
- },
|
|
|
- });
|
|
|
-
|
|
|
- // 更新审批流
|
|
|
- dispatch({
|
|
|
- type: 'detail/queryAuditList',
|
|
|
- payload: {
|
|
|
- template_id: version.template_id,
|
|
|
- template_node_id: version.template_node_id,
|
|
|
- flow_id: version.flow_id,
|
|
|
- version_id: version.version_id,
|
|
|
- },
|
|
|
- });
|
|
|
- if (flow.current == flow.list.FlowNodes.length - 1) {
|
|
|
- // 最后一个审核节点通过后 需要更新version id 不更不更,留在原地
|
|
|
- // localStorage.excelId = newVersion.id;
|
|
|
- // setVersion({
|
|
|
- // ...version,
|
|
|
- // flow_id: newVersion.flow_id,
|
|
|
- // id: newVersion.id,
|
|
|
- // });
|
|
|
- }
|
|
|
- },
|
|
|
- });
|
|
|
- },
|
|
|
- });*/
|
|
|
-
|
|
|
- const callback = () => {
|
|
|
- // 更新flow流程图
|
|
|
- dispatch({
|
|
|
- type: 'xflow/queryBoomFlowDetail',
|
|
|
- payload: {
|
|
|
- id: templateId,
|
|
|
- },
|
|
|
- });
|
|
|
-
|
|
|
- // 更新审批流
|
|
|
- dispatch({
|
|
|
- type: 'detail/queryDingInstanceDetail',
|
|
|
- payload: {
|
|
|
- process_instance_id: version.ding_instance_id, //创建表单成功返回的id
|
|
|
- },
|
|
|
- });
|
|
|
- };
|
|
|
-
|
|
|
Modal.confirm({
|
|
|
title: '提示',
|
|
|
content: isSingle
|
|
@@ -468,19 +434,8 @@ function Detail(props) {
|
|
|
: `是否通过审批。`,
|
|
|
okText: '确定',
|
|
|
cancelText: '取消',
|
|
|
- onOk: async () => {
|
|
|
- let param = {
|
|
|
- request: {
|
|
|
- process_instance_id: version.ding_instance_id,
|
|
|
- result: flag ? 'agree' : 'refuse',
|
|
|
- actioner_userid: currentUser.DingUserId || getCurrentUser()?.DingUserId,
|
|
|
- task_id: taskId,
|
|
|
- },
|
|
|
- };
|
|
|
- let res = await queryDingInstanceExecute(param);
|
|
|
- if (res?.data?.result) {
|
|
|
- callback();
|
|
|
- }
|
|
|
+ onOk: () => {
|
|
|
+ request();
|
|
|
},
|
|
|
});
|
|
|
};
|