Renxy 2 years ago
parent
commit
14f7348aa9

+ 12 - 10
src/pages/PurchaseAdmin/PurchaseList/Detail/AuditFlow.js

@@ -1,5 +1,5 @@
 import React, { useMemo, useEffect, useState, useRef } from 'react';
-import { Steps, Popover } from 'antd';
+import { Steps, Popover, Alert } from 'antd';
 import styles from './Index.less';
 import { queryDDProcessesForecast } from '@/services/boom';
 
@@ -70,7 +70,7 @@ function AuditFlow(props) {
         break;
     }
 
-    return <div style={{ marginTop: 20 }}>{item}</div>;
+    return <div style={{ margin: '20px auto' }}>{item}</div>;
   };
   const customDot = (dot, { status, index }) => {
     let item = flow.workflowActivityRules[index];
@@ -126,15 +126,17 @@ function AuditFlow(props) {
   }, [processCode, formComponentValues]);
 
   return (
-    <div className={styles.top}>
-      <Steps current={current} progressDot={customDot} direction={direction}>
-        {flow.workflowActivityRules.map(item => (
-          <Step key={item.activityId} title={item?.activityName} />
-        ))}
-        {/* <Step key={item.activityId} title={item?.activityName} description={renderDesc(item)} /> */}
-      </Steps>
+    <>
+      <div className={styles.top}>
+        <Steps current={current} progressDot={customDot} direction={direction}>
+          {flow.workflowActivityRules.map(item => (
+            <Step key={item.activityId} title={item?.activityName} />
+          ))}
+          {/* <Step key={item.activityId} title={item?.activityName} description={renderDesc(item)} /> */}
+        </Steps>
+      </div>
       {status !== undefined && renderAlert()}
-    </div>
+    </>
   );
 }
 

+ 12 - 10
src/pages/PurchaseAdmin/PurchaseList/Detail/Index.js

@@ -87,9 +87,9 @@ function Detail(props) {
       userId: '16569001414345099',
       formComponentValues: [],
       activityId: '',
-      status: version.active_audit,
+      status: version.audit_status,
     };
-    if (version?.flow_id && instanceDetail.tasks && instanceDetail.tasks?.length > 0) {
+    if (version?.flow_id && instanceDetail?.tasks && instanceDetail.tasks?.length > 0) {
       let item = flowDetail.nodes.find(item => item.Id == version.template_node_id);
       if (!item) return data;
       const { tasks, form_component_values } = instanceDetail;
@@ -949,14 +949,16 @@ function Detail(props) {
         />
       </div>
       {/* <TimeNode flow={flow} isAuditor={isAuditor} onApprove={onApprove}></TimeNode> */}
-      <AuditFlow
-        status={auditDetail.status}
-        processCode={auditDetail.processCode}
-        deptId="14169890"
-        userId="16569001414345099"
-        activityId={auditDetail.activityId}
-        formComponentValues={auditDetail.formComponentValues}
-      />
+      {version.flow_id ? (
+        <AuditFlow
+          status={auditDetail.status}
+          processCode={auditDetail.processCode}
+          deptId="14169890"
+          userId="16569001414345099"
+          activityId={auditDetail.activityId}
+          formComponentValues={auditDetail.formComponentValues}
+        />
+      ) : null}
       {/* {renderAlert()} */}
       {/* 判断是否为比对模式 */}
       {compareList.length == 2 ? (