浏览代码

Squashed commit of the following:
解决冲突
commit 01e68af988e61b95adea23245f0f59f5f4606994
Author: xujunjie <645007605@qq.com>
Date: Tue Aug 16 14:22:58 2022 +0800

增加loading

commit eafe8f3c8ad3b024688d8025aa0da3af446a6d92
Author: xujunjie <645007605@qq.com>
Date: Tue Aug 16 14:04:47 2022 +0800

loading

commit d76d6ee0d3705f94f8ee0d6641dd8d9cdbc6956f
Author: xujunjie <645007605@qq.com>
Date: Mon Aug 15 19:14:03 2022 +0800

update

commit ed54266002db0becdfc58e551be21d59790e6c8a
Merge: d452407 b05767b
Author: xujunjie <645007605@qq.com>
Date: Mon Aug 15 19:02:45 2022 +0800

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

commit d452407d1910a8b6618f87cef59bb99a13811dd0
Merge: 8b9bada b68be4e
Author: xujunjie <645007605@qq.com>
Date: Mon Aug 15 18:48:48 2022 +0800

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

commit 8b9bada72e9e7f22357318ef4e759daa20066b54
Author: xujunjie <645007605@qq.com>
Date: Mon Aug 15 18:48:45 2022 +0800

update

# Conflicts:
# src/pages/PurchaseAdmin/PurchaseList/Detail/AuditFlow.js

Renxy 2 年之前
父节点
当前提交
8c446393a3

+ 2 - 0
src/components/Flow/node/circle/index.tsx

@@ -33,6 +33,8 @@ export default function CustomRect(props) {
           display: 'flex',
           justifyContent: 'center',
           alignItems: 'center',
+          padding: "0px 8px",
+          lineHeight: 1.2
         }}
       >
         <span style={{ textAlign: 'center', lineHeight: '20px' }}>{label}</span>

+ 18 - 13
src/pages/PurchaseAdmin/PurchaseList/Detail/AuditFlow.js

@@ -1,5 +1,5 @@
 import React, { useMemo, useEffect, useState, useRef } from 'react';
-import { Steps, Popover, Alert, Button } from 'antd';
+import { Steps, Popover, Alert, Button, Spin } from 'antd';
 import styles from './Index.less';
 import { queryDDProcessesForecast } from '@/services/boom';
 import { connect } from 'dva';
@@ -21,7 +21,7 @@ function AuditFlow(props) {
     onApprove,
   } = props;
   const [flow, setFlow] = useState({ workflowActivityRules: [] });
-  // const [showAduit, setShowAduit] = useState(false);
+  const [loading, setLoading] = useState(false);
   const timerRef = useRef({
     id: '',
     status: false,
@@ -34,12 +34,15 @@ function AuditFlow(props) {
       let current = 0;
       const activityId = tasks[tasks.length - 1].activity_id;
       flow.workflowActivityRules.forEach((item, index) => {
-        if (tasks.find(task => task.activity_id == item.activityId)) {
-          current = index;
-        }
-        // 判断是否只剩抄送节点未被选中
-        if (item.activityName == '抄送人' && current == index - 1) {
-          current = index;
+        let task = tasks.find(task => task.activity_id == item.activityId);
+        if (task) {
+          if (task.task_status == 'COMPLETED') {
+            // 完成时节点为下一级
+            current = index + 1;
+          } else {
+            // 未完成则为当前节点
+            current = index;
+          }
         }
       });
       return current;
@@ -61,7 +64,7 @@ function AuditFlow(props) {
 
   const getDesc = item => {
     const { activityId } = item;
-    if (!tasks || tasks.length == 0) return;
+    if (!tasks || tasks.length == 0) return '';
     if (item.activityName == '抄送人') {
       let names = cc_userids
         .map(userId => {
@@ -79,7 +82,7 @@ function AuditFlow(props) {
         result = (
           <>
             <br />
-            结果: {TASK_RESULT[task.task_result]}
+            审批结果: {TASK_RESULT[task.task_result]}
             <br />
           </>
         );
@@ -136,12 +139,13 @@ function AuditFlow(props) {
 
   const getDetail = async () => {
     if (!deptId || !userId) {
-      console.error('depId或userId不存在!');
+      console.log('depId或userId不存在!');
       return;
     }
     if (!timerRef.current.status) {
       // 上锁
       timerRef.current.status = true;
+      setLoading(true);
       try {
         let flow = await queryDDProcessesForecast({
           processCode,
@@ -152,6 +156,7 @@ function AuditFlow(props) {
         setFlow(flow);
         console.log(flow);
       } catch (error) {}
+      setLoading(false);
       setTimeout(() => {
         // 延时解锁
         timerRef.current.status = false;
@@ -171,7 +176,7 @@ function AuditFlow(props) {
   }, [processCode, formComponentValues]);
 
   return (
-    <>
+    <Spin spinning={loading}>
       <div className={styles.top}>
         <Steps current={current} progressDot={customDot} direction={direction}>
           {flow.workflowActivityRules.map(item => (
@@ -193,7 +198,7 @@ function AuditFlow(props) {
         </div>
       </div>
       {status !== undefined && renderAlert()}
-    </>
+    </Spin>
   );
 }
 

+ 9 - 6
src/pages/PurchaseAdmin/PurchaseList/Detail/CommitAuditModal.js

@@ -167,12 +167,13 @@ function CommitAuditModal(props) {
                   id: itemProps.id,
                   ...val,
                 };
+              } else if (allValues[itemProps.id]) {
+                return {
+                  name: itemProps.label,
+                  // id: itemProps.id,
+                  value: allValues[itemProps.id] || undefined,
+                };
               }
-              return {
-                name: itemProps.label,
-                // id: itemProps.id,
-                value: allValues[itemProps.id] || '',
-              };
             })
             .filter(item => item);
           setFormComponentValues({ ...formComponentValues });
@@ -215,7 +216,7 @@ function CommitAuditModal(props) {
         originatorUserId: currentUser.DingUserId || getCurrentUser()?.DingUserId, //'16569001414345099',
         deptId: '14237557', //currentUser.DingDepId || getCurrentUser()?.DingDepId,
         template_node_id: `${approvalNode.Id}`,
-        formComponentValues: data[approvalNode.Id],
+        formComponentValues: data[approvalNode.Id] || [],
       };
       result.push(JSON.stringify(formItem));
     });
@@ -369,6 +370,8 @@ function CommitAuditModal(props) {
                     processCode={item.formCode}
                     formComponentValues={formComponentValues[item.nodeId]}
                     direction={'vertical'}
+                    deptId={'14237557'}
+                    userId={currentUser.DingUserId || getCurrentUser()?.DingUserId}
                   />
                 )}
               </Col>

+ 2 - 3
src/pages/PurchaseAdmin/PurchaseList/List/NewList.js

@@ -46,9 +46,8 @@ function List(props) {
                 setFlowDetail(data);
                 setVersion(record);
                 setFlowVisible(true);
-              } catch (error) {
-                setLoading2(false);
-              }
+              } catch (error) {}
+              setLoading2(false);
               // router.push(`/home/detail/${record.project_id}/${record.template_id}`);
             }}
           >