|
@@ -33,6 +33,7 @@ function AuditFlow(props) {
|
|
formComponentValues,
|
|
formComponentValues,
|
|
activityId,
|
|
activityId,
|
|
direction,
|
|
direction,
|
|
|
|
+ status,
|
|
} = props;
|
|
} = props;
|
|
const [flow, setFlow] = useState({ workflowActivityRules: [] });
|
|
const [flow, setFlow] = useState({ workflowActivityRules: [] });
|
|
const timerRef = useRef({
|
|
const timerRef = useRef({
|
|
@@ -45,12 +46,32 @@ function AuditFlow(props) {
|
|
} else {
|
|
} else {
|
|
return flow.workflowActivityRules.findIndex(item => item.activityId == activityId);
|
|
return flow.workflowActivityRules.findIndex(item => item.activityId == activityId);
|
|
}
|
|
}
|
|
- }, [activityId]);
|
|
|
|
|
|
+ }, [activityId, flow]);
|
|
|
|
|
|
const renderDesc = item => {
|
|
const renderDesc = item => {
|
|
return <></>;
|
|
return <></>;
|
|
};
|
|
};
|
|
|
|
+ const renderAlert = () => {
|
|
|
|
+ // const audit_comment = history.list[0]?.audit_comment;
|
|
|
|
+ let item = '';
|
|
|
|
+ switch (status) {
|
|
|
|
+ case 0:
|
|
|
|
+ if (!flow.list || flow.list.FlowNodes?.length == 0) return;
|
|
|
|
+ item = <Alert message="审批拒绝" type="error" />;
|
|
|
|
+ break;
|
|
|
|
+ case 1:
|
|
|
|
+ item = <Alert message="等待审核中" type="info" />;
|
|
|
|
+ break;
|
|
|
|
+ case 2:
|
|
|
|
+ item = <Alert message={`审批被拒绝`} type="error" />;
|
|
|
|
+ break;
|
|
|
|
+ case 3:
|
|
|
|
+ item = <Alert message="审批通过" type="success" />;
|
|
|
|
+ break;
|
|
|
|
+ }
|
|
|
|
|
|
|
|
+ return <div style={{ marginTop: 20 }}>{item}</div>;
|
|
|
|
+ };
|
|
const customDot = (dot, { status, index }) => {
|
|
const customDot = (dot, { status, index }) => {
|
|
let item = flow.workflowActivityRules[index];
|
|
let item = flow.workflowActivityRules[index];
|
|
|
|
|
|
@@ -74,7 +95,6 @@ function AuditFlow(props) {
|
|
};
|
|
};
|
|
|
|
|
|
const getDetail = async () => {
|
|
const getDetail = async () => {
|
|
- console.log(timerRef.current);
|
|
|
|
if (!timerRef.current.status) {
|
|
if (!timerRef.current.status) {
|
|
// 上锁
|
|
// 上锁
|
|
timerRef.current.status = true;
|
|
timerRef.current.status = true;
|
|
@@ -85,7 +105,6 @@ function AuditFlow(props) {
|
|
userId,
|
|
userId,
|
|
formComponentValues,
|
|
formComponentValues,
|
|
});
|
|
});
|
|
- console.log(flow);
|
|
|
|
setFlow(flow);
|
|
setFlow(flow);
|
|
} catch (error) {}
|
|
} catch (error) {}
|
|
setTimeout(() => {
|
|
setTimeout(() => {
|
|
@@ -114,6 +133,7 @@ function AuditFlow(props) {
|
|
))}
|
|
))}
|
|
{/* <Step key={item.activityId} title={item?.activityName} description={renderDesc(item)} /> */}
|
|
{/* <Step key={item.activityId} title={item?.activityName} description={renderDesc(item)} /> */}
|
|
</Steps>
|
|
</Steps>
|
|
|
|
+ {status !== undefined && renderAlert()}
|
|
</div>
|
|
</div>
|
|
);
|
|
);
|
|
}
|
|
}
|