Parcourir la source

Merge branch 'develop_0715' of http://120.55.44.4:10080/xujunjie/WorkloadWeb into develop_0715

Renxy il y a 2 ans
Parent
commit
f9d93e8ea8

+ 23 - 3
src/pages/PurchaseAdmin/PurchaseList/Detail/AuditFlow.js

@@ -33,6 +33,7 @@ function AuditFlow(props) {
     formComponentValues,
     activityId,
     direction,
+    status,
   } = props;
   const [flow, setFlow] = useState({ workflowActivityRules: [] });
   const timerRef = useRef({
@@ -45,12 +46,32 @@ function AuditFlow(props) {
     } else {
       return flow.workflowActivityRules.findIndex(item => item.activityId == activityId);
     }
-  }, [activityId]);
+  }, [activityId, flow]);
 
   const renderDesc = item => {
     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 }) => {
     let item = flow.workflowActivityRules[index];
 
@@ -74,7 +95,6 @@ function AuditFlow(props) {
   };
 
   const getDetail = async () => {
-    console.log(timerRef.current);
     if (!timerRef.current.status) {
       // 上锁
       timerRef.current.status = true;
@@ -85,7 +105,6 @@ function AuditFlow(props) {
           userId,
           formComponentValues,
         });
-        console.log(flow);
         setFlow(flow);
       } catch (error) {}
       setTimeout(() => {
@@ -114,6 +133,7 @@ function AuditFlow(props) {
         ))}
         {/* <Step key={item.activityId} title={item?.activityName} description={renderDesc(item)} /> */}
       </Steps>
+      {status !== undefined && renderAlert()}
     </div>
   );
 }

+ 1 - 1
src/pages/PurchaseAdmin/PurchaseList/Detail/Index.js

@@ -957,7 +957,7 @@ function Detail(props) {
         activityId={auditDetail.activityId}
         formComponentValues={auditDetail.formComponentValues}
       />
-      {renderAlert()}
+      {/* {renderAlert()} */}
       {/* 判断是否为比对模式 */}
       {compareList.length == 2 ? (
         <>